aboutsummaryrefslogtreecommitdiffstats
path: root/Application/org.eclipse.viatra.solver.language/src/org/eclipse/viatra/solver/language/SolverLanguage.xtext
diff options
context:
space:
mode:
Diffstat (limited to 'Application/org.eclipse.viatra.solver.language/src/org/eclipse/viatra/solver/language/SolverLanguage.xtext')
-rw-r--r--Application/org.eclipse.viatra.solver.language/src/org/eclipse/viatra/solver/language/SolverLanguage.xtext32
1 files changed, 18 insertions, 14 deletions
diff --git a/Application/org.eclipse.viatra.solver.language/src/org/eclipse/viatra/solver/language/SolverLanguage.xtext b/Application/org.eclipse.viatra.solver.language/src/org/eclipse/viatra/solver/language/SolverLanguage.xtext
index 5abeb891..1306b626 100644
--- a/Application/org.eclipse.viatra.solver.language/src/org/eclipse/viatra/solver/language/SolverLanguage.xtext
+++ b/Application/org.eclipse.viatra.solver.language/src/org/eclipse/viatra/solver/language/SolverLanguage.xtext
@@ -9,7 +9,7 @@ Statement:
9 ( 9 (
10 AssertionOrDefinition | PredicateDefinition | UnnamedErrorPrediateDefinition | DefaultDefinition | ExternPredicateDefinition | 10 AssertionOrDefinition | PredicateDefinition | UnnamedErrorPrediateDefinition | DefaultDefinition | ExternPredicateDefinition |
11 MetricDefinition | ExternMetricDefinition | ClassDefinition | ScopeDefinition | ObjectiveDefinition 11 MetricDefinition | ExternMetricDefinition | ClassDefinition | ScopeDefinition | ObjectiveDefinition
12 ) DOT; 12 ) FULL_STOP;
13 13
14AssertionOrDefinition returns Statement: 14AssertionOrDefinition returns Statement:
15 Expression ( 15 Expression (
@@ -28,7 +28,7 @@ DefaultDefinition:
28 "default" head=Call ":" range=Expression; 28 "default" head=Call ":" range=Expression;
29 29
30ExternPredicateDefinition: 30ExternPredicateDefinition:
31 "extern" head=Call "."; 31 "extern" head=Call;
32 32
33enum MetricType: 33enum MetricType:
34 INT="int" | REAL="real"; 34 INT="int" | REAL="real";
@@ -103,10 +103,10 @@ Aggregation:
103 op=AggregationOp "{" body=Expression "|" condition=Expression "}"; 103 op=AggregationOp "{" body=Expression "|" condition=Expression "}";
104 104
105AtomicExpression returns Expression: 105AtomicExpression returns Expression:
106 Reference ({Call.functor=current} -> argumentList=ArgumentList)? | Interval | Literal | "(" Expression ")"; 106 Reference | Call | Interval | Literal | "(" Expression ")";
107 107
108Call: 108Call:
109 functor=Reference (transitiveClosure?=STAR | reflexiveTransitiveClosure?=PLUS)? argumentList=ArgumentList; 109 functor=Reference (transitiveClosure?=TRANSITIVE_CLOSURE | reflexiveTransitiveClosure?=REFLEXIVE_TRANSITIVE_CLOSURE)? argumentList=ArgumentList;
110 110
111ArgumentList: 111ArgumentList:
112 {ArgumentList} "(" (arguments+=Argument ("," arguments+=Argument)*)? ")"; 112 {ArgumentList} "(" (arguments+=Argument ("," arguments+=Argument)*)? ")";
@@ -153,7 +153,7 @@ EmptyIntervalLiteral:
153StringLiteral: 153StringLiteral:
154 value=STRING; 154 value=STRING;
155 155
156ClassDefinition returns Statement: 156ClassDefinition:
157 abstract?="abstract"? "class" name=ID ("extends" superclasses+=[NamedElement|QualifiedName] ("," superclasses+=[NamedElement|QualifiedName])*)? 157 abstract?="abstract"? "class" name=ID ("extends" superclasses+=[NamedElement|QualifiedName] ("," superclasses+=[NamedElement|QualifiedName])*)?
158 "{" members+=MemberDefinition* "}"; 158 "{" members+=MemberDefinition* "}";
159 159
@@ -182,13 +182,13 @@ BoundedScopeDefinition:
182 "scope" ( 182 "scope" (
183 (lowerBound=INT "<=")? type=[NamedElement|QualifiedName] "<=" upperBound=INT | 183 (lowerBound=INT "<=")? type=[NamedElement|QualifiedName] "<=" upperBound=INT |
184 upperBound=INT ">=" type=[NamedElement|QualifiedName] (">=" lowerBound=INT)? 184 upperBound=INT ">=" type=[NamedElement|QualifiedName] (">=" lowerBound=INT)?
185 ) "."; 185 );
186 186
187LowerBoundedScopeDefinition: 187LowerBoundedScopeDefinition:
188 "scope" ( 188 "scope" (
189 lowerBound=INT "<=" type=[NamedElement|QualifiedName] | 189 lowerBound=INT "<=" type=[NamedElement|QualifiedName] |
190 type=[NamedElement|QualifiedName] ">=" lowerBound=INT 190 type=[NamedElement|QualifiedName] ">=" lowerBound=INT
191 ) "."; 191 );
192 192
193enum ObjectiveKind: 193enum ObjectiveKind:
194 MINIMIZE="minimize" | MAXIMIZE="maximize"; 194 MINIMIZE="minimize" | MAXIMIZE="maximize";
@@ -209,17 +209,21 @@ QualifiedName hidden():
209terminal STRING returns ecore::EString: 209terminal STRING returns ecore::EString:
210 '"' ( '\\' . /* 'b'|'t'|'n'|'f'|'r'|'u'|'"'|"'"|'\\' */ | !('\\'|'"') )* '"'; 210 '"' ( '\\' . /* 'b'|'t'|'n'|'f'|'r'|'u'|'"'|"'"|'\\' */ | !('\\'|'"') )* '"';
211 211
212terminal QUOTED_ID returns ecore::EString: 212terminal QUOTED_ID:
213 '\'' ( '\\' . /* 'b'|'t'|'n'|'f'|'r'|'u'|'"'|"'"|'\\' */ | !('\\'|'\'') )* '\''; 213 '\'' ( '\\' . /* 'b'|'t'|'n'|'f'|'r'|'u'|'"'|"'"|'\\' */ | !('\\'|'\'') )* '\'';
214 214
215terminal PLUS: 215@Override
216 "synthetic::plus"; 216terminal SL_COMMENT:
217 ('%' | '//') !('\n'|'\r')* ('\r'? '\n')?;
218
219terminal TRANSITIVE_CLOSURE:
220 "synthetic:TRANSITIVE_CLOSURE";
217 221
218terminal STAR: 222terminal REFLEXIVE_TRANSITIVE_CLOSURE:
219 "synthetic::star"; 223 "synthetic:REFLEXIVE_TRANSITIVE_CLOSURE";
220 224
221terminal DOT: 225terminal FULL_STOP:
222 "synthetic::dot"; 226 "synthetic:FULL_STOP";
223 227
224NamedElement: 228NamedElement:
225 name=QualifiedName; 229 name=QualifiedName;