stage4/generate_c/generate_c_typedecl.cc
changeset 1041 56ebe2a31b5b
parent 958 7474d2cd1d6e
equal deleted inserted replaced
1040:e8563dcaefca 1041:56ebe2a31b5b
   176     }
   176     }
   177 
   177 
   178     /* helper symbol for array_specification */
   178     /* helper symbol for array_specification */
   179     /* array_subrange_list ',' subrange */
   179     /* array_subrange_list ',' subrange */
   180     void *visit(array_subrange_list_c *symbol) {
   180     void *visit(array_subrange_list_c *symbol) {
   181       for(int i = 0; i < symbol->n; i++) {symbol->elements[i]->accept(*this);}
   181       for(int i = 0; i < symbol->n; i++) {symbol->get_element(i)->accept(*this);}
   182       return NULL;
   182       return NULL;
   183     }
   183     }
   184 
   184 
   185     /*  signed_integer DOTDOT signed_integer */
   185     /*  signed_integer DOTDOT signed_integer */
   186     //SYM_REF2(subrange_c, lower_limit, upper_limit)
   186     //SYM_REF2(subrange_c, lower_limit, upper_limit)
   293          std::string inter_elem_str = "",
   293          std::string inter_elem_str = "",
   294          std::string post_elem_str = "") {
   294          std::string post_elem_str = "") {
   295 
   295 
   296       if (list->n > 0) {
   296       if (list->n > 0) {
   297         s4o_incl.print(pre_elem_str);
   297         s4o_incl.print(pre_elem_str);
   298         list->elements[0]->accept(*this);
   298         list->get_element(0)->accept(*this);
   299       }
   299       }
   300 
   300 
   301       for(int i = 1; i < list->n; i++) {
   301       for(int i = 1; i < list->n; i++) {
   302         s4o_incl.print(inter_elem_str);
   302         s4o_incl.print(inter_elem_str);
   303         list->elements[i]->accept(*this);
   303         list->get_element(i)->accept(*this);
   304       }
   304       }
   305 
   305 
   306       if (list->n > 0)
   306       if (list->n > 0)
   307         s4o_incl.print(post_elem_str);
   307         s4o_incl.print(post_elem_str);
   308 
   308