blob: a3297bce9f7957bf1d2e5b42384ac203d4e4464f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
|
RoomModel DetailExpressionTestModel {
import room.basic.types.* from "../../../runtime/${etModellib}/model/Types.room"
import room.basic.test.* from "../../../runtime/${etModellib}/model/Tests.room"
import room.basic.service.timing.* from "../../../runtime/${etModellib}/model/TimingService.room"
async ActorClass DetailExpressionTest {
Interface {
SPP sppEvent: PEventdriven
Port portNotVisible: PEventdriven
}
Structure {
ServiceImplementation of sppEvent
Attribute numberArray [ 5 ]: int32
Attribute infoData: DDataNested
Port rPortEvent: PEventdriven
Port rPortData: PDatadriven
Port rReplEvent [5]: PEventdriven
conjugated Port cPortEvent: PEventdriven
conjugated Port cPortData: PDatadriven
conjugated Port cReplEvent [*]: PEventdriven
}
Behavior {
Operation actorOp(param: int32): boolean {
"return true;"
}
StateMachine {
Transition eventTrans: idle -> state1 {
triggers {
<out1: cPortEvent guard {
"/* TODO activate action code editor */"
"rPortData.in1 == numberArray[3] && accessibleMessageData && infoData.flag && actorOp(32) && rPortEvent.regularOp(32) && cPortEvent.conjugatedOp(32)"
}>
}
action
{
"// TODO syntax highlightiing"
"rPortEvent.out1(true);"
"rPortData.in1;"
"rReplEvent[0].out1(true);"
"rReplEvent.out1(true); // broadcast"
"cPortEvent.in1();"
"cPortData.in1(32);"
"cReplEvent[1].in1();"
"cReplEvent.in1(); // broadcast"
"sppEvent[4].out1(true);"
"sppEvent.out1(true); // broadcast"
"rPortEvent.regularOp(32);"
"cPortEvent.conjugatedOp(32);"
"actorOp(32);"
"int number = numberArray[0];"
"DData nestedData = infoData.nested;"
"int port = infoData.nested.tcpPort;"
""
"// transition event data"
"int data = (accessibleMessageData)? 1 : 0;"
""
"// -- not supported yet by code translation --"
"// getReplication():"
"// int replSize1 = rReplEvent.getReplication();"
"// int replSize2 = cReplEvent.getReplication();"
"// int replSize2 = sppEvent.getReplication();"
""
"// DataClass operations:"
"// infoData.operation(32);"
"// infoData.nested.set(\"127.0.0.1\", 8080);"
}
}
Transition guardedTrans: idle -> state2 {
guard
{
"rPortData.in1 == numberArray[3] && infoData.flag && actorOp(32) && rPortEvent.regularOp(32) && cPortEvent.conjugatedOp(32)"
}
}
Transition init: initial -> idle
State idle
State state1
State state2
}
}
}
ProtocolClass PEventdriven {
incoming {
Message in1()
}
outgoing {
Message out1(accessibleMessageData: boolean)
}
regular PortClass
{
Operation regularOp(param: int32): boolean {
"return true;"
}
Attribute regularAttr: int32
}
conjugated PortClass
{
Operation conjugatedOp(param: int32): boolean {
"return true;"
}
Attribute conjugatedAttr: int32
}
}
datadriven ProtocolClass PDatadriven {
incoming {
Message in1(data: int32)
}
/* not supported yet
regular PortClass
{
Operation regularOp(param: int32): boolean {
""
}
Attribute regularAttr: int32
}
conjugated PortClass
{
Operation conjugatedOp(param: int32): boolean {
""
}
Attribute conjugatedAttr: int32
}
* /*
*/
}
DataClass DDataNested {
Operation dataOp(number: int32) {
""
}
Attribute flag: boolean
Attribute array [ 5 ]: int32
Attribute nested: DData
}
DataClass DData {
Operation dataOp(ip: string, port: int32) {
""
}
Attribute iPAddr: string
Attribute tcpPort: int32
}
}
|