diff --git a/generator/src/generator/Generator.java b/generator/src/generator/Generator.java index 0577ce6..1969356 100644 --- a/generator/src/generator/Generator.java +++ b/generator/src/generator/Generator.java @@ -41,6 +41,7 @@ public static void main(String[] args) throws Exception { uml.setName("UML"); uml.load(); uml_module.getContext().getModelRepository().addModel(uml); + uml_module.getContext().setUserInput(new UserInput()); System.out.println("Generating XMI/UML model " + filename + " to " + out_path); @@ -63,6 +64,7 @@ public static void main(String[] args) throws Exception { scxml.setName("SCXML"); scxml.load(); scxml_module.getContext().getModelRepository().addModel(scxml); + scxml_module.getContext().setUserInput(new UserInput()); System.out.println("Generating SCXML model " + filename + " to " + out_path); diff --git a/generator/src/generator/ScxmlModel.egl b/generator/src/generator/ScxmlModel.egl index f2456e3..da04a7c 100644 --- a/generator/src/generator/ScxmlModel.egl +++ b/generator/src/generator/ScxmlModel.egl @@ -7,7 +7,7 @@ operation t_scxml getModel() : Tuple { var region = new Tuple(); result.region = region; - region.initial = self.a_initial; + region.initial_id = self.a_initial; region.initial_history = false; region.states = new List(); @@ -21,6 +21,7 @@ operation t_scxml getModel() : Tuple { operation t_state getModel() : Tuple { var result = new Tuple(); result.name = self.a_id; + result.id = self.a_id; if (self.e_onentry.isDefined() and self.e_onentry.e_script.isDefined()) { result.entry = self.e_onentry.e_script.a_src; @@ -35,18 +36,18 @@ operation t_state getModel() : Tuple { result.region = region; if (self.e_initial.isDefined() and self.e_initial.e_transition.isDefined()) { - region.initial = self.e_initial.e_transition.a_target; + region.initial_id = self.e_initial.e_transition.a_target; region.initial_history = false; } if (self.e_history.isDefined() and self.e_history.e_transition.isDefined()) { - region.initial = self.e_history.e_transition.a_target; + region.initial_id = self.e_history.e_transition.a_target; region.initial_history = true; } region.states = new List(); for (state in self.c_state) { var state_model = state.getModel(); - state_model.parent = result.name; + state_model.parent_state_id = result.id; region.states.add(state_model); } } @@ -64,7 +65,7 @@ operation t_state getModel() : Tuple { operation t_transition getModel() : Tuple { var result = new Tuple(); - result.target = self.a_target; + result.target_state_id = self.a_target; result.internal = (self.a_type = "internal"); result.trigger = self.a_event; diff --git a/generator/src/generator/Transformations.egl b/generator/src/generator/Transformations.egl index 9e254da..93679b4 100644 --- a/generator/src/generator/Transformations.egl +++ b/generator/src/generator/Transformations.egl @@ -8,36 +8,62 @@ operation Tuple transformStatemachine() { self.impl_type = "Impl"; self.impl_ptr_type = "ImplPtr"; + self.all_states = new Map(); self.all_actions = new List(); self.all_guards = new List(); self.all_entry_exit = new List(); - self.region.transformRegion(self); + self.region.transformRegionStates(self, null); + self.region.transformRegionTransitions(self, null); self.all_actions = self.all_actions.sortBy(a | a); self.all_guards = self.all_guards.sortBy(g | g); self.all_entry_exit = self.all_entry_exit.sortBy(e | e); } -operation Tuple transformRegion(statemachine : Tuple) { - self.initial_variable_name = "k" + self.initial; - +operation Tuple transformRegionStates(statemachine : Tuple, parent_state : Tuple) { self.states = self.states.sortBy(s | s.name); for (state in self.states) { - state.transformState(statemachine, self); + state.transformState(statemachine, self, parent_state); + + if (state.region.isDefined()) { + state.region.transformRegionStates(statemachine, state); + } } } -operation Tuple transformState(statemachine : Tuple, region : Tuple) { - self.variable_name = "k" + self.name; +operation Tuple transformRegionTransitions(statemachine : Tuple, parent_state : Tuple) { + var initial = statemachine.all_states.get(self.initial_id); + self.initial_variable_name = initial.variable_name; + + for (state in self.states) { + if (state.region.isDefined()) { + state.region.transformRegionTransitions(statemachine, state); + } + + state.transformTransitions(statemachine); + } +} + +operation Tuple transformState(statemachine : Tuple, region : Tuple, parent_state : Tuple) { + statemachine.all_states.put(self.id, self); + + if (parent_state.isDefined()) { + self.scoped_name = parent_state.scoped_name + self.name; + } else { + self.scoped_name = self.name; + } + self.variable_name = "k" + self.scoped_name; + self.state_type = statemachine.state_type; - if((region.initial = self.name) and region.initial_history) { + if((region.initial_id = self.id) and region.initial_history) { self.state_type = statemachine.history_state_type; } self.parent_variable_pointer = "nullptr"; - if (self.parent.isDefined()) { - self.parent_variable_pointer = "&k" + self.parent; + if (self.parent_state_id.isDefined()) { + var parent = statemachine.all_states.get(self.parent_state_id); + self.parent_variable_pointer = "&" + parent.variable_name; } self.entry_pointer = "nullptr"; @@ -55,17 +81,18 @@ operation Tuple transformState(statemachine : Tuple, region : Tuple) { statemachine.all_entry_exit.add(self.exit); } } +} +operation Tuple transformTransitions(statemachine : Tuple) { self.initial_variable_pointer = "nullptr"; if (self.region.isDefined()) { - self.region.transformRegion(statemachine); self.initial_variable_pointer = "&" + self.region.initial_variable_name; } for (transition in self.transitions) { transition.transformTransition(statemachine); } - self.transitions = self.transitions.sortBy(t | t.trigger + "-" + t.priority + "-" + t.start + t.target); + self.transitions = self.transitions.sortBy(t | t.trigger + "-" + t.priority + "-" + t.start + t.target_state_id); self.all_events = new List(); for (transition in self.transitions) { @@ -85,7 +112,8 @@ operation Tuple transformTransition(statemachine : Tuple) { if (self.internal) { self.target_variable_name = "kNone"; } else { - self.target_variable_name = "k" + self.target; + var target = statemachine.all_states.get(self.target_state_id); + self.target_variable_name = target.variable_name; } var actions = new List(); diff --git a/generator/src/generator/UserInput.java b/generator/src/generator/UserInput.java new file mode 100644 index 0000000..88f449e --- /dev/null +++ b/generator/src/generator/UserInput.java @@ -0,0 +1,49 @@ +package generator; + +import java.util.Collection; + +import org.eclipse.epsilon.eol.exceptions.EolUserException; +import org.eclipse.epsilon.eol.userinput.IUserInput; + +public class UserInput implements IUserInput { + + @Override + public void inform(String message) { + System.out.println(message); + } + + @Override + public boolean confirm(String question, boolean default_) throws EolUserException { + return false; + } + + @Override + public Object chooseMany(String question, Collection choices, Collection default_) { + return null; + } + + @Override + public Object choose(String question, Collection choices, Object default_) { + return null; + } + + @Override + public String prompt(String question, String default_) { + return ""; + } + + @Override + public int promptInteger(String question, int default_) { + return 0; + } + + @Override + public float promptReal(String question, float default_) { + return 0; + } + + @Override + public double promptReal(String question, double default_) { + return 0; + } +} diff --git a/generator/src/generator/XmiModel.egl b/generator/src/generator/XmiModel.egl index 4e3dcc0..b8b363a 100644 --- a/generator/src/generator/XmiModel.egl +++ b/generator/src/generator/XmiModel.egl @@ -12,7 +12,7 @@ operation Region getModel(sm : Tuple) : Tuple { var result = new Tuple(); var initial = self.subvertices.select(s | s.isKindOf(Pseudostate) and ((s.kind = PseudostateKind#initial) or (s.kind = PseudostateKind#shallowHistory))).first; - result.initial = initial.outgoing.first.target.name; + result.initial_id = initial.outgoing.first.target.id; result.initial_history = (initial.kind = PseudostateKind#shallowHistory); result.states = new List(); @@ -26,9 +26,10 @@ operation Region getModel(sm : Tuple) : Tuple { operation State getModel(sm : Tuple) : Tuple { var result = new Tuple(); result.name = self.name; + result.id = self.id; if (self.container.state != null) { - result.parent = self.container.state.name; + result.parent_state_id = self.container.state.id; } if (self.entry != null) { @@ -72,7 +73,7 @@ operation Transition getTarget(sm : Tuple, transition : Tuple, transitions : Lis } if (self.target.isKindOf(State)) { - transition.target = self.target.name; + transition.target_state_id = self.target.id; transitions.add(transition); } diff --git a/test/ScXmlFsmImpl.cxx b/test/ScXmlFsmImpl.cxx index dfd8b49..cecccd1 100644 --- a/test/ScXmlFsmImpl.cxx +++ b/test/ScXmlFsmImpl.cxx @@ -22,15 +22,15 @@ void ScXmlFsmImpl::Test() assert(fsm_.CurrentState() == nullptr); fsm_.Start(); - assert(fsm_.CurrentState() == &ScXmlTest::kState_2); + assert(fsm_.CurrentState() == &ScXmlTest::kState_1State_2); fsm_.React(EScXmlEvent::Internal); - assert(fsm_.CurrentState() == &ScXmlTest::kState_2); + assert(fsm_.CurrentState() == &ScXmlTest::kState_1State_2); fsm_.React(EScXmlEvent::Transition_3); - assert(fsm_.CurrentState() == &ScXmlTest::kState_3); + assert(fsm_.CurrentState() == &ScXmlTest::kState_1State_3); fsm_.React(EScXmlEvent::Transition_7); - assert(fsm_.CurrentState() == &ScXmlTest::kState_4); + assert(fsm_.CurrentState() == &ScXmlTest::kState_1State_4); fsm_.React(EScXmlEvent::Transition_8); - assert(fsm_.CurrentState() == &ScXmlTest::kState_2); + assert(fsm_.CurrentState() == &ScXmlTest::kState_1State_2); } void ScXmlFsmImpl::entry() diff --git a/test/XmiFsmImpl.cxx b/test/XmiFsmImpl.cxx index 46677dc..915200f 100644 --- a/test/XmiFsmImpl.cxx +++ b/test/XmiFsmImpl.cxx @@ -25,13 +25,13 @@ void XmiFsmImpl::Test() assert(fsm_.CurrentState() == &IoArHandlerMain::kClosed); fsm_.React(EXmiEvent::S_PNS_ArOpend_ind); - assert(fsm_.CurrentState() == &IoArHandlerMain::kParameterizing); + assert(fsm_.CurrentState() == &IoArHandlerMain::kOpenParameterizing); fsm_.React(EXmiEvent::S_PNS_ParamEndInd); - assert(fsm_.CurrentState() == &IoArHandlerMain::kWaitApplicationReady); + assert(fsm_.CurrentState() == &IoArHandlerMain::kOpenWaitApplicationReady); fsm_.React(EXmiEvent::SPnpbAppTimeout); - assert(fsm_.CurrentState() == &IoArHandlerMain::kWaitApplicationReady); + assert(fsm_.CurrentState() == &IoArHandlerMain::kOpenWaitApplicationReady); fsm_.React(EXmiEvent::SPnpbAppTimeout); - assert(fsm_.CurrentState() == &IoArHandlerMain::kWaitApplicationReadyCnf); + assert(fsm_.CurrentState() == &IoArHandlerMain::kOpenWaitApplicationReadyCnf); fsm_.React(EXmiEvent::S_PNS_ArClosed_ind); assert(fsm_.CurrentState() == &IoArHandlerMain::kClosed); } diff --git a/test/generated/IoArHandlerMainDeclaration.hxx b/test/generated/IoArHandlerMainDeclaration.hxx index 7bd9f8b..faed377 100644 --- a/test/generated/IoArHandlerMainDeclaration.hxx +++ b/test/generated/IoArHandlerMainDeclaration.hxx @@ -17,45 +17,45 @@ class IoArHandlerMain final : public IoArHandlerMainBase // State ApplicationReady static Transition ApplicationReadyHandler(ImplPtr impl, Event event); - static const State kApplicationReady; + static const State kOpenApplicationReady; // State DynamicReconfigurationRunning static Transition DynamicReconfigurationRunningHandler(ImplPtr impl, Event event); - static const State kDynamicReconfigurationRunning; + static const State kOpenApplicationReadyDynamicReconfigurationRunning; // State DrPlugPrmSequence static Transition DrPlugPrmSequenceHandler(ImplPtr impl, Event event); - static const State kDrPlugPrmSequence; + static const State kOpenApplicationReadyDynamicReconfigurationRunningDrPlugPrmSequence; // State DrWaitApplicationReadyCnfPlugSubmodule static Transition DrWaitApplicationReadyCnfPlugSubmoduleHandler(ImplPtr impl, Event event); - static const State kDrWaitApplicationReadyCnfPlugSubmodule; + static const State kOpenApplicationReadyDynamicReconfigurationRunningDrWaitApplicationReadyCnfPlugSubmodule; // State DrWaitApplicationReadyPlugSubmodule static Transition DrWaitApplicationReadyPlugSubmoduleHandler(ImplPtr impl, Event event); - static const State kDrWaitApplicationReadyPlugSubmodule; + static const State kOpenApplicationReadyDynamicReconfigurationRunningDrWaitApplicationReadyPlugSubmodule; // State DrWaitPlugCnf static Transition DrWaitPlugCnfHandler(ImplPtr impl, Event event); - static const State kDrWaitPlugCnf; + static const State kOpenApplicationReadyDynamicReconfigurationRunningDrWaitPlugCnf; // State DrWaitPullCnf static Transition DrWaitPullCnfHandler(ImplPtr impl, Event event); - static const State kDrWaitPullCnf; + static const State kOpenApplicationReadyDynamicReconfigurationRunningDrWaitPullCnf; // State Ready static Transition ReadyHandler(ImplPtr impl, Event event); - static const State kReady; + static const State kOpenApplicationReadyReady; // State Parameterizing static Transition ParameterizingHandler(ImplPtr impl, Event event); - static const State kParameterizing; + static const State kOpenParameterizing; // State WaitApplicationReady static Transition WaitApplicationReadyHandler(ImplPtr impl, Event event); - static const State kWaitApplicationReady; + static const State kOpenWaitApplicationReady; // State WaitApplicationReadyCnf static Transition WaitApplicationReadyCnfHandler(ImplPtr impl, Event event); - static const State kWaitApplicationReadyCnf; + static const State kOpenWaitApplicationReadyCnf; }; \ No newline at end of file diff --git a/test/generated/IoArHandlerMainInstance.hxx b/test/generated/IoArHandlerMainInstance.hxx index 30d0b69..5525a88 100644 --- a/test/generated/IoArHandlerMainInstance.hxx +++ b/test/generated/IoArHandlerMainInstance.hxx @@ -62,7 +62,7 @@ IoArHandlerMain::Transition IoArHandlerMain::ClosedHandler(ImplPtr impl, Event e } // State Open -const IoArHandlerMain::State IoArHandlerMain::kOpen("Open", &OpenHandler, nullptr, &kParameterizing, nullptr, nullptr); +const IoArHandlerMain::State IoArHandlerMain::kOpen("Open", &OpenHandler, nullptr, &kOpenParameterizing, nullptr, nullptr); IoArHandlerMain::Transition IoArHandlerMain::OpenHandler(ImplPtr impl, Event event) { (void)impl; // impl parameter is unused when there is no guard function being called in here @@ -123,7 +123,7 @@ IoArHandlerMain::Transition IoArHandlerMain::OpenHandler(ImplPtr impl, Event eve } // State ApplicationReady -const IoArHandlerMain::State IoArHandlerMain::kApplicationReady("ApplicationReady", &ApplicationReadyHandler, &kOpen, &kReady, nullptr, nullptr); +const IoArHandlerMain::State IoArHandlerMain::kOpenApplicationReady("ApplicationReady", &ApplicationReadyHandler, &kOpen, &kOpenApplicationReadyReady, nullptr, nullptr); IoArHandlerMain::Transition IoArHandlerMain::ApplicationReadyHandler(ImplPtr impl, Event event) { (void)impl; // impl parameter is unused when there is no guard function being called in here @@ -136,7 +136,7 @@ IoArHandlerMain::Transition IoArHandlerMain::ApplicationReadyHandler(ImplPtr imp } // State DynamicReconfigurationRunning -const IoArHandlerMain::State IoArHandlerMain::kDynamicReconfigurationRunning("DynamicReconfigurationRunning", &DynamicReconfigurationRunningHandler, &kApplicationReady, &kDrWaitPlugCnf, &Impl::StartDynReconfTimer, &Impl::StopDynReconfTimer); +const IoArHandlerMain::State IoArHandlerMain::kOpenApplicationReadyDynamicReconfigurationRunning("DynamicReconfigurationRunning", &DynamicReconfigurationRunningHandler, &kOpenApplicationReady, &kOpenApplicationReadyDynamicReconfigurationRunningDrWaitPlugCnf, &Impl::StartDynReconfTimer, &Impl::StopDynReconfTimer); IoArHandlerMain::Transition IoArHandlerMain::DynamicReconfigurationRunningHandler(ImplPtr impl, Event event) { (void)impl; // impl parameter is unused when there is no guard function being called in here @@ -157,7 +157,7 @@ IoArHandlerMain::Transition IoArHandlerMain::DynamicReconfigurationRunningHandle } // State DrPlugPrmSequence -const IoArHandlerMain::State IoArHandlerMain::kDrPlugPrmSequence("DrPlugPrmSequence", &DrPlugPrmSequenceHandler, &kDynamicReconfigurationRunning, nullptr, nullptr, nullptr); +const IoArHandlerMain::State IoArHandlerMain::kOpenApplicationReadyDynamicReconfigurationRunningDrPlugPrmSequence("DrPlugPrmSequence", &DrPlugPrmSequenceHandler, &kOpenApplicationReadyDynamicReconfigurationRunning, nullptr, nullptr, nullptr); IoArHandlerMain::Transition IoArHandlerMain::DrPlugPrmSequenceHandler(ImplPtr impl, Event event) { (void)impl; // impl parameter is unused when there is no guard function being called in here @@ -168,7 +168,7 @@ IoArHandlerMain::Transition IoArHandlerMain::DrPlugPrmSequenceHandler(ImplPtr im if (true) { static const Transition::ActionContainer<1> kActions = {&Impl::ApplyConfiguration}; - return TransitionTo(kDrWaitApplicationReadyPlugSubmodule, kActions); + return TransitionTo(kOpenApplicationReadyDynamicReconfigurationRunningDrWaitApplicationReadyPlugSubmodule, kActions); } return UnhandledEvent(); @@ -178,7 +178,7 @@ IoArHandlerMain::Transition IoArHandlerMain::DrPlugPrmSequenceHandler(ImplPtr im } // State DrWaitApplicationReadyCnfPlugSubmodule -const IoArHandlerMain::State IoArHandlerMain::kDrWaitApplicationReadyCnfPlugSubmodule("DrWaitApplicationReadyCnfPlugSubmodule", &DrWaitApplicationReadyCnfPlugSubmoduleHandler, &kDynamicReconfigurationRunning, nullptr, nullptr, nullptr); +const IoArHandlerMain::State IoArHandlerMain::kOpenApplicationReadyDynamicReconfigurationRunningDrWaitApplicationReadyCnfPlugSubmodule("DrWaitApplicationReadyCnfPlugSubmodule", &DrWaitApplicationReadyCnfPlugSubmoduleHandler, &kOpenApplicationReadyDynamicReconfigurationRunning, nullptr, nullptr, nullptr); IoArHandlerMain::Transition IoArHandlerMain::DrWaitApplicationReadyCnfPlugSubmoduleHandler(ImplPtr impl, Event event) { (void)impl; // impl parameter is unused when there is no guard function being called in here @@ -189,7 +189,7 @@ IoArHandlerMain::Transition IoArHandlerMain::DrWaitApplicationReadyCnfPlugSubmod if (true) { static const Transition::ActionContainer<1> kActions = {&Impl::DrPullDone}; - return TransitionTo(kReady, kActions); + return TransitionTo(kOpenApplicationReadyReady, kActions); } return UnhandledEvent(); @@ -199,7 +199,7 @@ IoArHandlerMain::Transition IoArHandlerMain::DrWaitApplicationReadyCnfPlugSubmod } // State DrWaitApplicationReadyPlugSubmodule -const IoArHandlerMain::State IoArHandlerMain::kDrWaitApplicationReadyPlugSubmodule("DrWaitApplicationReadyPlugSubmodule", &DrWaitApplicationReadyPlugSubmoduleHandler, &kDynamicReconfigurationRunning, nullptr, &Impl::StartWaitApplicationReadyTimer, &Impl::StopWaitApplicationReadyTimer); +const IoArHandlerMain::State IoArHandlerMain::kOpenApplicationReadyDynamicReconfigurationRunningDrWaitApplicationReadyPlugSubmodule("DrWaitApplicationReadyPlugSubmodule", &DrWaitApplicationReadyPlugSubmoduleHandler, &kOpenApplicationReadyDynamicReconfigurationRunning, nullptr, &Impl::StartWaitApplicationReadyTimer, &Impl::StopWaitApplicationReadyTimer); IoArHandlerMain::Transition IoArHandlerMain::DrWaitApplicationReadyPlugSubmoduleHandler(ImplPtr impl, Event event) { (void)impl; // impl parameter is unused when there is no guard function being called in here @@ -209,11 +209,11 @@ IoArHandlerMain::Transition IoArHandlerMain::DrWaitApplicationReadyPlugSubmodule case IoArHandlerMain_GET_STATIC_EVENT_ID(SPnpbAppTimeout): if (impl->CheckApplicationReady(event)) { - return TransitionTo(kDrWaitApplicationReadyCnfPlugSubmodule); + return TransitionTo(kOpenApplicationReadyDynamicReconfigurationRunningDrWaitApplicationReadyCnfPlugSubmodule); } if (true) { - return TransitionTo(kDrWaitApplicationReadyPlugSubmodule); + return TransitionTo(kOpenApplicationReadyDynamicReconfigurationRunningDrWaitApplicationReadyPlugSubmodule); } return UnhandledEvent(); @@ -223,7 +223,7 @@ IoArHandlerMain::Transition IoArHandlerMain::DrWaitApplicationReadyPlugSubmodule } // State DrWaitPlugCnf -const IoArHandlerMain::State IoArHandlerMain::kDrWaitPlugCnf("DrWaitPlugCnf", &DrWaitPlugCnfHandler, &kDynamicReconfigurationRunning, nullptr, nullptr, nullptr); +const IoArHandlerMain::State IoArHandlerMain::kOpenApplicationReadyDynamicReconfigurationRunningDrWaitPlugCnf("DrWaitPlugCnf", &DrWaitPlugCnfHandler, &kOpenApplicationReadyDynamicReconfigurationRunning, nullptr, nullptr, nullptr); IoArHandlerMain::Transition IoArHandlerMain::DrWaitPlugCnfHandler(ImplPtr impl, Event event) { (void)impl; // impl parameter is unused when there is no guard function being called in here @@ -233,7 +233,7 @@ IoArHandlerMain::Transition IoArHandlerMain::DrWaitPlugCnfHandler(ImplPtr impl, case IoArHandlerMain_GET_STATIC_EVENT_ID(S_PNS_PlugSubmodule_cnf): if (true) { - return TransitionTo(kDrPlugPrmSequence); + return TransitionTo(kOpenApplicationReadyDynamicReconfigurationRunningDrPlugPrmSequence); } return UnhandledEvent(); @@ -243,7 +243,7 @@ IoArHandlerMain::Transition IoArHandlerMain::DrWaitPlugCnfHandler(ImplPtr impl, } // State DrWaitPullCnf -const IoArHandlerMain::State IoArHandlerMain::kDrWaitPullCnf("DrWaitPullCnf", &DrWaitPullCnfHandler, &kDynamicReconfigurationRunning, nullptr, nullptr, nullptr); +const IoArHandlerMain::State IoArHandlerMain::kOpenApplicationReadyDynamicReconfigurationRunningDrWaitPullCnf("DrWaitPullCnf", &DrWaitPullCnfHandler, &kOpenApplicationReadyDynamicReconfigurationRunning, nullptr, nullptr, nullptr); IoArHandlerMain::Transition IoArHandlerMain::DrWaitPullCnfHandler(ImplPtr impl, Event event) { (void)impl; // impl parameter is unused when there is no guard function being called in here @@ -254,7 +254,7 @@ IoArHandlerMain::Transition IoArHandlerMain::DrWaitPullCnfHandler(ImplPtr impl, if (true) { static const Transition::ActionContainer<1> kActions = {&Impl::DrPullDone}; - return TransitionTo(kReady, kActions); + return TransitionTo(kOpenApplicationReadyReady, kActions); } return UnhandledEvent(); @@ -264,7 +264,7 @@ IoArHandlerMain::Transition IoArHandlerMain::DrWaitPullCnfHandler(ImplPtr impl, } // State Ready -const IoArHandlerMain::State IoArHandlerMain::kReady("Ready", &ReadyHandler, &kApplicationReady, nullptr, nullptr, nullptr); +const IoArHandlerMain::State IoArHandlerMain::kOpenApplicationReadyReady("Ready", &ReadyHandler, &kOpenApplicationReady, nullptr, nullptr, nullptr); IoArHandlerMain::Transition IoArHandlerMain::ReadyHandler(ImplPtr impl, Event event) { (void)impl; // impl parameter is unused when there is no guard function being called in here @@ -275,7 +275,7 @@ IoArHandlerMain::Transition IoArHandlerMain::ReadyHandler(ImplPtr impl, Event ev if (true) { static const Transition::ActionContainer<1> kActions = {&Impl::DrPlug}; - return TransitionTo(kDrWaitPlugCnf, kActions); + return TransitionTo(kOpenApplicationReadyDynamicReconfigurationRunningDrWaitPlugCnf, kActions); } return UnhandledEvent(); @@ -283,7 +283,7 @@ IoArHandlerMain::Transition IoArHandlerMain::ReadyHandler(ImplPtr impl, Event ev if (true) { static const Transition::ActionContainer<1> kActions = {&Impl::DrPull}; - return TransitionTo(kDrWaitPullCnf, kActions); + return TransitionTo(kOpenApplicationReadyDynamicReconfigurationRunningDrWaitPullCnf, kActions); } return UnhandledEvent(); @@ -293,7 +293,7 @@ IoArHandlerMain::Transition IoArHandlerMain::ReadyHandler(ImplPtr impl, Event ev } // State Parameterizing -const IoArHandlerMain::State IoArHandlerMain::kParameterizing("Parameterizing", &ParameterizingHandler, &kOpen, nullptr, nullptr, nullptr); +const IoArHandlerMain::State IoArHandlerMain::kOpenParameterizing("Parameterizing", &ParameterizingHandler, &kOpen, nullptr, nullptr, nullptr); IoArHandlerMain::Transition IoArHandlerMain::ParameterizingHandler(ImplPtr impl, Event event) { (void)impl; // impl parameter is unused when there is no guard function being called in here @@ -304,11 +304,11 @@ IoArHandlerMain::Transition IoArHandlerMain::ParameterizingHandler(ImplPtr impl, if (impl->FirstInArSetOrPrimary(event)) { static const Transition::ActionContainer<1> kActions = {&Impl::ApplyConfiguration}; - return TransitionTo(kWaitApplicationReady, kActions); + return TransitionTo(kOpenWaitApplicationReady, kActions); } if (true) { - return TransitionTo(kWaitApplicationReadyCnf); + return TransitionTo(kOpenWaitApplicationReadyCnf); } return UnhandledEvent(); @@ -318,7 +318,7 @@ IoArHandlerMain::Transition IoArHandlerMain::ParameterizingHandler(ImplPtr impl, } // State WaitApplicationReady -const IoArHandlerMain::State IoArHandlerMain::kWaitApplicationReady("WaitApplicationReady", &WaitApplicationReadyHandler, &kOpen, nullptr, &Impl::StartWaitApplicationReadyTimer, &Impl::StopWaitApplicationReadyTimer); +const IoArHandlerMain::State IoArHandlerMain::kOpenWaitApplicationReady("WaitApplicationReady", &WaitApplicationReadyHandler, &kOpen, nullptr, &Impl::StartWaitApplicationReadyTimer, &Impl::StopWaitApplicationReadyTimer); IoArHandlerMain::Transition IoArHandlerMain::WaitApplicationReadyHandler(ImplPtr impl, Event event) { (void)impl; // impl parameter is unused when there is no guard function being called in here @@ -328,11 +328,11 @@ IoArHandlerMain::Transition IoArHandlerMain::WaitApplicationReadyHandler(ImplPtr case IoArHandlerMain_GET_STATIC_EVENT_ID(SPnpbAppTimeout): if (impl->CheckApplicationReady(event)) { - return TransitionTo(kWaitApplicationReadyCnf); + return TransitionTo(kOpenWaitApplicationReadyCnf); } if (true) { - return TransitionTo(kWaitApplicationReady); + return TransitionTo(kOpenWaitApplicationReady); } return UnhandledEvent(); @@ -342,7 +342,7 @@ IoArHandlerMain::Transition IoArHandlerMain::WaitApplicationReadyHandler(ImplPtr } // State WaitApplicationReadyCnf -const IoArHandlerMain::State IoArHandlerMain::kWaitApplicationReadyCnf("WaitApplicationReadyCnf", &WaitApplicationReadyCnfHandler, &kOpen, nullptr, &Impl::SendApplicationReady, nullptr); +const IoArHandlerMain::State IoArHandlerMain::kOpenWaitApplicationReadyCnf("WaitApplicationReadyCnf", &WaitApplicationReadyCnfHandler, &kOpen, nullptr, &Impl::SendApplicationReady, nullptr); IoArHandlerMain::Transition IoArHandlerMain::WaitApplicationReadyCnfHandler(ImplPtr impl, Event event) { (void)impl; // impl parameter is unused when there is no guard function being called in here @@ -352,7 +352,7 @@ IoArHandlerMain::Transition IoArHandlerMain::WaitApplicationReadyCnfHandler(Impl case IoArHandlerMain_GET_STATIC_EVENT_ID(S_PNS_ApplicationReady_cnf): if (impl->success(event)) { - return TransitionTo(kApplicationReady); + return TransitionTo(kOpenApplicationReady); } if (true) { diff --git a/test/generated/ScXmlTestDeclaration.hxx b/test/generated/ScXmlTestDeclaration.hxx index 60a7420..fc68514 100644 --- a/test/generated/ScXmlTestDeclaration.hxx +++ b/test/generated/ScXmlTestDeclaration.hxx @@ -13,13 +13,13 @@ class ScXmlTest final : public ScXmlTestBase // State State_2 static Transition State_2Handler(ImplPtr impl, Event event); - static const HistoryState kState_2; + static const HistoryState kState_1State_2; // State State_3 static Transition State_3Handler(ImplPtr impl, Event event); - static const State kState_3; + static const State kState_1State_3; // State State_4 static Transition State_4Handler(ImplPtr impl, Event event); - static const State kState_4; + static const State kState_1State_4; }; \ No newline at end of file diff --git a/test/generated/ScXmlTestInstance.hxx b/test/generated/ScXmlTestInstance.hxx index aea17e4..4c8c7a7 100644 --- a/test/generated/ScXmlTestInstance.hxx +++ b/test/generated/ScXmlTestInstance.hxx @@ -14,7 +14,7 @@ const ScXmlTest::StatePtr ScXmlTest::kInitialState = &ScXmlTest::kState_1; // State State_1 -const ScXmlTest::State ScXmlTest::kState_1("State_1", &State_1Handler, nullptr, &kState_2, nullptr, nullptr); +const ScXmlTest::State ScXmlTest::kState_1("State_1", &State_1Handler, nullptr, &kState_1State_2, nullptr, nullptr); ScXmlTest::Transition ScXmlTest::State_1Handler(ImplPtr impl, Event event) { (void)impl; // impl parameter is unused when there is no guard function being called in here @@ -27,7 +27,7 @@ ScXmlTest::Transition ScXmlTest::State_1Handler(ImplPtr impl, Event event) } // State State_2 -const ScXmlTest::HistoryState ScXmlTest::kState_2("State_2", &State_2Handler, &kState_1, nullptr, nullptr, nullptr); +const ScXmlTest::HistoryState ScXmlTest::kState_1State_2("State_2", &State_2Handler, &kState_1, nullptr, nullptr, nullptr); ScXmlTest::Transition ScXmlTest::State_2Handler(ImplPtr impl, Event event) { (void)impl; // impl parameter is unused when there is no guard function being called in here @@ -46,7 +46,7 @@ ScXmlTest::Transition ScXmlTest::State_2Handler(ImplPtr impl, Event event) if (impl->guard(event)) { static const Transition::ActionContainer<2> kActions = {&Impl::action, &Impl::action2}; - return TransitionTo(kState_3, kActions); + return TransitionTo(kState_1State_3, kActions); } return UnhandledEvent(); @@ -56,7 +56,7 @@ ScXmlTest::Transition ScXmlTest::State_2Handler(ImplPtr impl, Event event) } // State State_3 -const ScXmlTest::State ScXmlTest::kState_3("State_3", &State_3Handler, &kState_1, nullptr, &Impl::entry, &Impl::exit); +const ScXmlTest::State ScXmlTest::kState_1State_3("State_3", &State_3Handler, &kState_1, nullptr, &Impl::entry, &Impl::exit); ScXmlTest::Transition ScXmlTest::State_3Handler(ImplPtr impl, Event event) { (void)impl; // impl parameter is unused when there is no guard function being called in here @@ -66,7 +66,7 @@ ScXmlTest::Transition ScXmlTest::State_3Handler(ImplPtr impl, Event event) case ScXmlTest_GET_STATIC_EVENT_ID(Transition_7): if (true) { - return TransitionTo(kState_4); + return TransitionTo(kState_1State_4); } return UnhandledEvent(); @@ -76,7 +76,7 @@ ScXmlTest::Transition ScXmlTest::State_3Handler(ImplPtr impl, Event event) } // State State_4 -const ScXmlTest::State ScXmlTest::kState_4("State_4", &State_4Handler, &kState_1, nullptr, nullptr, nullptr); +const ScXmlTest::State ScXmlTest::kState_1State_4("State_4", &State_4Handler, &kState_1, nullptr, nullptr, nullptr); ScXmlTest::Transition ScXmlTest::State_4Handler(ImplPtr impl, Event event) { (void)impl; // impl parameter is unused when there is no guard function being called in here @@ -86,7 +86,7 @@ ScXmlTest::Transition ScXmlTest::State_4Handler(ImplPtr impl, Event event) case ScXmlTest_GET_STATIC_EVENT_ID(Transition_8): if (true) { - return TransitionTo(kState_2); + return TransitionTo(kState_1State_2); } return UnhandledEvent();