96 s4o_incl.print(post_elem_str); |
96 s4o_incl.print(post_elem_str); |
97 |
97 |
98 return NULL; |
98 return NULL; |
99 } |
99 } |
100 |
100 |
|
101 bool type_is_fb(symbol_c* type_decl) { |
|
102 return search_base_type_c::type_is_fb(type_decl); |
|
103 } |
101 |
104 |
102 /***************************/ |
105 /***************************/ |
103 /* B 0 - Programming Model */ |
106 /* B 0 - Programming Model */ |
104 /***************************/ |
107 /***************************/ |
105 /* leave for derived classes... */ |
108 /* leave for derived classes... */ |
343 current_basetypedeclaration = arrayderiveddeclaration_bd; |
346 current_basetypedeclaration = arrayderiveddeclaration_bd; |
344 symbol->array_spec_init->accept(*this); |
347 symbol->array_spec_init->accept(*this); |
345 current_basetypedeclaration = none_bd; |
348 current_basetypedeclaration = none_bd; |
346 |
349 |
347 if (array_is_derived) |
350 if (array_is_derived) |
348 s4o_incl.print("__DECLARE_DERIVED_TYPE("); |
351 s4o_incl.print("__DECLARE_DERIVED_TYPE("); |
349 else |
352 else |
350 s4o_incl.print("__DECLARE_ARRAY_TYPE("); |
353 s4o_incl.print("__DECLARE_ARRAY_TYPE("); |
351 current_type_name->accept(*basedecl); |
354 current_type_name->accept(*basedecl); |
352 s4o_incl.print(","); |
355 s4o_incl.print(","); |
353 current_basetypedeclaration = arraybasetypeincl_bd; |
356 current_basetypedeclaration = arraybasetypeincl_bd; |
354 symbol->array_spec_init->accept(*this); |
357 symbol->array_spec_init->accept(*this); |
355 current_basetypedeclaration = none_bd; |
358 current_basetypedeclaration = none_bd; |
356 if (!array_is_derived) { |
359 if (!array_is_derived) { |
357 s4o_incl.print(","); |
360 s4o_incl.print(","); |
358 current_basetypedeclaration = arraysubrange_bd; |
361 current_basetypedeclaration = arraysubrange_bd; |
359 symbol->array_spec_init->accept(*this); |
362 symbol->array_spec_init->accept(*this); |
360 current_basetypedeclaration = none_bd; |
363 current_basetypedeclaration = none_bd; |
361 } |
364 } |
362 s4o_incl.print(")\n"); |
365 s4o_incl.print(")\n"); |
363 |
366 |
364 current_type_name = NULL; |
367 current_type_name = NULL; |
365 current_typedefinition = none_td; |
368 current_typedefinition = none_td; |
372 void *visit(array_spec_init_c *symbol) { |
375 void *visit(array_spec_init_c *symbol) { |
373 TRACE("array_spec_init_c"); |
376 TRACE("array_spec_init_c"); |
374 |
377 |
375 if (current_typedefinition == array_td) { |
378 if (current_typedefinition == array_td) { |
376 switch (current_basetypedeclaration) { |
379 switch (current_basetypedeclaration) { |
377 case arrayderiveddeclaration_bd: |
380 case arrayderiveddeclaration_bd: |
378 array_is_derived = dynamic_cast<identifier_c *>(symbol->array_specification) != NULL; |
381 array_is_derived = dynamic_cast<identifier_c *>(symbol->array_specification) != NULL; |
379 break; |
382 break; |
380 default: |
383 default: |
381 if (array_is_derived) |
384 if (array_is_derived) |
382 symbol->array_specification->accept(*basedecl); |
385 symbol->array_specification->accept(*basedecl); |
383 else |
386 else |
384 symbol->array_specification->accept(*this); |
387 symbol->array_specification->accept(*this); |
385 break; |
388 break; |
386 } |
389 } |
387 } |
390 } |
388 else { |
391 else { |
389 symbol->array_specification->accept(*basedecl); |
392 symbol->array_specification->accept(*basedecl); |
390 } |
393 } |
391 return NULL; |
394 return NULL; |
392 } |
395 } |
393 |
396 |
394 /* ARRAY '[' array_subrange_list ']' OF non_generic_type_name */ |
397 /* ARRAY '[' array_subrange_list ']' OF non_generic_type_name */ |
439 s4o_incl.print(","); |
442 s4o_incl.print(","); |
440 symbol->simple_spec_init->accept(*this); |
443 symbol->simple_spec_init->accept(*this); |
441 s4o_incl.print(")\n"); |
444 s4o_incl.print(")\n"); |
442 |
445 |
443 if (search_base_type_c::type_is_subrange(symbol->simple_type_name)) { |
446 if (search_base_type_c::type_is_subrange(symbol->simple_type_name)) { |
444 s4o.print("#define __CHECK_"); |
447 s4o.print("#define __CHECK_"); |
445 current_type_name->accept(*this); |
448 current_type_name->accept(*this); |
446 s4o.print(" __CHECK_"); |
449 s4o.print(" __CHECK_"); |
447 symbol->simple_spec_init->accept(*this); |
450 symbol->simple_spec_init->accept(*this); |
448 s4o.print("\n"); |
451 s4o.print("\n"); |
449 } |
452 } |
450 |
453 |
451 return NULL; |
454 return NULL; |
452 } |
455 } |
453 |
456 |