Skip to content

Commit

Permalink
Convert messages to error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
dziegel committed Aug 22, 2024
1 parent 30e3dc7 commit 5162772
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions generator/src/generator/Transformations.egl
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ operation Tuple regionTransform(statemachine : Tuple, parent_state : Tuple) {
// Initial variable name
var initial = statemachine.all_states.get(self.initial_state_id);
if (initial == null) {
("Unable to find state id " + self.initial_state_id).println();
("Unable to find state id " + self.initial_state_id).errln();
}
self.initial_variable_name = initial.variable_name;
}

operation Tuple stateTransform(statemachine : Tuple, region : Tuple, parent_state : Tuple) {
self.transitions_for_trigger_transformed = new Map();
if ((self.region == null) and self.transitions_for_trigger.isEmpty()) {
(statemachine.name + ": No outgoing transitions from state " + self.name).println();
(statemachine.name + ": No outgoing transitions from state " + self.name).errln();
}

// State type
Expand All @@ -84,7 +84,7 @@ operation Tuple stateTransform(statemachine : Tuple, region : Tuple, parent_stat
self.entry_pointer = "nullptr";
if (self.entry.isDefined()) {
if (self.entry == "") {
(sm.name + ": Empty entry function in state " + self.name).println();
(sm.name + ": Empty entry function in state " + self.name).errln();
}
self.entry_pointer = "&" + statemachine.name + "::" + "Impl::" + self.entry;
if (not statemachine.all_entry_exit.includes(self.entry)) {
Expand All @@ -96,7 +96,7 @@ operation Tuple stateTransform(statemachine : Tuple, region : Tuple, parent_stat
self.exit_pointer = "nullptr";
if (self.exit.isDefined()) {
if (self.exit == "") {
(sm.name + ": Empty exit function in state " + self.name).println();
(sm.name + ": Empty exit function in state " + self.name).errln();
}
self.exit_pointer = "&" + statemachine.name + "::" + "Impl::" + self.exit;
if (not statemachine.all_entry_exit.includes(self.exit)) {
Expand Down Expand Up @@ -139,7 +139,7 @@ operation Tuple stateTransform(statemachine : Tuple, region : Tuple, parent_stat
}
}
if (transitions.trans_unconditional.size() > 1) {
("More than one unconditional outgoing transition from state " + self.name + " for trigger " + trigger).println();
("More than one unconditional outgoing transition from state " + self.name + " for trigger " + trigger).errln();
}

self.transitions_for_trigger_transformed.put(trigger, transitions);
Expand All @@ -159,7 +159,7 @@ operation Tuple transitionTransform(statemachine : Tuple, state : Tuple, trigger
all_actions.add("&" + statemachine.name + "::" + statemachine.impl_type + "::" + action);
if (not statemachine.all_actions.includes(action)) {
if (action == "") {
(sm.name + ": Empty function behavior in transition starting from state " + self.start).println();
(sm.name + ": Empty function behavior in transition starting from state " + self.start).errln();
}
statemachine.all_actions.add(action);
}
Expand All @@ -185,7 +185,7 @@ operation Tuple transitionTransform(statemachine : Tuple, state : Tuple, trigger
if(not self.internal and (self.target_state_id != null)) {
var target = statemachine.all_states.get(self.target_state_id);
if (target == null) {
("Unable to find state id " + self.target_state_id).println();
("Unable to find state id " + self.target_state_id).errln();
}
self.target_variable_name = target.variable_name;

Expand All @@ -207,7 +207,7 @@ operation Tuple transitionTransform(statemachine : Tuple, state : Tuple, trigger
}
}
if (self.trans_unconditional.size() > 1) {
("More than one unconditional outgoing transition from state " + self.name + " for trigger " + trigger).println();
("More than one unconditional outgoing transition from state " + state.name + " for trigger " + trigger).errln();
}
}
%]

0 comments on commit 5162772

Please sign in to comment.