absyntax_utils/search_varfb_instance_type.cc
changeset 412 aad38592bdde
parent 382 ac6dfec701c9
child 625 c0bda77b37a0
equal deleted inserted replaced
411:3e21d98d0a71 412:aad38592bdde
   299    *       OR A
   299    *       OR A
   300    *       structure_element_declaration_list_c
   300    *       structure_element_declaration_list_c
   301    */
   301    */
   302 }
   302 }
   303 
   303 
       
   304 /*  var1_list ':' structure_type_name */
       
   305 void *search_varfb_instance_type_c::visit(structured_var_declaration_c *symbol) {
       
   306   this->is_complex = true;
       
   307   if (NULL != current_structelement_name) ERROR;
       
   308 
       
   309   /* make sure that we have decomposed all structure elements of the variable name */
       
   310   symbol_c *var_name = decompose_var_instance_name->next_part();
       
   311   if (NULL == var_name) {
       
   312 	/* this is it... !
       
   313 	 * No need to look any further...
       
   314 	 * Note also that, unlike for the struct types, a function block may
       
   315 	 * not be defined based on another (i.e. no inheritance is allowed),
       
   316 	 * so this function block is already the most base type.
       
   317 	 * We simply return it.
       
   318 	 */
       
   319 	return (void *)symbol;
       
   320   }
       
   321 
       
   322   /* reset current_type_id because of new structure element part */
       
   323   this->current_typeid = NULL;
       
   324 
       
   325   /* look for the var_name in the structure declaration */
       
   326   current_structelement_name = var_name;
       
   327 
       
   328   /* recursively find out the data type of current_structelement_name... */
       
   329   return symbol->structure_type_name->accept(*this);
       
   330 }
       
   331 
   304 /* structure_type_name ASSIGN structure_initialization */
   332 /* structure_type_name ASSIGN structure_initialization */
   305 /* structure_initialization may be NULL ! */
   333 /* structure_initialization may be NULL ! */
   306 // SYM_REF2(initialized_structure_c, structure_type_name, structure_initialization)
   334 // SYM_REF2(initialized_structure_c, structure_type_name, structure_initialization)
   307 /* NOTE: only the initialized structure is ever used when declaring a new variable instance */
   335 /* NOTE: only the initialized structure is ever used when declaring a new variable instance */
   308 void *search_varfb_instance_type_c::visit(initialized_structure_c *symbol)	{
   336 void *search_varfb_instance_type_c::visit(initialized_structure_c *symbol)	{