Correcty determine the datatype (TIME) of the parameters of SFC actions with timed qualifiers
authormjsousa
Tue, 24 Jan 2017 12:44:44 +0000
changeset 1028 7c8709ce6b8f
parent 1027 675ee2eeb3ff
child 1029 37145f381bb0
Correcty determine the datatype (TIME) of the parameters of SFC actions with timed qualifiers
stage3/narrow_candidate_datatypes.cc
stage3/narrow_candidate_datatypes.hh
--- a/stage3/narrow_candidate_datatypes.cc	Mon Jan 23 12:50:07 2017 +0000
+++ b/stage3/narrow_candidate_datatypes.cc	Tue Jan 24 12:44:44 2017 +0000
@@ -930,6 +930,18 @@
 	return NULL;
 }
 
+
+void *narrow_candidate_datatypes_c::visit(action_qualifier_c *symbol) {
+	for(unsigned int i = 0; i < symbol->action_time->candidate_datatypes.size(); i++) {
+		if (get_datatype_info_c::is_TIME_compatible(symbol->action_time->candidate_datatypes[i]))
+			symbol->action_time->datatype = symbol->action_time->candidate_datatypes[i];
+	}
+	symbol->action_time->accept(*this);
+	symbol->action_qualifier->accept(*this); // Not really necessary for now...
+	return NULL;
+}
+    
+
 /********************************/
 /* B 1.7 Configuration elements */
 /********************************/
--- a/stage3/narrow_candidate_datatypes.hh	Mon Jan 23 12:50:07 2017 +0000
+++ b/stage3/narrow_candidate_datatypes.hh	Tue Jan 24 12:44:44 2017 +0000
@@ -249,6 +249,7 @@
     /* B 1.6 Sequential function chart elements */
     /********************************************/
     void *visit(transition_condition_c *symbol);
+    void *visit(action_qualifier_c     *symbol);
 
     /********************************/
     /* B 1.7 Configuration elements */