aboutsummaryrefslogtreecommitdiffstats
path: root/subprojects/frontend/src/language/problem.grammar
diff options
context:
space:
mode:
Diffstat (limited to 'subprojects/frontend/src/language/problem.grammar')
-rw-r--r--subprojects/frontend/src/language/problem.grammar17
1 files changed, 11 insertions, 6 deletions
diff --git a/subprojects/frontend/src/language/problem.grammar b/subprojects/frontend/src/language/problem.grammar
index 7c4098d5..c2410913 100644
--- a/subprojects/frontend/src/language/problem.grammar
+++ b/subprojects/frontend/src/language/problem.grammar
@@ -3,6 +3,7 @@
3@external prop implicitCompletion from './props' 3@external prop implicitCompletion from './props'
4 4
5@precedence { 5@precedence {
6 reference @cut,
6 prefix, 7 prefix,
7 exponential @right, 8 exponential @right,
8 multiplicative @left, 9 multiplicative @left,
@@ -47,10 +48,10 @@ statement {
47 Assertion { 48 Assertion {
48 kw<"default">? (NotOp | UnknownOp)? RelationName 49 kw<"default">? (NotOp | UnknownOp)? RelationName
49 ParameterList<AssertionArgument> 50 ParameterList<AssertionArgument>
50 (":" LogicValue | ("=" | kw<"in">) Expr)? "." 51 (":" Expr)? "."
51 } | 52 } |
52 IndividualDeclaration { 53 IndividualDeclaration {
53 kw<"individual"> sep<",", IndividualNodeName> "." 54 kw<"indiv"> sep<",", IndividualNodeName> "."
54 } | 55 } |
55 ScopeDeclaration { 56 ScopeDeclaration {
56 kw<"scope"> sep<",", ScopeElement> "." 57 kw<"scope"> sep<",", ScopeElement> "."
@@ -58,7 +59,8 @@ statement {
58} 59}
59 60
60FeatureDeclaration { 61FeatureDeclaration {
61 (ReferenceKind | PrimitiveType | kw<"bool">) RelationName 62 // The @cut helps disambiguate silly cases like `contains contains`
63 (ReferenceKind !reference | PrimitiveType | kw<"bool">)? RelationName
62 ("[" Multiplicity? "]")? 64 ("[" Multiplicity? "]")?
63 RelationName 65 RelationName
64 (kw<"opposite"> RelationName)? 66 (kw<"opposite"> RelationName)?
@@ -90,7 +92,7 @@ BinaryExpr {
90} 92}
91 93
92UnaryExpr { 94UnaryExpr {
93 !prefix ("+" | "-" | "!" | "#" | Modality) Expr 95 !prefix ("+" | "-" | "!" | kw<"count"> | Modality) Expr
94} 96}
95 97
96Aggregation { 98Aggregation {
@@ -109,7 +111,7 @@ Atom { RelationName "+"? ParameterList<Expr> }
109 111
110AssertionArgument { NodeName | StarArgument } 112AssertionArgument { NodeName | StarArgument }
111 113
112Constant { Real | String | StarMult } 114Constant { Real | String | StarMult | LogicValue }
113 115
114ReferenceKind { 116ReferenceKind {
115 kw<"refers"> | ckw<"contains"> | kw<"container"> 117 kw<"refers"> | ckw<"contains"> | kw<"container">
@@ -199,7 +201,10 @@ sep1<separator, content> { content (separator content)* }
199 "\"" (![\\"\n] | "\\" (![\n] | "\n"))* "\"" 201 "\"" (![\\"\n] | "\\" (![\n] | "\n"))* "\""
200 } 202 }
201 203
202 SymbolicComparisonOp { ">" | ">=" | "<" | "<=" | "==" | "!=" } 204 SymbolicComparisonOp {
205 ">" | ">=" | "<" | "<=" | "==" | "!=" |
206 "<:" | ":>" | "===" | "!=="
207 }
203 208
204 NotOp { "!" } 209 NotOp { "!" }
205 210