summaryrefslogtreecommitdiffstats
blob: 8292d4a5b4366b941a7f33fc9a47cbbf88217db7 (plain)
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
147
148
149
150
-- @name		FScript
-- @version		1.0
-- @authors		Frédéric Jouault
-- @date		20080205
-- @description	Metamodel of the FScript Fractal action language. This metamodel includes the FPath metamodel.
-- @see			http://fractal.objectweb.org/fscript/fscript_manual.pdf
package FScript {

	-- Every class should extend LocatedElement, directly or indirectly.
	-- This is a technical constraint to support text-to-model traceability.
	abstract class LocatedElement {
		attribute location[0-1] : String;
		attribute commentsBefore[*] ordered : String;
		attribute commentsAfter[*] ordered : String;
	}

-- BEGIN DSL-specific classes (replace sample contents)
	abstract class Procedure extends LocatedElement {
		attribute name : String;
		reference parameters[*] ordered container : VariableDefinition;
		reference body container : Block;
	}
	
	class Function extends Procedure {}

	class Action extends Procedure {}
	
	class VariableDefinition extends LocatedElement {
		attribute name : String;
	}
	
	class Block extends LocatedElement {
		reference statements[*] ordered container : ControlStructure;
		reference freeVariables[*] ordered container : VariableDefinition;
	}
-- @begin Control Structures
	abstract class ControlStructure extends LocatedElement {}
	
	class VariableAssignment extends ControlStructure {
		reference variable : VariableDefinition;
		reference value container : Expression;	
	}
	
	class Conditional extends ControlStructure {
		reference condition container : Expression;
		reference then container : Block;
		reference else[0-1] container : Block;
	}
	
	class Iteration extends ControlStructure {
		reference variable container : VariableDefinition;
		reference source container : Expression;
		reference body container : Block;
	}
	
	class ReturnStat extends ControlStructure {
		reference expression[0-1] container : Expression;
	}
	
	abstract class PrimitiveAction extends ControlStructure {}
	
	class BindAction extends PrimitiveAction {
		reference clientInterface container : Expression;
		reference serverInterface container : Expression;
	}
-- @end Control Structures
-- END DSL-specific classes
}

-- FPath metamodel elements copied from the FPath Language Project.
package FPath {

-- BEGIN DSL-specific classes (replace sample contents)
	abstract class Expression extends LocatedElement {}

	class ContextExp extends Expression {}
	
	class VariableExp extends Expression {
		reference definition : VariableDefinition;
	}
	
	class FunctionCallExp extends Expression {
		attribute name : String;
		reference arguments[*] ordered container : Expression;
	}

	class NumberExp extends Expression {
		attribute value : Double;
	}

	class StringExp extends Expression {
		attribute value : String;
	}
	
	class PathExp extends Expression {
		reference initialNodeSet container : Expression;
		reference steps[1-*] ordered container : Step;
	}

	abstract class OperatorExp extends Expression {
		attribute operator : String;
	}

	class BinaryOperatorExp extends OperatorExp {
		reference left container : Expression;
		reference right container : Expression;
	}

	class UnaryOperatorExp extends OperatorExp {
		reference operand container : Expression;
	}

	class Step extends LocatedElement {
		attribute axis : Axis;
		reference test container : Test;
		reference predicates[*] ordered container : Expression;
	}
	
	abstract class Test extends LocatedElement {}
	
	class WildcardTest extends Test {}
	
	class NameTest extends Test {
		attribute name : String;
	}
	
	enumeration Axis {
		literal component;
		literal "internal-interface";
		literal interface;
		literal "attribute";
		literal binding;
		literal child;
		literal parent;
		literal descendant;
		literal ancestor;
		literal sibling;
		literal "descendant-or-self";
		literal "ancestor-or-self";
		literal "sibling-or-self";
	}
-- END DSL-specific classes
}

package PrimitiveTypes {
	datatype Boolean;
	datatype Double;
	datatype Integer;
	datatype String;
}