Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 10a55bc988662ba8a98c9c297abda5b2b607fc54 (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
grammar org.eclipse.papyrus.uml.textedit.parameter.xtext.UmlParameter //with org.eclipse.xtext.common.Terminals
with org.eclipse.papyrus.uml.textedit.common.xtext.UmlCommon

import "http://www.eclipse.org/uml2/5.0.0/UML" as uml
import "http://www.eclipse.org/papyrus/uml/textedit/common/xtext/UmlCommon" as common

generate umlParameter "http://www.eclipse.org/papyrus/uml/textedit/parameter/xtext/UmlParameter"

ParameterRule:
	(visibility = VisibilityRule)?
	(direction = DirectionRule)?
	name=ID (':' (type=TypeRule | typeUndefined?="<Undefined>"))?
	(multiplicity = MultiplicityRule) ? 
	(modifiers = ModifiersRule) ?
	(effect = EffectRule)?
	(defaultValue = DefaultValueRule)?
;
	
ModifiersRule:
	{ModifiersRule}'{' (values += ModifierSpecification (',' values += ModifierSpecification)*)? '}'
;

ModifierSpecification:
	value = ModifierKind ;

VisibilityRule:
	visibility = VisibilityKind
;

DirectionRule:
	direction = Direction
;

enum ModifierKind:
	EXCEPTION = "exception" 
	| STREAM = "stream" 
	| ORDERED = "ordered" 
	| UNIQUE = "unique" ;


enum EffectKind:
	CREATE= "create"
	| READ = "read"
	| UPDATE = "update"
	| DELETE="delete";
	
EffectRule:
	'{' "effect:" effectKind = EffectKind '}';
	
DefaultValueRule :
	'=' default = Value ;
	
Value : IntValue | StringValue | BooleanValue | RealValue | NullValue | NoValue;

IntValue : literalInteger = INT;

StringValue : literalString = STRING;

enum BooleanLiterals:
	TRUE = "true" |
	FALSE = "false"
;

BooleanValue : literalBoolean = BooleanLiterals;

//TODO: Support all Java-compliant doubles
RealValue : integer = INT '.' | '.' fraction = INT | integer = INT "." fraction = INT;

NullValue : {NullValue}'null';

NoValue : {NoValue}'none';

Back to the top