diff options
author | 2021-10-11 01:13:32 +0200 | |
---|---|---|
committer | 2021-10-31 19:26:10 +0100 | |
commit | 1d7f4031d614ae16b53de5a84312a71346da0c9c (patch) | |
tree | 961eedc36eca26af61baa862e5cf4b9d1b04de79 /language-web/src/main/js/editor/problem.grammar | |
parent | feat(web): experiment with Lezer parser (diff) | |
download | refinery-1d7f4031d614ae16b53de5a84312a71346da0c9c.tar.gz refinery-1d7f4031d614ae16b53de5a84312a71346da0c9c.tar.zst refinery-1d7f4031d614ae16b53de5a84312a71346da0c9c.zip |
chore(web): remove CodeMirror 5 MWE2 integration
CodeMirror 6 uses a hand-writter Lezer parser instead of the stream
parser generated by Xtext for CodeMirror 5.
Diffstat (limited to 'language-web/src/main/js/editor/problem.grammar')
-rw-r--r-- | language-web/src/main/js/editor/problem.grammar | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/language-web/src/main/js/editor/problem.grammar b/language-web/src/main/js/editor/problem.grammar index c64402b0..921cec53 100644 --- a/language-web/src/main/js/editor/problem.grammar +++ b/language-web/src/main/js/editor/problem.grammar | |||
@@ -3,41 +3,42 @@ | |||
3 | 3 | ||
4 | statement { | 4 | statement { |
5 | ProblemDeclaration { | 5 | ProblemDeclaration { |
6 | kw<"problem"> QualifiedName "." | 6 | ckw<"problem"> QualifiedName "." |
7 | } | | 7 | } | |
8 | ClassDefinition { | 8 | ClassDefinition { |
9 | kw<"abstract">? kw<"class"> RelationName | 9 | ckw<"abstract">? ckw<"class"> RelationName |
10 | (ClassBody { "{" ReferenceDeclaration* "}" } | ".") | 10 | (ClassBody { "{" ReferenceDeclaration* "}" } | ".") |
11 | } | | 11 | } | |
12 | EnumDefinition { | 12 | EnumDefinition { |
13 | kw<"enum"> RelationName | 13 | ckw<"enum"> RelationName |
14 | (EnumBody { "{" sep<",", UniqueNodeName> "}" } | ".") | 14 | (EnumBody { "{" sep<",", UniqueNodeName> "}" } | ".") |
15 | } | | 15 | } | |
16 | PredicateDefinition { | 16 | PredicateDefinition { |
17 | (kw<"error"> kw<"pred">? | kw<"pred">) RelationName ParameterList<Parameter>? | 17 | (ckw<"error"> ckw<"pred">? | ckw<"pred">) RelationName ParameterList<Parameter>? |
18 | PredicateBody { ("<->" sep<OrOp, Conjunction>)? "." } | 18 | PredicateBody { ("<->" sep<OrOp, Conjunction>)? "." } |
19 | } | | 19 | } | |
20 | Assertion { | 20 | Assertion { |
21 | kw<"default">? (NotOp | UnknownOp)? RelationName | 21 | ckw<"default">? (NotOp | UnknownOp)? RelationName |
22 | ParameterList<AssertionArgument> (":" LogicValue)? "." | 22 | ParameterList<AssertionArgument> (":" LogicValue)? "." |
23 | } | | 23 | } | |
24 | UniqueDeclaration { | 24 | UniqueDeclaration { |
25 | kw<"unique"> sep<",", UniqueNodeName> "." | 25 | ckw<"unique"> sep<",", UniqueNodeName> "." |
26 | } | | 26 | } | |
27 | ScopeDeclaration { | 27 | ScopeDeclaration { |
28 | kw<"scope"> sep<",", ScopeElement> "." | 28 | ckw<"scope"> sep<",", ScopeElement> "." |
29 | } | 29 | } |
30 | } | 30 | } |
31 | 31 | ||
32 | ReferenceDeclaration { | 32 | ReferenceDeclaration { |
33 | (kw<"refers"> | kw<"contains">)? | 33 | ((kw<"refers"> | kw<"contains">) !times RelationName | !plus RelationName) |
34 | RelationName | ||
35 | RelationName | 34 | RelationName |
36 | ( "[" Multiplicity? "]" )? | 35 | ( "[" Multiplicity? "]" )? |
37 | (kw<"opposite"> RelationName)? | 36 | (kw<"opposite"> RelationName)? |
38 | ";"? | 37 | ";"? |
39 | } | 38 | } |
40 | 39 | ||
40 | @precedence { times @left, plus } | ||
41 | |||
41 | Parameter { RelationName? VariableName } | 42 | Parameter { RelationName? VariableName } |
42 | 43 | ||
43 | Conjunction { sep1<",", Literal> } | 44 | Conjunction { sep1<",", Literal> } |
@@ -53,7 +54,7 @@ Argument { VariableName | Real } | |||
53 | AssertionArgument { NodeName | StarArgument | Real } | 54 | AssertionArgument { NodeName | StarArgument | Real } |
54 | 55 | ||
55 | LogicValue { | 56 | LogicValue { |
56 | kw<"true"> | kw<"false"> | kw<"unknown"> | kw<"error"> | 57 | ckw<"true"> | ckw<"false"> | ckw<"unknown"> | ckw<"error"> |
57 | } | 58 | } |
58 | 59 | ||
59 | ScopeElement { RelationName ("=" | "+=") Multiplicity } | 60 | ScopeElement { RelationName ("=" | "+=") Multiplicity } |
@@ -72,6 +73,8 @@ QualifiedName { identifier ("::" identifier)* } | |||
72 | 73 | ||
73 | kw<term> { @specialize[@name={term}]<identifier, term> } | 74 | kw<term> { @specialize[@name={term}]<identifier, term> } |
74 | 75 | ||
76 | ckw<term> { @extend[@name={term}]<identifier, term> } | ||
77 | |||
75 | ParameterList<content> { "(" sep<",", content> ")" } | 78 | ParameterList<content> { "(" sep<",", content> ")" } |
76 | 79 | ||
77 | sep<separator, content> { sep1<separator, content>? } | 80 | sep<separator, content> { sep1<separator, content>? } |