stage3/narrow_candidate_datatypes.cc
changeset 807 4d71292f8732
parent 806 f218434eeaf8
child 808 7a6b53d61ea3
equal deleted inserted replaced
806:f218434eeaf8 807:4d71292f8732
   746 	symbol->var_declarations->accept(*this);
   746 	symbol->var_declarations->accept(*this);
   747 	if (debug) printf("Narrowing candidate data types list in body of FB %s\n", ((token_c *)(symbol->fblock_name))->value);
   747 	if (debug) printf("Narrowing candidate data types list in body of FB %s\n", ((token_c *)(symbol->fblock_name))->value);
   748 	symbol->fblock_body->accept(*this);
   748 	symbol->fblock_body->accept(*this);
   749 	delete search_varfb_instance_type;
   749 	delete search_varfb_instance_type;
   750 	search_varfb_instance_type = NULL;
   750 	search_varfb_instance_type = NULL;
       
   751 	
       
   752 	// A FB declaration can also be used as a Datatype! We now do the narrow algorithm considering it as such!
       
   753 	if (symbol->candidate_datatypes.size() == 1)
       
   754 		symbol->datatype = symbol->candidate_datatypes[0];
   751 	return NULL;
   755 	return NULL;
   752 }
   756 }
   753 
   757 
   754 /********************/
   758 /********************/
   755 /* B 1.5.3 Programs */
   759 /* B 1.5.3 Programs */