markus.muehlbrandt@gmail.com 11 лет назад
Родитель
Сommit
2b868f3a5d
34 измененных файлов с 1 добавлено и 2369 удалено
  1. 1 2
      plugins/org.yakindu.sct.generator.cpp/META-INF/MANIFEST.MF
  2. 0 50
      plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/CMakeLists.xpt
  3. 0 45
      plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/CustomEventH.xpt
  4. 0 84
      plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/CustomRepositoryH.xpt
  5. 0 180
      plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/CustomStatemachine_cyCPP.xpt
  6. 0 100
      plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/CustomStatemachine_cyH.xpt
  7. 0 186
      plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/CustomStatemachine_evCPP.xpt
  8. 0 96
      plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/CustomStatemachine_evH.xpt
  9. 0 38
      plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/DataRepositoryBoost.xpt
  10. 0 66
      plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/DataRepositoryCPP.xpt
  11. 0 44
      plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/DataRepositoryH.xpt
  12. 0 33
      plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/DummyTimerCPP.xpt
  13. 0 35
      plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/DummyTimerH.xpt
  14. 0 130
      plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/Dump.xpt
  15. 0 45
      plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/EventH.xpt
  16. 0 34
      plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/EventReceiverH.xpt
  17. 0 71
      plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/EventSetCPP.xpt
  18. 0 41
      plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/EventSetH.xpt
  19. 0 159
      plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/Expression.ext
  20. 0 156
      plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/Interfaces.xpt
  21. 0 70
      plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/Main.xpt
  22. 0 76
      plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/Naming.ext
  23. 0 40
      plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/StatemachineBaseCPP.xpt
  24. 0 49
      plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/StatemachineBaseH.xpt
  25. 0 31
      plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/StatemachineExceptionH.xpt
  26. 0 48
      plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/Statemachine_cyCPP.xpt
  27. 0 46
      plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/Statemachine_cyH.xpt
  28. 0 56
      plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/Statemachine_evCPP.xpt
  29. 0 54
      plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/Statemachine_evH.xpt
  30. 0 112
      plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/TestMain_cy.xpt
  31. 0 106
      plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/TestMain_ev.xpt
  32. 0 36
      plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/TimerH.xpt
  33. 0 13
      plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/TypeModelExtensions.ext
  34. 0 37
      plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/definitionH.xpt

+ 1 - 2
plugins/org.yakindu.sct.generator.cpp/META-INF/MANIFEST.MF

@@ -23,6 +23,5 @@ Require-Bundle: org.yakindu.sct.model.sexec,
  org.eclipse.xtext.xbase.lib;bundle-version="2.3.1",
  org.eclipse.xtext.builder;bundle-version="2.3.0"
 Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Export-Package: org.yakindu.sct.generator.cpp,
- org.yakindu.sct.generator.cpp.templates
+Export-Package: org.yakindu.sct.generator.cpp
 Bundle-Vendor: statecharts.org

+ 0 - 50
plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/CMakeLists.xpt

@@ -1,50 +0,0 @@
-«REM»
-
-Templates for the main statechart cpp file.
-
-@auther joern seger
-
-«ENDREM»
-
-«IMPORT sexec»
-«IMPORT stext»
-«IMPORT sgraph»
-
-«EXTENSION org::yakindu::sct::generator::cpp::templates::Expression»
-«EXTENSION org::yakindu::sct::generator::cpp::templates::Naming»
-
-«DEFINE file FOR ExecutionFlow»
-
-«FILE 'CMakeLists.txt'»
-
-set ( SRC_BASE
-	DataRepository.cpp
-	DummyTimer.cpp
-	EventSet.cpp
-	StatemachineBase.cpp
-)
-
-set ( SRC_IFACE
-«FOREACH this.scopes.typeSelect(InterfaceScope) AS interface -»
-	«interface.interfaceClassName()».cpp
-«ENDFOREACH»
-)	
-
-set ( SRC_EV
-	Statemachine_ev.cpp
-	Statemachine_ev.h
-	«StName()»_ev.cpp
-)
-
-set ( SRC_CY
-	Statemachine_cy.cpp
-	Statemachine_cy.h
-	«StName()»_cy.cpp
-)
-
-add_library(«StName()»_ev ${SRC_BASE} ${SRC_IFACE} ${SRC_EV})
-add_library(«StName()»_cy ${SRC_BASE} ${SRC_IFACE} ${SRC_CY})
-
-«ENDFILE»
-
-«ENDDEFINE»

+ 0 - 45
plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/CustomEventH.xpt

@@ -1,45 +0,0 @@
-«REM»
-
-Templates for the main statechart cpp file.
-
-@auther joern seger
-
-«ENDREM»
-
-«IMPORT sexec»
-«IMPORT stext»
-«IMPORT sgraph»
-
-«EXTENSION org::yakindu::sct::generator::cpp::templates::Expression»
-«EXTENSION org::yakindu::sct::generator::cpp::templates::Naming»
-
-
-«DEFINE file FOR ExecutionFlow»
-
-«FILE EvName()+'.h'»
-#ifndef «EVNAME()»_H_
-#define «EVNAME()»_H_
-
-#include "Event.h"
-
-enum EventID {
-«FOREACH this.declaredEvents() AS ev -»
-  ev_«((EventDefinition)ev).name.toLowerCase() -»,
-«ENDFOREACH»
-	event_last
-};
-
-«FOREACH this.declaredEvents() AS ev»
-class «((EventDefinition)ev).name» : public _Event { 
-  public: 
-    «((EventDefinition)ev).name»() : _Event((uint32_t)ev_«((EventDefinition)ev).name.toLowerCase()») {} 
-    «eventTypeToString(((EventDefinition)ev).type)» value;    
-};
-«ENDFOREACH»
- 
-
-#endif /* «name.toUpperCase()»_H_ */
-
-«ENDFILE»
-
-«ENDDEFINE»

+ 0 - 84
plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/CustomRepositoryH.xpt

@@ -1,84 +0,0 @@
-«REM»
-
-Templates for the main statechart cpp file.
-
-@auther joern seger
-
-«ENDREM»
-
-«IMPORT sexec»
-«IMPORT stext»
-«IMPORT sgraph»
-«IMPORT base»
-
-«EXTENSION org::yakindu::sct::generator::cpp::templates::Expression»
-«EXTENSION org::yakindu::sct::generator::cpp::templates::Naming»
-
-
-«DEFINE interfaces FOR ExecutionFlow»
-«EXPAND scope FOREACH this.scopes»
-«ENDDEFINE»
-
-«DEFINE scope FOR Scope -»
-«ENDDEFINE»
-
-«DEFINE scope FOR InterfaceScope»
-«EXPAND declaration FOREACH this.declarations»
-«ENDDEFINE»
-
-«DEFINE scope FOR InternalScope»
-«EXPAND declaration FOREACH this.declarations»
-«ENDDEFINE»
-
-«DEFINE declaration FOR Declaration -»
-	// unknown declaration «name()»
-«ENDDEFINE»
-
-«DEFINE declaration FOR EventDefinition -» 
-«ENDDEFINE»
-
-«DEFINE declaration FOR VariableDefinition -»
-	«type» «name»; 
-«ENDDEFINE»
-
-
-«DEFINE file FOR ExecutionFlow»
-
-«FILE DRName()+'.h'»
-#ifndef «DRNAME()»_H_
-#define «DRNAME()»_H_
-
-#include "definition.h"
-#include "DataRepository.h"
-
-class «DRName()» : public DataRepository {
-
-«FOREACH this.declaredVariables() AS variable»
-    «((VariableDefinition)variable).type» «((VariableDefinition)variable).name»;
-«ENDFOREACH»
-
-public:
-
-	«DRName()»() : 
-«FOREACH this.declaredVariables() AS variable SEPARATOR ','-»
- «((VariableDefinition)variable).name»(0)«
-ENDFOREACH»
-	{};
-	virtual ~«DRName()»() {};
-	
-«FOREACH this.declaredVariables() AS variable»
-    «((VariableDefinition)variable).type» get_«((VariableDefinition)variable).name»()
-    { «((VariableDefinition)variable).type» value; lock(); value = «((VariableDefinition)variable).name»; unlock(); return value; }
-«ENDFOREACH»
-
-«FOREACH this.declaredVariables() AS variable»
-    void set_«((VariableDefinition)variable).name»(const «((VariableDefinition)variable).type»& value)
-    { lock(); «((VariableDefinition)variable).name» =  value; unlock(); }
-«ENDFOREACH»
-
-};
-
-#endif /* «DRNAME()»_H_ */
-«ENDFILE»
-
-«ENDDEFINE»

+ 0 - 180
plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/CustomStatemachine_cyCPP.xpt

@@ -1,180 +0,0 @@
-«REM»
-
-Templates for the main statechart cpp file.
-
-@auther joern seger
-
-«ENDREM»
-
-«IMPORT sexec»
-«IMPORT stext»
-«IMPORT sgraph»
-«IMPORT ecore»
-
-«IMPORT org::yakindu::sct::generator::cpp::templates»
-«EXTENSION org::yakindu::sct::generator::cpp::templates::Expression»
-«EXTENSION org::yakindu::sct::generator::cpp::templates::TypeModelExtensions»
-«EXTENSION org::yakindu::sct::generator::cpp::templates::Naming»
-
-«DEFINE ActionCode FOR Step»
-// ActionCode for Step not defined
-«ENDDEFINE»
-
-«DEFINE ActionCode FOR Execution -»
-	«this.statement.toCppCode()»
-«ENDDEFINE»
-
-«DEFINE ActionCode FOR Call -»
-«this.step.functionName()»();
-«ENDDEFINE»
-
-«DEFINE ActionCode FOR Sequence -»
-  «EXPAND ActionCode FOREACH this.steps»
-«ENDDEFINE»
-
-«DEFINE ActionCode FOR Check -»
-  «IF this != null -»
-«this.condition.toCppCode() -»
-  «ELSE -»
- true «
- ENDIF -»«
-  ENDDEFINE»
-
-«DEFINE ActionCode FOR CheckRef -»
-  «IF this.check != null -»
-  «this.check.functionName()»() «
-  ELSE -»
- true «
-  ENDIF -»«
-ENDDEFINE»
-
-«DEFINE ActionCode FOR Reaction -»
-  «EXPAND ActionCode FOR this.effect» 
-«ENDDEFINE»
-
-«DEFINE ActionCode FOR If -»
-if («EXPAND ActionCode FOR this.check») { 
-  «EXPAND ActionCode FOR this.thenStep -»
-}
-else {
-  «EXPAND ActionCode FOR this.elseStep -»
-}
-«ENDDEFINE»
-
-«DEFINE ActionCode FOR EnterState -»
-state[0] = _«this.state.simpleName»;
-«ENDDEFINE»
-
-«DEFINE ActionCode FOR ExitState -»
-state[0] = last_state;
-«ENDDEFINE»
-
-«DEFINE ConditionMethodsImplement FOR ExecutionState -»
-  «FOREACH reactions AS r -»
-  «IF r.check != null -»
-bool «StNameCy()»::«r.check.functionName()»() {
-  return (	«r.check.condition.toCppCode()» );
-}
-  «ENDIF -»
-  «ENDFOREACH -»
-«ENDDEFINE»
-
-«DEFINE StatementMethodsImplement FOR ExecutionState -»
-  «FOREACH reactions AS r -»
-void «StNameCy()»::«r.effect.functionName()»() {
-  «EXPAND ActionCode FOR r.effect -»
-}
-  «ENDFOREACH»
-«ENDDEFINE»
-
-«DEFINE ReactCode FOR Sequence- » 
-«EXPAND ActionCode FOREACH this.steps»
-«ENDDEFINE»
-
-«DEFINE ReactMethodsImplement FOR ExecutionState -»
-void «StNameCy()»::react_«this.simpleName»()
-{
-	«EXPAND ReactCode FOR reactSequence»
-}
-«ENDDEFINE»
-
-«DEFINE EnterMethodImplement FOR ExecutionState -»
-«IF this.entryAction != null -»
-void «StNameCy()»::«this.entryAction.entryActionFunctionName()»()
-{
-«EXPAND ActionCode FOR this.entryAction -»
-}
-«ENDIF -»
-«ENDDEFINE»
-
-«DEFINE ExitMethodImplement FOR ExecutionState -»
-«IF this.exitAction != null -»
-void «StNameCy()»::«this.exitAction.exitActionFunctionName()»()
-{
-«EXPAND ActionCode FOR this.exitAction -»
-}
-«ENDIF -»
-«ENDDEFINE»
-
-«DEFINE file FOR ExecutionFlow»
-«FILE StName()+'_cy.cpp'»
-#include <iostream>
-#include "«StNameCy()».h"
-
-«StNameCy()»::«StNameCy()»(Timer* _timer) : Statemachine_cy(«((ExecutionFlow)this.eRootContainer).stateVector.size», event_last, _timer) {
-}
-
-«StNameCy()»::~«StNameCy()»() {
-}
-
-«EXPAND ConditionMethodsImplement FOREACH this.states -»
-«EXPAND StatementMethodsImplement FOREACH this.states -»
-«EXPAND ReactMethodsImplement FOREACH this.states -»
-«EXPAND EnterMethodImplement FOREACH this.states -»
-«EXPAND ExitMethodImplement FOREACH this.states -»
-
-void «StNameCy()»::init()
-{
-	«EXPAND ActionCode FOREACH this.enterSequence.steps -»
-}
-
-«FOREACH declaredEvents() AS event -»
-«IF (((EventDefinition)event).type.isVoid()) -»
-void set«((EventDefinition)event).name.toFirstUpper()»()
-«ELSE -»
-void set«((EventDefinition)event).name.toFirstUpper()»(«eventTypeToString(((EventDefinition)event).type)» value)
-«ENDIF -»
-{
-	«((EventDefinition)event).name»* ev(new «((EventDefinition)event).name»);
-
-«IF (((EventDefinition)event).type.isVoid()) -»
-	ev->value = value;
-«ENDIF -»
-	queueEvent(ev);
-}
-«ENDFOREACH -»
-
-/* Yet unimplemented
-void «StNameCy()»::exit()
-{
-}
-*/
-
-void «StNameCy()»::_runCycle()
-{
-	for (int i=0; i<MAX_PARALLEL_STATES; ++i) {
-		switch(state[i]) {
-	«FOREACH this.states AS state»
-	    case _«state.simpleName»:
-	        react_«state.simpleName»();
-	        break;
-	«ENDFOREACH»
-		default:
-			/* no state found */
-			break;
-		}
-	}
-}
-«ENDFILE»
-
-«ENDDEFINE»

+ 0 - 100
plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/CustomStatemachine_cyH.xpt

@@ -1,100 +0,0 @@
-«REM»
-
-Templates for the main statechart cpp file.
-
-@auther joern seger
-
-«ENDREM»
-
-«IMPORT sexec»
-«IMPORT stext»
-«IMPORT sgraph»
-
-«EXTENSION org::yakindu::sct::generator::cpp::templates::Expression»
-«EXTENSION org::yakindu::sct::generator::cpp::templates::TypeModelExtensions»
-«EXTENSION org::yakindu::sct::generator::cpp::templates::Naming»
-
-«DEFINE file FOR ExecutionFlow»
-
-«FILE StName()+'_cy.h'»
-#ifndef «STNAME()»_H_
-#define «STNAME()»_H_
-
-#include "Statemachine_cy.h"
-#include "«DRName()».h"
-#include "«EvName()».h"
-
-
-#define MAX_PARALLEL_STATES «this.stateVector.size»
-
-class «StNameCy()»: public Statemachine_cy, public «DRName()» {
-
-public:
-	enum States {
-	    «FOREACH this.states AS exState-»
-	    _«exState.simpleName -»,
-	    «ENDFOREACH -»
-		last_state
-	};		
-
-protected:
-	/* conditions */
-	«FOREACH states AS state -»
-	  «FOREACH state.reactions AS reaction -»
-	  «IF reaction.check != null -»
-	bool «reaction.check.functionName()»();
-	  «ENDIF -»
-	  «ENDFOREACH -»
-	«ENDFOREACH -»
-	
-	/* actions */
-	«FOREACH states AS state -»
-	  «FOREACH state.reactions AS reaction -»
-	void «reaction.effect.functionName()»();
-	  «ENDFOREACH -»
-	«ENDFOREACH -»
-
-	/* state reactions */
-	«FOREACH states AS state -»
-	void react_«state.simpleName»();
-	«ENDFOREACH -»
-	
-	/* entrys */
-	«FOREACH states AS state -»
-	«IF state.entryAction != null -»
-	void «state.entryAction.entryActionFunctionName()»();
-	«ENDIF -»
-	«ENDFOREACH -»
-	
-	/*exits */
-	«FOREACH states AS state -»
-	«IF state.exitAction != null -»
-	void «state.exitAction.exitActionFunctionName()»();
-	«ENDIF -»
-	«ENDFOREACH -»
-	
-	virtual void _runCycle();
-
-public:
-
-	«StNameCy()»(Timer* timer);
-	virtual ~«StNameCy()»();
-
-	virtual void init();
-
-	«FOREACH declaredEvents() AS event -»
-	«IF (((EventDefinition)event).type.isVoid()) -»
-	void set«((EventDefinition)event).name.toFirstUpper()»();
-	«ELSE -»
-	void set«((EventDefinition)event).name.toFirstUpper()»(«eventTypeToString(((EventDefinition)event).type)» value);
-	«ENDIF -»
-    «ENDFOREACH -»
-};
-
-//}; // namespace
-#endif /* «STNAME()»_H_ */
-
-«ENDFILE»
-
-«ENDDEFINE»
-

+ 0 - 186
plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/CustomStatemachine_evCPP.xpt

@@ -1,186 +0,0 @@
-«REM»
-
-Templates for the main statechart cpp file.
-
-@auther joern seger
-
-«ENDREM»
-
-«IMPORT sexec»
-«IMPORT stext»
-«IMPORT sgraph»
-«IMPORT ecore»
-
-«IMPORT org::yakindu::sct::generator::cpp::templates»
-«EXTENSION org::yakindu::sct::generator::cpp::templates::Expression»
-«EXTENSION org::yakindu::sct::generator::cpp::templates::Naming»
-
-«DEFINE ActionCode FOR Step»
-// ActionCode for Step not defined
-«ENDDEFINE»
-
-«DEFINE ActionCode FOR ScheduleTimeEvent»
-  timer->setTimer(ev_«this.timeEvent.name», «this.timeValue», «this.timeEvent.periodic»);
-«ENDDEFINE»
-
-«DEFINE ActionCode FOR UnscheduleTimeEvent»
-  timer->unsetTimer(ev_«this.timeEvent.name»);
-«ENDDEFINE»
-
-«DEFINE ActionCode FOR Execution»
-	«this.statement.toCppCode()»
-«ENDDEFINE»
-
-«DEFINE ActionCode FOR Call»
-«this.step.functionName()»();
-«ENDDEFINE»
-
-«DEFINE ActionCode FOR Sequence»
-  «EXPAND ActionCode FOREACH this.steps»
-«ENDDEFINE»
-
-«DEFINE ActionCode FOR Check -»
-  «IF this != null -»
-«this.condition.toCppCode() -»
-  «ELSE -»
- true «
- ENDIF -»«
-  ENDDEFINE»
-
-«DEFINE ActionCode FOR CheckRef -»
-  «IF this.check != null -»
-  «this.check.functionName()»(ev) «
-  ELSE -»
- true «
-  ENDIF -»«
-ENDDEFINE»
-
-«DEFINE ActionCode FOR Reaction»
-  «EXPAND ActionCode FOR this.effect» 
-«ENDDEFINE»
-
-«DEFINE ActionCode FOR If»
-if («EXPAND ActionCode FOR this.check») { 
-  «EXPAND ActionCode FOR this.thenStep»
-}
-else {
-  «EXPAND ActionCode FOR this.elseStep»
-}
-«ENDDEFINE»
-
-«DEFINE ActionCode FOR EnterState»
-state[0] = _«this.state.simpleName»;
-«ENDDEFINE»
-
-«DEFINE ActionCode FOR ExitState»
-state[0] = last_state;
-«ENDDEFINE»
-
-«DEFINE ConditionMethodsImplement FOR ExecutionState»
-  «FOREACH reactions AS r»
-  «IF r.check != null -»
-bool «StNameEv()»::«r.check.functionName()»(const _Event& ev) {
-  return (	«r.check.condition.toCppCode()» );
-}
-  «ENDIF -»
-  «ENDFOREACH»
-«ENDDEFINE»
-
-«DEFINE StatementMethodsImplement FOR ExecutionState»
-  «FOREACH reactions AS r»
-void «this.StName()»::«r.effect.functionName()»() {
-  «EXPAND ActionCode FOR r.effect»
-}
-  «ENDFOREACH»
-«ENDDEFINE»
-
-«DEFINE ReactCode FOR Sequence» 
-«EXPAND ActionCode FOREACH this.steps»
-«ENDDEFINE»
-
-«DEFINE ReactMethodsImplement FOR ExecutionState»
-void «StNameEv()»::react_«this.simpleName»(const _Event& ev)
-{
-	«EXPAND ReactCode FOR reactSequence»
-}
-«ENDDEFINE»
-
-«DEFINE EnterMethodImplement FOR ExecutionState»
-«IF this.entryAction != null»
-void «StNameEv()»::«this.entryAction.entryActionFunctionName()»()
-{
-«EXPAND ActionCode FOR this.entryAction»
-}
-«ENDIF»
-«ENDDEFINE»
-
-«DEFINE ExitMethodImplement FOR ExecutionState»
-«IF this.exitAction != null»
-void «StNameEv()»::«this.exitAction.exitActionFunctionName()»()
-{
-«EXPAND ActionCode FOR this.exitAction»
-}
-«ENDIF»
-«ENDDEFINE»
-
-«DEFINE file FOR ExecutionFlow»
-«FILE StName()+'_ev.cpp'»
-#include <iostream>
-#include "«StNameEv()».h"
-
-«StNameEv()»::«StNameEv()»(Timer* _timer) : Statemachine_ev(«((ExecutionFlow)this.eRootContainer).stateVector.size», event_last, _timer) {
-}
-
-«StNameEv()»::~«StNameEv()»() {
-}
-
-«EXPAND ConditionMethodsImplement FOREACH this.states»
-
-«EXPAND StatementMethodsImplement FOREACH this.states»
-
-«EXPAND ReactMethodsImplement FOREACH this.states»
-
-«EXPAND EnterMethodImplement FOREACH this.states»
-
-«EXPAND ExitMethodImplement FOREACH this.states»
-
-
-void «StNameEv()»::init()
-{
-	«EXPAND ActionCode FOREACH this.enterSequence.steps»
-}
-
-/* Yet unimplemented
-void «StNameEv()»::exit()
-{
-}
-*/
-
-void «StNameEv()»::_setActualEventData(Event ev)
-{
-	setEventData(ev);
-}
-
-void «StNameEv()»::_removeActualEventData()
-{
-	clearEventData();
-}
-
-void «StNameEv()»::_runCycle(Event ev)
-{
-	for (int i=0; i<MAX_PARALLEL_STATES; ++i) {
-		switch(state[i]) {
-	«FOREACH this.states AS state»
-	    case _«state.simpleName»:
-	        react_«state.simpleName»(*ev);
-	        break;
-	«ENDFOREACH»
-		default:
-			/* no state found */
-			break;
-		}
-	}
-}
-«ENDFILE»
-
-«ENDDEFINE»

+ 0 - 96
plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/CustomStatemachine_evH.xpt

@@ -1,96 +0,0 @@
-«REM»
-
-Templates for the main statechart cpp file.
-
-@auther joern seger
-
-«ENDREM»
-
-«IMPORT sexec»
-«IMPORT stext»
-«IMPORT sgraph»
-
-«EXTENSION org::yakindu::sct::generator::cpp::templates::Expression»
-«EXTENSION org::yakindu::sct::generator::cpp::templates::Naming»
-
-«DEFINE file FOR ExecutionFlow»
-
-«FILE StName()+'_ev.h'»
-#ifndef «STNAME()»_H_
-#define «STNAME()»_H_
-
-#include "Statemachine_ev.h"
-#include "«DRName()».h"
-#include "«EvName()».h"
-
-
-#define MAX_PARALLEL_STATES «this.stateVector.size»
-
-class «StNameEv()»: public Statemachine_ev, public «DRName()» {
-
-public:
-	enum States {
-	    «FOREACH this.states AS exState-»
-	      _«exState.simpleName»,
-	    «ENDFOREACH»
-		last_state
-	};
-
-protected:
-	/* conditions */
-	«FOREACH states AS state -»
-	  «FOREACH state.reactions AS reaction -»
-	  «IF reaction.check != null -»
-	bool «reaction.check.functionName()»(const _Event& event);
-	  «ENDIF»
-	  «ENDFOREACH»
-	«ENDFOREACH»
-	
-	/* actions */
-	«FOREACH states AS state -»
-	  «FOREACH state.reactions AS reaction -»
-	void «reaction.effect.functionName()»();
-	  «ENDFOREACH»
-	«ENDFOREACH»
-
-	/* state reactions */
-	«FOREACH states AS state -»
-	void react_«state.simpleName»(const _Event& ev);
-	«ENDFOREACH»
-	
-	/* entrys */
-	«FOREACH states AS state -»
-	«IF state.entryAction != null»
-	void «state.entryAction.entryActionFunctionName()»();
-	«ENDIF»
-	«ENDFOREACH»
-	
-	/*exits */
-	«FOREACH states AS state -»
-	«IF state.exitAction != null»
-	void «state.exitAction.exitActionFunctionName()»();
-	«ENDIF»
-	«ENDFOREACH»
-	
-	virtual void _runCycle(Event ev);
-	virtual void _setActualEventData(Event ev);
-	virtual void _removeActualEventData();
-
-public:
-
-	«StNameEv()»(Timer* timer);
-	virtual ~«StNameEv()»();
-
-	virtual void init();
-
-	//virtual void queueEvent(const Event& ev);
-
-};
-
-//}; // namespace
-#endif /* «STNAME()»_H_ */
-
-«ENDFILE»
-
-«ENDDEFINE»
-

+ 0 - 38
plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/DataRepositoryBoost.xpt

@@ -1,38 +0,0 @@
-«REM»
-
-Templates for the main statechart cpp file.
-
-@auther joern seger
-
-«ENDREM»
-
-«IMPORT sexec»
-«IMPORT stext»
-«IMPORT sgraph»
-
-
-«DEFINE file FOR ExecutionFlow»
-
-«FILE 'DataRepositoryBoost.cpp'»
-#ifndef DATAREPOSITORYBOOST_H_
-#define DATAREPOSITORYBOOST_H_
-
-#include "DataRepository.h"
-#include <boost/thread/mutex.hpp>
-
-class DataRepositoryBoost : public DataRepository {
-protected:
-	boost::recursive_mutex mutex;
-
-	virtual void lock(){ mutex.lock(); }
-	virtual void unlock(){ mutex.unlock(); }
-
-public:
-	DataRepositoryBoost(){};
-	virtual ~DataRepositoryBoost(){};
-};
-
-#endif /* DATAREPOSITORYBOOST_H_ */
-«ENDFILE»
-
-«ENDDEFINE»

+ 0 - 66
plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/DataRepositoryCPP.xpt

@@ -1,66 +0,0 @@
-«REM»
-
-Templates for the main statechart cpp file.
-
-@auther joern seger
-
-«ENDREM»
-
-«IMPORT sexec»
-«IMPORT stext»
-«IMPORT sgraph»
-
-
-«DEFINE file FOR ExecutionFlow»
-
-«FILE 'DataRepository.cpp'»
-#include "DataRepository.h"
-#include "StatemachineException.h"
-
-#include <iostream>
-
-DataRepository::DataRepository() : eventDataList(0), maxDataListItems(0)
-{
-}
-
-void DataRepository::clearEventData()
-{
-	for(uint32_t i(0);i<maxDataListItems; ++i) {
-		eventDataList[i] = 0;
-	}
-}
-
-void DataRepository::deleteEventData()
-{
-	for(uint32_t i(0);i<maxDataListItems; ++i) {
-		delete eventDataList[i];
-		eventDataList[i] = 0;
-	}
-}
-
-void DataRepository::setEventData(const Event & data)
-{
-	std::cout << "Set Event Data (ID "<<data->getID()<<")\n";
-
-	if (data->getID() < maxDataListItems) {
-		eventDataList[data->getID()] =
-				data;
-	}
-	else
-		throw StatechartException("DataRepository::setEvent: event ID out of range!");
-}
-
-DataRepository::DataRepository(const uint32_t maxEvents)
-: maxDataListItems(maxEvents)
-{
-	eventDataList = new Event[maxDataListItems];
-	clearEventData();
-}
-
-DataRepository::~DataRepository() {
-	clearEventData();
-	delete[] eventDataList;
-}
-«ENDFILE»
-
-«ENDDEFINE»

+ 0 - 44
plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/DataRepositoryH.xpt

@@ -1,44 +0,0 @@
-«REM»
-
-Templates for the main statechart cpp file.
-
-@auther joern seger
-
-«ENDREM»
-
-«IMPORT sexec»
-«IMPORT stext»
-«IMPORT sgraph»
-
-
-«DEFINE file FOR ExecutionFlow»
-
-«FILE 'DataRepository.h'»
-#ifndef DATAREPOSITORY_H_
-#define DATAREPOSITORY_H_
-
-#include "definition.h"
-#include "Event.h"
-
-class DataRepository {
-protected:
-	virtual void lock(){}
-	virtual void unlock(){}
-
-	Event* eventDataList;
-	uint32_t maxDataListItems;
-
-	void clearEventData();
-	void setEventData(const Event& data);
-    void deleteEventData();
-     
-public:
-	DataRepository();
-	DataRepository(const uint32_t maxEvents);
-	virtual ~DataRepository();
-};
-
-#endif /* DATAREPOSITORY_H_ */
-«ENDFILE»
-
-«ENDDEFINE»

+ 0 - 33
plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/DummyTimerCPP.xpt

@@ -1,33 +0,0 @@
-�REM�
-
-Templates for the main statechart cpp file.
-
-@auther joern seger
-
-�ENDREM�
-
-�IMPORT sexec�
-�IMPORT stext�
-�IMPORT sgraph�
-
-
-�DEFINE file FOR ExecutionFlow�
-
-�FILE 'DummyTimer.cpp'�
-#include "DummyTimer.h"
-
-DummyTimer::DummyTimer() 
-{}
-
-DummyTimer::~DummyTimer() 
-{}
-
-void DummyTimer::setTimer(const uint32_t evid, const uint32_t time_ms, bool periodic)
-{}
-
-void DummyTimer::unsetTimer(const uint32_t evid)
-{}
-
-�ENDFILE�
-
-�ENDDEFINE�

+ 0 - 35
plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/DummyTimerH.xpt

@@ -1,35 +0,0 @@
-«REM»
-
-Templates for the main statechart cpp file.
-
-@auther joern seger
-
-«ENDREM»
-
-«IMPORT sexec»
-«IMPORT stext»
-«IMPORT sgraph»
-
-
-«DEFINE file FOR ExecutionFlow»
-
-«FILE 'DummyTimer.h'»
-#ifndef DUMMYTIMER_H_
-#define DUMMYTIMER_H_
-
-#include "Timer.h"
-
-class DummyTimer: public Timer {
-public:
-	DummyTimer();
-	virtual ~DummyTimer();
-
-	virtual void setTimer(const uint32_t evid, const uint32_t time_ms, bool periodic = false);
-	virtual void unsetTimer(const uint32_t evid);
-
-};
-
-#endif /* DUMMYTIMER_H_ */
-«ENDFILE»
-
-«ENDDEFINE»

+ 0 - 130
plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/Dump.xpt

@@ -1,130 +0,0 @@
-«REM»
-
-Templates for writing a test dump file.
-
-@auther axel terfloth
-
-«ENDREM»
-
-«IMPORT sexec»
-«IMPORT stext»
-«IMPORT sgraph»
-
-«IMPORT org::yakindu::sct::generator::cpp::templates»
-«EXTENSION org::yakindu::sct::generator::cpp::templates::Naming»
-
-«DEFINE file FOR ExecutionFlow»
-
-«FILE 'dump.txt'»
-«EXPAND interfaces FOR this»
-Execution States:
-«EXPAND executionStates FOREACH this.states»
-
-«ENDFILE»
-
-«ENDDEFINE»
-
-
-«DEFINE interfaces FOR ExecutionFlow»
-Statechart-Interfaces:
-«EXPAND scope FOREACH this.scopes»
-«ENDDEFINE»
-
-«DEFINE scope FOR Scope -»
-«ENDDEFINE»
-
-«DEFINE scope FOR InterfaceScope»
-interface «name» : 
-«EXPAND declaration FOREACH this.declarations»
-«ENDDEFINE»
-
-«DEFINE scope FOR InternalScope»
-internal : 
-«EXPAND declaration FOREACH this.declarations»
-«ENDDEFINE»
-
-«DEFINE declaration FOR Declaration -»
-	unknown declaration «name()»
-«ENDDEFINE»
-
-«DEFINE declaration FOR EventDefinition -»
-	event «name»
-«ENDDEFINE»
-
-«DEFINE declaration FOR VariableDefinition -»
-	var «name» : «type»
-«ENDDEFINE»
-
-«DEFINE executionStates FOR ExecutionState»
-Name: «this.name»
-Simple Name: «this.simpleName»
-
-«EXPAND ReactionFunctions FOR this»
-
-React: «EXPAND code FOR this.reactSequence»
-«ENDDEFINE»
-
-
-«DEFINE code FOR Sequence -»
-	{ «EXPAND code FOREACH this.steps -»
-	}
-«ENDDEFINE»
-
-
-«DEFINE code FOR If»
-		if («EXPAND code FOR check») then «EXPAND code FOR this.thenStep»
-		«IF this.elseStep != null -»else «EXPAND code FOR this.elseStep»«ENDIF-»
-«ENDDEFINE»
-
-«DEFINE code FOR EnterState -»
- enter «this.state.name -»
-«ENDDEFINE»
-
-«DEFINE code FOR ExitState -»
- exit «this.state.name -»
-«ENDDEFINE»
-
-«DEFINE code FOR Check -»
-«EXPAND code FOR this.condition -»
-«ENDDEFINE»
-
-
-«DEFINE code FOR CheckRef -»
-check_«this.check.name -»()
-«ENDDEFINE»
-
-«DEFINE code FOR Call -»
-take_«this.step.name -»()
-«ENDDEFINE»
-
-
-«DEFINE code FOR Step»
-!!! UNKNOWN STEP !!!
-«ENDDEFINE»
-
-
-
-«DEFINE code FOR Statement -»
-«ENDDEFINE»
-
-«DEFINE code FOR LogicalOrExpression -»
-«EXPAND code FOR leftOperand» || «EXPAND code FOR rightOperand -»
-«ENDDEFINE»
-
-
-«DEFINE code FOR ElementReferenceExpression -»
-«this.reference-»
-«ENDDEFINE»
-
-
-«DEFINE ReactionFunctions FOR ExecutionState»
-«FOREACH reactions AS r»
-public boolean check_«r.name»() {
-	«EXPAND code FOR r.check»
-}
-
-public void take_«r.name»() {
-	«EXPAND code FOR r.effect»
-}
-«ENDFOREACH»
-«ENDDEFINE»

+ 0 - 45
plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/EventH.xpt

@@ -1,45 +0,0 @@
-�REM�
-
-Templates for the main statechart cpp file.
-
-@auther joern seger
-
-�ENDREM�
-
-�IMPORT sexec�
-�IMPORT stext�
-�IMPORT sgraph�
-
-
-�DEFINE file FOR ExecutionFlow�
-
-�FILE 'Event.h'�
-#ifndef EVENT_H_
-#define EVENT_H_
-
-#include "definition.h"
-
-class _Event {
-
-protected:
-	uint32_t ID;
-
-public:
-	_Event() : ID(0xffffffff) {}
-	_Event(int _ID) : ID(_ID) {}
-	virtual ~_Event() {}
-
-	uint32_t getID() const { return(ID); }
-	void setID(uint32_t id) { ID = id; }
-
-};
-
-typedef _Event* Event;
-
-template <class A>
-Event createEvent() { return new A; }
-
-#endif /* EVENT_H_ */
-�ENDFILE�
-
-�ENDDEFINE�

+ 0 - 34
plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/EventReceiverH.xpt

@@ -1,34 +0,0 @@
-�REM�
-
-Templates for the main statechart cpp file.
-
-@auther axel terfloth
-
-�ENDREM�
-
-�IMPORT sexec�
-�IMPORT stext�
-�IMPORT sgraph�
-
-
-�DEFINE file FOR ExecutionFlow�
-
-�FILE 'EventReceiver.h'�
-#ifndef EVENTRECEIVER_H_
-#define EVENTRECEIVER_H_
-
-#include "Event.h"
-
-class EventReceiver {
-
-public:
-	EventReceiver(){}
-	virtual ~EventReceiver(){}
-
-	virtual void queueEvent(Event ev) = 0; // setEvent()
-};
-
-#endif /* EVENTRECEIVER_H_ */
-�ENDFILE�
-
-�ENDDEFINE�

+ 0 - 71
plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/EventSetCPP.xpt

@@ -1,71 +0,0 @@
-�REM�
-
-Templates for the main statechart cpp file.
-
-@auther joern seger
-
-�ENDREM�
-
-�IMPORT sexec�
-�IMPORT stext�
-�IMPORT sgraph�
-
-
-�DEFINE file FOR ExecutionFlow�
-
-�FILE 'EventSet.cpp'�
-#include "EventSet.h"
-#include "StatemachineException.h"
-
-EventSet::EventSet() : _set(0), maxEvents(0) {
-}
-
-EventSet::EventSet(const uint32_t & _maxEvents)
-: maxEvents(_maxEvents)
-{
-	_set = new bool[maxEvents];
-	clean();
-}
-
-EventSet::~EventSet() {
-	delete[] _set;
-}
-
-bool EventSet::check(const uint32_t evid) const
-{
-	if (evid < maxEvents) {
-		return _set[evid];
-	}
-	throw StatechartException("EventSet::check: Event ID out of range");
-}
-
-
-
-void EventSet::clean()
-{
-	for (uint32_t i(0);i<maxEvents;++i)
-		_set[i] = false;
-}
-
-
-
-void EventSet::set(const uint32_t evid)
-{
-	if (evid < maxEvents) {
-		_set[evid] = true;
-	} else {
-		throw StatechartException("EventSet::set�: Event ID out of range");
-	}
-}
-
-bool EventSet::isAny() const
-{
-	for (uint32_t i(0);i<maxEvents;++i)
-		if (_set[i])
-			return(true);
-	return(false);
-
-}
-�ENDFILE�
-
-�ENDDEFINE�

+ 0 - 41
plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/EventSetH.xpt

@@ -1,41 +0,0 @@
-�REM�
-
-Templates for the main statechart cpp file.
-
-@auther joern seger
-
-�ENDREM�
-
-�IMPORT sexec�
-�IMPORT stext�
-�IMPORT sgraph�
-
-
-�DEFINE file FOR ExecutionFlow�
-
-�FILE 'EventSet.h'�
-#ifndef EVENTSET_H_
-#define EVENTSET_H_
-
-#include "definition.h"
-
-class EventSet {
-protected:
-	bool* _set;
-	uint32_t maxEvents;
-
-public:
-	EventSet();
-	EventSet(const uint32_t& maxEvents);
-	virtual ~EventSet();
-
-	bool check(const uint32_t evid) const;
-	void clean();
-	void set(const uint32_t evid);
-	bool isAny() const;
-};
-
-#endif /* EVENTSET_H_ */
-�ENDFILE�
-
-�ENDDEFINE�

+ 0 - 159
plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/Expression.ext

@@ -1,159 +0,0 @@
-import stext;
-import sexec;
-import ecore;
-import sgraph;
-import types;
-
-extension org::yakindu::sct::generator::cpp::templates::Naming;
-
-toCppCode(Void void) :
-	"/*toCppCode() called with NULL element. Polymorphic resolver could not match callable method!*/";
-String toCppCode(Void o, String statechartReference) : 
-	""; //polymorphic placeholder (abstract rule)
-
-String toCppCode(Expression statement) : 
-	null; //polymorphic placeholder (abstract rule)
- 
-String toCppCode(Statement statement) : 
-	null; //polymorphic placeholder (abstract rule)
-
-String toCppCode(Literal lit) :
-   "Unknown Literal Type" ;
-
-String toCppCode(BoolLiteral bLit) :
-   (bLit.value == true) ? "bool_true" : "bool_false"; 
-
-String toCppCode(IntLiteral iLit) :
-	iLit.value.toString();
- 
-String toCppCode(RealLiteral rLit) :
-	rLit.value.toString();
-
-String toCppCode(HexLiteral hLit) :
-	hLit.value.toString();
-
-String toCppCode(PrimitiveValueExpression primValue) :
-	primValue.value.toCppCode();
-
-/* Assignment */
-String toCppCode(AssignmentExpression assignment) :
-  switch (assignment.operator) {
-  case (AssignmentOperator::assign) : "set_" + assignment.varRef.name() + "(" + assignment.expression.toCppCode() + ");"  
-  case (AssignmentOperator::multAssign) : "set_" + assignment.varRef.name() + "(get_"+ assignment.varRef.name()+ "() * (" + assignment.expression.toCppCode() + "));"
-  case (AssignmentOperator::divAssign) : "set_" + assignment.varRef.name() + "(get_"+ assignment.varRef.name()+ "() / (" + assignment.expression.toCppCode() + "));"
-  case (AssignmentOperator::modAssign) : "set_" + assignment.varRef.name() + "(get_"+ assignment.varRef.name()+ "() % (" + assignment.expression.toCppCode() + "));"
-  case (AssignmentOperator::addAssign) : "set_" + assignment.varRef.name() + "(get_"+ assignment.varRef.name()+ "() + (" + assignment.expression.toCppCode() + "));"
-  case (AssignmentOperator::subAssign) : "set_" + assignment.varRef.name() + "(get_"+ assignment.varRef.name()+ "() - (" + assignment.expression.toCppCode() + "));"
-  case (AssignmentOperator::leftShiftAssign) : "set_" + assignment.varRef.name() + "(get_"+ assignment.varRef.name()+ "() << ("+ assignment.expression.toCppCode() + "));"
-  case (AssignmentOperator::rightShiftAssign) : "set_" + assignment.varRef.name() + "(get_"+ assignment.varRef.name()+ "() >> (" + assignment.expression.toCppCode() + "));"
-  case (AssignmentOperator::andAssign) : "set_" + assignment.varRef.name() + "(get_"+ assignment.varRef.name()+ "() & (" + assignment.expression.toCppCode() + "));"
-  case (AssignmentOperator::xorAssign) : "set_" + assignment.varRef.name() + "(get_"+ assignment.varRef.name()+ "() ^ (" + assignment.expression.toCppCode() + "));"
-  case (AssignmentOperator::orAssign) : "set_" + assignment.varRef.name() + "(get_"+ assignment.varRef.name()+ "() ^ (" + assignment.expression.toCppCode() + "));"
-  default : ""
-  };
-		
-/* EventRaising */
-
-String toCppCode(EventRaisingExpression eventRaising) :
-	((eventRaising.value == null)?"":
-	"((" + eventRaising.event.name() + "*) handle->" + eventRaising.getInterfaceName() + "." + eventRaising.event.name() + ")->value = " 
-	+ eventRaising.value.toCppCode() + ";") + 
-	" statemachine_cy_setEvent(&handle->base, handle->" + eventRaising.getInterfaceName() + "." + eventRaising.event.name() + "); ";
-//  "{ _Event* ev = eventPool_createEvent(handle->base.eventPool, ev_"+eventRaising.event.name+"); if (ev) { " + eventRaising.addValue() + "statemachine_cy_setEvent(&handle->base, ev); } }";
-
-String getInterfaceName(EventRaisingExpression event) :
-	"interface" + (( ((InterfaceScope)event.event.getEvent().eContainer).name == null)?"":((InterfaceScope)event.event.getEvent().eContainer).name.toFirstUpper());
-
-EventDefinition getEvent(Expression e) : null;
-EventDefinition getEvent(ecore::EObject e) : null;
-EventDefinition getEvent(FeatureCall this) : feature.getEvent();
-EventDefinition getEvent(ElementReferenceExpression this) : reference.getEvent();
-EventDefinition getEvent(EventDefinition this) : this;
-
-String addValue(EventRaisingExpression event) :
-  ( (event.value == null)?"":("((" +event.event.name() + "*)ev)->value = " + event.value.toCppCode() + "; ") );
-
-
-
-/* Logical Expressions */
-String toCppCode(LogicalOrExpression expression) :
-  	expression.leftOperand.toCppCode() + " || " + expression.rightOperand.toCppCode();
-  	
-String toCppCode(LogicalAndExpression expression) :
-  	expression.leftOperand.toCppCode() + " && " + expression.rightOperand.toCppCode();
-
-String toCppCode(LogicalNotExpression expression) :
-  	" ^" + expression.operand.toCppCode();
-
-String toCppCode(LogicalRelationExpression expression) :
-   expression.leftOperand.toCppCode() + getOperator(expression.operator) + expression.rightOperand.toCppCode();
-    
-String toCppCode(BitwiseAndExpression expression) :
-  	expression.leftOperand.toCppCode() + " & " + expression.rightOperand.toCppCode();
-
-String toCppCode(BitwiseOrExpression expression) :
-  	expression.leftOperand.toCppCode() + " | " + expression.rightOperand.toCppCode();
-
-String toCppCode(BitwiseXorExpression expression) :
-  	expression.leftOperand.toCppCode() + " ^ " + expression.rightOperand.toCppCode();
-
-String toCppCode(NumericalAddSubtractExpression expression) :
-  	expression.leftOperand.toCppCode() + getOperator(expression.operator) + expression.rightOperand.toCppCode();
-  	
-String toCppCode(NumericalMultiplyDivideExpression expression) :
-  	expression.leftOperand.toCppCode() + getOperator(expression.operator) + expression.rightOperand.toCppCode();
-
-// is this just relevant for events?
-String toCppCode(ElementReferenceExpression ev) :
-    " eventSet.check( ev_" + ev.reference.name().toLowerCase() + ") ";
-
-String getOperator(AdditiveOperator operator) : 
-    switch(operator) {
-    	case(AdditiveOperator::plus) : " + "
-    	case(AdditiveOperator::minus) : " - "
-    	default : ""
-    };
-
-String getOperator(MultiplicativeOperator operator) : 
-    switch(operator) {
-    	case(MultiplicativeOperator::mul) : " * "
-    	case(MultiplicativeOperator::div) : " / "
-    	case(MultiplicativeOperator::mod) : " % "
-    	default : ""
-    };
-
-String getOperator(RelationalOperator operator) :
-	switch (operator) {
-	  case (RelationalOperator::greater) : " > "
-	  case (RelationalOperator::greaterEqual) : " >= "
-	  case (RelationalOperator::smaller) : " < "
-	  case (RelationalOperator::smallerEqual) : " <= "
-	  case (RelationalOperator::equals) : " == "
-	  case (RelationalOperator::notEquals) : " != "
-	  default : ""
-	};
-
-String eventTypeToString(Type type) : 
-  switch (type.name) {
-  case null : "void"
-  case "void" : "void"
-  case "real" : "real"
-  case "integer" : "integer"
-  case "boolean" : "boolean"
-  case "string"  : "strng"
-  default : "unknownType"
-  };
-  
-Set[EventDefinition] getInEvents(InterfaceScope interface) : 
-	interface.declarations.typeSelect(EventDefinition).select(e|e.direction == Direction::IN);
-
-Set[EventDefinition] getOutEvents(InterfaceScope interface) : 
-	interface.declarations.typeSelect(EventDefinition).select(e|e.direction == Direction::OUT);
-
-Set[EventDefinition] getLocalEvents(InterfaceScope interface) : 
-	interface.declarations.typeSelect(EventDefinition).select(e|e.direction == Direction::LOCAL);
- 
-/* Timer handling */
-
- 
-	

+ 0 - 156
plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/Interfaces.xpt

@@ -1,156 +0,0 @@
-�REM�
-
-Templates for the main statechart cpp file.
-
-@auther joern seger
-
-�ENDREM�
-
-�IMPORT sexec�
-�IMPORT stext�
-�IMPORT sgraph�
-
-�EXTENSION org::yakindu::sct::generator::cpp::templates::Expression�
-�EXTENSION org::yakindu::sct::generator::cpp::templates::TypeModelExtensions�
-�EXTENSION org::yakindu::sct::generator::cpp::templates::Naming�
-
-
-�DEFINE file FOR ExecutionFlow�
-�FOREACH this.scopes.typeSelect(InterfaceScope) AS interface�
-�FILE StName()+interface.interfaceClassName()+".h"�
-
-#ifndef �interface.interfaceClassName().toUpperCase()�_H_
-#define �interface.interfaceClassName().toUpperCase()�_H_
-
-#include "definition.h"
-#include "Event.h"
-#include "EventSet.h"
-#include "EventPool.h"
-#include "Statemachine.h"
-#include "�EvName()�.h"
-#include <vector>
-
-namespace �StName()� {
-
-class AbstractInterface {
-
-};
-
-class �interfaceClassName(interface)� : public AbstractInterface {
-
-protected:
-	Statemachine& statemachine;
-    std::vector<_Event*> outEventList;
-
-�FOREACH interface.declarations.typeSelect(VariableDefinition) AS variable -�
-	�variable.type� �variable.name�;
-�ENDFOREACH� 
-	
-	bool isMyEvent(Event& event);
-	
-public:
-
-	�interfaceClassName(interface)�(Statemachine& statemachine);
-	
-�FOREACH interface.declarations.typeSelect(VariableDefinition) AS variable -�
-	�variable.type�& get_�variable.name�() const;
-	�IF variable.readonly == false -�
-	void set_�variable.name�(�variable.type�& value);
-	�ENDIF�
-�ENDFOREACH� 
-	
-	void resetEvent();
-	
-	�FOREACH interface.getOutEvents() AS event -�
-	boolean is_�event.name�_raised(�
-	IF !event.type.isVoid() -� �event.type.eventTypeToString()�* value�ENDIF� );
-	�ENDFOREACH�
-
-	�FOREACH interface.getInEvents() AS event -�
-	void raise_�event.name�(�
-	IF !event.type.isVoid() -� �event.type.eventTypeToString()� value �ENDIF�);
-	�ENDFOREACH� 
-	
-
-};
-
-}
-
-#endif /* INTERFACEBASE_H_ */
-
-
-�ENDFILE�
-
-�FILE StName()+interface.interfaceClassName()+".cpp"�
-#include "�StName()��interface.interfaceClassName()�.h"
-
-using namespace �StName()�;
-
-bool �interfaceClassName(interface)�::isMyEvent(Event& event)
-{
-
-}
-
-
-�interfaceClassName(interface)�::�interfaceClassName(interface)�(Statemachine& _statemachine)
-  : statemachine(_statemachine) 
-{}
-	
-�FOREACH interface.declarations.typeSelect(VariableDefinition) AS variable -�
-�variable.type�& �interfaceClassName(interface)�::get_�variable.name�() const
-{ return �variable.name�; }
-
-�IF variable.readonly == false -�
-void �interfaceClassName(interface)�::set_�variable.name�(�variable.type�& value)
-{ �variable.name� = value; }
-�ENDIF-�
-�ENDFOREACH� 
-	
-void �interfaceClassName(interface)�::resetEvent()
-{  outEventList.clear(); }
-	
-�FOREACH interface.getOutEvents() AS event -�
-boolean �interfaceClassName(interface)�::is_�event.name�_raised(�
-	IF !event.type.isVoid() -� �event.type.eventTypeToString()�* value�ENDIF� )
-{
-	std::vector<Event>::const_iterator cit(outEventList.begin());
-	for(; cit != outEventList.end(); ++cit)
-	  if (cit->getID() == (uint32_t)�event.getEventEnumName()�) {
-	  	�IF !event.type.isVoid() -�
-	  	*value = static_cast<�event.name�*>(cit)->value;
-	  	�ENDIF�
-	  	return true;
-	  } 
-	return false;
-}
-�ENDFOREACH�
-
-
-�FOREACH interface.getInEvents() AS event -�
-void �interfaceClassName(interface)�::raise_�event.name�(�
-	IF !event.type.isVoid() -� �event.type.eventTypeToString()� value �ENDIF�)
-{
-	Event ev = new �event.name�;
-	statemachine.setEvent(ev);
-}
-�ENDFOREACH� 
-	
-bool �interface.interfaceName()�::is_my_event(uint32_t evid)
-{
-	bool ret = false;
-	switch (evid) {
-�FOREACH interface.getInEvents() AS event -�
-	case �event.getEventEnumName()�:
-�ENDFOREACH�
-		ret = true;
-		break;
-	default:
-		break;
-	}
-	return ret;
-}
-
-
-�ENDFILE�
-�ENDFOREACH�
-�ENDDEFINE�

+ 0 - 70
plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/Main.xpt

@@ -1,70 +0,0 @@
-«REM»
-
-Contais the root templates that call the different file templates.
-
-@author andreas muelder
-@auther axel terfloth
-@author joern seger
-
-«ENDREM»
-
-«IMPORT sexec»
-«IMPORT stext»
-«IMPORT sgraph»
-
-«IMPORT org::yakindu::sct::generator::cpp::templates»
-
-«DEFINE main(sgen::GeneratorEntry entry) FOR ExecutionFlow»
-
-	«REM» basis files «ENDREM»
-	«EXPAND StatemachineExceptionH::file FOR this»
-	«EXPAND definitionH::file FOR this»
-
-	«EXPAND EventH::file FOR this»
-	«EXPAND TimerH::file FOR this»
-	
-
-	«EXPAND EventSetH::file FOR this»
-	«EXPAND EventSetCPP::file FOR this»
-
-	«EXPAND EventReceiverH::file FOR this»
-
-	«EXPAND StatemachineBaseH::file FOR this»
-	«EXPAND StatemachineBaseCPP::file FOR this»
-	
-	«EXPAND Statemachine_cyH::file FOR this»
-	«EXPAND Statemachine_cyCPP::file FOR this»
-	
-	«EXPAND Statemachine_evH::file FOR this»
-	«EXPAND Statemachine_evCPP::file FOR this»
-
-	«EXPAND DataRepositoryH::file FOR this»
-	«EXPAND DataRepositoryCPP::file FOR this»
-	«EXPAND DataRepositoryBoost::file FOR this»
-	
-	«EXPAND DummyTimerH::file FOR this»
-	«EXPAND DummyTimerCPP::file FOR this»
-	
-	«REM» custom code «ENDREM»	
-
-	«EXPAND Interfaces::file FOR this»
-
-	«EXPAND CustomStatemachine_cyH::file FOR this»
-	«EXPAND CustomStatemachine_cyCPP::file FOR this»
-
-	«EXPAND CustomStatemachine_evH::file FOR this»
-	«EXPAND CustomStatemachine_evCPP::file FOR this»
-
-
-	«EXPAND CustomRepositoryH::file FOR this»
-	«EXPAND CustomEventH::file FOR this»
-	
-	«EXPAND CMakeLists::file FOR this»
-	«EXPAND TestMain_cy::file FOR this»
-	«EXPAND TestMain_ev::file FOR this»
-
-
-«ENDDEFINE»
-
-
-

+ 0 - 76
plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/Naming.ext

@@ -1,76 +0,0 @@
-import stext;
-import sexec;
-import ecore;
-import sgraph;
-import base;
-
-//TODO Workaround for error in Typesystem
-String name(Declaration this) : this.metaType.getProperty("name").toString();
-String name(Vertex this) : this.metaType.getProperty("name").toString();
-String name(EObject this): this.metaType.getProperty("name").toString();
-
-String name(Expression this):
-	"/*Name of "+this+"*/";
-String name(FeatureCall this):
-	feature.name();
-String name(ElementReferenceExpression this):
-	reference.name();
-
-ExecutionFlow getExecutionFlow(InterfaceScope this) : ((ExecutionFlow)this.eContainer);
-
-String scName(Expression statement) : ((ExecutionFlow)statement.eRootContainer).name ;
-
-List[EventDefinition] declaredEvents(ExecutionFlow flow) : flow.scopes.declarations.typeSelect(EventDefinition);
-List[TimeEvent] declaredTimerEvents(ExecutionFlow flow) : flow.scopes.declarations.typeSelect(TimeEvent);
-List[VariableDefinition] declaredVariables(ExecutionFlow flow) : flow.scopes.declarations.typeSelect(VariableDefinition);
-
-String test(ecore::ENamedElement obj) :  "";
-String StName(Object this) : ((ExecutionFlow)((EObject)this).eRootContainer).name.toFirstUpper();// + "Statemachine";
-String STNAME(Object this) : ((ExecutionFlow)((EObject)this).eRootContainer).name.toUpperCase() + "STATEMACHINE";
-String StNameEv(Object this) : ((ExecutionFlow)((EObject)this).eRootContainer).name.toFirstUpper();// + "Statemachine_ev";
-String StNameCy(Object this) : ((ExecutionFlow)((EObject)this).eRootContainer).name.toFirstUpper();// + "Statemachine_cy";
-
-String DRName(Object this) : ((ExecutionFlow)((EObject)this).eRootContainer).name.toFirstUpper() + "DataRepository";
-String DRNAME(Object this) : ((ExecutionFlow)((EObject)this).eRootContainer).name.toUpperCase() + "DATAREPOSITORY";
-
-String EvName(Object this) : ((ExecutionFlow)((EObject)this).eRootContainer).name.toFirstUpper() + "Event";
-String EVNAME(Object this) : ((ExecutionFlow)((EObject)this).eRootContainer).name.toUpperCase() + "EVENT";
-
-cached String functionName(Step step) : 
-	(step.isEffect()) ? step.actionFunctionName() : (
-	(step.isReactionCheck()) ? step.checkFunctionName() : (
-	(step.isEntryAction()) ? step.entryActionFunctionName() : ( 
-	(step.isExitAction()) ? step.exitActionFunctionName() : (
-	(step.isEnterSequence()) ? step.enterSequenceFunctionName() : ( 
-	(step.isExitSequence()) ? step.exitSequenceFunctionName() : 	
-	" !! unknown function type !!" )))));
-
-
-String actionFunctionName(Step this) : "actions_" + this.reaction().state().simpleName + "_" + this.reaction().name; 
-String checkFunctionName(Step this) : "condition_" + this.reaction().state().simpleName + "_" + this.reaction().name; 
-String entryActionFunctionName(Step this) : "entryActions_" + this.state().simpleName; 
-String exitActionFunctionName(Step this) : "exitActions_" + this.state().simpleName; 
-String enterSequenceFunctionName(Step this) : "_enterSequence_" + this.state().simpleName; 
-String exitSequenceFunctionName(Step this) : "_exitSequence_" + this.state().simpleName; 
-
-boolean isEffect(Step step) : (! Check.isInstance(step)) && Reaction.isInstance(step.eContainer) ;
-boolean isReactionCheck(Step step) : Reaction.isInstance(step.eContainer) && Check.isInstance(step);
-boolean isEntryAction(Step step) : ExecutionState.isInstance(step.eContainer) && step.state().entryAction == step;
-boolean isExitAction(Step step) : ExecutionState.isInstance(step.eContainer) && step.state().exitAction == step;
-boolean isEnterSequence(Step step) : ExecutionState.isInstance(step.eContainer) && step.state().enterSequence == step;
-boolean isExitSequence(Step step) : ExecutionState.isInstance(step.eContainer) && step.state().exitSequence == step;
-  
-Reaction reaction(Step this) : (Reaction) this.eContainer ;
-ExecutionState state(Reaction this) : (ExecutionState) eContainer;
-ExecutionState state(Step this) : (ExecutionState) eContainer;
-
-String interfaceName(InterfaceScope this) : ((this.name == null) ? "_if" : "_if_" + this.name);
-String interfaceClassName(InterfaceScope this) : "If" + ((this.name == null)?"":this.name.toFirstUpper());
-String interfaceObjectName(InterfaceScope this) : "interface" + ((this.name == null)?"":this.name.toFirstUpper());
-
-String getEventEnumName(EventDefinition this) : "ev_" + this.name.toFirstLower();
-String getEventEnumName(TimeEvent this) : "ev_" + this.name.toFirstLower();
-
-String getBoolTrue() : "bool_true";
-String getBoolFalse() : "bool_false";
-

+ 0 - 40
plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/StatemachineBaseCPP.xpt

@@ -1,40 +0,0 @@
-«REM»
-
-Templates for the main statechart cpp file.
-
-@auther joern seger
-
-«ENDREM»
-
-«IMPORT sexec»
-«IMPORT stext»
-«IMPORT sgraph»
-
-
-«DEFINE file FOR ExecutionFlow»
-
-«FILE 'StatemachineBase.cpp'»
-#include "StatemachineBase.h"
-
-StatemachineBase::StatemachineBase(uint16_t maxStates, Timer* _timer) : timer(_timer)
-{
-	state = new uint32_t[maxStates]; /* memory allocation for all states */
-	statePtr = 0; /* actual state referencer */
-}
-StatemachineBase::~StatemachineBase() {
-	delete[] state;
-	delete timer;
-}
-
-void StatemachineBase::setEventReceiver(EventReceiver& receiver)
-{
-	outgoingEvents = &receiver;
-}
-
-uint32_t StatemachineBase::getState(uint16_t pos)
-{
-    return (state[pos]);
-}
-«ENDFILE»
-
-«ENDDEFINE»

+ 0 - 49
plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/StatemachineBaseH.xpt

@@ -1,49 +0,0 @@
-«REM»
-
-Templates for the main statechart cpp file.
-
-@auther joern seger
-
-«ENDREM»
-
-«IMPORT sexec»
-«IMPORT stext»
-«IMPORT sgraph»
-
-
-«DEFINE file FOR ExecutionFlow»
-
-«FILE 'StatemachineBase.h'»
-#ifndef STATEMACHINEBASE_H_
-#define STATEMACHINEBASE_H_
-
-#include "definition.h"
-#include "EventReceiver.h"
-#include "Timer.h"
-
-class StatemachineBase : public EventReceiver {
-protected:
-	uint32_t* state;
-	uint16_t statePtr;
-
-	Timer* timer;
-	EventReceiver *outgoingEvents;
-
-public:
-
-	StatemachineBase(uint16_t maxStates, Timer* timer);
-	virtual ~StatemachineBase();
-
-	virtual void init() = 0;
-	virtual void runCycle() = 0;
-	virtual bool eventWaiting() const = 0;
-
-	virtual void setEventReceiver(EventReceiver& receiver);
-
-	uint32_t getState(uint16_t pos);
-
-};
-#endif /* STATEMACHINEBASE_H_ */
-«ENDFILE»
-
-«ENDDEFINE»

+ 0 - 31
plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/StatemachineExceptionH.xpt

@@ -1,31 +0,0 @@
-«REM»
-
-Templates for the main statechart cpp file.
-
-@auther joern seger
-
-«ENDREM»
-
-«IMPORT sexec»
-«IMPORT stext»
-«IMPORT sgraph»
-
-
-«DEFINE file FOR ExecutionFlow»
-
-«FILE 'StatemachineException.h'»
-#ifndef STATEMACHINEEXCEPTION_H_
-#define STATEMACHINEEXCEPTION_H_
-
-#include <stdexcept>
-
-class StatechartException : public std::runtime_error {
-public:
-	StatechartException(const std::string & msg)
-      : std::runtime_error(msg) {}
-};
-
-#endif /* STATEMACHINEEXCEPTION_H_ */
-«ENDFILE»
-
-«ENDDEFINE»

+ 0 - 48
plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/Statemachine_cyCPP.xpt

@@ -1,48 +0,0 @@
-«REM»
-
-Templates for the main statechart cpp file.
-
-@auther axel terfloth
-
-«ENDREM»
-
-«IMPORT sexec»
-«IMPORT stext»
-«IMPORT sgraph»
-
-
-«DEFINE file FOR ExecutionFlow»
-
-«FILE 'Statemachine_cy.cpp'»
-#include "Statemachine_cy.h"
-#include "StatemachineException.h"
-
-Statemachine_cy::Statemachine_cy(uint16_t maxStates, uint16_t maxEvents, Timer* _timer)
-  : StatemachineBase(maxStates, _timer), eventSet(maxEvents) {
-}
-
-Statemachine_cy::~Statemachine_cy() {
-}
-
-void Statemachine_cy::queueEvent(Event ev) {
-	eventSet.set(ev->getID());
-}
-
-bool Statemachine_cy::check(const Event& ev) const
-{
-	return eventSet.check(ev->getID());
-}
-
-bool Statemachine_cy::eventWaiting() const {
-	return eventSet.isAny();
-}
-
-void Statemachine_cy::runCycle() {
-
-	_runCycle();
-	eventSet.clean();
-
-}
-«ENDFILE»
-
-«ENDDEFINE»

+ 0 - 46
plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/Statemachine_cyH.xpt

@@ -1,46 +0,0 @@
-«REM»
-
-Templates for the main statechart cpp file.
-
-@auther axel terfloth
-
-«ENDREM»
-
-«IMPORT sexec»
-«IMPORT stext»
-«IMPORT sgraph»
-
-
-«DEFINE file FOR ExecutionFlow»
-
-«FILE 'Statemachine_cy.h'»
-#ifndef STATEMACHINE_CY_H_
-#define STATEMACHINE_CY_H_
-
-#include <deque>
-#include "EventSet.h"
-#include "StatemachineBase.h"
-
-class Statemachine_cy : public StatemachineBase {
-
-protected:
-	EventSet eventSet;
-
-	virtual bool check(const Event& ev) const;
-	virtual void _runCycle() {}
-
-public:
-	Statemachine_cy(uint16_t maxStates, uint16_t maxEvents, Timer* timer);
-	virtual ~Statemachine_cy();
-
-	virtual void init() {}
-	void runCycle();
-	virtual void queueEvent(Event ev);
-	bool eventWaiting() const;
-
-};
-
-#endif /* STATEMACHINE_CY_H_ */
-«ENDFILE»
-
-«ENDDEFINE»

+ 0 - 56
plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/Statemachine_evCPP.xpt

@@ -1,56 +0,0 @@
-«REM»
-
-Templates for the main statechart cpp file.
-
-@auther joern seger
-
-«ENDREM»
-
-«IMPORT sexec»
-«IMPORT stext»
-«IMPORT sgraph»
-
-
-«DEFINE file FOR ExecutionFlow»
-
-«FILE 'Statemachine_ev.cpp'»
-#include "Statemachine_ev.h"
-#include "StatemachineException.h"
-
-Statemachine_ev::Statemachine_ev(uint16_t maxStates, uint16_t maxEvents, Timer* _timer) : StatemachineBase(maxStates, _timer){
-}
-
-Statemachine_ev::~Statemachine_ev() {
-}
-
-void Statemachine_ev::queueEvent(Event ev) {
-	/* creates a copy */
-	eventList.push_back(ev);
-}
-
-Event Statemachine_ev::getEvent() {
-	if (eventList.empty())
-		throw(StatechartException("There is no event available"));
-	Event retEvent = eventList.front();
-	eventList.pop_front();
-	return (retEvent);
-}
-
-bool Statemachine_ev::eventWaiting() const {
-	return (!eventList.empty());
-}
-
-void Statemachine_ev::runCycle() {
-	if (!eventWaiting())
-		return;
-
-	Event ev = getEvent();
-	_setActualEventData(ev);
-	_runCycle(ev);
-	_removeActualEventData();
-
-	delete ev;
-}
-«ENDFILE»
-
-«ENDDEFINE»

+ 0 - 54
plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/Statemachine_evH.xpt

@@ -1,54 +0,0 @@
-«REM»
-
-Templates for the main statechart cpp file.
-
-@auther joern seger
-
-«ENDREM»
-
-«IMPORT sexec»
-«IMPORT stext»
-«IMPORT sgraph»
-
-
-«DEFINE file FOR ExecutionFlow»
-
-«FILE 'Statemachine_ev.h'»
-#ifndef STATEMACHINE_EV_H_
-#define STATEMACHINE_EV_H_
-
-#include <deque>
-#include "Event.h"
-#include "Timer.h"
-#include "EventSet.h"
-#include "StatemachineBase.h"
-
-class Statemachine_ev : public StatemachineBase {
-
-protected:
-
-	std::deque<Event> eventList;
-
-	Event getEvent();
-
-	virtual void _runCycle(Event ev) = 0;
-	virtual void _setActualEventData(Event ev) = 0;
-	virtual void _removeActualEventData() = 0;
-
-public:
-	Statemachine_ev(uint16_t maxStates, uint16_t maxEvents, Timer* timer);
-	virtual ~Statemachine_ev();
-
-	virtual void init() {}
-	virtual void runCycle();
-	virtual void queueEvent(Event ev);
-	virtual bool eventWaiting() const;
-
-	uint32_t getState(uint16_t pos) { return(state[pos]); }
-
-};
-
-#endif /* STATEMACHINE_EV_H_ */
-«ENDFILE»
-
-«ENDDEFINE»

+ 0 - 112
plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/TestMain_cy.xpt

@@ -1,112 +0,0 @@
-«REM»
-
-Templates for the main statechart cpp file.
-
-@auther joern seger
-
-«ENDREM»
-
-«IMPORT sexec»
-«IMPORT stext»
-«IMPORT sgraph»
-
-«EXTENSION org::yakindu::sct::generator::cpp::templates::Expression»
-«EXTENSION org::yakindu::sct::generator::cpp::templates::Naming»
-
-
-«DEFINE file FOR ExecutionFlow»
-
-«FILE 'main_cy.cpp'»
-#include <cstdio>
-#include <iostream>
-#include <cstring>
-#include <assert.h>
-#include "«StNameCy()».h"
-#include "«EvName()».h"
-#include "Timer.h"
-#include "DummyTimer.h"
-
-int main()
-{
-	Timer* timer;
-	
-	const char* stateName[6] = {"State1", "State2", "State3", "State4", "State5", "State6"};
-	«StNameCy()» machine(timer = new DummyTimer);
-
-	/* initialize the initial states */
-	machine.init();
-
-	/* create one event and enqueue it */
-	Event e = createEvent<Event1>();
-	machine.queueEvent(e);
-
-	/* run the cycle */
-	machine.runCycle();
-
-	/* check the state */
-	std::cout << stateName[machine.getState(0)] << "\n";
-	assert( strcmp(stateName[machine.getState(0)], "State3") == 0);
-
-	e = createEvent<Event2>();
-	machine.queueEvent(e);
-
-	machine.runCycle();
-
-	std::cout << stateName[machine.getState(0)] << "\n";
-	assert( strcmp(stateName[machine.getState(0)], "State1") == 0);
-
-	/* does event queuing work? */
-	e = createEvent<Event1>();
-	machine.queueEvent(e);
-	e = createEvent<Event3>();
-	machine.queueEvent(e);
-
-	machine.runCycle();
-
-	std::cout << stateName[machine.getState(0)] << "\n";
-	assert( strcmp(stateName[machine.getState(0)], "State3") == 0);
-
-	assert( machine.eventWaiting() == false );
-
-	e = createEvent<Event3>();
-	machine.queueEvent(e);
-
-	assert( machine.eventWaiting() == true );
-
-	/* run second cycle */
-	machine.runCycle();
-
-	std::cout << stateName[machine.getState(0)] << "\n";
-	assert( strcmp(stateName[machine.getState(0)], "State4") == 0);
-
-	e = createEvent<Event4>();
-	machine.queueEvent(e);
-
-	machine.runCycle();
-
-	std::cout << stateName[machine.getState(0)] << "\n";
-	assert( strcmp(stateName[machine.getState(0)], "State3") == 0);
-
-	e = createEvent<Event3>();
-	machine.queueEvent(e);
-
-	machine.runCycle();
-
-	std::cout << stateName[machine.getState(0)] << "\n";
-	assert( strcmp(stateName[machine.getState(0)], "State4") == 0);
-
-	e = createEvent<Event5>();
-	machine.queueEvent(e);
-
-	machine.runCycle();
-
-	std::cout << stateName[machine.getState(0)] << "\n";
-	assert( strcmp(stateName[machine.getState(0)], "State1") == 0);
-
-    delete timer;
-
-	return(0);
-}
-«ENDFILE»
-
-«ENDDEFINE»

+ 0 - 106
plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/TestMain_ev.xpt

@@ -1,106 +0,0 @@
-«REM»
-
-Templates for the main statechart cpp file.
-
-@auther joern seger
-
-«ENDREM»
-
-«IMPORT sexec»
-«IMPORT stext»
-«IMPORT sgraph»
-
-«EXTENSION org::yakindu::sct::generator::cpp::templates::Expression»
-«EXTENSION org::yakindu::sct::generator::cpp::templates::Naming»
-
-
-«DEFINE file FOR ExecutionFlow»
-
-«FILE 'main_ev.cpp'»
-#include <cstdio>
-#include <iostream>
-#include "«StNameEv()».h"
-#include "«EvName()».h"
-#include "DummyTimer.h"
-
-int main()
-{
-	Timer* timer;
-
-	char* stateName[6] = {"State1", "State2", "State3", "State4", "State5", "State6"};
-	«StNameEv()» machine(timer = new DummyTimer);
-
-	// initialize the initial states 
-	machine.init();
-	
-	/* Example code 
-	// create one event and enqueue it 
-	Event e = createEvent<Event1>();
-	machine.queueEvent(e);
-
-	// run the cycle 
-	machine.runCycle();
-
-	// check the state 
-	std::cout << stateName[machine.getState(0)] << "\n";
-	assert( strcmp(stateName[machine.getState(0)], "State3") == 0);
-
-	e = createEvent<Event2>();
-	machine.queueEvent(e);
-
-	machine.runCycle();
-
-	std::cout << stateName[machine.getState(0)] << "\n";
-	assert( strcmp(stateName[machine.getState(0)], "State1") == 0);
-
-	// does event queuing work?
-	e = createEvent<Event1>();
-	machine.queueEvent(e);
-	e = createEvent<Event3>();
-	machine.queueEvent(e);
-
-	machine.runCycle();
-
-	std::cout << stateName[machine.getState(0)] << "\n";
-	assert( strcmp(stateName[machine.getState(0)], "State3") == 0);
-
-	// run second cycle
-	machine.runCycle();
-
-	std::cout << stateName[machine.getState(0)] << "\n";
-	assert( strcmp(stateName[machine.getState(0)], "State4") == 0);
-
-	e = createEvent<Event4>();
-	machine.queueEvent(e);
-
-	machine.runCycle();
-
-	std::cout << stateName[machine.getState(0)] << "\n";
-	assert( strcmp(stateName[machine.getState(0)], "State3") == 0);
-
-	e = createEvent<Event3>();
-	machine.queueEvent(e);
-
-	machine.runCycle();
-
-	std::cout << stateName[machine.getState(0)] << "\n";
-	assert( strcmp(stateName[machine.getState(0)], "State4") == 0);
-
-	e = createEvent<Event5>();
-	machine.queueEvent(e);
-
-	machine.runCycle();
-
-	std::cout << stateName[machine.getState(0)] << "\n";
-	assert( strcmp(stateName[machine.getState(0)], "State1") == 0);
-
-	*/
-	
-	delete timer;
-	return(0);
-	
-}
-
-«ENDFILE»
-
-«ENDDEFINE»

+ 0 - 36
plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/TimerH.xpt

@@ -1,36 +0,0 @@
-�REM�
-
-Templates for the main statechart cpp file.
-
-@auther joern seger
-
-�ENDREM�
-
-�IMPORT sexec�
-�IMPORT stext�
-�IMPORT sgraph�
-
-
-�DEFINE file FOR ExecutionFlow�
-
-�FILE 'Timer.h'�
-#ifndef TIMER_H_
-#define TIMER_H_
-
-#include "definition.h"
-//#include "Event.h"
-
-class Timer {
-public:
-	Timer() {}
-	virtual ~Timer() {}
-
-	virtual void setTimer(const uint32_t evid, const uint32_t time_ms, bool periodic = false) = 0;
-	virtual void unsetTimer(const uint32_t evid) = 0;
-
-};
-
-#endif /* TIMER_H_ */
-�ENDFILE�
-
-�ENDDEFINE�

+ 0 - 13
plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/TypeModelExtensions.ext

@@ -1,13 +0,0 @@
-/*
-  Copyright (c) 2011 committers of YAKINDU and others.
-  All rights reserved. This program and the accompanying materials
-  are made available under the terms of the Eclipse Public License v1.0
-  which accompanies this distribution, and is available at
-  http://www.eclipse.org/legal/epl-v10.html
-  Contributors:
-  	Markus Muehlbrandt - Initial contribution and API
- */
-import types;
-
-boolean isVoid(Type this) :
-	name == null || name == "void";

+ 0 - 37
plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/definitionH.xpt

@@ -1,37 +0,0 @@
-«REM»
-
-Templates for the main statechart cpp file.
-
-@auther joern seger
-
-«ENDREM»
-
-«IMPORT sexec»
-«IMPORT stext»
-«IMPORT sgraph»
-
-
-«DEFINE file FOR ExecutionFlow»
-
-«FILE 'definition.h'»
-#ifndef DEFINITION_H_
-#define DEFINITION_H_
-
-/* platform/compiler specific additions (#includes) */
-/* temporarly set to fix values */ 
-
-typedef unsigned int uint32_t;
-typedef unsigned short uint16_t;
-
-typedef int int32_t;
-typedef short int16_t;
-
-typedef int32_t integer; 
-typedef bool boolean;
-typedef float real;
-//typedef string char*;
- 
-#endif /* DEFINITION_H_ */
-«ENDFILE»
-
-«ENDDEFINE»