aboutsummaryrefslogtreecommitdiffstats
path: root/language-web/src/main/js/language/problem.grammar
diff options
context:
space:
mode:
Diffstat (limited to 'language-web/src/main/js/language/problem.grammar')
-rw-r--r--language-web/src/main/js/language/problem.grammar26
1 files changed, 21 insertions, 5 deletions
diff --git a/language-web/src/main/js/language/problem.grammar b/language-web/src/main/js/language/problem.grammar
index cf940698..c242a4ba 100644
--- a/language-web/src/main/js/language/problem.grammar
+++ b/language-web/src/main/js/language/problem.grammar
@@ -14,9 +14,15 @@ statement {
14 (EnumBody { "{" sep<",", UniqueNodeName> "}" } | ".") 14 (EnumBody { "{" sep<",", UniqueNodeName> "}" } | ".")
15 } | 15 } |
16 PredicateDefinition { 16 PredicateDefinition {
17 (ckw<"error"> ckw<"pred">? | ckw<"pred">) RelationName ParameterList<Parameter>? 17 (ckw<"error"> ckw<"pred">? | ckw<"direct">? ckw<"pred">)
18 RelationName ParameterList<Parameter>?
18 PredicateBody { ("<->" sep<OrOp, Conjunction>)? "." } 19 PredicateBody { ("<->" sep<OrOp, Conjunction>)? "." }
19 } | 20 } |
21 RuleDefinition {
22 ckw<"direct">? ckw<"rule">
23 RuleName ParameterList<Parameter>?
24 RuleBody { ":" sep<OrOp, Conjunction> "~>" sep<OrOp, Action> "." }
25 } |
20 Assertion { 26 Assertion {
21 ckw<"default">? (NotOp | UnknownOp)? RelationName 27 ckw<"default">? (NotOp | UnknownOp)? RelationName
22 ParameterList<AssertionArgument> (":" LogicValue)? "." 28 ParameterList<AssertionArgument> (":" LogicValue)? "."
@@ -47,9 +53,17 @@ Conjunction { ("," | Literal)+ }
47 53
48OrOp { ";" } 54OrOp { ";" }
49 55
50Literal { NotOp? Atom } 56Literal { NotOp? Atom (("=" | ":") sep1<"|", LogicValue>)? }
57
58Atom { RelationName "+"? ParameterList<Argument> }
51 59
52Atom { RelationName ParameterList<Argument>? } 60Action { ("," | ActionLiteral)+ }
61
62ActionLiteral {
63 ckw<"new"> VariableName |
64 ckw<"delete"> VariableName |
65 Literal
66}
53 67
54Argument { VariableName | Constant } 68Argument { VariableName | Constant }
55 69
@@ -67,6 +81,8 @@ Multiplicity { (IntMult "..")? (IntMult | StarMult)}
67 81
68RelationName { QualifiedName } 82RelationName { QualifiedName }
69 83
84RuleName { QualifiedName }
85
70UniqueNodeName { QualifiedName } 86UniqueNodeName { QualifiedName }
71 87
72VariableName { QualifiedName } 88VariableName { QualifiedName }
@@ -83,7 +99,7 @@ ParameterList<content> { "(" sep<",", content> ")" }
83 99
84sep<separator, content> { sep1<separator, content>? } 100sep<separator, content> { sep1<separator, content>? }
85 101
86sep1<separator, content> { content (separator content?)* } 102sep1<separator, content> { content (separator content)* }
87 103
88@skip { LineComment | BlockComment | whitespace } 104@skip { LineComment | BlockComment | whitespace }
89 105
@@ -123,7 +139,7 @@ sep1<separator, content> { content (separator content?)* }
123 139
124 StarArgument { "*" } 140 StarArgument { "*" }
125 141
126 "{" "}" "(" ")" "[" "]" "." ".." "," ":" "<->" 142 "{" "}" "(" ")" "[" "]" "." ".." "," ":" "<->" "~>"
127} 143}
128 144
129@detectDelim 145@detectDelim