diff options
Diffstat (limited to 'subprojects/frontend/src/language')
-rw-r--r-- | subprojects/frontend/src/language/problem.grammar | 21 | ||||
-rw-r--r-- | subprojects/frontend/src/language/problemLanguageSupport.ts | 3 |
2 files changed, 17 insertions, 7 deletions
diff --git a/subprojects/frontend/src/language/problem.grammar b/subprojects/frontend/src/language/problem.grammar index 95861110..7feb6bfe 100644 --- a/subprojects/frontend/src/language/problem.grammar +++ b/subprojects/frontend/src/language/problem.grammar | |||
@@ -18,7 +18,10 @@ statement { | |||
18 | (EnumBody { "{" sep<",", IndividualNodeName> "}" } | ".") | 18 | (EnumBody { "{" sep<",", IndividualNodeName> "}" } | ".") |
19 | } | | 19 | } | |
20 | PredicateDefinition { | 20 | PredicateDefinition { |
21 | (ckw<"error"> ckw<"pred">? | ckw<"pred">) | 21 | ( |
22 | (ckw<"error"> | ckw<"contained"> | ckw<"containment">) ckw<"pred">? | | ||
23 | ckw<"pred"> | ||
24 | ) | ||
22 | RelationName ParameterList<Parameter>? | 25 | RelationName ParameterList<Parameter>? |
23 | PredicateBody { ("<->" sep<OrOp, Conjunction>)? "." } | 26 | PredicateBody { ("<->" sep<OrOp, Conjunction>)? "." } |
24 | } | | 27 | } | |
@@ -28,23 +31,29 @@ statement { | |||
28 | RuleBody { ":" sep<OrOp, Conjunction> "==>" sep<OrOp, Consequent> "." } | 31 | RuleBody { ":" sep<OrOp, Conjunction> "==>" sep<OrOp, Consequent> "." } |
29 | } | | 32 | } | |
30 | Assertion { | 33 | Assertion { |
31 | kw<"default">? (NotOp | UnknownOp)? RelationName | 34 | ckw<"default">? (NotOp | UnknownOp)? RelationName |
32 | ParameterList<AssertionArgument> (":" LogicValue)? "." | 35 | ParameterList<AssertionArgument> (":" LogicValue)? "." |
33 | } | | 36 | } | |
34 | NodeValueAssertion { | 37 | NodeValueAssertion { |
35 | IndividualNodeName ":" Constant "." | 38 | QualifiedName ":" Constant "." |
36 | } | | 39 | } | |
37 | IndividualDeclaration { | 40 | IndividualDeclaration { |
38 | ckw<"indiv"> sep<",", IndividualNodeName> "." | 41 | ckw<"indiv"> sep<",", IndividualNodeName> "." |
39 | } | | 42 | } | |
40 | ScopeDeclaration { | 43 | ScopeDeclaration { |
41 | kw<"scope"> sep<",", ScopeElement> "." | 44 | ckw<"scope"> sep<",", ScopeElement> "." |
42 | } | 45 | } |
43 | } | 46 | } |
44 | 47 | ||
45 | ReferenceDeclaration { | 48 | ReferenceDeclaration { |
46 | (kw<"refers"> | kw<"contains">)? | 49 | ( |
47 | RelationName | 50 | ExplicitContainmentReference[@dynamicPrecedence=1] { |
51 | (ckw<"refers"> | ckw<"contains"> | ckw<"container">) RelationName ~containment | ||
52 | } | | ||
53 | ImplicitContainmentReference { | ||
54 | RelationName ~containment | ||
55 | } | ||
56 | ) | ||
48 | ("[" Multiplicity? "]")? | 57 | ("[" Multiplicity? "]")? |
49 | RelationName | 58 | RelationName |
50 | (kw<"opposite"> RelationName)? | 59 | (kw<"opposite"> RelationName)? |
diff --git a/subprojects/frontend/src/language/problemLanguageSupport.ts b/subprojects/frontend/src/language/problemLanguageSupport.ts index 07a884e7..03a7c4cc 100644 --- a/subprojects/frontend/src/language/problemLanguageSupport.ts +++ b/subprojects/frontend/src/language/problemLanguageSupport.ts | |||
@@ -27,7 +27,8 @@ const parserWithMetadata = parser.configure({ | |||
27 | LineComment: t.lineComment, | 27 | LineComment: t.lineComment, |
28 | BlockComment: t.blockComment, | 28 | BlockComment: t.blockComment, |
29 | 'problem class enum pred rule indiv scope': t.definitionKeyword, | 29 | 'problem class enum pred rule indiv scope': t.definitionKeyword, |
30 | 'abstract extends refers contains opposite error default': t.modifier, | 30 | 'abstract extends refers contains container opposite': t.modifier, |
31 | 'default error contained containment': t.modifier, | ||
31 | 'true false unknown error': t.operatorKeyword, | 32 | 'true false unknown error': t.operatorKeyword, |
32 | 'may must current count': t.operatorKeyword, | 33 | 'may must current count': t.operatorKeyword, |
33 | 'new delete': t.keyword, | 34 | 'new delete': t.keyword, |