stage4/generate_c/generate_var_list.cc
changeset 166 09004f402097
parent 160 59d58f5e6caa
child 195 66d501d7b67d
equal deleted inserted replaced
165:83963465b773 166:09004f402097
   104     }
   104     }
   105     
   105     
   106     void update_var_type_symbol(symbol_c *symbol) {
   106     void update_var_type_symbol(symbol_c *symbol) {
   107       
   107       
   108       this->current_var_type_name = spec_init_sperator_c::get_spec(symbol);
   108       this->current_var_type_name = spec_init_sperator_c::get_spec(symbol);
   109       if (this->current_var_type_name == NULL)
   109       if (this->current_var_type_name == NULL) {
       
   110         std::list<SYMBOL>::iterator pt;
       
   111         for(pt = current_symbol_list.begin(); pt != current_symbol_list.end(); pt++) {
       
   112           fprintf(stderr, "%s.", ((identifier_c*)(pt->symbol))->value);
       
   113         }
   110         ERROR;
   114         ERROR;
       
   115       }
   111       
   116       
   112       this->current_var_type_symbol = search_fb_typedecl->get_decl(this->current_var_type_name);
   117       this->current_var_type_symbol = search_fb_typedecl->get_decl(this->current_var_type_name);
   113       if (this->current_var_type_symbol != NULL)
   118       if (this->current_var_type_symbol != NULL)
   114         this->current_var_type_category = function_block_vtc;
   119         this->current_var_type_category = function_block_vtc;
   115       else {
   120       else {
   345        */
   350        */
   346     
   351     
   347       /* Start off by setting the current_var_type_symbol and
   352       /* Start off by setting the current_var_type_symbol and
   348        * current_var_init_symbol private variables...
   353        * current_var_init_symbol private variables...
   349        */
   354        */
   350       update_var_type_symbol(symbol);
   355       update_var_type_symbol(symbol->specification);
   351       
   356       
   352       /* now to produce the c equivalent... */
   357       /* now to produce the c equivalent... */
   353       if (this->current_var_type_category == variable_vtc)
   358       if (this->current_var_type_category == variable_vtc)
   354         this->current_var_type_category = pointer_vtc;
   359         this->current_var_type_category = pointer_vtc;
   355       declare_variable(symbol->global_var_name);
   360       declare_variable(symbol->global_var_name);