stage4/generate_c/generate_var_list.cc
changeset 958 7474d2cd1d6e
parent 945 477393b00f95
child 1041 56ebe2a31b5b
equal deleted inserted replaced
957:4489afa5b1c5 958:7474d2cd1d6e
    88 /***********************************************************************/
    88 /***********************************************************************/
    89 /***********************************************************************/
    89 /***********************************************************************/
    90 /***********************************************************************/
    90 /***********************************************************************/
    91 /***********************************************************************/
    91 /***********************************************************************/
    92 
    92 
    93 
    93 /* TODO: Delete this helper class search_type_symbol_c, as well as the search_fb_typedecl_c
       
    94  *       in the absyntac_utils directory. They are no longer usefull, now that we have
       
    95  *       datatype analysis working!
       
    96  */
    94 class search_type_symbol_c: public iterator_visitor_c {
    97 class search_type_symbol_c: public iterator_visitor_c {
    95 
    98 
    96   public:
    99   public:
    97     typedef enum {
   100     typedef enum {
    98       none_vtc,
   101       none_vtc,
   141         return (this->current_var_type_symbol);
   144         return (this->current_var_type_symbol);
   142 
   145 
   143       return (this->current_var_type_name);
   146       return (this->current_var_type_name);
   144     }
   147     }
   145 
   148 
   146     void *visit(identifier_c* symbol) {
   149     void *visit(derived_datatype_identifier_c* symbol) {
       
   150       if (this->current_var_type_name == NULL) {
       
   151         this->current_var_type_name = symbol;
       
   152 
       
   153         this->current_var_type_symbol = search_fb_typedecl->get_decl(this->current_var_type_name);
       
   154         if (this->current_var_type_symbol != NULL)
       
   155           this->current_var_type_category = function_block_vtc;
       
   156 
       
   157         else {
       
   158           this->current_var_type_symbol = search_base_type_c::get_basetype_decl(this->current_var_type_name);
       
   159           this->current_var_type_symbol->accept(*this);
       
   160         }
       
   161       }
       
   162       return NULL;
       
   163     }
       
   164 
       
   165     void *visit(poutype_identifier_c* symbol) {
   147       if (this->current_var_type_name == NULL) {
   166       if (this->current_var_type_name == NULL) {
   148         this->current_var_type_name = symbol;
   167         this->current_var_type_name = symbol;
   149 
   168 
   150         this->current_var_type_symbol = search_fb_typedecl->get_decl(this->current_var_type_name);
   169         this->current_var_type_symbol = search_fb_typedecl->get_decl(this->current_var_type_name);
   151         if (this->current_var_type_symbol != NULL)
   170         if (this->current_var_type_symbol != NULL)