-
-
Notifications
You must be signed in to change notification settings - Fork 200
/
Copy pathumple_structure.grammar
50 lines (38 loc) · 2.62 KB
/
umple_structure.grammar
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
// The master of this part of the Umple grammar is available at
// [*https://github.com/umple/umple/blob/master/cruise.umple/src/strcture/umple_structure.grammar*]
//@author Ahmed M.Orabi {@link ahmedvc@hotmail.com}
//@author Mahmoud M.Orabi {@link mahmoud_3rabi@hotmail.com}
primitiveDefinition : primitive [name] { [[primitiveBody]]* }
primitiveBody- : [[isA]] | [[constraint]]
// Port Definition
portName : ( [~classname] . )? [name]
portMultiplicity : [!portMultiplicity:\[[0-9]+\]]
typedPortName : [~type]? [~portName] [[portMultiplicity]]?
portDefinition : [[portClass]] | [[portDeclaration]]
portClass- : [=port] ;
portDeclaration : [=modifier:public|protected|private]? [=inverse:conjugated]? [!direction:(in|out|port)\s] ( [[typedPortName]] ) ;
// Port Connectors
portBindingDefinition : ( [~fromClassname] . )? [fromPort] -> ( [~toClassname] . )? [toPort] [[bindinHandler]]
bindinHandler : { [**code] } | ;
// Port Watchlist Definition
portWatch- : ( [[constraintList]] | [[comment]] | [[reqImplementation]] )*
// Active Method Definition
activeMethodDefinition : [[portWatch]]? [=modifier:public|protected|private]? [type]? [=activeType:atomic|synchronous|intercept]? [=active] [[activeMethodDeclarator]] [[activeMethodBody]]+
activeMethodDeclarator : [~methodName] [[parameterList]]?
//activeMethodBody : [[activeDirectionHandler]] { ( [[activeTrigger]] )* [**code] }
activeMethodBody : [[activeMethodBodyContent]] [[inverseDirectionHandler]]?
inverseDirectionHandler : -> [[portWatch]]? [[activeMethodDeclarator]] [[activeMethodBodyContent]]
activeMethodBodyContent : { ( [[comment]] | [[reqImplementation]] | [[activeTrigger]] | [**code] )* }
activeTrigger : [[hitchConstraint]]? [[constraintList]]? [=trigger:/] [[activeTriggerBody]] [[thenDefinition]]? [[resolveDefinition]]?
activeTriggerBody- : ( [[deferredList]] | [[activeTriggerDefinition]] )
deferredList : [ [[activeTriggerDefinition]] ( , [[activeTriggerDefinition]] )* ]
activeTriggerDefinition- : [[anonymousTriggerBody]] | [[invoke]]
thenDefinition : .then -( [[anonymousTriggerBody]]? -)
resolveDefinition : .resolve -( [[anonymousTriggerBody]]? -)
hitchConstraint : [=clause:after|poll] OPEN_ROUND_BRACKET [timer] CLOSE_ROUND_BRACKET
constraintList : [ [[basicConstraint]] ( , [[basicConstraint]] )* ]
basicConstraint- : [[timeConstraint]] | [[messageConstraint]] | [[constraint]]
timeConstraint : [=clause:latency|period|timeout] OPEN_ROUND_BRACKET [timer] CLOSE_ROUND_BRACKET
messageConstraint : [=clause:priority] OPEN_ROUND_BRACKET [priorityValue] CLOSE_ROUND_BRACKET
invoke : ( [~classname] . )? [name] -( ( [parameter] ( , [parameter] )* )? -) ;
anonymousTriggerBody : { [**code] }