stage3/narrow_candidate_datatypes.cc
changeset 994 66dc2ef40e70
parent 945 477393b00f95
child 996 c752b113237b
equal deleted inserted replaced
993:bb30d84711ee 994:66dc2ef40e70
   698 	/* we need to check the data types of the expressions used for the subscripts... */
   698 	/* we need to check the data types of the expressions used for the subscripts... */
   699 	symbol->subscript_list->accept(*this);
   699 	symbol->subscript_list->accept(*this);
   700 
   700 
   701 	/* Set the datatype of the subscripted variable and visit it recursively. For the reason why we do this,                                                 */
   701 	/* Set the datatype of the subscripted variable and visit it recursively. For the reason why we do this,                                                 */
   702 	/* Please read the comments in the array_variable_c and structured_variable_c visitors in the fill_candidate_datatypes.cc file! */
   702 	/* Please read the comments in the array_variable_c and structured_variable_c visitors in the fill_candidate_datatypes.cc file! */
   703 	symbol->subscripted_variable->accept(*this); // visit recursively
       
   704 
       
   705 	if (symbol->subscripted_variable->candidate_datatypes.size() == 1)
   703 	if (symbol->subscripted_variable->candidate_datatypes.size() == 1)
   706 	  symbol->subscripted_variable->datatype = symbol->subscripted_variable->candidate_datatypes[0]; // set the datatype
   704 	  symbol->subscripted_variable->datatype = symbol->subscripted_variable->candidate_datatypes[0]; // set the datatype
       
   705 	symbol->subscripted_variable->accept(*this); // visit recursively
   707 
   706 
   708 	return NULL;
   707 	return NULL;
   709 }
   708 }
   710 
   709 
   711 
   710 
   732  */
   731  */
   733 // SYM_REF2(structured_variable_c, record_variable, field_selector)
   732 // SYM_REF2(structured_variable_c, record_variable, field_selector)
   734 void *narrow_candidate_datatypes_c::visit(structured_variable_c *symbol) {
   733 void *narrow_candidate_datatypes_c::visit(structured_variable_c *symbol) {
   735 	/* Set the datatype of the record_variable and visit it recursively. For the reason why we do this,                                                      */
   734 	/* Set the datatype of the record_variable and visit it recursively. For the reason why we do this,                                                      */
   736 	/* Please read the comments in the array_variable_c and structured_variable_c visitors in the fill_candidate_datatypes.cc file! */
   735 	/* Please read the comments in the array_variable_c and structured_variable_c visitors in the fill_candidate_datatypes.cc file! */
   737 	symbol->record_variable->accept(*this); // visit recursively
       
   738 
       
   739 	if (symbol->record_variable->candidate_datatypes.size() == 1)
   736 	if (symbol->record_variable->candidate_datatypes.size() == 1)
   740 	  symbol->record_variable->datatype = symbol->record_variable->candidate_datatypes[0]; // set the datatype
   737 	  symbol->record_variable->datatype = symbol->record_variable->candidate_datatypes[0]; // set the datatype
       
   738 	symbol->record_variable->accept(*this); // visit recursively
   741 
   739 
   742 	return NULL;
   740 	return NULL;
   743 }
   741 }
   744 
   742 
   745 
   743