diff --git a/subprojects/frontend/src/language/problem.grammar b/subprojects/frontend/src/language/problem.grammar index 1af17c36..254029cd 100644 --- a/subprojects/frontend/src/language/problem.grammar +++ b/subprojects/frontend/src/language/problem.grammar @@ -54,7 +54,7 @@ statement { PredicateDefinition { ((kw<"error"> | kw<"partial"> | ckw<"shadow">)* kw<"pred"> | kw<"error">) RelationName ParameterList? - (kw<"subsets"> sep1<",", RelationName>)* + (ckw<"subsets"> sep1<",", RelationName>)* PredicateBody { ("<->" sep)? "." } } | // FunctionDefinition { @@ -91,8 +91,10 @@ FeatureDeclaration { ("[" Multiplicity? "]")? RelationName ( - kw<"opposite"> RelationName | - kw<"subsets"> sep1<",", RelationName> + !feature RelationOptions[@dynamicPrecedence=1] { + ckw<"opposite"> RelationName | + ckw<"subsets"> sep1<",", RelationName> + } )* ";"? } 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 4e266b18..283afae2 100644 --- a/subprojects/language/src/main/java/tools/refinery/language/Problem.xtext +++ b/subprojects/language/src/main/java/tools/refinery/language/Problem.xtext @@ -301,7 +301,7 @@ NonContainmentQualifiedName hidden(): (NonContainmentIdentifier | "::" Identifier) (QUALIFIED_NAME_SEPARATOR Identifier)*; Identifier: - NonContainmentIdentifier | "contains" | "container"; + NonContainmentIdentifier | "contains" | "container" | "opposite" | "subsets"; NonContainmentIdentifier: ID | QUOTED_ID | "atom" | "multi" | "problem" | "module" |