stage3/narrow_candidate_datatypes.cc
changeset 895 f824bf8e1579
parent 889 5f380b99e95e
child 909 8b2a31dea131
equal deleted inserted replaced
892:54d5d185d6e2 895:f824bf8e1579
   815 }
   815 }
   816 
   816 
   817 /********************************************/
   817 /********************************************/
   818 /* B 1.6 Sequential function chart elements */
   818 /* B 1.6 Sequential function chart elements */
   819 /********************************************/
   819 /********************************************/
   820 
       
   821 void *narrow_candidate_datatypes_c::visit(transition_condition_c *symbol) {
   820 void *narrow_candidate_datatypes_c::visit(transition_condition_c *symbol) {
   822 	if (symbol->candidate_datatypes.size() != 1)
   821 	// We can safely ask for a BOOL type, as even if the result is a SAFEBOOL, in that case it will aslo include BOOL as a possible datatype.
   823 		return NULL;
   822 	set_datatype(&get_datatype_info_c::bool_type_name /* datatype*/, symbol /* symbol */);
   824 	symbol->datatype = symbol->candidate_datatypes[0];
   823 
   825 	if (symbol->transition_condition_il != NULL) {
   824 	if (symbol->transition_condition_il != NULL) {
   826 		symbol->transition_condition_il->datatype = symbol->datatype;
   825 		set_datatype(symbol->datatype, symbol->transition_condition_il);
   827 		symbol->transition_condition_il->accept(*this);
   826 		symbol->transition_condition_il->accept(*this);
   828 	}
   827 	}
   829 	if (symbol->transition_condition_st != NULL) {
   828 	if (symbol->transition_condition_st != NULL) {
   830 		symbol->transition_condition_st->datatype = symbol->datatype;
   829 		set_datatype(symbol->datatype, symbol->transition_condition_st);
   831 		symbol->transition_condition_st->accept(*this);
   830 		symbol->transition_condition_st->accept(*this);
   832 	}
   831 	}
   833 	return NULL;
   832 	return NULL;
   834 }
   833 }
   835 
   834