Fix bug - correctly declare struct members whose type is a directly defined array (e.g.: STRUCT x: ARRAY of XXX; END_STRUCT)
authormjsousa
Sat, 08 Feb 2014 10:32:26 +0000
changeset 856 d80971552535
parent 855 a3109442e166
child 857 70c4c259bc3e
Fix bug - correctly declare struct members whose type is a directly defined array (e.g.: STRUCT x: ARRAY of XXX; END_STRUCT)
stage4/generate_c/generate_c.cc
--- a/stage4/generate_c/generate_c.cc	Wed Feb 05 20:04:50 2014 +0000
+++ b/stage4/generate_c/generate_c.cc	Sat Feb 08 10:32:26 2014 +0000
@@ -855,11 +855,20 @@
     void *visit(array_spec_init_c *symbol) {
       switch (current_mode) {
         case arraydeclaration_im:
+          {
+            array_specification_c *specification = dynamic_cast<array_specification_c*>(symbol->array_specification);
+            if (specification != NULL)
+              symbol->array_specification->accept(*this);
+          }
+          break;
         case arrayname_im:
           {
             array_specification_c *specification = dynamic_cast<array_specification_c*>(symbol->array_specification);
             if (specification != NULL)
               symbol->array_specification->accept(*this);
+            identifier_c *name = dynamic_cast<identifier_c*>(symbol->array_specification);
+            if (name != NULL)
+              s4o_incl.print(name->value);
           }
           break;
         default: