diff options
Diffstat (limited to 'subprojects/language/src/main/java/tools/refinery/language/Problem.xtext')
-rw-r--r-- | subprojects/language/src/main/java/tools/refinery/language/Problem.xtext | 48 |
1 files changed, 21 insertions, 27 deletions
diff --git a/subprojects/language/src/main/java/tools/refinery/language/Problem.xtext b/subprojects/language/src/main/java/tools/refinery/language/Problem.xtext index 9e330347..0a91178b 100644 --- a/subprojects/language/src/main/java/tools/refinery/language/Problem.xtext +++ b/subprojects/language/src/main/java/tools/refinery/language/Problem.xtext | |||
@@ -14,7 +14,7 @@ Problem: | |||
14 | 14 | ||
15 | Statement: | 15 | Statement: |
16 | Assertion | ClassDeclaration | EnumDeclaration | | 16 | Assertion | ClassDeclaration | EnumDeclaration | |
17 | PredicateDefinition | FunctionDefinition | /* RuleDefinition | */ | 17 | PredicateDefinition | /* FunctionDefinition | RuleDefinition | */ |
18 | ScopeDeclaration | IndividualDeclaration; | 18 | ScopeDeclaration | IndividualDeclaration; |
19 | 19 | ||
20 | ClassDeclaration: | 20 | ClassDeclaration: |
@@ -32,7 +32,7 @@ EnumLiteral returns Node: | |||
32 | name=Identifier; | 32 | name=Identifier; |
33 | 33 | ||
34 | FeatureDeclaration: | 34 | FeatureDeclaration: |
35 | ReferenceDeclaration | AttributeDeclaration | FlagDeclaration; | 35 | ReferenceDeclaration /* | AttributeDeclaration | FlagDeclaration */; |
36 | 36 | ||
37 | enum ReferenceKind: | 37 | enum ReferenceKind: |
38 | REFERENCE="refers" | CONTAINMENT="contains" | CONTAINER="container"; | 38 | REFERENCE="refers" | CONTAINMENT="contains" | CONTAINER="container"; |
@@ -44,23 +44,17 @@ ReferenceDeclaration: | |||
44 | name=Identifier | 44 | name=Identifier |
45 | ("opposite" opposite=[ReferenceDeclaration|QualifiedName])?; | 45 | ("opposite" opposite=[ReferenceDeclaration|QualifiedName])?; |
46 | 46 | ||
47 | enum PrimitiveType: | 47 | //enum PrimitiveType: |
48 | INT="int" | REAL="real" | STRING="string"; | 48 | // INT="int" | REAL="real" | STRING="string"; |
49 | 49 | // | |
50 | AttributeDeclaration: | 50 | //AttributeDeclaration: |
51 | attributeType=PrimitiveType name=Identifier; | 51 | // attributeType=PrimitiveType name=Identifier; |
52 | 52 | // | |
53 | FlagDeclaration: | 53 | //FlagDeclaration: |
54 | "bool" name=Identifier; | 54 | // "bool" name=Identifier; |
55 | |||
56 | enum ErrorKind returns PredicateKind: | ||
57 | ERROR="error"; | ||
58 | |||
59 | enum PredicateKind: | ||
60 | ERROR="error" | CONTAINED="contained" | CONTAINMENT="containment"; | ||
61 | 55 | ||
62 | PredicateDefinition: | 56 | PredicateDefinition: |
63 | (kind=ErrorKind | kind=PredicateKind? "pred") | 57 | ("pred" | error?="error" "pred"?) |
64 | name=Identifier | 58 | name=Identifier |
65 | "(" (parameters+=Parameter ("," parameters+=Parameter)*)? ")" | 59 | "(" (parameters+=Parameter ("," parameters+=Parameter)*)? ")" |
66 | ("<->" bodies+=Conjunction (";" bodies+=Conjunction)*)? | 60 | ("<->" bodies+=Conjunction (";" bodies+=Conjunction)*)? |
@@ -69,14 +63,14 @@ PredicateDefinition: | |||
69 | Conjunction: | 63 | Conjunction: |
70 | literals+=Expr ("," literals+=Expr)*; | 64 | literals+=Expr ("," literals+=Expr)*; |
71 | 65 | ||
72 | FunctionDefinition: | 66 | //FunctionDefinition: |
73 | "fn" functionType=PrimitiveType name=Identifier | 67 | // "fn" functionType=PrimitiveType name=Identifier |
74 | "(" (parameters+=Parameter ("," parameters+=Parameter)*)? ")" | 68 | // "(" (parameters+=Parameter ("," parameters+=Parameter)*)? ")" |
75 | ("=" cases+=Case (";" cases+=Case)*)? | 69 | // ("=" cases+=Case (";" cases+=Case)*)? |
76 | "."; | 70 | // "."; |
77 | 71 | // | |
78 | Case: | 72 | //Case: |
79 | Conjunction ({Match.condition=current} "->" value=Expr)?; | 73 | // Conjunction ({Match.condition=current} "->" value=Expr)?; |
80 | 74 | ||
81 | //RuleDefinition: | 75 | //RuleDefinition: |
82 | // "rule" | 76 | // "rule" |
@@ -87,7 +81,7 @@ Case: | |||
87 | // "."; | 81 | // "."; |
88 | 82 | ||
89 | Parameter: | 83 | Parameter: |
90 | (modality=Modality? parameterType=[Relation|QualifiedName])? name=Identifier; | 84 | parameterType=[Relation|QualifiedName]? name=Identifier; |
91 | 85 | ||
92 | //Consequent: | 86 | //Consequent: |
93 | // actions+=Action ("," actions+=Action)*; | 87 | // actions+=Action ("," actions+=Action)*; |
@@ -268,7 +262,7 @@ NonContainmentQualifiedName hidden(): | |||
268 | NonContainmentIdentifier ("::" Identifier)*; | 262 | NonContainmentIdentifier ("::" Identifier)*; |
269 | 263 | ||
270 | Identifier: | 264 | Identifier: |
271 | NonContainmentIdentifier | "contains"; | 265 | NonContainmentIdentifier | "contains" | "container"; |
272 | 266 | ||
273 | NonContainmentIdentifier: | 267 | NonContainmentIdentifier: |
274 | ID | "contained" | "sum" | "prod" | "min" | "max"; | 268 | ID | "contained" | "sum" | "prod" | "min" | "max"; |