Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'examples/org.eclipse.etrice.generator.c.reference/model/generic_fsm_gen.room')
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/model/generic_fsm_gen.room81
1 files changed, 81 insertions, 0 deletions
diff --git a/examples/org.eclipse.etrice.generator.c.reference/model/generic_fsm_gen.room b/examples/org.eclipse.etrice.generator.c.reference/model/generic_fsm_gen.room
new file mode 100644
index 000000000..8f825d377
--- /dev/null
+++ b/examples/org.eclipse.etrice.generator.c.reference/model/generic_fsm_gen.room
@@ -0,0 +1,81 @@
+RoomModel generic_fsm_gen {
+
+ SubSystemClass Main {
+ ActorRef sys: AC
+ ActorRef peer: Peer
+ Binding sys.fct and peer.fct
+ }
+
+ ActorClass Peer {
+ Interface {
+ conjugated Port fct: PC
+ }
+ Structure {
+ external Port fct
+ }
+ Behavior {
+ StateMachine {
+ Transition init: initial -> state0 {
+ action {
+ "PCConjPort_m1(&self->constData->fct);"
+ }
+ }
+ Transition tr0: state0 -> state0 {
+ triggers {
+ <m2: fct>
+ }
+ action {
+ "printf(\"Peer\\n\");"
+ "PCConjPort_m1(&self->constData->fct);"
+ }
+ }
+ State state0
+ }
+ }
+ }
+
+ ActorClass AC {
+ Interface {
+ Port fct: PC
+ }
+ Structure {
+ external Port fct
+ }
+ Behavior {
+ StateMachine {
+ Transition init: initial -> state0 { }
+ Transition tr0: state0 -> state0 {
+ triggers {
+ <m1: fct>
+ }
+ action {
+ "printf(\"AC\\n\");"
+ "static int32 counter = 0;"
+ "if (++counter < 3){"
+ "\tPCPort_m2(&self->constData->fct);"
+ "}"
+ }
+ }
+ State state0
+ }
+ }
+ }
+
+ ProtocolClass PC {
+ incoming {
+ Message m1()
+ }
+ outgoing {
+ Message m2()
+ }
+ }
+
+ DataClass DC {
+ Attribute ival: int32
+ Operation mult(a: int32, b: int32): int32 {
+ "return a*b;"
+ }
+ }
+
+ PrimitiveType int32 -> int (Integer) default "0"
+} \ No newline at end of file

Back to the top