absyntax_utils/search_base_type.cc
changeset 945 477393b00f95
parent 921 d228aaa4d616
child 958 7474d2cd1d6e
equal deleted inserted replaced
943:566414d7ba1f 945:477393b00f95
   103 /*************************/
   103 /*************************/
   104 
   104 
   105 /*******************************************/
   105 /*******************************************/
   106 /* B 1.1 - Letters, digits and identifiers */
   106 /* B 1.1 - Letters, digits and identifiers */
   107 /*******************************************/
   107 /*******************************************/
   108 void *search_base_type_c::visit(identifier_c *type_name) {
   108 
       
   109 
       
   110 void *search_base_type_c::handle_datatype_identifier(token_c *type_name) {
   109   symbol_c *type_decl;
   111   symbol_c *type_decl;
   110 
   112 
   111   this->current_basetype_name = type_name;
   113   this->current_basetype_name = type_name;
   112   /* if we have reached this point, it is because the current_basetype is not yet pointing to the base datatype we are looking for,
   114   /* if we have reached this point, it is because the current_basetype is not yet pointing to the base datatype we are looking for,
   113    * so we will be searching for the delcaration of the type named in type_name, which might be the base datatype (we search recursively!)
   115    * so we will be searching for the delcaration of the type named in type_name, which might be the base datatype (we search recursively!)
   126   /* Type declaration not found!! */
   128   /* Type declaration not found!! */
   127     ERROR;
   129     ERROR;
   128     
   130     
   129   return NULL;
   131   return NULL;
   130 }
   132 }
       
   133 
       
   134 void *search_base_type_c::visit(                 identifier_c *type_name) {return handle_datatype_identifier(type_name);}  // still needed to handle FB and program datatypes!
       
   135 void *search_base_type_c::visit(derived_datatype_identifier_c *type_name) {return handle_datatype_identifier(type_name);}
   131 
   136 
   132 
   137 
   133 /*********************/
   138 /*********************/
   134 /* B 1.2 - Constants */
   139 /* B 1.2 - Constants */
   135 /*********************/
   140 /*********************/