-
-
Notifications
You must be signed in to change notification settings - Fork 201
Expand file tree
/
Copy pathumple_patterns.grammar
More file actions
43 lines (29 loc) · 1.84 KB
/
umple_patterns.grammar
File metadata and controls
43 lines (29 loc) · 1.84 KB
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
// The master of this second part of the Umple grammar is available at
// [*https://github.com/umple/umple/blob/master/cruise.umple/src/umple_patterns.grammar*]
// Copyright: All contributors to the Umple Project
// This file is made available subject to the open source license found at:
// [*https://umple.org/license*]
softwarePattern- : [[isA]] | [[singleton]] | [[immutable]] | [[keyDefinition]] | [[codeInjection]]
// Generalization and inheritance [*isAclause*]
isA- : [[singleIsA]] | [[multipleIsA]]
singleIsA- : isA [[isAName]] ( , isA [[isAName]] )* ;
multipleIsA- : isA [[isAName]] ( , [[isAName]] )* ;
isAName- : " [**extendsNames] " [[gTemplateParameter]]? | [extendsName] [[gTemplateParameter]]?
gTemplateParameter : < [[AllInclusionExclusionAlias]] >
// A class that can have only one instance [*SingletonPattern*]
singleton- : [=singleton] ;
// A class that can't be modified when created [*ImmutablePattern*]
immutable- : [=immutable] ;
// For equality and hashing [*KeysforEqualityandHashing*]
keyDefinition- : [[defaultKey]] | [[key]]
// Aspect oriented code injection: [*BeforeandAfterStatements*]
codeInjection- : [[beforeCode]] | [[afterCode]]
toplevelCodeInjection- : [[toplevelBeforeCode]] | [[toplevelAfterCode]]
parameterTypes : [parameterType] (, [parameterType])*
parameterListing : OPEN_ROUND_BRACKET ([[parameterTypes]])? CLOSE_ROUND_BRACKET
injectionOperation : [operationName] ([[parameterListing]])?
beforeCode : ( before | [=around] ) [[aspectBody]]
afterCode : after [[aspectBody]]
toplevelBeforeCode : ( before | [=around] ) {([className])(, [className])*} [[aspectBody]]
toplevelAfterCode : after {([className])(, [className])*} [[aspectBody]]
aspectBody- : ([=operationSource:custom|generated|all])? ([!codeLabel:\S+:])? [[injectionOperation]] ( , [[injectionOperation]] )* ([[codeLang]] [[codeLangs]])? { [**code] } ( [[moreCode]] )*