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