From 419e76265ecbdf65e960e0624be006d31ed1e191 Mon Sep 17 00:00:00 2001 From: Kristóf Marussy Date: Fri, 8 May 2020 18:28:19 +0200 Subject: Update solver language grammar First version, still needs TokenSource and Linker to work. --- .../parser/antlr/internal/InternalSolverLanguage.g | 4421 +++++++++++++------- 1 file changed, 2907 insertions(+), 1514 deletions(-) (limited to 'Application/org.eclipse.viatra.solver.language/src-gen/org/eclipse/viatra/solver/language/parser/antlr/internal/InternalSolverLanguage.g') diff --git a/Application/org.eclipse.viatra.solver.language/src-gen/org/eclipse/viatra/solver/language/parser/antlr/internal/InternalSolverLanguage.g b/Application/org.eclipse.viatra.solver.language/src-gen/org/eclipse/viatra/solver/language/parser/antlr/internal/InternalSolverLanguage.g index 501e2e59..3fac9254 100644 --- a/Application/org.eclipse.viatra.solver.language/src-gen/org/eclipse/viatra/solver/language/parser/antlr/internal/InternalSolverLanguage.g +++ b/Application/org.eclipse.viatra.solver.language/src-gen/org/eclipse/viatra/solver/language/parser/antlr/internal/InternalSolverLanguage.g @@ -1,5 +1,5 @@ /* - * generated by Xtext 2.18.0.M3 + * generated by Xtext 2.21.0 */ grammar InternalSolverLanguage; @@ -23,6 +23,7 @@ import org.eclipse.xtext.parser.*; import org.eclipse.xtext.parser.impl.*; import org.eclipse.emf.ecore.util.EcoreUtil; import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.common.util.Enumerator; import org.eclipse.xtext.parser.antlr.AbstractInternalAntlrParser; import org.eclipse.xtext.parser.antlr.XtextTokenStream; import org.eclipse.xtext.parser.antlr.XtextTokenStream.HiddenTokens; @@ -112,35 +113,113 @@ ruleStatement returns [EObject current=null] leaveRule(); }: ( + ( + { + newCompositeNode(grammarAccess.getStatementAccess().getAssertionOrDefinitionParserRuleCall_0_0()); + } + this_AssertionOrDefinition_0=ruleAssertionOrDefinition + { + $current = $this_AssertionOrDefinition_0.current; + afterParserOrEnumRuleCall(); + } + | + { + newCompositeNode(grammarAccess.getStatementAccess().getPredicateDefinitionParserRuleCall_0_1()); + } + this_PredicateDefinition_1=rulePredicateDefinition + { + $current = $this_PredicateDefinition_1.current; + afterParserOrEnumRuleCall(); + } + | + { + newCompositeNode(grammarAccess.getStatementAccess().getUnnamedErrorPrediateDefinitionParserRuleCall_0_2()); + } + this_UnnamedErrorPrediateDefinition_2=ruleUnnamedErrorPrediateDefinition + { + $current = $this_UnnamedErrorPrediateDefinition_2.current; + afterParserOrEnumRuleCall(); + } + | + { + newCompositeNode(grammarAccess.getStatementAccess().getDefaultDefinitionParserRuleCall_0_3()); + } + this_DefaultDefinition_3=ruleDefaultDefinition + { + $current = $this_DefaultDefinition_3.current; + afterParserOrEnumRuleCall(); + } + | + { + newCompositeNode(grammarAccess.getStatementAccess().getExternPredicateDefinitionParserRuleCall_0_4()); + } + this_ExternPredicateDefinition_4=ruleExternPredicateDefinition + { + $current = $this_ExternPredicateDefinition_4.current; + afterParserOrEnumRuleCall(); + } + | + { + newCompositeNode(grammarAccess.getStatementAccess().getMetricDefinitionParserRuleCall_0_5()); + } + this_MetricDefinition_5=ruleMetricDefinition + { + $current = $this_MetricDefinition_5.current; + afterParserOrEnumRuleCall(); + } + | + { + newCompositeNode(grammarAccess.getStatementAccess().getExternMetricDefinitionParserRuleCall_0_6()); + } + this_ExternMetricDefinition_6=ruleExternMetricDefinition + { + $current = $this_ExternMetricDefinition_6.current; + afterParserOrEnumRuleCall(); + } + | + { + newCompositeNode(grammarAccess.getStatementAccess().getClassDefinitionParserRuleCall_0_7()); + } + this_ClassDefinition_7=ruleClassDefinition + { + $current = $this_ClassDefinition_7.current; + afterParserOrEnumRuleCall(); + } + | + { + newCompositeNode(grammarAccess.getStatementAccess().getScopeDefinitionParserRuleCall_0_8()); + } + this_ScopeDefinition_8=ruleScopeDefinition + { + $current = $this_ScopeDefinition_8.current; + afterParserOrEnumRuleCall(); + } + | + { + newCompositeNode(grammarAccess.getStatementAccess().getObjectiveDefinitionParserRuleCall_0_9()); + } + this_ObjectiveDefinition_9=ruleObjectiveDefinition + { + $current = $this_ObjectiveDefinition_9.current; + afterParserOrEnumRuleCall(); + } + ) + this_DOT_10=RULE_DOT { - newCompositeNode(grammarAccess.getStatementAccess().getInterpretationParserRuleCall_0()); - } - this_Interpretation_0=ruleInterpretation - { - $current = $this_Interpretation_0.current; - afterParserOrEnumRuleCall(); - } - | - { - newCompositeNode(grammarAccess.getStatementAccess().getPredicateParserRuleCall_1()); - } - this_Predicate_1=rulePredicate - { - $current = $this_Predicate_1.current; - afterParserOrEnumRuleCall(); + newLeafNode(this_DOT_10, grammarAccess.getStatementAccess().getDOTTerminalRuleCall_1()); } ) ; -// Entry rule entryRuleREALLiteral -entryRuleREALLiteral returns [String current=null]: - { newCompositeNode(grammarAccess.getREALLiteralRule()); } - iv_ruleREALLiteral=ruleREALLiteral - { $current=$iv_ruleREALLiteral.current.getText(); } +// Entry rule entryRuleAssertionOrDefinition +entryRuleAssertionOrDefinition returns [EObject current=null]: + { newCompositeNode(grammarAccess.getAssertionOrDefinitionRule()); } + iv_ruleAssertionOrDefinition=ruleAssertionOrDefinition + { $current=$iv_ruleAssertionOrDefinition.current; } EOF; -// Rule REALLiteral -ruleREALLiteral returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] +// Rule AssertionOrDefinition +ruleAssertionOrDefinition returns [EObject current=null] @init { enterRule(); } @@ -148,44 +227,128 @@ ruleREALLiteral returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleTok leaveRule(); }: ( - ( - kw='-' - { - $current.merge(kw); - newLeafNode(kw, grammarAccess.getREALLiteralAccess().getHyphenMinusKeyword_0()); - } - )? - this_INT_1=RULE_INT - { - $current.merge(this_INT_1); - } - { - newLeafNode(this_INT_1, grammarAccess.getREALLiteralAccess().getINTTerminalRuleCall_1()); - } - kw='.' - { - $current.merge(kw); - newLeafNode(kw, grammarAccess.getREALLiteralAccess().getFullStopKeyword_2()); - } - this_INT_3=RULE_INT { - $current.merge(this_INT_3); + newCompositeNode(grammarAccess.getAssertionOrDefinitionAccess().getExpressionParserRuleCall_0()); } + this_Expression_0=ruleExpression { - newLeafNode(this_INT_3, grammarAccess.getREALLiteralAccess().getINTTerminalRuleCall_3()); + $current = $this_Expression_0.current; + afterParserOrEnumRuleCall(); } + ( + ( + ( + { + $current = forceCreateModelElementAndSet( + grammarAccess.getAssertionOrDefinitionAccess().getAssertionBodyAction_1_0_0(), + $current); + } + ) + ( + otherlv_2=':' + { + newLeafNode(otherlv_2, grammarAccess.getAssertionOrDefinitionAccess().getColonKeyword_1_0_1_0()); + } + ( + ( + { + newCompositeNode(grammarAccess.getAssertionOrDefinitionAccess().getRangeExpressionParserRuleCall_1_0_1_1_0()); + } + lv_range_3_0=ruleExpression + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getAssertionOrDefinitionRule()); + } + set( + $current, + "range", + lv_range_3_0, + "org.eclipse.viatra.solver.language.SolverLanguage.Expression"); + afterParserOrEnumRuleCall(); + } + ) + ) + )? + ) + | + ( + ( + { + $current = forceCreateModelElementAndSet( + grammarAccess.getAssertionOrDefinitionAccess().getPredicateDefinitionHeadAction_1_1_0(), + $current); + } + ) + otherlv_5=':-' + { + newLeafNode(otherlv_5, grammarAccess.getAssertionOrDefinitionAccess().getColonHyphenMinusKeyword_1_1_1()); + } + ( + ( + { + newCompositeNode(grammarAccess.getAssertionOrDefinitionAccess().getBodyExpressionParserRuleCall_1_1_2_0()); + } + lv_body_6_0=ruleExpression + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getAssertionOrDefinitionRule()); + } + set( + $current, + "body", + lv_body_6_0, + "org.eclipse.viatra.solver.language.SolverLanguage.Expression"); + afterParserOrEnumRuleCall(); + } + ) + ) + ) + | + ( + ( + { + $current = forceCreateModelElementAndSet( + grammarAccess.getAssertionOrDefinitionAccess().getMetricDefinitionHeadAction_1_2_0(), + $current); + } + ) + otherlv_8='=' + { + newLeafNode(otherlv_8, grammarAccess.getAssertionOrDefinitionAccess().getEqualsSignKeyword_1_2_1()); + } + ( + ( + { + newCompositeNode(grammarAccess.getAssertionOrDefinitionAccess().getBodyExpressionParserRuleCall_1_2_2_0()); + } + lv_body_9_0=ruleExpression + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getAssertionOrDefinitionRule()); + } + set( + $current, + "body", + lv_body_9_0, + "org.eclipse.viatra.solver.language.SolverLanguage.Expression"); + afterParserOrEnumRuleCall(); + } + ) + ) + ) + ) ) ; -// Entry rule entryRuleINTLiteral -entryRuleINTLiteral returns [String current=null]: - { newCompositeNode(grammarAccess.getINTLiteralRule()); } - iv_ruleINTLiteral=ruleINTLiteral - { $current=$iv_ruleINTLiteral.current.getText(); } +// Entry rule entryRulePredicateDefinition +entryRulePredicateDefinition returns [EObject current=null]: + { newCompositeNode(grammarAccess.getPredicateDefinitionRule()); } + iv_rulePredicateDefinition=rulePredicateDefinition + { $current=$iv_rulePredicateDefinition.current; } EOF; -// Rule INTLiteral -ruleINTLiteral returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] +// Rule PredicateDefinition +rulePredicateDefinition returns [EObject current=null] @init { enterRule(); } @@ -194,31 +357,122 @@ ruleINTLiteral returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToke }: ( ( - kw='-' - { - $current.merge(kw); - newLeafNode(kw, grammarAccess.getINTLiteralAccess().getHyphenMinusKeyword_0()); - } - )? - this_INT_1=RULE_INT - { - $current.merge(this_INT_1); - } + ( + ( + ( + lv_functional_0_0='functional' + { + newLeafNode(lv_functional_0_0, grammarAccess.getPredicateDefinitionAccess().getFunctionalFunctionalKeyword_0_0_0_0()); + } + { + if ($current==null) { + $current = createModelElement(grammarAccess.getPredicateDefinitionRule()); + } + setWithLastConsumed($current, "functional", true, "functional"); + } + ) + ) + ( + ( + lv_error_1_0='error' + { + newLeafNode(lv_error_1_0, grammarAccess.getPredicateDefinitionAccess().getErrorErrorKeyword_0_0_1_0()); + } + { + if ($current==null) { + $current = createModelElement(grammarAccess.getPredicateDefinitionRule()); + } + setWithLastConsumed($current, "error", true, "error"); + } + ) + )? + ) + | + ( + ( + ( + lv_error_2_0='error' + { + newLeafNode(lv_error_2_0, grammarAccess.getPredicateDefinitionAccess().getErrorErrorKeyword_0_1_0_0()); + } + { + if ($current==null) { + $current = createModelElement(grammarAccess.getPredicateDefinitionRule()); + } + setWithLastConsumed($current, "error", true, "error"); + } + ) + ) + ( + ( + lv_functional_3_0='functional' + { + newLeafNode(lv_functional_3_0, grammarAccess.getPredicateDefinitionAccess().getFunctionalFunctionalKeyword_0_1_1_0()); + } + { + if ($current==null) { + $current = createModelElement(grammarAccess.getPredicateDefinitionRule()); + } + setWithLastConsumed($current, "functional", true, "functional"); + } + ) + )? + ) + ) + ( + ( + { + newCompositeNode(grammarAccess.getPredicateDefinitionAccess().getHeadCallParserRuleCall_1_0()); + } + lv_head_4_0=ruleCall + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getPredicateDefinitionRule()); + } + set( + $current, + "head", + lv_head_4_0, + "org.eclipse.viatra.solver.language.SolverLanguage.Call"); + afterParserOrEnumRuleCall(); + } + ) + ) + otherlv_5=':-' { - newLeafNode(this_INT_1, grammarAccess.getINTLiteralAccess().getINTTerminalRuleCall_1()); + newLeafNode(otherlv_5, grammarAccess.getPredicateDefinitionAccess().getColonHyphenMinusKeyword_2()); } + ( + ( + { + newCompositeNode(grammarAccess.getPredicateDefinitionAccess().getBodyExpressionParserRuleCall_3_0()); + } + lv_body_6_0=ruleExpression + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getPredicateDefinitionRule()); + } + set( + $current, + "body", + lv_body_6_0, + "org.eclipse.viatra.solver.language.SolverLanguage.Expression"); + afterParserOrEnumRuleCall(); + } + ) + ) ) ; -// Entry rule entryRuleBooleanValue -entryRuleBooleanValue returns [EObject current=null]: - { newCompositeNode(grammarAccess.getBooleanValueRule()); } - iv_ruleBooleanValue=ruleBooleanValue - { $current=$iv_ruleBooleanValue.current; } +// Entry rule entryRuleUnnamedErrorPrediateDefinition +entryRuleUnnamedErrorPrediateDefinition returns [EObject current=null]: + { newCompositeNode(grammarAccess.getUnnamedErrorPrediateDefinitionRule()); } + iv_ruleUnnamedErrorPrediateDefinition=ruleUnnamedErrorPrediateDefinition + { $current=$iv_ruleUnnamedErrorPrediateDefinition.current; } EOF; -// Rule BooleanValue -ruleBooleanValue returns [EObject current=null] +// Rule UnnamedErrorPrediateDefinition +ruleUnnamedErrorPrediateDefinition returns [EObject current=null] @init { enterRule(); } @@ -226,45 +480,64 @@ ruleBooleanValue returns [EObject current=null] leaveRule(); }: ( + otherlv_0='error' + { + newLeafNode(otherlv_0, grammarAccess.getUnnamedErrorPrediateDefinitionAccess().getErrorKeyword_0()); + } ( ( { - $current = forceCreateModelElement( - grammarAccess.getBooleanValueAccess().getBooleanTrueAction_0_0(), - $current); + newCompositeNode(grammarAccess.getUnnamedErrorPrediateDefinitionAccess().getArgumentListArgumentListParserRuleCall_1_0()); + } + lv_argumentList_1_0=ruleArgumentList + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getUnnamedErrorPrediateDefinitionRule()); + } + set( + $current, + "argumentList", + lv_argumentList_1_0, + "org.eclipse.viatra.solver.language.SolverLanguage.ArgumentList"); + afterParserOrEnumRuleCall(); } ) - otherlv_1='true' - { - newLeafNode(otherlv_1, grammarAccess.getBooleanValueAccess().getTrueKeyword_0_1()); - } ) - | + otherlv_2=':-' + { + newLeafNode(otherlv_2, grammarAccess.getUnnamedErrorPrediateDefinitionAccess().getColonHyphenMinusKeyword_2()); + } ( - otherlv_2='false' - { - newLeafNode(otherlv_2, grammarAccess.getBooleanValueAccess().getFalseKeyword_1_0()); - } ( { - $current = forceCreateModelElement( - grammarAccess.getBooleanValueAccess().getBooleanFalseAction_1_1(), - $current); + newCompositeNode(grammarAccess.getUnnamedErrorPrediateDefinitionAccess().getBodyExpressionParserRuleCall_3_0()); + } + lv_body_3_0=ruleExpression + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getUnnamedErrorPrediateDefinitionRule()); + } + set( + $current, + "body", + lv_body_3_0, + "org.eclipse.viatra.solver.language.SolverLanguage.Expression"); + afterParserOrEnumRuleCall(); } ) ) ) ; -// Entry rule entryRuleTruthValue -entryRuleTruthValue returns [EObject current=null]: - { newCompositeNode(grammarAccess.getTruthValueRule()); } - iv_ruleTruthValue=ruleTruthValue - { $current=$iv_ruleTruthValue.current; } +// Entry rule entryRuleDefaultDefinition +entryRuleDefaultDefinition returns [EObject current=null]: + { newCompositeNode(grammarAccess.getDefaultDefinitionRule()); } + iv_ruleDefaultDefinition=ruleDefaultDefinition + { $current=$iv_ruleDefaultDefinition.current; } EOF; -// Rule TruthValue -ruleTruthValue returns [EObject current=null] +// Rule DefaultDefinition +ruleDefaultDefinition returns [EObject current=null] @init { enterRule(); } @@ -272,73 +545,64 @@ ruleTruthValue returns [EObject current=null] leaveRule(); }: ( + otherlv_0='default' + { + newLeafNode(otherlv_0, grammarAccess.getDefaultDefinitionAccess().getDefaultKeyword_0()); + } ( ( { - $current = forceCreateModelElement( - grammarAccess.getTruthValueAccess().getTrueAction_0_0(), - $current); - } - ) - otherlv_1='true' - { - newLeafNode(otherlv_1, grammarAccess.getTruthValueAccess().getTrueKeyword_0_1()); - } - ) - | - ( - ( - { - $current = forceCreateModelElement( - grammarAccess.getTruthValueAccess().getFalseAction_1_0(), - $current); + newCompositeNode(grammarAccess.getDefaultDefinitionAccess().getHeadCallParserRuleCall_1_0()); } - ) - otherlv_3='false' - { - newLeafNode(otherlv_3, grammarAccess.getTruthValueAccess().getFalseKeyword_1_1()); - } - ) - | - ( - ( + lv_head_1_0=ruleCall { - $current = forceCreateModelElement( - grammarAccess.getTruthValueAccess().getUnknownAction_2_0(), - $current); + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getDefaultDefinitionRule()); + } + set( + $current, + "head", + lv_head_1_0, + "org.eclipse.viatra.solver.language.SolverLanguage.Call"); + afterParserOrEnumRuleCall(); } ) - otherlv_5='unknown' - { - newLeafNode(otherlv_5, grammarAccess.getTruthValueAccess().getUnknownKeyword_2_1()); - } ) - | + otherlv_2=':' + { + newLeafNode(otherlv_2, grammarAccess.getDefaultDefinitionAccess().getColonKeyword_2()); + } ( ( { - $current = forceCreateModelElement( - grammarAccess.getTruthValueAccess().getErrorAction_3_0(), - $current); + newCompositeNode(grammarAccess.getDefaultDefinitionAccess().getRangeExpressionParserRuleCall_3_0()); + } + lv_range_3_0=ruleExpression + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getDefaultDefinitionRule()); + } + set( + $current, + "range", + lv_range_3_0, + "org.eclipse.viatra.solver.language.SolverLanguage.Expression"); + afterParserOrEnumRuleCall(); } ) - otherlv_7='error' - { - newLeafNode(otherlv_7, grammarAccess.getTruthValueAccess().getErrorKeyword_3_1()); - } ) ) ; -// Entry rule entryRuleInterpretation -entryRuleInterpretation returns [EObject current=null]: - { newCompositeNode(grammarAccess.getInterpretationRule()); } - iv_ruleInterpretation=ruleInterpretation - { $current=$iv_ruleInterpretation.current; } +// Entry rule entryRuleExternPredicateDefinition +entryRuleExternPredicateDefinition returns [EObject current=null]: + { newCompositeNode(grammarAccess.getExternPredicateDefinitionRule()); } + iv_ruleExternPredicateDefinition=ruleExternPredicateDefinition + { $current=$iv_ruleExternPredicateDefinition.current; } EOF; -// Rule Interpretation -ruleInterpretation returns [EObject current=null] +// Rule ExternPredicateDefinition +ruleExternPredicateDefinition returns [EObject current=null] @init { enterRule(); } @@ -346,44 +610,45 @@ ruleInterpretation returns [EObject current=null] leaveRule(); }: ( + otherlv_0='extern' { - newCompositeNode(grammarAccess.getInterpretationAccess().getBasicInterpretationParserRuleCall_0()); - } - this_BasicInterpretation_0=ruleBasicInterpretation - { - $current = $this_BasicInterpretation_0.current; - afterParserOrEnumRuleCall(); - } - | - { - newCompositeNode(grammarAccess.getInterpretationAccess().getDefaultInterpretationParserRuleCall_1()); - } - this_DefaultInterpretation_1=ruleDefaultInterpretation - { - $current = $this_DefaultInterpretation_1.current; - afterParserOrEnumRuleCall(); - } - | - { - newCompositeNode(grammarAccess.getInterpretationAccess().getCDInterpretationParserRuleCall_2()); + newLeafNode(otherlv_0, grammarAccess.getExternPredicateDefinitionAccess().getExternKeyword_0()); } - this_CDInterpretation_2=ruleCDInterpretation + ( + ( + { + newCompositeNode(grammarAccess.getExternPredicateDefinitionAccess().getHeadCallParserRuleCall_1_0()); + } + lv_head_1_0=ruleCall + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getExternPredicateDefinitionRule()); + } + set( + $current, + "head", + lv_head_1_0, + "org.eclipse.viatra.solver.language.SolverLanguage.Call"); + afterParserOrEnumRuleCall(); + } + ) + ) + otherlv_2='.' { - $current = $this_CDInterpretation_2.current; - afterParserOrEnumRuleCall(); + newLeafNode(otherlv_2, grammarAccess.getExternPredicateDefinitionAccess().getFullStopKeyword_2()); } ) ; -// Entry rule entryRuleBasicInterpretation -entryRuleBasicInterpretation returns [EObject current=null]: - { newCompositeNode(grammarAccess.getBasicInterpretationRule()); } - iv_ruleBasicInterpretation=ruleBasicInterpretation - { $current=$iv_ruleBasicInterpretation.current; } +// Entry rule entryRuleMetricDefinition +entryRuleMetricDefinition returns [EObject current=null]: + { newCompositeNode(grammarAccess.getMetricDefinitionRule()); } + iv_ruleMetricDefinition=ruleMetricDefinition + { $current=$iv_ruleMetricDefinition.current; } EOF; -// Rule BasicInterpretation -ruleBasicInterpretation returns [EObject current=null] +// Rule MetricDefinition +ruleMetricDefinition returns [EObject current=null] @init { enterRule(); } @@ -394,97 +659,60 @@ ruleBasicInterpretation returns [EObject current=null] ( ( { - newCompositeNode(grammarAccess.getBasicInterpretationAccess().getSymbolSymbolParserRuleCall_0_0()); + newCompositeNode(grammarAccess.getMetricDefinitionAccess().getTypeMetricTypeEnumRuleCall_0_0()); } - lv_symbol_0_0=ruleSymbol + lv_type_0_0=ruleMetricType { if ($current==null) { - $current = createModelElementForParent(grammarAccess.getBasicInterpretationRule()); + $current = createModelElementForParent(grammarAccess.getMetricDefinitionRule()); } set( $current, - "symbol", - lv_symbol_0_0, - "org.eclipse.viatra.solver.language.SolverLanguage.Symbol"); + "type", + lv_type_0_0, + "org.eclipse.viatra.solver.language.SolverLanguage.MetricType"); afterParserOrEnumRuleCall(); } ) ) ( - otherlv_1='(' - { - newLeafNode(otherlv_1, grammarAccess.getBasicInterpretationAccess().getLeftParenthesisKeyword_1_0()); - } ( - ( - ( - { - newCompositeNode(grammarAccess.getBasicInterpretationAccess().getObjectsComplexObjectParserRuleCall_1_1_0_0()); - } - lv_objects_2_0=ruleComplexObject - { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getBasicInterpretationRule()); - } - add( - $current, - "objects", - lv_objects_2_0, - "org.eclipse.viatra.solver.language.SolverLanguage.ComplexObject"); - afterParserOrEnumRuleCall(); - } - ) - ) - ( - otherlv_3=',' - { - newLeafNode(otherlv_3, grammarAccess.getBasicInterpretationAccess().getCommaKeyword_1_1_1_0()); + { + newCompositeNode(grammarAccess.getMetricDefinitionAccess().getHeadExpressionParserRuleCall_1_0()); + } + lv_head_1_0=ruleExpression + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getMetricDefinitionRule()); } - ( - ( - { - newCompositeNode(grammarAccess.getBasicInterpretationAccess().getObjectsComplexObjectParserRuleCall_1_1_1_1_0()); - } - lv_objects_4_0=ruleComplexObject - { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getBasicInterpretationRule()); - } - add( - $current, - "objects", - lv_objects_4_0, - "org.eclipse.viatra.solver.language.SolverLanguage.ComplexObject"); - afterParserOrEnumRuleCall(); - } - ) - ) - )* - )? - otherlv_5=')' - { - newLeafNode(otherlv_5, grammarAccess.getBasicInterpretationAccess().getRightParenthesisKeyword_1_2()); - } - )? - otherlv_6=':' + set( + $current, + "head", + lv_head_1_0, + "org.eclipse.viatra.solver.language.SolverLanguage.Expression"); + afterParserOrEnumRuleCall(); + } + ) + ) + otherlv_2='=' { - newLeafNode(otherlv_6, grammarAccess.getBasicInterpretationAccess().getColonKeyword_2()); + newLeafNode(otherlv_2, grammarAccess.getMetricDefinitionAccess().getEqualsSignKeyword_2()); } ( ( { - newCompositeNode(grammarAccess.getBasicInterpretationAccess().getValueTruthValueParserRuleCall_3_0()); + newCompositeNode(grammarAccess.getMetricDefinitionAccess().getBodyExpressionParserRuleCall_3_0()); } - lv_value_7_0=ruleTruthValue + lv_body_3_0=ruleExpression { if ($current==null) { - $current = createModelElementForParent(grammarAccess.getBasicInterpretationRule()); + $current = createModelElementForParent(grammarAccess.getMetricDefinitionRule()); } set( $current, - "value", - lv_value_7_0, - "org.eclipse.viatra.solver.language.SolverLanguage.TruthValue"); + "body", + lv_body_3_0, + "org.eclipse.viatra.solver.language.SolverLanguage.Expression"); afterParserOrEnumRuleCall(); } ) @@ -492,15 +720,15 @@ ruleBasicInterpretation returns [EObject current=null] ) ; -// Entry rule entryRuleSymbol -entryRuleSymbol returns [EObject current=null]: - { newCompositeNode(grammarAccess.getSymbolRule()); } - iv_ruleSymbol=ruleSymbol - { $current=$iv_ruleSymbol.current; } +// Entry rule entryRuleExternMetricDefinition +entryRuleExternMetricDefinition returns [EObject current=null]: + { newCompositeNode(grammarAccess.getExternMetricDefinitionRule()); } + iv_ruleExternMetricDefinition=ruleExternMetricDefinition + { $current=$iv_ruleExternMetricDefinition.current; } EOF; -// Rule Symbol -ruleSymbol returns [EObject current=null] +// Rule ExternMetricDefinition +ruleExternMetricDefinition returns [EObject current=null] @init { enterRule(); } @@ -508,79 +736,60 @@ ruleSymbol returns [EObject current=null] leaveRule(); }: ( + otherlv_0='extern' { - newCompositeNode(grammarAccess.getSymbolAccess().getModelSymbolParserRuleCall_0()); - } - this_ModelSymbol_0=ruleModelSymbol - { - $current = $this_ModelSymbol_0.current; - afterParserOrEnumRuleCall(); - } - | - { - newCompositeNode(grammarAccess.getSymbolAccess().getPartialitySymbolParserRuleCall_1()); - } - this_PartialitySymbol_1=rulePartialitySymbol - { - $current = $this_PartialitySymbol_1.current; - afterParserOrEnumRuleCall(); - } - | - { - newCompositeNode(grammarAccess.getSymbolAccess().getDataSymbolParserRuleCall_2()); + newLeafNode(otherlv_0, grammarAccess.getExternMetricDefinitionAccess().getExternKeyword_0()); } - this_DataSymbol_2=ruleDataSymbol - { - $current = $this_DataSymbol_2.current; - afterParserOrEnumRuleCall(); - } - ) -; - -// Entry rule entryRuleModelSymbol -entryRuleModelSymbol returns [EObject current=null]: - { newCompositeNode(grammarAccess.getModelSymbolRule()); } - iv_ruleModelSymbol=ruleModelSymbol - { $current=$iv_ruleModelSymbol.current; } - EOF; - -// Rule ModelSymbol -ruleModelSymbol returns [EObject current=null] -@init { - enterRule(); -} -@after { - leaveRule(); -}: - ( ( - lv_name_0_0=RULE_ID - { - newLeafNode(lv_name_0_0, grammarAccess.getModelSymbolAccess().getNameIDTerminalRuleCall_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getModelSymbolRule()); + ( + { + newCompositeNode(grammarAccess.getExternMetricDefinitionAccess().getTypeMetricTypeEnumRuleCall_1_0()); } - setWithLastConsumed( - $current, - "name", - lv_name_0_0, - "org.eclipse.xtext.common.Terminals.ID"); - } + lv_type_1_0=ruleMetricType + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getExternMetricDefinitionRule()); + } + set( + $current, + "type", + lv_type_1_0, + "org.eclipse.viatra.solver.language.SolverLanguage.MetricType"); + afterParserOrEnumRuleCall(); + } + ) + ) + ( + ( + { + newCompositeNode(grammarAccess.getExternMetricDefinitionAccess().getHeadCallParserRuleCall_2_0()); + } + lv_head_2_0=ruleCall + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getExternMetricDefinitionRule()); + } + set( + $current, + "head", + lv_head_2_0, + "org.eclipse.viatra.solver.language.SolverLanguage.Call"); + afterParserOrEnumRuleCall(); + } + ) ) ) ; -// Entry rule entryRulePartialitySymbol -entryRulePartialitySymbol returns [EObject current=null]: - { newCompositeNode(grammarAccess.getPartialitySymbolRule()); } - iv_rulePartialitySymbol=rulePartialitySymbol - { $current=$iv_rulePartialitySymbol.current; } +// Entry rule entryRuleExpression +entryRuleExpression returns [EObject current=null]: + { newCompositeNode(grammarAccess.getExpressionRule()); } + iv_ruleExpression=ruleExpression + { $current=$iv_ruleExpression.current; } EOF; -// Rule PartialitySymbol -rulePartialitySymbol returns [EObject current=null] +// Rule Expression +ruleExpression returns [EObject current=null] @init { enterRule(); } @@ -589,34 +798,34 @@ rulePartialitySymbol returns [EObject current=null] }: ( { - newCompositeNode(grammarAccess.getPartialitySymbolAccess().getExistSymbolParserRuleCall_0()); + newCompositeNode(grammarAccess.getExpressionAccess().getIfElseParserRuleCall_0()); } - this_ExistSymbol_0=ruleExistSymbol + this_IfElse_0=ruleIfElse { - $current = $this_ExistSymbol_0.current; + $current = $this_IfElse_0.current; afterParserOrEnumRuleCall(); } | { - newCompositeNode(grammarAccess.getPartialitySymbolAccess().getEqualsSymbolParserRuleCall_1()); + newCompositeNode(grammarAccess.getExpressionAccess().getDisjunctiveExpressionParserRuleCall_1()); } - this_EqualsSymbol_1=ruleEqualsSymbol + this_DisjunctiveExpression_1=ruleDisjunctiveExpression { - $current = $this_EqualsSymbol_1.current; + $current = $this_DisjunctiveExpression_1.current; afterParserOrEnumRuleCall(); } ) ; -// Entry rule entryRuleExistSymbol -entryRuleExistSymbol returns [EObject current=null]: - { newCompositeNode(grammarAccess.getExistSymbolRule()); } - iv_ruleExistSymbol=ruleExistSymbol - { $current=$iv_ruleExistSymbol.current; } +// Entry rule entryRuleIfElse +entryRuleIfElse returns [EObject current=null]: + { newCompositeNode(grammarAccess.getIfElseRule()); } + iv_ruleIfElse=ruleIfElse + { $current=$iv_ruleIfElse.current; } EOF; -// Rule ExistSymbol -ruleExistSymbol returns [EObject current=null] +// Rule IfElse +ruleIfElse returns [EObject current=null] @init { enterRule(); } @@ -624,59 +833,87 @@ ruleExistSymbol returns [EObject current=null] leaveRule(); }: ( - otherlv_0='exists' + otherlv_0='if' { - newLeafNode(otherlv_0, grammarAccess.getExistSymbolAccess().getExistsKeyword_0()); + newLeafNode(otherlv_0, grammarAccess.getIfElseAccess().getIfKeyword_0()); } ( - { - $current = forceCreateModelElement( - grammarAccess.getExistSymbolAccess().getExistSymbolAction_1(), - $current); - } + ( + { + newCompositeNode(grammarAccess.getIfElseAccess().getConditionExpressionParserRuleCall_1_0()); + } + lv_condition_1_0=ruleExpression + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getIfElseRule()); + } + set( + $current, + "condition", + lv_condition_1_0, + "org.eclipse.viatra.solver.language.SolverLanguage.Expression"); + afterParserOrEnumRuleCall(); + } + ) ) - ) -; - -// Entry rule entryRuleEqualsSymbol -entryRuleEqualsSymbol returns [EObject current=null]: - { newCompositeNode(grammarAccess.getEqualsSymbolRule()); } - iv_ruleEqualsSymbol=ruleEqualsSymbol - { $current=$iv_ruleEqualsSymbol.current; } - EOF; - -// Rule EqualsSymbol -ruleEqualsSymbol returns [EObject current=null] -@init { - enterRule(); -} -@after { - leaveRule(); -}: - ( - otherlv_0='equals' + otherlv_2='then' { - newLeafNode(otherlv_0, grammarAccess.getEqualsSymbolAccess().getEqualsKeyword_0()); + newLeafNode(otherlv_2, grammarAccess.getIfElseAccess().getThenKeyword_2()); } ( - { - $current = forceCreateModelElement( - grammarAccess.getEqualsSymbolAccess().getEqualsSymbolAction_1(), - $current); - } + ( + { + newCompositeNode(grammarAccess.getIfElseAccess().getThenExpressionParserRuleCall_3_0()); + } + lv_then_3_0=ruleExpression + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getIfElseRule()); + } + set( + $current, + "then", + lv_then_3_0, + "org.eclipse.viatra.solver.language.SolverLanguage.Expression"); + afterParserOrEnumRuleCall(); + } + ) + ) + otherlv_4='else' + { + newLeafNode(otherlv_4, grammarAccess.getIfElseAccess().getElseKeyword_4()); + } + ( + ( + { + newCompositeNode(grammarAccess.getIfElseAccess().getElseExpressionParserRuleCall_5_0()); + } + lv_else_5_0=ruleExpression + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getIfElseRule()); + } + set( + $current, + "else", + lv_else_5_0, + "org.eclipse.viatra.solver.language.SolverLanguage.Expression"); + afterParserOrEnumRuleCall(); + } + ) ) ) ; -// Entry rule entryRuleDataSymbol -entryRuleDataSymbol returns [EObject current=null]: - { newCompositeNode(grammarAccess.getDataSymbolRule()); } - iv_ruleDataSymbol=ruleDataSymbol - { $current=$iv_ruleDataSymbol.current; } +// Entry rule entryRuleDisjunctiveExpression +entryRuleDisjunctiveExpression returns [EObject current=null]: + { newCompositeNode(grammarAccess.getDisjunctiveExpressionRule()); } + iv_ruleDisjunctiveExpression=ruleDisjunctiveExpression + { $current=$iv_ruleDisjunctiveExpression.current; } EOF; -// Rule DataSymbol -ruleDataSymbol returns [EObject current=null] +// Rule DisjunctiveExpression +ruleDisjunctiveExpression returns [EObject current=null] @init { enterRule(); } @@ -685,82 +922,126 @@ ruleDataSymbol returns [EObject current=null] }: ( { - newCompositeNode(grammarAccess.getDataSymbolAccess().getBooleanSymbolParserRuleCall_0()); - } - this_BooleanSymbol_0=ruleBooleanSymbol - { - $current = $this_BooleanSymbol_0.current; - afterParserOrEnumRuleCall(); - } - | - { - newCompositeNode(grammarAccess.getDataSymbolAccess().getIntegerSymbolParserRuleCall_1()); - } - this_IntegerSymbol_1=ruleIntegerSymbol - { - $current = $this_IntegerSymbol_1.current; - afterParserOrEnumRuleCall(); - } - | - { - newCompositeNode(grammarAccess.getDataSymbolAccess().getRealSymbolParserRuleCall_2()); - } - this_RealSymbol_2=ruleRealSymbol - { - $current = $this_RealSymbol_2.current; - afterParserOrEnumRuleCall(); - } - | - { - newCompositeNode(grammarAccess.getDataSymbolAccess().getStringSymbolParserRuleCall_3()); + newCompositeNode(grammarAccess.getDisjunctiveExpressionAccess().getConjunctiveExpressionParserRuleCall_0()); } - this_StringSymbol_3=ruleStringSymbol + this_ConjunctiveExpression_0=ruleConjunctiveExpression { - $current = $this_StringSymbol_3.current; + $current = $this_ConjunctiveExpression_0.current; afterParserOrEnumRuleCall(); } - ) -; - -// Entry rule entryRuleBooleanSymbol -entryRuleBooleanSymbol returns [EObject current=null]: - { newCompositeNode(grammarAccess.getBooleanSymbolRule()); } - iv_ruleBooleanSymbol=ruleBooleanSymbol - { $current=$iv_ruleBooleanSymbol.current; } - EOF; - -// Rule BooleanSymbol -ruleBooleanSymbol returns [EObject current=null] -@init { - enterRule(); -} -@after { - leaveRule(); -}: - ( - otherlv_0='bool' - { - newLeafNode(otherlv_0, grammarAccess.getBooleanSymbolAccess().getBoolKeyword_0()); - } ( - { - $current = forceCreateModelElement( - grammarAccess.getBooleanSymbolAccess().getBooleanSymbolAction_1(), - $current); - } - ) + ( + ( + { + $current = forceCreateModelElementAndAdd( + grammarAccess.getDisjunctiveExpressionAccess().getDisjunctionChildrenAction_1_0_0(), + $current); + } + ) + ( + otherlv_2=';' + { + newLeafNode(otherlv_2, grammarAccess.getDisjunctiveExpressionAccess().getSemicolonKeyword_1_0_1_0()); + } + ( + ( + { + newCompositeNode(grammarAccess.getDisjunctiveExpressionAccess().getChildrenConjunctiveExpressionParserRuleCall_1_0_1_1_0()); + } + lv_children_3_0=ruleConjunctiveExpression + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getDisjunctiveExpressionRule()); + } + add( + $current, + "children", + lv_children_3_0, + "org.eclipse.viatra.solver.language.SolverLanguage.ConjunctiveExpression"); + afterParserOrEnumRuleCall(); + } + ) + ) + )+ + ) + | + ( + ( + { + $current = forceCreateModelElementAndSet( + grammarAccess.getDisjunctiveExpressionAccess().getCaseConditionAction_1_1_0(), + $current); + } + ) + otherlv_5='->' + { + newLeafNode(otherlv_5, grammarAccess.getDisjunctiveExpressionAccess().getHyphenMinusGreaterThanSignKeyword_1_1_1()); + } + ( + ( + { + newCompositeNode(grammarAccess.getDisjunctiveExpressionAccess().getBodyConjunctiveExpressionParserRuleCall_1_1_2_0()); + } + lv_body_6_0=ruleConjunctiveExpression + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getDisjunctiveExpressionRule()); + } + set( + $current, + "body", + lv_body_6_0, + "org.eclipse.viatra.solver.language.SolverLanguage.ConjunctiveExpression"); + afterParserOrEnumRuleCall(); + } + ) + ) + ( + { + $current = forceCreateModelElementAndAdd( + grammarAccess.getDisjunctiveExpressionAccess().getSwitchCasesAction_1_1_3(), + $current); + } + ) + ( + otherlv_8=';' + { + newLeafNode(otherlv_8, grammarAccess.getDisjunctiveExpressionAccess().getSemicolonKeyword_1_1_4_0()); + } + ( + ( + { + newCompositeNode(grammarAccess.getDisjunctiveExpressionAccess().getCasesCaseParserRuleCall_1_1_4_1_0()); + } + lv_cases_9_0=ruleCase + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getDisjunctiveExpressionRule()); + } + add( + $current, + "cases", + lv_cases_9_0, + "org.eclipse.viatra.solver.language.SolverLanguage.Case"); + afterParserOrEnumRuleCall(); + } + ) + ) + )* + ) + )? ) ; -// Entry rule entryRuleIntegerSymbol -entryRuleIntegerSymbol returns [EObject current=null]: - { newCompositeNode(grammarAccess.getIntegerSymbolRule()); } - iv_ruleIntegerSymbol=ruleIntegerSymbol - { $current=$iv_ruleIntegerSymbol.current; } +// Entry rule entryRuleCase +entryRuleCase returns [EObject current=null]: + { newCompositeNode(grammarAccess.getCaseRule()); } + iv_ruleCase=ruleCase + { $current=$iv_ruleCase.current; } EOF; -// Rule IntegerSymbol -ruleIntegerSymbol returns [EObject current=null] +// Rule Case +ruleCase returns [EObject current=null] @init { enterRule(); } @@ -768,59 +1049,60 @@ ruleIntegerSymbol returns [EObject current=null] leaveRule(); }: ( - otherlv_0='int' - { - newLeafNode(otherlv_0, grammarAccess.getIntegerSymbolAccess().getIntKeyword_0()); - } ( - { - $current = forceCreateModelElement( - grammarAccess.getIntegerSymbolAccess().getIntegerSymbolAction_1(), - $current); - } + ( + { + newCompositeNode(grammarAccess.getCaseAccess().getConditionConjunctiveExpressionParserRuleCall_0_0()); + } + lv_condition_0_0=ruleConjunctiveExpression + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getCaseRule()); + } + set( + $current, + "condition", + lv_condition_0_0, + "org.eclipse.viatra.solver.language.SolverLanguage.ConjunctiveExpression"); + afterParserOrEnumRuleCall(); + } + ) ) - ) -; - -// Entry rule entryRuleRealSymbol -entryRuleRealSymbol returns [EObject current=null]: - { newCompositeNode(grammarAccess.getRealSymbolRule()); } - iv_ruleRealSymbol=ruleRealSymbol - { $current=$iv_ruleRealSymbol.current; } - EOF; - -// Rule RealSymbol -ruleRealSymbol returns [EObject current=null] -@init { - enterRule(); -} -@after { - leaveRule(); -}: - ( - otherlv_0='real' + otherlv_1='->' { - newLeafNode(otherlv_0, grammarAccess.getRealSymbolAccess().getRealKeyword_0()); + newLeafNode(otherlv_1, grammarAccess.getCaseAccess().getHyphenMinusGreaterThanSignKeyword_1()); } ( - { - $current = forceCreateModelElement( - grammarAccess.getRealSymbolAccess().getRealSymbolAction_1(), - $current); - } + ( + { + newCompositeNode(grammarAccess.getCaseAccess().getBodyConjunctiveExpressionParserRuleCall_2_0()); + } + lv_body_2_0=ruleConjunctiveExpression + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getCaseRule()); + } + set( + $current, + "body", + lv_body_2_0, + "org.eclipse.viatra.solver.language.SolverLanguage.ConjunctiveExpression"); + afterParserOrEnumRuleCall(); + } + ) ) ) ; -// Entry rule entryRuleStringSymbol -entryRuleStringSymbol returns [EObject current=null]: - { newCompositeNode(grammarAccess.getStringSymbolRule()); } - iv_ruleStringSymbol=ruleStringSymbol - { $current=$iv_ruleStringSymbol.current; } +// Entry rule entryRuleConjunctiveExpression +entryRuleConjunctiveExpression returns [EObject current=null]: + { newCompositeNode(grammarAccess.getConjunctiveExpressionRule()); } + iv_ruleConjunctiveExpression=ruleConjunctiveExpression + { $current=$iv_ruleConjunctiveExpression.current; } EOF; -// Rule StringSymbol -ruleStringSymbol returns [EObject current=null] +// Rule ConjunctiveExpression +ruleConjunctiveExpression returns [EObject current=null] @init { enterRule(); } @@ -828,29 +1110,60 @@ ruleStringSymbol returns [EObject current=null] leaveRule(); }: ( - otherlv_0='string' { - newLeafNode(otherlv_0, grammarAccess.getStringSymbolAccess().getStringKeyword_0()); + newCompositeNode(grammarAccess.getConjunctiveExpressionAccess().getComparisonExpressionParserRuleCall_0()); + } + this_ComparisonExpression_0=ruleComparisonExpression + { + $current = $this_ComparisonExpression_0.current; + afterParserOrEnumRuleCall(); } ( - { - $current = forceCreateModelElement( - grammarAccess.getStringSymbolAccess().getStringSymbolAction_1(), - $current); - } - ) + ( + { + $current = forceCreateModelElementAndAdd( + grammarAccess.getConjunctiveExpressionAccess().getConjunctionChildrenAction_1_0(), + $current); + } + ) + ( + otherlv_2=',' + { + newLeafNode(otherlv_2, grammarAccess.getConjunctiveExpressionAccess().getCommaKeyword_1_1_0()); + } + ( + ( + { + newCompositeNode(grammarAccess.getConjunctiveExpressionAccess().getChildrenComparisonExpressionParserRuleCall_1_1_1_0()); + } + lv_children_3_0=ruleComparisonExpression + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getConjunctiveExpressionRule()); + } + add( + $current, + "children", + lv_children_3_0, + "org.eclipse.viatra.solver.language.SolverLanguage.ComparisonExpression"); + afterParserOrEnumRuleCall(); + } + ) + ) + )+ + )? ) ; -// Entry rule entryRuleComplexObject -entryRuleComplexObject returns [EObject current=null]: - { newCompositeNode(grammarAccess.getComplexObjectRule()); } - iv_ruleComplexObject=ruleComplexObject - { $current=$iv_ruleComplexObject.current; } +// Entry rule entryRuleComparisonExpression +entryRuleComparisonExpression returns [EObject current=null]: + { newCompositeNode(grammarAccess.getComparisonExpressionRule()); } + iv_ruleComparisonExpression=ruleComparisonExpression + { $current=$iv_ruleComparisonExpression.current; } EOF; -// Rule ComplexObject -ruleComplexObject returns [EObject current=null] +// Rule ComparisonExpression +ruleComparisonExpression returns [EObject current=null] @init { enterRule(); } @@ -859,43 +1172,72 @@ ruleComplexObject returns [EObject current=null] }: ( { - newCompositeNode(grammarAccess.getComplexObjectAccess().getObjectParserRuleCall_0()); - } - this_Object_0=ruleObject - { - $current = $this_Object_0.current; - afterParserOrEnumRuleCall(); - } - | - { - newCompositeNode(grammarAccess.getComplexObjectAccess().getAllInstancesParserRuleCall_1()); - } - this_AllInstances_1=ruleAllInstances - { - $current = $this_AllInstances_1.current; - afterParserOrEnumRuleCall(); - } - | - { - newCompositeNode(grammarAccess.getComplexObjectAccess().getAllObjectsParserRuleCall_2()); + newCompositeNode(grammarAccess.getComparisonExpressionAccess().getAdditiveExpressionParserRuleCall_0()); } - this_AllObjects_2=ruleAllObjects + this_AdditiveExpression_0=ruleAdditiveExpression { - $current = $this_AllObjects_2.current; + $current = $this_AdditiveExpression_0.current; afterParserOrEnumRuleCall(); } + ( + ( + { + $current = forceCreateModelElementAndSet( + grammarAccess.getComparisonExpressionAccess().getComparisonLeftAction_1_0(), + $current); + } + ) + ( + ( + { + newCompositeNode(grammarAccess.getComparisonExpressionAccess().getOpComparisonOperatorEnumRuleCall_1_1_0()); + } + lv_op_2_0=ruleComparisonOperator + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getComparisonExpressionRule()); + } + set( + $current, + "op", + lv_op_2_0, + "org.eclipse.viatra.solver.language.SolverLanguage.ComparisonOperator"); + afterParserOrEnumRuleCall(); + } + ) + ) + ( + ( + { + newCompositeNode(grammarAccess.getComparisonExpressionAccess().getRightAdditiveExpressionParserRuleCall_1_2_0()); + } + lv_right_3_0=ruleAdditiveExpression + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getComparisonExpressionRule()); + } + set( + $current, + "right", + lv_right_3_0, + "org.eclipse.viatra.solver.language.SolverLanguage.AdditiveExpression"); + afterParserOrEnumRuleCall(); + } + ) + ) + )? ) ; -// Entry rule entryRuleObject -entryRuleObject returns [EObject current=null]: - { newCompositeNode(grammarAccess.getObjectRule()); } - iv_ruleObject=ruleObject - { $current=$iv_ruleObject.current; } +// Entry rule entryRuleAdditiveExpression +entryRuleAdditiveExpression returns [EObject current=null]: + { newCompositeNode(grammarAccess.getAdditiveExpressionRule()); } + iv_ruleAdditiveExpression=ruleAdditiveExpression + { $current=$iv_ruleAdditiveExpression.current; } EOF; -// Rule Object -ruleObject returns [EObject current=null] +// Rule AdditiveExpression +ruleAdditiveExpression returns [EObject current=null] @init { enterRule(); } @@ -904,43 +1246,72 @@ ruleObject returns [EObject current=null] }: ( { - newCompositeNode(grammarAccess.getObjectAccess().getNamedObjectParserRuleCall_0()); - } - this_NamedObject_0=ruleNamedObject - { - $current = $this_NamedObject_0.current; - afterParserOrEnumRuleCall(); - } - | - { - newCompositeNode(grammarAccess.getObjectAccess().getUnnamedObjectParserRuleCall_1()); - } - this_UnnamedObject_1=ruleUnnamedObject - { - $current = $this_UnnamedObject_1.current; - afterParserOrEnumRuleCall(); - } - | - { - newCompositeNode(grammarAccess.getObjectAccess().getDataObjectParserRuleCall_2()); + newCompositeNode(grammarAccess.getAdditiveExpressionAccess().getMultiplicativeExpressionParserRuleCall_0()); } - this_DataObject_2=ruleDataObject + this_MultiplicativeExpression_0=ruleMultiplicativeExpression { - $current = $this_DataObject_2.current; + $current = $this_MultiplicativeExpression_0.current; afterParserOrEnumRuleCall(); } + ( + ( + { + $current = forceCreateModelElementAndSet( + grammarAccess.getAdditiveExpressionAccess().getBinaryExpressionLeftAction_1_0(), + $current); + } + ) + ( + ( + { + newCompositeNode(grammarAccess.getAdditiveExpressionAccess().getOpAdditiveBinaryOperatorEnumRuleCall_1_1_0()); + } + lv_op_2_0=ruleAdditiveBinaryOperator + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getAdditiveExpressionRule()); + } + set( + $current, + "op", + lv_op_2_0, + "org.eclipse.viatra.solver.language.SolverLanguage.AdditiveBinaryOperator"); + afterParserOrEnumRuleCall(); + } + ) + ) + ( + ( + { + newCompositeNode(grammarAccess.getAdditiveExpressionAccess().getRightMultiplicativeExpressionParserRuleCall_1_2_0()); + } + lv_right_3_0=ruleMultiplicativeExpression + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getAdditiveExpressionRule()); + } + set( + $current, + "right", + lv_right_3_0, + "org.eclipse.viatra.solver.language.SolverLanguage.MultiplicativeExpression"); + afterParserOrEnumRuleCall(); + } + ) + ) + )* ) ; -// Entry rule entryRuleNamedObject -entryRuleNamedObject returns [EObject current=null]: - { newCompositeNode(grammarAccess.getNamedObjectRule()); } - iv_ruleNamedObject=ruleNamedObject - { $current=$iv_ruleNamedObject.current; } +// Entry rule entryRuleMultiplicativeExpression +entryRuleMultiplicativeExpression returns [EObject current=null]: + { newCompositeNode(grammarAccess.getMultiplicativeExpressionRule()); } + iv_ruleMultiplicativeExpression=ruleMultiplicativeExpression + { $current=$iv_ruleMultiplicativeExpression.current; } EOF; -// Rule NamedObject -ruleNamedObject returns [EObject current=null] +// Rule MultiplicativeExpression +ruleMultiplicativeExpression returns [EObject current=null] @init { enterRule(); } @@ -948,44 +1319,73 @@ ruleNamedObject returns [EObject current=null] leaveRule(); }: ( - otherlv_0='\'' { - newLeafNode(otherlv_0, grammarAccess.getNamedObjectAccess().getApostropheKeyword_0()); + newCompositeNode(grammarAccess.getMultiplicativeExpressionAccess().getExponentialExpressionParserRuleCall_0()); + } + this_ExponentialExpression_0=ruleExponentialExpression + { + $current = $this_ExponentialExpression_0.current; + afterParserOrEnumRuleCall(); } ( ( - lv_name_1_0=RULE_ID { - newLeafNode(lv_name_1_0, grammarAccess.getNamedObjectAccess().getNameIDTerminalRuleCall_1_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getNamedObjectRule()); - } - setWithLastConsumed( - $current, - "name", - lv_name_1_0, - "org.eclipse.xtext.common.Terminals.ID"); + $current = forceCreateModelElementAndSet( + grammarAccess.getMultiplicativeExpressionAccess().getBinaryExpressionLeftAction_1_0(), + $current); } ) - ) - otherlv_2='\'' - { - newLeafNode(otherlv_2, grammarAccess.getNamedObjectAccess().getApostropheKeyword_2()); - } + ( + ( + { + newCompositeNode(grammarAccess.getMultiplicativeExpressionAccess().getOpMultiplicativeBinaryOperatorEnumRuleCall_1_1_0()); + } + lv_op_2_0=ruleMultiplicativeBinaryOperator + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getMultiplicativeExpressionRule()); + } + set( + $current, + "op", + lv_op_2_0, + "org.eclipse.viatra.solver.language.SolverLanguage.MultiplicativeBinaryOperator"); + afterParserOrEnumRuleCall(); + } + ) + ) + ( + ( + { + newCompositeNode(grammarAccess.getMultiplicativeExpressionAccess().getRightExponentialExpressionParserRuleCall_1_2_0()); + } + lv_right_3_0=ruleExponentialExpression + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getMultiplicativeExpressionRule()); + } + set( + $current, + "right", + lv_right_3_0, + "org.eclipse.viatra.solver.language.SolverLanguage.ExponentialExpression"); + afterParserOrEnumRuleCall(); + } + ) + ) + )* ) ; -// Entry rule entryRuleUnnamedObject -entryRuleUnnamedObject returns [EObject current=null]: - { newCompositeNode(grammarAccess.getUnnamedObjectRule()); } - iv_ruleUnnamedObject=ruleUnnamedObject - { $current=$iv_ruleUnnamedObject.current; } +// Entry rule entryRuleExponentialExpression +entryRuleExponentialExpression returns [EObject current=null]: + { newCompositeNode(grammarAccess.getExponentialExpressionRule()); } + iv_ruleExponentialExpression=ruleExponentialExpression + { $current=$iv_ruleExponentialExpression.current; } EOF; -// Rule UnnamedObject -ruleUnnamedObject returns [EObject current=null] +// Rule ExponentialExpression +ruleExponentialExpression returns [EObject current=null] @init { enterRule(); } @@ -993,34 +1393,73 @@ ruleUnnamedObject returns [EObject current=null] leaveRule(); }: ( + { + newCompositeNode(grammarAccess.getExponentialExpressionAccess().getUnaryExpressionParserRuleCall_0()); + } + this_UnaryExpression_0=ruleUnaryExpression + { + $current = $this_UnaryExpression_0.current; + afterParserOrEnumRuleCall(); + } ( - lv_name_0_0=RULE_ID - { - newLeafNode(lv_name_0_0, grammarAccess.getUnnamedObjectAccess().getNameIDTerminalRuleCall_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getUnnamedObjectRule()); + ( + { + $current = forceCreateModelElementAndSet( + grammarAccess.getExponentialExpressionAccess().getBinaryExpressionLeftAction_1_0(), + $current); } - setWithLastConsumed( - $current, - "name", - lv_name_0_0, - "org.eclipse.xtext.common.Terminals.ID"); - } - ) + ) + ( + ( + { + newCompositeNode(grammarAccess.getExponentialExpressionAccess().getOpExponentialOpEnumRuleCall_1_1_0()); + } + lv_op_2_0=ruleExponentialOp + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getExponentialExpressionRule()); + } + set( + $current, + "op", + lv_op_2_0, + "org.eclipse.viatra.solver.language.SolverLanguage.ExponentialOp"); + afterParserOrEnumRuleCall(); + } + ) + ) + ( + ( + { + newCompositeNode(grammarAccess.getExponentialExpressionAccess().getRightExponentialExpressionParserRuleCall_1_2_0()); + } + lv_right_3_0=ruleExponentialExpression + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getExponentialExpressionRule()); + } + set( + $current, + "right", + lv_right_3_0, + "org.eclipse.viatra.solver.language.SolverLanguage.ExponentialExpression"); + afterParserOrEnumRuleCall(); + } + ) + ) + )? ) ; -// Entry rule entryRuleDataObject -entryRuleDataObject returns [EObject current=null]: - { newCompositeNode(grammarAccess.getDataObjectRule()); } - iv_ruleDataObject=ruleDataObject - { $current=$iv_ruleDataObject.current; } +// Entry rule entryRuleUnaryExpression +entryRuleUnaryExpression returns [EObject current=null]: + { newCompositeNode(grammarAccess.getUnaryExpressionRule()); } + iv_ruleUnaryExpression=ruleUnaryExpression + { $current=$iv_ruleUnaryExpression.current; } EOF; -// Rule DataObject -ruleDataObject returns [EObject current=null] +// Rule UnaryExpression +ruleUnaryExpression returns [EObject current=null] @init { enterRule(); } @@ -1029,52 +1468,118 @@ ruleDataObject returns [EObject current=null] }: ( { - newCompositeNode(grammarAccess.getDataObjectAccess().getBooleanObjectParserRuleCall_0()); + newCompositeNode(grammarAccess.getUnaryExpressionAccess().getAggregationExpressionParserRuleCall_0()); } - this_BooleanObject_0=ruleBooleanObject + this_AggregationExpression_0=ruleAggregationExpression { - $current = $this_BooleanObject_0.current; + $current = $this_AggregationExpression_0.current; afterParserOrEnumRuleCall(); } | + ( + ( + { + $current = forceCreateModelElement( + grammarAccess.getUnaryExpressionAccess().getUnaryExpressionAction_1_0(), + $current); + } + ) + ( + ( + { + newCompositeNode(grammarAccess.getUnaryExpressionAccess().getOpUnaryOpEnumRuleCall_1_1_0()); + } + lv_op_2_0=ruleUnaryOp + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getUnaryExpressionRule()); + } + set( + $current, + "op", + lv_op_2_0, + "org.eclipse.viatra.solver.language.SolverLanguage.UnaryOp"); + afterParserOrEnumRuleCall(); + } + ) + ) + ( + ( + { + newCompositeNode(grammarAccess.getUnaryExpressionAccess().getBodyAggregationExpressionParserRuleCall_1_2_0()); + } + lv_body_3_0=ruleAggregationExpression + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getUnaryExpressionRule()); + } + set( + $current, + "body", + lv_body_3_0, + "org.eclipse.viatra.solver.language.SolverLanguage.AggregationExpression"); + afterParserOrEnumRuleCall(); + } + ) + ) + ) + ) +; + +// Entry rule entryRuleAggregationExpression +entryRuleAggregationExpression returns [EObject current=null]: + { newCompositeNode(grammarAccess.getAggregationExpressionRule()); } + iv_ruleAggregationExpression=ruleAggregationExpression + { $current=$iv_ruleAggregationExpression.current; } + EOF; + +// Rule AggregationExpression +ruleAggregationExpression returns [EObject current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( { - newCompositeNode(grammarAccess.getDataObjectAccess().getIntObjectParserRuleCall_1()); + newCompositeNode(grammarAccess.getAggregationExpressionAccess().getAtomicExpressionParserRuleCall_0()); } - this_IntObject_1=ruleIntObject + this_AtomicExpression_0=ruleAtomicExpression { - $current = $this_IntObject_1.current; + $current = $this_AtomicExpression_0.current; afterParserOrEnumRuleCall(); } | { - newCompositeNode(grammarAccess.getDataObjectAccess().getRealObjectParserRuleCall_2()); + newCompositeNode(grammarAccess.getAggregationExpressionAccess().getCountParserRuleCall_1()); } - this_RealObject_2=ruleRealObject + this_Count_1=ruleCount { - $current = $this_RealObject_2.current; + $current = $this_Count_1.current; afterParserOrEnumRuleCall(); } | { - newCompositeNode(grammarAccess.getDataObjectAccess().getStringObjectParserRuleCall_3()); + newCompositeNode(grammarAccess.getAggregationExpressionAccess().getAggregationParserRuleCall_2()); } - this_StringObject_3=ruleStringObject + this_Aggregation_2=ruleAggregation { - $current = $this_StringObject_3.current; + $current = $this_Aggregation_2.current; afterParserOrEnumRuleCall(); } ) ; -// Entry rule entryRuleBooleanObject -entryRuleBooleanObject returns [EObject current=null]: - { newCompositeNode(grammarAccess.getBooleanObjectRule()); } - iv_ruleBooleanObject=ruleBooleanObject - { $current=$iv_ruleBooleanObject.current; } +// Entry rule entryRuleCount +entryRuleCount returns [EObject current=null]: + { newCompositeNode(grammarAccess.getCountRule()); } + iv_ruleCount=ruleCount + { $current=$iv_ruleCount.current; } EOF; -// Rule BooleanObject -ruleBooleanObject returns [EObject current=null] +// Rule Count +ruleCount returns [EObject current=null] @init { enterRule(); } @@ -1082,71 +1587,49 @@ ruleBooleanObject returns [EObject current=null] leaveRule(); }: ( + otherlv_0='count' + { + newLeafNode(otherlv_0, grammarAccess.getCountAccess().getCountKeyword_0()); + } + otherlv_1='{' + { + newLeafNode(otherlv_1, grammarAccess.getCountAccess().getLeftCurlyBracketKeyword_1()); + } ( - { - newCompositeNode(grammarAccess.getBooleanObjectAccess().getValueBooleanValueParserRuleCall_0()); - } - lv_value_0_0=ruleBooleanValue - { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getBooleanObjectRule()); + ( + { + newCompositeNode(grammarAccess.getCountAccess().getBodyExpressionParserRuleCall_2_0()); } - set( - $current, - "value", - lv_value_0_0, - "org.eclipse.viatra.solver.language.SolverLanguage.BooleanValue"); - afterParserOrEnumRuleCall(); - } - ) - ) -; - -// Entry rule entryRuleIntObject -entryRuleIntObject returns [EObject current=null]: - { newCompositeNode(grammarAccess.getIntObjectRule()); } - iv_ruleIntObject=ruleIntObject - { $current=$iv_ruleIntObject.current; } - EOF; - -// Rule IntObject -ruleIntObject returns [EObject current=null] -@init { - enterRule(); -} -@after { - leaveRule(); -}: - ( - ( - { - newCompositeNode(grammarAccess.getIntObjectAccess().getValueINTLiteralParserRuleCall_0()); - } - lv_value_0_0=ruleINTLiteral - { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getIntObjectRule()); + lv_body_2_0=ruleExpression + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getCountRule()); + } + set( + $current, + "body", + lv_body_2_0, + "org.eclipse.viatra.solver.language.SolverLanguage.Expression"); + afterParserOrEnumRuleCall(); } - set( - $current, - "value", - lv_value_0_0, - "org.eclipse.viatra.solver.language.SolverLanguage.INTLiteral"); - afterParserOrEnumRuleCall(); - } + ) ) + otherlv_3='}' + { + newLeafNode(otherlv_3, grammarAccess.getCountAccess().getRightCurlyBracketKeyword_3()); + } ) ; -// Entry rule entryRuleRealObject -entryRuleRealObject returns [EObject current=null]: - { newCompositeNode(grammarAccess.getRealObjectRule()); } - iv_ruleRealObject=ruleRealObject - { $current=$iv_ruleRealObject.current; } +// Entry rule entryRuleAggregation +entryRuleAggregation returns [EObject current=null]: + { newCompositeNode(grammarAccess.getAggregationRule()); } + iv_ruleAggregation=ruleAggregation + { $current=$iv_ruleAggregation.current; } EOF; -// Rule RealObject -ruleRealObject returns [EObject current=null] +// Rule Aggregation +ruleAggregation returns [EObject current=null] @init { enterRule(); } @@ -1155,238 +1638,181 @@ ruleRealObject returns [EObject current=null] }: ( ( - { - newCompositeNode(grammarAccess.getRealObjectAccess().getValueREALLiteralParserRuleCall_0()); - } - lv_value_0_0=ruleREALLiteral - { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getRealObjectRule()); + ( + { + newCompositeNode(grammarAccess.getAggregationAccess().getOpAggregationOpEnumRuleCall_0_0()); } - set( - $current, - "value", - lv_value_0_0, - "org.eclipse.viatra.solver.language.SolverLanguage.REALLiteral"); - afterParserOrEnumRuleCall(); - } - ) - ) -; - -// Entry rule entryRuleStringObject -entryRuleStringObject returns [EObject current=null]: - { newCompositeNode(grammarAccess.getStringObjectRule()); } - iv_ruleStringObject=ruleStringObject - { $current=$iv_ruleStringObject.current; } - EOF; - -// Rule StringObject -ruleStringObject returns [EObject current=null] -@init { - enterRule(); -} -@after { - leaveRule(); -}: - ( - ( - lv_value_0_0=RULE_STRING - { - newLeafNode(lv_value_0_0, grammarAccess.getStringObjectAccess().getValueSTRINGTerminalRuleCall_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getStringObjectRule()); + lv_op_0_0=ruleAggregationOp + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getAggregationRule()); + } + set( + $current, + "op", + lv_op_0_0, + "org.eclipse.viatra.solver.language.SolverLanguage.AggregationOp"); + afterParserOrEnumRuleCall(); } - setWithLastConsumed( - $current, - "value", - lv_value_0_0, - "org.eclipse.viatra.solver.language.SolverLanguage.STRING"); - } + ) ) - ) -; - -// Entry rule entryRulePredicate -entryRulePredicate returns [EObject current=null]: - { newCompositeNode(grammarAccess.getPredicateRule()); } - iv_rulePredicate=rulePredicate - { $current=$iv_rulePredicate.current; } - EOF; - -// Rule Predicate -rulePredicate returns [EObject current=null] -@init { - enterRule(); -} -@after { - leaveRule(); -}: - ( + otherlv_1='{' + { + newLeafNode(otherlv_1, grammarAccess.getAggregationAccess().getLeftCurlyBracketKeyword_1()); + } ( ( - lv_isError_0_0='error' { - newLeafNode(lv_isError_0_0, grammarAccess.getPredicateAccess().getIsErrorErrorKeyword_0_0()); + newCompositeNode(grammarAccess.getAggregationAccess().getBodyExpressionParserRuleCall_2_0()); } + lv_body_2_0=ruleExpression { if ($current==null) { - $current = createModelElement(grammarAccess.getPredicateRule()); + $current = createModelElementForParent(grammarAccess.getAggregationRule()); } - setWithLastConsumed($current, "isError", true, "error"); + set( + $current, + "body", + lv_body_2_0, + "org.eclipse.viatra.solver.language.SolverLanguage.Expression"); + afterParserOrEnumRuleCall(); } ) - )? + ) + otherlv_3='|' + { + newLeafNode(otherlv_3, grammarAccess.getAggregationAccess().getVerticalLineKeyword_3()); + } ( ( { - newCompositeNode(grammarAccess.getPredicateAccess().getSymbolModelSymbolParserRuleCall_1_0()); + newCompositeNode(grammarAccess.getAggregationAccess().getConditionExpressionParserRuleCall_4_0()); } - lv_symbol_1_0=ruleModelSymbol + lv_condition_4_0=ruleExpression { if ($current==null) { - $current = createModelElementForParent(grammarAccess.getPredicateRule()); + $current = createModelElementForParent(grammarAccess.getAggregationRule()); } set( $current, - "symbol", - lv_symbol_1_0, - "org.eclipse.viatra.solver.language.SolverLanguage.ModelSymbol"); + "condition", + lv_condition_4_0, + "org.eclipse.viatra.solver.language.SolverLanguage.Expression"); afterParserOrEnumRuleCall(); } ) ) + otherlv_5='}' + { + newLeafNode(otherlv_5, grammarAccess.getAggregationAccess().getRightCurlyBracketKeyword_5()); + } + ) +; + +// Entry rule entryRuleAtomicExpression +entryRuleAtomicExpression returns [EObject current=null]: + { newCompositeNode(grammarAccess.getAtomicExpressionRule()); } + iv_ruleAtomicExpression=ruleAtomicExpression + { $current=$iv_ruleAtomicExpression.current; } + EOF; + +// Rule AtomicExpression +ruleAtomicExpression returns [EObject current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( ( - otherlv_2='(' { - newLeafNode(otherlv_2, grammarAccess.getPredicateAccess().getLeftParenthesisKeyword_2_0()); + newCompositeNode(grammarAccess.getAtomicExpressionAccess().getReferenceParserRuleCall_0_0()); + } + this_Reference_0=ruleReference + { + $current = $this_Reference_0.current; + afterParserOrEnumRuleCall(); } ( ( + { + $current = forceCreateModelElementAndSet( + grammarAccess.getAtomicExpressionAccess().getCallFunctorAction_0_1_0(), + $current); + } + ) + ( + ('(')=> ( { - newCompositeNode(grammarAccess.getPredicateAccess().getParametersParameterParserRuleCall_2_1_0_0()); + newCompositeNode(grammarAccess.getAtomicExpressionAccess().getArgumentListArgumentListParserRuleCall_0_1_1_0()); } - lv_parameters_3_0=ruleParameter + lv_argumentList_2_0=ruleArgumentList { if ($current==null) { - $current = createModelElementForParent(grammarAccess.getPredicateRule()); + $current = createModelElementForParent(grammarAccess.getAtomicExpressionRule()); } - add( + set( $current, - "parameters", - lv_parameters_3_0, - "org.eclipse.viatra.solver.language.SolverLanguage.Parameter"); + "argumentList", + lv_argumentList_2_0, + "org.eclipse.viatra.solver.language.SolverLanguage.ArgumentList"); afterParserOrEnumRuleCall(); } ) ) - ( - otherlv_4=',' - { - newLeafNode(otherlv_4, grammarAccess.getPredicateAccess().getCommaKeyword_2_1_1_0()); - } - ( - ( - { - newCompositeNode(grammarAccess.getPredicateAccess().getParametersParameterParserRuleCall_2_1_1_1_0()); - } - lv_parameters_5_0=ruleParameter - { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getPredicateRule()); - } - add( - $current, - "parameters", - lv_parameters_5_0, - "org.eclipse.viatra.solver.language.SolverLanguage.Parameter"); - afterParserOrEnumRuleCall(); - } - ) - ) - )* )? - otherlv_6=')' - { - newLeafNode(otherlv_6, grammarAccess.getPredicateAccess().getRightParenthesisKeyword_2_2()); - } - )? - otherlv_7=':-' + ) + | + { + newCompositeNode(grammarAccess.getAtomicExpressionAccess().getIntervalParserRuleCall_1()); + } + this_Interval_3=ruleInterval + { + $current = $this_Interval_3.current; + afterParserOrEnumRuleCall(); + } + | + { + newCompositeNode(grammarAccess.getAtomicExpressionAccess().getLiteralParserRuleCall_2()); + } + this_Literal_4=ruleLiteral { - newLeafNode(otherlv_7, grammarAccess.getPredicateAccess().getColonHyphenMinusKeyword_3()); + $current = $this_Literal_4.current; + afterParserOrEnumRuleCall(); } + | ( - otherlv_8='false' + otherlv_5='(' { - newLeafNode(otherlv_8, grammarAccess.getPredicateAccess().getFalseKeyword_4_0()); + newLeafNode(otherlv_5, grammarAccess.getAtomicExpressionAccess().getLeftParenthesisKeyword_3_0()); + } + { + newCompositeNode(grammarAccess.getAtomicExpressionAccess().getExpressionParserRuleCall_3_1()); + } + this_Expression_6=ruleExpression + { + $current = $this_Expression_6.current; + afterParserOrEnumRuleCall(); + } + otherlv_7=')' + { + newLeafNode(otherlv_7, grammarAccess.getAtomicExpressionAccess().getRightParenthesisKeyword_3_2()); } - | - ( - ( - ( - { - newCompositeNode(grammarAccess.getPredicateAccess().getBodiesPatternBodyParserRuleCall_4_1_0_0()); - } - lv_bodies_9_0=rulePatternBody - { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getPredicateRule()); - } - add( - $current, - "bodies", - lv_bodies_9_0, - "org.eclipse.viatra.solver.language.SolverLanguage.PatternBody"); - afterParserOrEnumRuleCall(); - } - ) - ) - ( - otherlv_10='|' - { - newLeafNode(otherlv_10, grammarAccess.getPredicateAccess().getVerticalLineKeyword_4_1_1_0()); - } - ( - ( - { - newCompositeNode(grammarAccess.getPredicateAccess().getBodiesPatternBodyParserRuleCall_4_1_1_1_0()); - } - lv_bodies_11_0=rulePatternBody - { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getPredicateRule()); - } - add( - $current, - "bodies", - lv_bodies_11_0, - "org.eclipse.viatra.solver.language.SolverLanguage.PatternBody"); - afterParserOrEnumRuleCall(); - } - ) - ) - )* - ) ) - otherlv_12='.' - { - newLeafNode(otherlv_12, grammarAccess.getPredicateAccess().getFullStopKeyword_5()); - } ) ; -// Entry rule entryRuleParameter -entryRuleParameter returns [EObject current=null]: - { newCompositeNode(grammarAccess.getParameterRule()); } - iv_ruleParameter=ruleParameter - { $current=$iv_ruleParameter.current; } +// Entry rule entryRuleCall +entryRuleCall returns [EObject current=null]: + { newCompositeNode(grammarAccess.getCallRule()); } + iv_ruleCall=ruleCall + { $current=$iv_ruleCall.current; } EOF; -// Rule Parameter -ruleParameter returns [EObject current=null] +// Rule Call +ruleCall returns [EObject current=null] @init { enterRule(); } @@ -1397,157 +1823,92 @@ ruleParameter returns [EObject current=null] ( ( { - newCompositeNode(grammarAccess.getParameterAccess().getVariableVariableParserRuleCall_0_0()); + newCompositeNode(grammarAccess.getCallAccess().getFunctorReferenceParserRuleCall_0_0()); } - lv_variable_0_0=ruleVariable + lv_functor_0_0=ruleReference { if ($current==null) { - $current = createModelElementForParent(grammarAccess.getParameterRule()); + $current = createModelElementForParent(grammarAccess.getCallRule()); } set( $current, - "variable", - lv_variable_0_0, - "org.eclipse.viatra.solver.language.SolverLanguage.Variable"); + "functor", + lv_functor_0_0, + "org.eclipse.viatra.solver.language.SolverLanguage.Reference"); afterParserOrEnumRuleCall(); } ) ) ( - otherlv_1=':' - { - newLeafNode(otherlv_1, grammarAccess.getParameterAccess().getColonKeyword_1_0()); - } ( ( + lv_transitiveClosure_1_0=RULE_STAR { - newCompositeNode(grammarAccess.getParameterAccess().getTypeSymbolParserRuleCall_1_1_0()); + newLeafNode(lv_transitiveClosure_1_0, grammarAccess.getCallAccess().getTransitiveClosureSTARTerminalRuleCall_1_0_0()); } - lv_type_2_0=ruleSymbol { if ($current==null) { - $current = createModelElementForParent(grammarAccess.getParameterRule()); + $current = createModelElement(grammarAccess.getCallRule()); } - set( + setWithLastConsumed( $current, - "type", - lv_type_2_0, - "org.eclipse.viatra.solver.language.SolverLanguage.Symbol"); - afterParserOrEnumRuleCall(); + "transitiveClosure", + true, + "org.eclipse.viatra.solver.language.SolverLanguage.STAR"); } ) ) - )? - ) -; - -// Entry rule entryRulePatternBody -entryRulePatternBody returns [EObject current=null]: - { newCompositeNode(grammarAccess.getPatternBodyRule()); } - iv_rulePatternBody=rulePatternBody - { $current=$iv_rulePatternBody.current; } - EOF; - -// Rule PatternBody -rulePatternBody returns [EObject current=null] -@init { - enterRule(); -} -@after { - leaveRule(); -}: - ( - ( - { - $current = forceCreateModelElement( - grammarAccess.getPatternBodyAccess().getPatternBodyAction_0(), - $current); - } - ) - ( - otherlv_1='true' - { - newLeafNode(otherlv_1, grammarAccess.getPatternBodyAccess().getTrueKeyword_1_0()); - } | ( ( + lv_reflexiveTransitiveClosure_2_0=RULE_PLUS { - newCompositeNode(grammarAccess.getPatternBodyAccess().getConstraintsConstraintParserRuleCall_1_1_0()); + newLeafNode(lv_reflexiveTransitiveClosure_2_0, grammarAccess.getCallAccess().getReflexiveTransitiveClosurePLUSTerminalRuleCall_1_1_0()); } - lv_constraints_2_0=ruleConstraint { if ($current==null) { - $current = createModelElementForParent(grammarAccess.getPatternBodyRule()); + $current = createModelElement(grammarAccess.getCallRule()); } - add( + setWithLastConsumed( $current, - "constraints", - lv_constraints_2_0, - "org.eclipse.viatra.solver.language.SolverLanguage.Constraint"); - afterParserOrEnumRuleCall(); + "reflexiveTransitiveClosure", + true, + "org.eclipse.viatra.solver.language.SolverLanguage.PLUS"); } ) - )* - ) - ) -; - -// Entry rule entryRulePolarity -entryRulePolarity returns [EObject current=null]: - { newCompositeNode(grammarAccess.getPolarityRule()); } - iv_rulePolarity=rulePolarity - { $current=$iv_rulePolarity.current; } - EOF; - -// Rule Polarity -rulePolarity returns [EObject current=null] -@init { - enterRule(); -} -@after { - leaveRule(); -}: - ( + ) + )? ( ( { - $current = forceCreateModelElement( - grammarAccess.getPolarityAccess().getPositiveAction_0_0(), - $current); + newCompositeNode(grammarAccess.getCallAccess().getArgumentListArgumentListParserRuleCall_2_0()); } - ) - otherlv_1='+' - { - newLeafNode(otherlv_1, grammarAccess.getPolarityAccess().getPlusSignKeyword_0_1()); - } - ) - | - ( - ( + lv_argumentList_3_0=ruleArgumentList { - $current = forceCreateModelElement( - grammarAccess.getPolarityAccess().getNegativeAction_1_0(), - $current); + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getCallRule()); + } + set( + $current, + "argumentList", + lv_argumentList_3_0, + "org.eclipse.viatra.solver.language.SolverLanguage.ArgumentList"); + afterParserOrEnumRuleCall(); } ) - otherlv_3='-' - { - newLeafNode(otherlv_3, grammarAccess.getPolarityAccess().getHyphenMinusKeyword_1_1()); - } ) ) ; -// Entry rule entryRuleConstraint -entryRuleConstraint returns [EObject current=null]: - { newCompositeNode(grammarAccess.getConstraintRule()); } - iv_ruleConstraint=ruleConstraint - { $current=$iv_ruleConstraint.current; } +// Entry rule entryRuleArgumentList +entryRuleArgumentList returns [EObject current=null]: + { newCompositeNode(grammarAccess.getArgumentListRule()); } + iv_ruleArgumentList=ruleArgumentList + { $current=$iv_ruleArgumentList.current; } EOF; -// Rule Constraint -ruleConstraint returns [EObject current=null] +// Rule ArgumentList +ruleArgumentList returns [EObject current=null] @init { enterRule(); } @@ -1556,185 +1917,78 @@ ruleConstraint returns [EObject current=null] }: ( ( - ( - ( - { - newCompositeNode(grammarAccess.getConstraintAccess().getPolarityPolarityParserRuleCall_0_0_0()); - } - lv_polarity_0_0=rulePolarity - { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getConstraintRule()); - } - set( - $current, - "polarity", - lv_polarity_0_0, - "org.eclipse.viatra.solver.language.SolverLanguage.Polarity"); - afterParserOrEnumRuleCall(); - } - ) - )? - ( - ( - { - newCompositeNode(grammarAccess.getConstraintAccess().getSymbolModelSymbolParserRuleCall_0_1_0()); - } - lv_symbol_1_0=ruleModelSymbol - { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getConstraintRule()); - } - set( - $current, - "symbol", - lv_symbol_1_0, - "org.eclipse.viatra.solver.language.SolverLanguage.ModelSymbol"); - afterParserOrEnumRuleCall(); - } - ) - ) - ( - otherlv_2='(' - { - newLeafNode(otherlv_2, grammarAccess.getConstraintAccess().getLeftParenthesisKeyword_0_2_0()); - } - ( - ( - { - newCompositeNode(grammarAccess.getConstraintAccess().getParamsLiteralParserRuleCall_0_2_1_0()); - } - lv_params_3_0=ruleLiteral - { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getConstraintRule()); - } - add( - $current, - "params", - lv_params_3_0, - "org.eclipse.viatra.solver.language.SolverLanguage.Literal"); - afterParserOrEnumRuleCall(); - } - ) - )? - ( - otherlv_4=',' - { - newLeafNode(otherlv_4, grammarAccess.getConstraintAccess().getCommaKeyword_0_2_2_0()); - } - ( - ( - { - newCompositeNode(grammarAccess.getConstraintAccess().getParamsLiteralParserRuleCall_0_2_2_1_0()); - } - lv_params_5_0=ruleLiteral - { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getConstraintRule()); - } - add( - $current, - "params", - lv_params_5_0, - "org.eclipse.viatra.solver.language.SolverLanguage.Literal"); - afterParserOrEnumRuleCall(); - } - ) - ) - )* - otherlv_6=')' - { - newLeafNode(otherlv_6, grammarAccess.getConstraintAccess().getRightParenthesisKeyword_0_2_3()); - } - )? - ) - | - ( - ( - ( - { - newCompositeNode(grammarAccess.getConstraintAccess().getClosureTypeClosureTypeParserRuleCall_1_0_0()); - } - lv_closureType_7_0=ruleClosureType - { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getConstraintRule()); - } - set( - $current, - "closureType", - lv_closureType_7_0, - "org.eclipse.viatra.solver.language.SolverLanguage.ClosureType"); - afterParserOrEnumRuleCall(); - } - ) - ) - otherlv_8='(' { - newLeafNode(otherlv_8, grammarAccess.getConstraintAccess().getLeftParenthesisKeyword_1_1()); + $current = forceCreateModelElement( + grammarAccess.getArgumentListAccess().getArgumentListAction_0(), + $current); } + ) + otherlv_1='(' + { + newLeafNode(otherlv_1, grammarAccess.getArgumentListAccess().getLeftParenthesisKeyword_1()); + } + ( ( ( { - newCompositeNode(grammarAccess.getConstraintAccess().getParamsLiteralParserRuleCall_1_2_0()); + newCompositeNode(grammarAccess.getArgumentListAccess().getArgumentsArgumentParserRuleCall_2_0_0()); } - lv_params_9_0=ruleLiteral + lv_arguments_2_0=ruleArgument { if ($current==null) { - $current = createModelElementForParent(grammarAccess.getConstraintRule()); + $current = createModelElementForParent(grammarAccess.getArgumentListRule()); } add( $current, - "params", - lv_params_9_0, - "org.eclipse.viatra.solver.language.SolverLanguage.Literal"); + "arguments", + lv_arguments_2_0, + "org.eclipse.viatra.solver.language.SolverLanguage.Argument"); afterParserOrEnumRuleCall(); } ) - )? + ) ( - otherlv_10=',' + otherlv_3=',' { - newLeafNode(otherlv_10, grammarAccess.getConstraintAccess().getCommaKeyword_1_3_0()); + newLeafNode(otherlv_3, grammarAccess.getArgumentListAccess().getCommaKeyword_2_1_0()); } ( ( { - newCompositeNode(grammarAccess.getConstraintAccess().getParamsLiteralParserRuleCall_1_3_1_0()); + newCompositeNode(grammarAccess.getArgumentListAccess().getArgumentsArgumentParserRuleCall_2_1_1_0()); } - lv_params_11_0=ruleLiteral + lv_arguments_4_0=ruleArgument { if ($current==null) { - $current = createModelElementForParent(grammarAccess.getConstraintRule()); + $current = createModelElementForParent(grammarAccess.getArgumentListRule()); } add( $current, - "params", - lv_params_11_0, - "org.eclipse.viatra.solver.language.SolverLanguage.Literal"); + "arguments", + lv_arguments_4_0, + "org.eclipse.viatra.solver.language.SolverLanguage.Argument"); afterParserOrEnumRuleCall(); } ) ) )* - otherlv_12=')' - { - newLeafNode(otherlv_12, grammarAccess.getConstraintAccess().getRightParenthesisKeyword_1_4()); - } - ) + )? + otherlv_5=')' + { + newLeafNode(otherlv_5, grammarAccess.getArgumentListAccess().getRightParenthesisKeyword_3()); + } ) ; -// Entry rule entryRuleClosureType -entryRuleClosureType returns [EObject current=null]: - { newCompositeNode(grammarAccess.getClosureTypeRule()); } - iv_ruleClosureType=ruleClosureType - { $current=$iv_ruleClosureType.current; } +// Entry rule entryRuleArgument +entryRuleArgument returns [EObject current=null]: + { newCompositeNode(grammarAccess.getArgumentRule()); } + iv_ruleArgument=ruleArgument + { $current=$iv_ruleArgument.current; } EOF; -// Rule ClosureType -ruleClosureType returns [EObject current=null] +// Rule Argument +ruleArgument returns [EObject current=null] @init { enterRule(); } @@ -1742,90 +1996,53 @@ ruleClosureType returns [EObject current=null] leaveRule(); }: ( - ( - ( - { - $current = forceCreateModelElement( - grammarAccess.getClosureTypeAccess().getReflexiveClosureAction_0_0(), - $current); - } - ) - otherlv_1='*' - { - newLeafNode(otherlv_1, grammarAccess.getClosureTypeAccess().getAsteriskKeyword_0_1()); - } - ) + { + newCompositeNode(grammarAccess.getArgumentAccess().getExpressionArgumentParserRuleCall_0()); + } + this_ExpressionArgument_0=ruleExpressionArgument + { + $current = $this_ExpressionArgument_0.current; + afterParserOrEnumRuleCall(); + } | - ( - ( - { - $current = forceCreateModelElement( - grammarAccess.getClosureTypeAccess().getIrreflexiveClosureAction_1_0(), - $current); - } - ) - otherlv_3='+' - { - newLeafNode(otherlv_3, grammarAccess.getClosureTypeAccess().getPlusSignKeyword_1_1()); - } - ) - ) -; - -// Entry rule entryRuleLiteral -entryRuleLiteral returns [EObject current=null]: - { newCompositeNode(grammarAccess.getLiteralRule()); } - iv_ruleLiteral=ruleLiteral - { $current=$iv_ruleLiteral.current; } - EOF; - -// Rule Literal -ruleLiteral returns [EObject current=null] -@init { - enterRule(); -} -@after { - leaveRule(); -}: - ( { - newCompositeNode(grammarAccess.getLiteralAccess().getVariableParserRuleCall_0()); + newCompositeNode(grammarAccess.getArgumentAccess().getStarArgumentParserRuleCall_1()); } - this_Variable_0=ruleVariable + this_StarArgument_1=ruleStarArgument { - $current = $this_Variable_0.current; + $current = $this_StarArgument_1.current; afterParserOrEnumRuleCall(); } | { - newCompositeNode(grammarAccess.getLiteralAccess().getDataObjectParserRuleCall_1()); + newCompositeNode(grammarAccess.getArgumentAccess().getTypedArgumentParserRuleCall_2()); } - this_DataObject_1=ruleDataObject + this_TypedArgument_2=ruleTypedArgument { - $current = $this_DataObject_1.current; + $current = $this_TypedArgument_2.current; afterParserOrEnumRuleCall(); } | { - newCompositeNode(grammarAccess.getLiteralAccess().getNamedObjectParserRuleCall_2()); + newCompositeNode(grammarAccess.getArgumentAccess().getTypedStarArgumentParserRuleCall_3()); } - this_NamedObject_2=ruleNamedObject + this_TypedStarArgument_3=ruleTypedStarArgument { - $current = $this_NamedObject_2.current; + $current = $this_TypedStarArgument_3.current; afterParserOrEnumRuleCall(); } ) ; -// Entry rule entryRuleVariable -entryRuleVariable returns [EObject current=null]: - { newCompositeNode(grammarAccess.getVariableRule()); } - iv_ruleVariable=ruleVariable - { $current=$iv_ruleVariable.current; } +// Entry rule entryRuleExpressionArgument +entryRuleExpressionArgument returns [EObject current=null]: + { newCompositeNode(grammarAccess.getExpressionArgumentRule()); } + iv_ruleExpressionArgument=ruleExpressionArgument + { $current=$iv_ruleExpressionArgument.current; } EOF; -// Rule Variable -ruleVariable returns [EObject current=null] +// Rule ExpressionArgument +ruleExpressionArgument returns [EObject current=null] @init { enterRule(); } @@ -1834,33 +2051,34 @@ ruleVariable returns [EObject current=null] }: ( ( - lv_name_0_0=RULE_ID { - newLeafNode(lv_name_0_0, grammarAccess.getVariableAccess().getNameIDTerminalRuleCall_0()); + newCompositeNode(grammarAccess.getExpressionArgumentAccess().getBodyComparisonExpressionParserRuleCall_0()); } + lv_body_0_0=ruleComparisonExpression { if ($current==null) { - $current = createModelElement(grammarAccess.getVariableRule()); + $current = createModelElementForParent(grammarAccess.getExpressionArgumentRule()); } - setWithLastConsumed( + set( $current, - "name", - lv_name_0_0, - "org.eclipse.xtext.common.Terminals.ID"); + "body", + lv_body_0_0, + "org.eclipse.viatra.solver.language.SolverLanguage.ComparisonExpression"); + afterParserOrEnumRuleCall(); } ) ) ; -// Entry rule entryRuleAllInstances -entryRuleAllInstances returns [EObject current=null]: - { newCompositeNode(grammarAccess.getAllInstancesRule()); } - iv_ruleAllInstances=ruleAllInstances - { $current=$iv_ruleAllInstances.current; } +// Entry rule entryRuleStarArgument +entryRuleStarArgument returns [EObject current=null]: + { newCompositeNode(grammarAccess.getStarArgumentRule()); } + iv_ruleStarArgument=ruleStarArgument + { $current=$iv_ruleStarArgument.current; } EOF; -// Rule AllInstances -ruleAllInstances returns [EObject current=null] +// Rule StarArgument +ruleStarArgument returns [EObject current=null] @init { enterRule(); } @@ -1868,25 +2086,64 @@ ruleAllInstances returns [EObject current=null] leaveRule(); }: ( - otherlv_0=':' + ( + { + $current = forceCreateModelElement( + grammarAccess.getStarArgumentAccess().getStarArgumentAction_0(), + $current); + } + ) + otherlv_1='*' { - newLeafNode(otherlv_0, grammarAccess.getAllInstancesAccess().getColonKeyword_0()); + newLeafNode(otherlv_1, grammarAccess.getStarArgumentAccess().getAsteriskKeyword_1()); } + ) +; + +// Entry rule entryRuleTypedArgument +entryRuleTypedArgument returns [EObject current=null]: + { newCompositeNode(grammarAccess.getTypedArgumentRule()); } + iv_ruleTypedArgument=ruleTypedArgument + { $current=$iv_ruleTypedArgument.current; } + EOF; + +// Rule TypedArgument +ruleTypedArgument returns [EObject current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( ( ( { - newCompositeNode(grammarAccess.getAllInstancesAccess().getSymbolSymbolParserRuleCall_1_0()); + if ($current==null) { + $current = createModelElement(grammarAccess.getTypedArgumentRule()); + } + } + { + newCompositeNode(grammarAccess.getTypedArgumentAccess().getTypeNamedElementCrossReference_0_0()); + } + ruleQualifiedName + { + afterParserOrEnumRuleCall(); } - lv_symbol_1_0=ruleSymbol + ) + ) + ( + ( { if ($current==null) { - $current = createModelElementForParent(grammarAccess.getAllInstancesRule()); + $current = createModelElement(grammarAccess.getTypedArgumentRule()); } - set( - $current, - "symbol", - lv_symbol_1_0, - "org.eclipse.viatra.solver.language.SolverLanguage.Symbol"); + } + { + newCompositeNode(grammarAccess.getTypedArgumentAccess().getVariableNamedElementCrossReference_1_0()); + } + ruleQualifiedName + { afterParserOrEnumRuleCall(); } ) @@ -1894,15 +2151,15 @@ ruleAllInstances returns [EObject current=null] ) ; -// Entry rule entryRuleAllObjects -entryRuleAllObjects returns [EObject current=null]: - { newCompositeNode(grammarAccess.getAllObjectsRule()); } - iv_ruleAllObjects=ruleAllObjects - { $current=$iv_ruleAllObjects.current; } +// Entry rule entryRuleTypedStarArgument +entryRuleTypedStarArgument returns [EObject current=null]: + { newCompositeNode(grammarAccess.getTypedStarArgumentRule()); } + iv_ruleTypedStarArgument=ruleTypedStarArgument + { $current=$iv_ruleTypedStarArgument.current; } EOF; -// Rule AllObjects -ruleAllObjects returns [EObject current=null] +// Rule TypedStarArgument +ruleTypedStarArgument returns [EObject current=null] @init { enterRule(); } @@ -1911,28 +2168,37 @@ ruleAllObjects returns [EObject current=null] }: ( ( - { - $current = forceCreateModelElement( - grammarAccess.getAllObjectsAccess().getAllObjectsAction_0(), - $current); - } + ( + { + if ($current==null) { + $current = createModelElement(grammarAccess.getTypedStarArgumentRule()); + } + } + { + newCompositeNode(grammarAccess.getTypedStarArgumentAccess().getTypeNamedElementCrossReference_0_0()); + } + ruleQualifiedName + { + afterParserOrEnumRuleCall(); + } + ) ) otherlv_1='*' { - newLeafNode(otherlv_1, grammarAccess.getAllObjectsAccess().getAsteriskKeyword_1()); + newLeafNode(otherlv_1, grammarAccess.getTypedStarArgumentAccess().getAsteriskKeyword_1()); } ) ; -// Entry rule entryRuleDefaultInterpretation -entryRuleDefaultInterpretation returns [EObject current=null]: - { newCompositeNode(grammarAccess.getDefaultInterpretationRule()); } - iv_ruleDefaultInterpretation=ruleDefaultInterpretation - { $current=$iv_ruleDefaultInterpretation.current; } +// Entry rule entryRuleReference +entryRuleReference returns [EObject current=null]: + { newCompositeNode(grammarAccess.getReferenceRule()); } + iv_ruleReference=ruleReference + { $current=$iv_ruleReference.current; } EOF; -// Rule DefaultInterpretation -ruleDefaultInterpretation returns [EObject current=null] +// Rule Reference +ruleReference returns [EObject current=null] @init { enterRule(); } @@ -1940,41 +2206,101 @@ ruleDefaultInterpretation returns [EObject current=null] leaveRule(); }: ( - otherlv_0='default' + ( + { + if ($current==null) { + $current = createModelElement(grammarAccess.getReferenceRule()); + } + } + { + newCompositeNode(grammarAccess.getReferenceAccess().getReferredNamedElementCrossReference_0()); + } + ruleQualifiedName + { + afterParserOrEnumRuleCall(); + } + ) + ) +; + +// Entry rule entryRuleInterval +entryRuleInterval returns [EObject current=null]: + { newCompositeNode(grammarAccess.getIntervalRule()); } + iv_ruleInterval=ruleInterval + { $current=$iv_ruleInterval.current; } + EOF; + +// Rule Interval +ruleInterval returns [EObject current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + otherlv_0='[' + { + newLeafNode(otherlv_0, grammarAccess.getIntervalAccess().getLeftSquareBracketKeyword_0()); + } + ( + ( + { + newCompositeNode(grammarAccess.getIntervalAccess().getLowerBoundExpressionParserRuleCall_1_0()); + } + lv_lowerBound_1_0=ruleExpression + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getIntervalRule()); + } + set( + $current, + "lowerBound", + lv_lowerBound_1_0, + "org.eclipse.viatra.solver.language.SolverLanguage.Expression"); + afterParserOrEnumRuleCall(); + } + ) + ) + otherlv_2='..' { - newLeafNode(otherlv_0, grammarAccess.getDefaultInterpretationAccess().getDefaultKeyword_0()); + newLeafNode(otherlv_2, grammarAccess.getIntervalAccess().getFullStopFullStopKeyword_2()); } ( ( { - newCompositeNode(grammarAccess.getDefaultInterpretationAccess().getInterpretationBasicInterpretationParserRuleCall_1_0()); + newCompositeNode(grammarAccess.getIntervalAccess().getUpperBoundExpressionParserRuleCall_3_0()); } - lv_interpretation_1_0=ruleBasicInterpretation + lv_upperBound_3_0=ruleExpression { if ($current==null) { - $current = createModelElementForParent(grammarAccess.getDefaultInterpretationRule()); + $current = createModelElementForParent(grammarAccess.getIntervalRule()); } set( $current, - "interpretation", - lv_interpretation_1_0, - "org.eclipse.viatra.solver.language.SolverLanguage.BasicInterpretation"); + "upperBound", + lv_upperBound_3_0, + "org.eclipse.viatra.solver.language.SolverLanguage.Expression"); afterParserOrEnumRuleCall(); } ) ) + otherlv_4=']' + { + newLeafNode(otherlv_4, grammarAccess.getIntervalAccess().getRightSquareBracketKeyword_4()); + } ) ; -// Entry rule entryRuleCDInterpretation -entryRuleCDInterpretation returns [EObject current=null]: - { newCompositeNode(grammarAccess.getCDInterpretationRule()); } - iv_ruleCDInterpretation=ruleCDInterpretation - { $current=$iv_ruleCDInterpretation.current; } +// Entry rule entryRuleLiteral +entryRuleLiteral returns [EObject current=null]: + { newCompositeNode(grammarAccess.getLiteralRule()); } + iv_ruleLiteral=ruleLiteral + { $current=$iv_ruleLiteral.current; } EOF; -// Rule CDInterpretation -ruleCDInterpretation returns [EObject current=null] +// Rule Literal +ruleLiteral returns [EObject current=null] @init { enterRule(); } @@ -1983,43 +2309,61 @@ ruleCDInterpretation returns [EObject current=null] }: ( { - newCompositeNode(grammarAccess.getCDInterpretationAccess().getClassInterpretationParserRuleCall_0()); + newCompositeNode(grammarAccess.getLiteralAccess().getLogicLiteralParserRuleCall_0()); + } + this_LogicLiteral_0=ruleLogicLiteral + { + $current = $this_LogicLiteral_0.current; + afterParserOrEnumRuleCall(); + } + | + { + newCompositeNode(grammarAccess.getLiteralAccess().getNumericLiteralParserRuleCall_1()); + } + this_NumericLiteral_1=ruleNumericLiteral + { + $current = $this_NumericLiteral_1.current; + afterParserOrEnumRuleCall(); + } + | + { + newCompositeNode(grammarAccess.getLiteralAccess().getInfinityLiteralParserRuleCall_2()); } - this_ClassInterpretation_0=ruleClassInterpretation + this_InfinityLiteral_2=ruleInfinityLiteral { - $current = $this_ClassInterpretation_0.current; + $current = $this_InfinityLiteral_2.current; afterParserOrEnumRuleCall(); } | { - newCompositeNode(grammarAccess.getCDInterpretationAccess().getEnumInterpretationParserRuleCall_1()); + newCompositeNode(grammarAccess.getLiteralAccess().getEmptyIntervalLiteralParserRuleCall_3()); } - this_EnumInterpretation_1=ruleEnumInterpretation + this_EmptyIntervalLiteral_3=ruleEmptyIntervalLiteral { - $current = $this_EnumInterpretation_1.current; + $current = $this_EmptyIntervalLiteral_3.current; afterParserOrEnumRuleCall(); } | { - newCompositeNode(grammarAccess.getCDInterpretationAccess().getGlobalRelationInterpretationParserRuleCall_2()); + newCompositeNode(grammarAccess.getLiteralAccess().getStringLiteralParserRuleCall_4()); } - this_GlobalRelationInterpretation_2=ruleGlobalRelationInterpretation + this_StringLiteral_4=ruleStringLiteral { - $current = $this_GlobalRelationInterpretation_2.current; + $current = $this_StringLiteral_4.current; afterParserOrEnumRuleCall(); } ) ; -// Entry rule entryRuleClassInterpretation -entryRuleClassInterpretation returns [EObject current=null]: - { newCompositeNode(grammarAccess.getClassInterpretationRule()); } - iv_ruleClassInterpretation=ruleClassInterpretation - { $current=$iv_ruleClassInterpretation.current; } +// Entry rule entryRuleLogicLiteral +entryRuleLogicLiteral returns [EObject current=null]: + { newCompositeNode(grammarAccess.getLogicLiteralRule()); } + iv_ruleLogicLiteral=ruleLogicLiteral + { $current=$iv_ruleLogicLiteral.current; } EOF; -// Rule ClassInterpretation -ruleClassInterpretation returns [EObject current=null] +// Rule LogicLiteral +ruleLogicLiteral returns [EObject current=null] @init { enterRule(); } @@ -2028,106 +2372,70 @@ ruleClassInterpretation returns [EObject current=null] }: ( ( - ( - lv_abstract_0_0='abstract' - { - newLeafNode(lv_abstract_0_0, grammarAccess.getClassInterpretationAccess().getAbstractAbstractKeyword_0_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getClassInterpretationRule()); - } - setWithLastConsumed($current, "abstract", true, "abstract"); - } - ) - )? - otherlv_1='class' - { - newLeafNode(otherlv_1, grammarAccess.getClassInterpretationAccess().getClassKeyword_1()); - } - ( - ( - { - newCompositeNode(grammarAccess.getClassInterpretationAccess().getSymbolModelSymbolParserRuleCall_2_0()); - } - lv_symbol_2_0=ruleModelSymbol - { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getClassInterpretationRule()); - } - set( - $current, - "symbol", - lv_symbol_2_0, - "org.eclipse.viatra.solver.language.SolverLanguage.ModelSymbol"); - afterParserOrEnumRuleCall(); + { + newCompositeNode(grammarAccess.getLogicLiteralAccess().getValueLogicValueEnumRuleCall_0()); + } + lv_value_0_0=ruleLogicValue + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getLogicLiteralRule()); } - ) + set( + $current, + "value", + lv_value_0_0, + "org.eclipse.viatra.solver.language.SolverLanguage.LogicValue"); + afterParserOrEnumRuleCall(); + } ) + ) +; + +// Entry rule entryRuleNumericLiteral +entryRuleNumericLiteral returns [EObject current=null]: + { newCompositeNode(grammarAccess.getNumericLiteralRule()); } + iv_ruleNumericLiteral=ruleNumericLiteral + { $current=$iv_ruleNumericLiteral.current; } + EOF; + +// Rule NumericLiteral +ruleNumericLiteral returns [EObject current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( ( - otherlv_3='extends' { - newLeafNode(otherlv_3, grammarAccess.getClassInterpretationAccess().getExtendsKeyword_3_0()); + newCompositeNode(grammarAccess.getNumericLiteralAccess().getValueRealParserRuleCall_0()); } - ( - ( - { - newCompositeNode(grammarAccess.getClassInterpretationAccess().getSupertypesModelSymbolParserRuleCall_3_1_0()); - } - lv_supertypes_4_0=ruleModelSymbol - { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getClassInterpretationRule()); - } - add( - $current, - "supertypes", - lv_supertypes_4_0, - "org.eclipse.viatra.solver.language.SolverLanguage.ModelSymbol"); - afterParserOrEnumRuleCall(); - } - ) - )+ - )? - otherlv_5='{' - { - newLeafNode(otherlv_5, grammarAccess.getClassInterpretationAccess().getLeftCurlyBracketKeyword_4()); - } - ( - ( - { - newCompositeNode(grammarAccess.getClassInterpretationAccess().getFieltFieldRelationInterpretationParserRuleCall_5_0()); - } - lv_fielt_6_0=ruleFieldRelationInterpretation - { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getClassInterpretationRule()); - } - add( - $current, - "fielt", - lv_fielt_6_0, - "org.eclipse.viatra.solver.language.SolverLanguage.FieldRelationInterpretation"); - afterParserOrEnumRuleCall(); + lv_value_0_0=ruleReal + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getNumericLiteralRule()); } - ) - )* - otherlv_7='}' - { - newLeafNode(otherlv_7, grammarAccess.getClassInterpretationAccess().getRightCurlyBracketKeyword_6()); - } + set( + $current, + "value", + lv_value_0_0, + "org.eclipse.viatra.solver.language.SolverLanguage.Real"); + afterParserOrEnumRuleCall(); + } + ) ) ; -// Entry rule entryRuleEnumInterpretation -entryRuleEnumInterpretation returns [EObject current=null]: - { newCompositeNode(grammarAccess.getEnumInterpretationRule()); } - iv_ruleEnumInterpretation=ruleEnumInterpretation - { $current=$iv_ruleEnumInterpretation.current; } +// Entry rule entryRuleInfinityLiteral +entryRuleInfinityLiteral returns [EObject current=null]: + { newCompositeNode(grammarAccess.getInfinityLiteralRule()); } + iv_ruleInfinityLiteral=ruleInfinityLiteral + { $current=$iv_ruleInfinityLiteral.current; } EOF; -// Rule EnumInterpretation -ruleEnumInterpretation returns [EObject current=null] +// Rule InfinityLiteral +ruleInfinityLiteral returns [EObject current=null] @init { enterRule(); } @@ -2135,68 +2443,29 @@ ruleEnumInterpretation returns [EObject current=null] leaveRule(); }: ( - otherlv_0='enum' - { - newLeafNode(otherlv_0, grammarAccess.getEnumInterpretationAccess().getEnumKeyword_0()); - } ( - ( - { - newCompositeNode(grammarAccess.getEnumInterpretationAccess().getSymbolModelSymbolParserRuleCall_1_0()); - } - lv_Symbol_1_0=ruleModelSymbol - { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getEnumInterpretationRule()); - } - set( - $current, - "Symbol", - lv_Symbol_1_0, - "org.eclipse.viatra.solver.language.SolverLanguage.ModelSymbol"); - afterParserOrEnumRuleCall(); - } - ) + { + $current = forceCreateModelElement( + grammarAccess.getInfinityLiteralAccess().getInfinityLiteralAction_0(), + $current); + } ) - otherlv_2='{' - { - newLeafNode(otherlv_2, grammarAccess.getEnumInterpretationAccess().getLeftCurlyBracketKeyword_2()); - } - ( - ( - { - newCompositeNode(grammarAccess.getEnumInterpretationAccess().getObjectsNamedObjectParserRuleCall_3_0()); - } - lv_objects_3_0=ruleNamedObject - { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getEnumInterpretationRule()); - } - add( - $current, - "objects", - lv_objects_3_0, - "org.eclipse.viatra.solver.language.SolverLanguage.NamedObject"); - afterParserOrEnumRuleCall(); - } - ) - )+ - otherlv_4='}' + otherlv_1='inf' { - newLeafNode(otherlv_4, grammarAccess.getEnumInterpretationAccess().getRightCurlyBracketKeyword_4()); + newLeafNode(otherlv_1, grammarAccess.getInfinityLiteralAccess().getInfKeyword_1()); } ) ; -// Entry rule entryRuleFieldRelationInterpretation -entryRuleFieldRelationInterpretation returns [EObject current=null]: - { newCompositeNode(grammarAccess.getFieldRelationInterpretationRule()); } - iv_ruleFieldRelationInterpretation=ruleFieldRelationInterpretation - { $current=$iv_ruleFieldRelationInterpretation.current; } +// Entry rule entryRuleEmptyIntervalLiteral +entryRuleEmptyIntervalLiteral returns [EObject current=null]: + { newCompositeNode(grammarAccess.getEmptyIntervalLiteralRule()); } + iv_ruleEmptyIntervalLiteral=ruleEmptyIntervalLiteral + { $current=$iv_ruleEmptyIntervalLiteral.current; } EOF; -// Rule FieldRelationInterpretation -ruleFieldRelationInterpretation returns [EObject current=null] +// Rule EmptyIntervalLiteral +ruleEmptyIntervalLiteral returns [EObject current=null] @init { enterRule(); } @@ -2205,92 +2474,189 @@ ruleFieldRelationInterpretation returns [EObject current=null] }: ( ( - ( - lv_containment_0_0='containment' - { - newLeafNode(lv_containment_0_0, grammarAccess.getFieldRelationInterpretationAccess().getContainmentContainmentKeyword_0_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getFieldRelationInterpretationRule()); - } - setWithLastConsumed($current, "containment", true, "containment"); - } - ) - )? + { + $current = forceCreateModelElement( + grammarAccess.getEmptyIntervalLiteralAccess().getEmptyIntervalLiteralAction_0(), + $current); + } + ) + otherlv_1='empty' + { + newLeafNode(otherlv_1, grammarAccess.getEmptyIntervalLiteralAccess().getEmptyKeyword_1()); + } + ) +; + +// Entry rule entryRuleStringLiteral +entryRuleStringLiteral returns [EObject current=null]: + { newCompositeNode(grammarAccess.getStringLiteralRule()); } + iv_ruleStringLiteral=ruleStringLiteral + { $current=$iv_ruleStringLiteral.current; } + EOF; + +// Rule StringLiteral +ruleStringLiteral returns [EObject current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + ( + lv_value_0_0=RULE_STRING + { + newLeafNode(lv_value_0_0, grammarAccess.getStringLiteralAccess().getValueSTRINGTerminalRuleCall_0()); + } + { + if ($current==null) { + $current = createModelElement(grammarAccess.getStringLiteralRule()); + } + setWithLastConsumed( + $current, + "value", + lv_value_0_0, + "org.eclipse.viatra.solver.language.SolverLanguage.STRING"); + } + ) + ) +; + +// Entry rule entryRuleClassDefinition +entryRuleClassDefinition returns [EObject current=null]: + { newCompositeNode(grammarAccess.getClassDefinitionRule()); } + iv_ruleClassDefinition=ruleClassDefinition + { $current=$iv_ruleClassDefinition.current; } + EOF; + +// Rule ClassDefinition +ruleClassDefinition returns [EObject current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( ( ( + lv_abstract_0_0='abstract' { - newCompositeNode(grammarAccess.getFieldRelationInterpretationAccess().getSymbolModelSymbolParserRuleCall_1_0()); + newLeafNode(lv_abstract_0_0, grammarAccess.getClassDefinitionAccess().getAbstractAbstractKeyword_0_0()); } - lv_symbol_1_0=ruleModelSymbol { if ($current==null) { - $current = createModelElementForParent(grammarAccess.getFieldRelationInterpretationRule()); + $current = createModelElement(grammarAccess.getClassDefinitionRule()); } - set( - $current, - "symbol", - lv_symbol_1_0, - "org.eclipse.viatra.solver.language.SolverLanguage.ModelSymbol"); - afterParserOrEnumRuleCall(); + setWithLastConsumed($current, "abstract", true, "abstract"); } ) - ) - otherlv_2=':' + )? + otherlv_1='class' { - newLeafNode(otherlv_2, grammarAccess.getFieldRelationInterpretationAccess().getColonKeyword_2()); + newLeafNode(otherlv_1, grammarAccess.getClassDefinitionAccess().getClassKeyword_1()); } ( ( + lv_name_2_0=RULE_ID { - newCompositeNode(grammarAccess.getFieldRelationInterpretationAccess().getMultiplicityMultiplicityDefinitionParserRuleCall_3_0()); + newLeafNode(lv_name_2_0, grammarAccess.getClassDefinitionAccess().getNameIDTerminalRuleCall_2_0()); } - lv_multiplicity_3_0=ruleMultiplicityDefinition { if ($current==null) { - $current = createModelElementForParent(grammarAccess.getFieldRelationInterpretationRule()); + $current = createModelElement(grammarAccess.getClassDefinitionRule()); } - set( + setWithLastConsumed( $current, - "multiplicity", - lv_multiplicity_3_0, - "org.eclipse.viatra.solver.language.SolverLanguage.MultiplicityDefinition"); - afterParserOrEnumRuleCall(); + "name", + lv_name_2_0, + "org.eclipse.xtext.common.Terminals.ID"); } ) + ) + ( + otherlv_3='extends' + { + newLeafNode(otherlv_3, grammarAccess.getClassDefinitionAccess().getExtendsKeyword_3_0()); + } + ( + ( + { + if ($current==null) { + $current = createModelElement(grammarAccess.getClassDefinitionRule()); + } + } + { + newCompositeNode(grammarAccess.getClassDefinitionAccess().getSuperclassesNamedElementCrossReference_3_1_0()); + } + ruleQualifiedName + { + afterParserOrEnumRuleCall(); + } + ) + ) + ( + otherlv_5=',' + { + newLeafNode(otherlv_5, grammarAccess.getClassDefinitionAccess().getCommaKeyword_3_2_0()); + } + ( + ( + { + if ($current==null) { + $current = createModelElement(grammarAccess.getClassDefinitionRule()); + } + } + { + newCompositeNode(grammarAccess.getClassDefinitionAccess().getSuperclassesNamedElementCrossReference_3_2_1_0()); + } + ruleQualifiedName + { + afterParserOrEnumRuleCall(); + } + ) + ) + )* )? + otherlv_7='{' + { + newLeafNode(otherlv_7, grammarAccess.getClassDefinitionAccess().getLeftCurlyBracketKeyword_4()); + } ( ( { - newCompositeNode(grammarAccess.getFieldRelationInterpretationAccess().getTargetSymbolParserRuleCall_4_0()); + newCompositeNode(grammarAccess.getClassDefinitionAccess().getMembersMemberDefinitionParserRuleCall_5_0()); } - lv_target_4_0=ruleSymbol + lv_members_8_0=ruleMemberDefinition { if ($current==null) { - $current = createModelElementForParent(grammarAccess.getFieldRelationInterpretationRule()); + $current = createModelElementForParent(grammarAccess.getClassDefinitionRule()); } - set( + add( $current, - "target", - lv_target_4_0, - "org.eclipse.viatra.solver.language.SolverLanguage.Symbol"); + "members", + lv_members_8_0, + "org.eclipse.viatra.solver.language.SolverLanguage.MemberDefinition"); afterParserOrEnumRuleCall(); } ) - ) + )* + otherlv_9='}' + { + newLeafNode(otherlv_9, grammarAccess.getClassDefinitionAccess().getRightCurlyBracketKeyword_6()); + } ) ; -// Entry rule entryRuleGlobalRelationInterpretation -entryRuleGlobalRelationInterpretation returns [EObject current=null]: - { newCompositeNode(grammarAccess.getGlobalRelationInterpretationRule()); } - iv_ruleGlobalRelationInterpretation=ruleGlobalRelationInterpretation - { $current=$iv_ruleGlobalRelationInterpretation.current; } +// Entry rule entryRuleMemberDefinition +entryRuleMemberDefinition returns [EObject current=null]: + { newCompositeNode(grammarAccess.getMemberDefinitionRule()); } + iv_ruleMemberDefinition=ruleMemberDefinition + { $current=$iv_ruleMemberDefinition.current; } EOF; -// Rule GlobalRelationInterpretation -ruleGlobalRelationInterpretation returns [EObject current=null] +// Rule MemberDefinition +ruleMemberDefinition returns [EObject current=null] @init { enterRule(); } @@ -2300,133 +2666,236 @@ ruleGlobalRelationInterpretation returns [EObject current=null] ( ( ( - lv_containment_0_0='containment' + lv_containment_0_0='contains' { - newLeafNode(lv_containment_0_0, grammarAccess.getGlobalRelationInterpretationAccess().getContainmentContainmentKeyword_0_0()); + newLeafNode(lv_containment_0_0, grammarAccess.getMemberDefinitionAccess().getContainmentContainsKeyword_0_0()); } { if ($current==null) { - $current = createModelElement(grammarAccess.getGlobalRelationInterpretationRule()); + $current = createModelElement(grammarAccess.getMemberDefinitionRule()); } - setWithLastConsumed($current, "containment", true, "containment"); + setWithLastConsumed($current, "containment", true, "contains"); } ) )? - otherlv_1='relation' - { - newLeafNode(otherlv_1, grammarAccess.getGlobalRelationInterpretationAccess().getRelationKeyword_1()); - } ( ( - { - newCompositeNode(grammarAccess.getGlobalRelationInterpretationAccess().getSymbolModelSymbolParserRuleCall_2_0()); - } - lv_symbol_2_0=ruleModelSymbol { if ($current==null) { - $current = createModelElementForParent(grammarAccess.getGlobalRelationInterpretationRule()); + $current = createModelElement(grammarAccess.getMemberDefinitionRule()); } - set( - $current, - "symbol", - lv_symbol_2_0, - "org.eclipse.viatra.solver.language.SolverLanguage.ModelSymbol"); + } + { + newCompositeNode(grammarAccess.getMemberDefinitionAccess().getTypeNamedElementCrossReference_1_0()); + } + ruleQualifiedName + { afterParserOrEnumRuleCall(); } ) ) - otherlv_3=':' - { - newLeafNode(otherlv_3, grammarAccess.getGlobalRelationInterpretationAccess().getColonKeyword_3()); - } ( ( { - newCompositeNode(grammarAccess.getGlobalRelationInterpretationAccess().getSourceMultiplicityMultiplicityDefinitionParserRuleCall_4_0()); + newCompositeNode(grammarAccess.getMemberDefinitionAccess().getMultiplicityMultiplicityParserRuleCall_2_0()); } - lv_sourceMultiplicity_4_0=ruleMultiplicityDefinition + lv_multiplicity_2_0=ruleMultiplicity { if ($current==null) { - $current = createModelElementForParent(grammarAccess.getGlobalRelationInterpretationRule()); + $current = createModelElementForParent(grammarAccess.getMemberDefinitionRule()); } set( $current, - "sourceMultiplicity", - lv_sourceMultiplicity_4_0, - "org.eclipse.viatra.solver.language.SolverLanguage.MultiplicityDefinition"); + "multiplicity", + lv_multiplicity_2_0, + "org.eclipse.viatra.solver.language.SolverLanguage.Multiplicity"); afterParserOrEnumRuleCall(); } ) )? ( ( + lv_name_3_0=RULE_ID { - newCompositeNode(grammarAccess.getGlobalRelationInterpretationAccess().getSourceSymbolParserRuleCall_5_0()); + newLeafNode(lv_name_3_0, grammarAccess.getMemberDefinitionAccess().getNameIDTerminalRuleCall_3_0()); } - lv_source_5_0=ruleSymbol { if ($current==null) { - $current = createModelElementForParent(grammarAccess.getGlobalRelationInterpretationRule()); + $current = createModelElement(grammarAccess.getMemberDefinitionRule()); } - set( + setWithLastConsumed( $current, - "source", - lv_source_5_0, - "org.eclipse.viatra.solver.language.SolverLanguage.Symbol"); - afterParserOrEnumRuleCall(); + "name", + lv_name_3_0, + "org.eclipse.xtext.common.Terminals.ID"); } ) ) ( + otherlv_4='opposite' + { + newLeafNode(otherlv_4, grammarAccess.getMemberDefinitionAccess().getOppositeKeyword_4_0()); + } ( - { - newCompositeNode(grammarAccess.getGlobalRelationInterpretationAccess().getTargetMultiplicityMultiplicityDefinitionParserRuleCall_6_0()); - } - lv_targetMultiplicity_6_0=ruleMultiplicityDefinition - { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getGlobalRelationInterpretationRule()); + ( + { + if ($current==null) { + $current = createModelElement(grammarAccess.getMemberDefinitionRule()); + } } - set( - $current, - "targetMultiplicity", - lv_targetMultiplicity_6_0, - "org.eclipse.viatra.solver.language.SolverLanguage.MultiplicityDefinition"); - afterParserOrEnumRuleCall(); - } + { + newCompositeNode(grammarAccess.getMemberDefinitionAccess().getOppositeNamedElementCrossReference_4_1_0()); + } + ruleQualifiedName + { + afterParserOrEnumRuleCall(); + } + ) ) )? + ( + otherlv_6=';' + { + newLeafNode(otherlv_6, grammarAccess.getMemberDefinitionAccess().getSemicolonKeyword_5()); + } + )? + ) +; + +// Entry rule entryRuleMultiplicity +entryRuleMultiplicity returns [EObject current=null]: + { newCompositeNode(grammarAccess.getMultiplicityRule()); } + iv_ruleMultiplicity=ruleMultiplicity + { $current=$iv_ruleMultiplicity.current; } + EOF; + +// Rule Multiplicity +ruleMultiplicity returns [EObject current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + { + newCompositeNode(grammarAccess.getMultiplicityAccess().getManyMultiplicityParserRuleCall_0()); + } + this_ManyMultiplicity_0=ruleManyMultiplicity + { + $current = $this_ManyMultiplicity_0.current; + afterParserOrEnumRuleCall(); + } + | + { + newCompositeNode(grammarAccess.getMultiplicityAccess().getExactMultiplicityParserRuleCall_1()); + } + this_ExactMultiplicity_1=ruleExactMultiplicity + { + $current = $this_ExactMultiplicity_1.current; + afterParserOrEnumRuleCall(); + } + | + { + newCompositeNode(grammarAccess.getMultiplicityAccess().getBoundedMultiplicityParserRuleCall_2()); + } + this_BoundedMultiplicity_2=ruleBoundedMultiplicity + { + $current = $this_BoundedMultiplicity_2.current; + afterParserOrEnumRuleCall(); + } + ) +; + +// Entry rule entryRuleManyMultiplicity +entryRuleManyMultiplicity returns [EObject current=null]: + { newCompositeNode(grammarAccess.getManyMultiplicityRule()); } + iv_ruleManyMultiplicity=ruleManyMultiplicity + { $current=$iv_ruleManyMultiplicity.current; } + EOF; + +// Rule ManyMultiplicity +ruleManyMultiplicity returns [EObject current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + ( + { + $current = forceCreateModelElement( + grammarAccess.getManyMultiplicityAccess().getManyMultiplicityAction_0(), + $current); + } + ) + otherlv_1='[' + { + newLeafNode(otherlv_1, grammarAccess.getManyMultiplicityAccess().getLeftSquareBracketKeyword_1()); + } + otherlv_2=']' + { + newLeafNode(otherlv_2, grammarAccess.getManyMultiplicityAccess().getRightSquareBracketKeyword_2()); + } + ) +; + +// Entry rule entryRuleExactMultiplicity +entryRuleExactMultiplicity returns [EObject current=null]: + { newCompositeNode(grammarAccess.getExactMultiplicityRule()); } + iv_ruleExactMultiplicity=ruleExactMultiplicity + { $current=$iv_ruleExactMultiplicity.current; } + EOF; + +// Rule ExactMultiplicity +ruleExactMultiplicity returns [EObject current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + otherlv_0='[' + { + newLeafNode(otherlv_0, grammarAccess.getExactMultiplicityAccess().getLeftSquareBracketKeyword_0()); + } ( ( { - newCompositeNode(grammarAccess.getGlobalRelationInterpretationAccess().getTargetSymbolParserRuleCall_7_0()); + newCompositeNode(grammarAccess.getExactMultiplicityAccess().getMultiplicityUpperMultiplictyParserRuleCall_1_0()); } - lv_target_7_0=ruleSymbol + lv_multiplicity_1_0=ruleUpperMultiplicty { if ($current==null) { - $current = createModelElementForParent(grammarAccess.getGlobalRelationInterpretationRule()); + $current = createModelElementForParent(grammarAccess.getExactMultiplicityRule()); } set( $current, - "target", - lv_target_7_0, - "org.eclipse.viatra.solver.language.SolverLanguage.Symbol"); + "multiplicity", + lv_multiplicity_1_0, + "org.eclipse.viatra.solver.language.SolverLanguage.UpperMultiplicty"); afterParserOrEnumRuleCall(); } ) ) + otherlv_2=']' + { + newLeafNode(otherlv_2, grammarAccess.getExactMultiplicityAccess().getRightSquareBracketKeyword_2()); + } ) ; -// Entry rule entryRuleMultiplicityDefinition -entryRuleMultiplicityDefinition returns [EObject current=null]: - { newCompositeNode(grammarAccess.getMultiplicityDefinitionRule()); } - iv_ruleMultiplicityDefinition=ruleMultiplicityDefinition - { $current=$iv_ruleMultiplicityDefinition.current; } +// Entry rule entryRuleBoundedMultiplicity +entryRuleBoundedMultiplicity returns [EObject current=null]: + { newCompositeNode(grammarAccess.getBoundedMultiplicityRule()); } + iv_ruleBoundedMultiplicity=ruleBoundedMultiplicity + { $current=$iv_ruleBoundedMultiplicity.current; } EOF; -// Rule MultiplicityDefinition -ruleMultiplicityDefinition returns [EObject current=null] +// Rule BoundedMultiplicity +ruleBoundedMultiplicity returns [EObject current=null] @init { enterRule(); } @@ -2434,67 +2903,991 @@ ruleMultiplicityDefinition returns [EObject current=null] leaveRule(); }: ( + otherlv_0='[' + { + newLeafNode(otherlv_0, grammarAccess.getBoundedMultiplicityAccess().getLeftSquareBracketKeyword_0()); + } ( ( - lv_lower_0_0=RULE_INT + lv_lowerBound_1_0=RULE_INT { - newLeafNode(lv_lower_0_0, grammarAccess.getMultiplicityDefinitionAccess().getLowerINTTerminalRuleCall_0_0()); + newLeafNode(lv_lowerBound_1_0, grammarAccess.getBoundedMultiplicityAccess().getLowerBoundINTTerminalRuleCall_1_0()); } { if ($current==null) { - $current = createModelElement(grammarAccess.getMultiplicityDefinitionRule()); + $current = createModelElement(grammarAccess.getBoundedMultiplicityRule()); } setWithLastConsumed( $current, - "lower", - lv_lower_0_0, + "lowerBound", + lv_lowerBound_1_0, "org.eclipse.xtext.common.Terminals.INT"); } ) ) - otherlv_1='..' + otherlv_2='..' { - newLeafNode(otherlv_1, grammarAccess.getMultiplicityDefinitionAccess().getFullStopFullStopKeyword_1()); + newLeafNode(otherlv_2, grammarAccess.getBoundedMultiplicityAccess().getFullStopFullStopKeyword_2()); } ( ( - ( - lv_upper_2_0=RULE_INT - { - newLeafNode(lv_upper_2_0, grammarAccess.getMultiplicityDefinitionAccess().getUpperINTTerminalRuleCall_2_0_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getMultiplicityDefinitionRule()); - } - setWithLastConsumed( - $current, - "upper", - lv_upper_2_0, - "org.eclipse.xtext.common.Terminals.INT"); - } - ) - ) - | - ( - ( - lv_unlimitedUpper_3_0='*' - { - newLeafNode(lv_unlimitedUpper_3_0, grammarAccess.getMultiplicityDefinitionAccess().getUnlimitedUpperAsteriskKeyword_2_1_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getMultiplicityDefinitionRule()); - } - setWithLastConsumed($current, "unlimitedUpper", true, "*"); + { + newCompositeNode(grammarAccess.getBoundedMultiplicityAccess().getUpperBoundUpperMultiplictyParserRuleCall_3_0()); + } + lv_upperBound_3_0=ruleUpperMultiplicty + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getBoundedMultiplicityRule()); } - ) + set( + $current, + "upperBound", + lv_upperBound_3_0, + "org.eclipse.viatra.solver.language.SolverLanguage.UpperMultiplicty"); + afterParserOrEnumRuleCall(); + } ) ) + otherlv_4=']' + { + newLeafNode(otherlv_4, grammarAccess.getBoundedMultiplicityAccess().getRightSquareBracketKeyword_4()); + } ) ; -RULE_STRING : '"' ('\\' .|~(('\\'|'"')))* '"'; +// Entry rule entryRuleScopeDefinition +entryRuleScopeDefinition returns [EObject current=null]: + { newCompositeNode(grammarAccess.getScopeDefinitionRule()); } + iv_ruleScopeDefinition=ruleScopeDefinition + { $current=$iv_ruleScopeDefinition.current; } + EOF; + +// Rule ScopeDefinition +ruleScopeDefinition returns [EObject current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + { + newCompositeNode(grammarAccess.getScopeDefinitionAccess().getExactScopeDefinitionParserRuleCall_0()); + } + this_ExactScopeDefinition_0=ruleExactScopeDefinition + { + $current = $this_ExactScopeDefinition_0.current; + afterParserOrEnumRuleCall(); + } + | + { + newCompositeNode(grammarAccess.getScopeDefinitionAccess().getBoundedScopeDefinitionParserRuleCall_1()); + } + this_BoundedScopeDefinition_1=ruleBoundedScopeDefinition + { + $current = $this_BoundedScopeDefinition_1.current; + afterParserOrEnumRuleCall(); + } + | + { + newCompositeNode(grammarAccess.getScopeDefinitionAccess().getLowerBoundedScopeDefinitionParserRuleCall_2()); + } + this_LowerBoundedScopeDefinition_2=ruleLowerBoundedScopeDefinition + { + $current = $this_LowerBoundedScopeDefinition_2.current; + afterParserOrEnumRuleCall(); + } + ) +; + +// Entry rule entryRuleExactScopeDefinition +entryRuleExactScopeDefinition returns [EObject current=null]: + { newCompositeNode(grammarAccess.getExactScopeDefinitionRule()); } + iv_ruleExactScopeDefinition=ruleExactScopeDefinition + { $current=$iv_ruleExactScopeDefinition.current; } + EOF; + +// Rule ExactScopeDefinition +ruleExactScopeDefinition returns [EObject current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + otherlv_0='scope' + { + newLeafNode(otherlv_0, grammarAccess.getExactScopeDefinitionAccess().getScopeKeyword_0()); + } + ( + ( + { + if ($current==null) { + $current = createModelElement(grammarAccess.getExactScopeDefinitionRule()); + } + } + { + newCompositeNode(grammarAccess.getExactScopeDefinitionAccess().getTypeNamedElementCrossReference_1_0()); + } + ruleQualifiedName + { + afterParserOrEnumRuleCall(); + } + ) + ) + otherlv_2='==' + { + newLeafNode(otherlv_2, grammarAccess.getExactScopeDefinitionAccess().getEqualsSignEqualsSignKeyword_2()); + } + ( + ( + lv_exactScope_3_0=RULE_INT + { + newLeafNode(lv_exactScope_3_0, grammarAccess.getExactScopeDefinitionAccess().getExactScopeINTTerminalRuleCall_3_0()); + } + { + if ($current==null) { + $current = createModelElement(grammarAccess.getExactScopeDefinitionRule()); + } + setWithLastConsumed( + $current, + "exactScope", + lv_exactScope_3_0, + "org.eclipse.xtext.common.Terminals.INT"); + } + ) + ) + ) +; + +// Entry rule entryRuleBoundedScopeDefinition +entryRuleBoundedScopeDefinition returns [EObject current=null]: + { newCompositeNode(grammarAccess.getBoundedScopeDefinitionRule()); } + iv_ruleBoundedScopeDefinition=ruleBoundedScopeDefinition + { $current=$iv_ruleBoundedScopeDefinition.current; } + EOF; + +// Rule BoundedScopeDefinition +ruleBoundedScopeDefinition returns [EObject current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + otherlv_0='scope' + { + newLeafNode(otherlv_0, grammarAccess.getBoundedScopeDefinitionAccess().getScopeKeyword_0()); + } + ( + ( + ( + ( + ( + lv_lowerBound_1_0=RULE_INT + { + newLeafNode(lv_lowerBound_1_0, grammarAccess.getBoundedScopeDefinitionAccess().getLowerBoundINTTerminalRuleCall_1_0_0_0_0()); + } + { + if ($current==null) { + $current = createModelElement(grammarAccess.getBoundedScopeDefinitionRule()); + } + setWithLastConsumed( + $current, + "lowerBound", + lv_lowerBound_1_0, + "org.eclipse.xtext.common.Terminals.INT"); + } + ) + ) + otherlv_2='<=' + { + newLeafNode(otherlv_2, grammarAccess.getBoundedScopeDefinitionAccess().getLessThanSignEqualsSignKeyword_1_0_0_1()); + } + )? + ( + ( + { + if ($current==null) { + $current = createModelElement(grammarAccess.getBoundedScopeDefinitionRule()); + } + } + { + newCompositeNode(grammarAccess.getBoundedScopeDefinitionAccess().getTypeNamedElementCrossReference_1_0_1_0()); + } + ruleQualifiedName + { + afterParserOrEnumRuleCall(); + } + ) + ) + otherlv_4='<=' + { + newLeafNode(otherlv_4, grammarAccess.getBoundedScopeDefinitionAccess().getLessThanSignEqualsSignKeyword_1_0_2()); + } + ( + ( + lv_upperBound_5_0=RULE_INT + { + newLeafNode(lv_upperBound_5_0, grammarAccess.getBoundedScopeDefinitionAccess().getUpperBoundINTTerminalRuleCall_1_0_3_0()); + } + { + if ($current==null) { + $current = createModelElement(grammarAccess.getBoundedScopeDefinitionRule()); + } + setWithLastConsumed( + $current, + "upperBound", + lv_upperBound_5_0, + "org.eclipse.xtext.common.Terminals.INT"); + } + ) + ) + ) + | + ( + ( + ( + lv_upperBound_6_0=RULE_INT + { + newLeafNode(lv_upperBound_6_0, grammarAccess.getBoundedScopeDefinitionAccess().getUpperBoundINTTerminalRuleCall_1_1_0_0()); + } + { + if ($current==null) { + $current = createModelElement(grammarAccess.getBoundedScopeDefinitionRule()); + } + setWithLastConsumed( + $current, + "upperBound", + lv_upperBound_6_0, + "org.eclipse.xtext.common.Terminals.INT"); + } + ) + ) + otherlv_7='>=' + { + newLeafNode(otherlv_7, grammarAccess.getBoundedScopeDefinitionAccess().getGreaterThanSignEqualsSignKeyword_1_1_1()); + } + ( + ( + { + if ($current==null) { + $current = createModelElement(grammarAccess.getBoundedScopeDefinitionRule()); + } + } + { + newCompositeNode(grammarAccess.getBoundedScopeDefinitionAccess().getTypeNamedElementCrossReference_1_1_2_0()); + } + ruleQualifiedName + { + afterParserOrEnumRuleCall(); + } + ) + ) + ( + otherlv_9='>=' + { + newLeafNode(otherlv_9, grammarAccess.getBoundedScopeDefinitionAccess().getGreaterThanSignEqualsSignKeyword_1_1_3_0()); + } + ( + ( + lv_lowerBound_10_0=RULE_INT + { + newLeafNode(lv_lowerBound_10_0, grammarAccess.getBoundedScopeDefinitionAccess().getLowerBoundINTTerminalRuleCall_1_1_3_1_0()); + } + { + if ($current==null) { + $current = createModelElement(grammarAccess.getBoundedScopeDefinitionRule()); + } + setWithLastConsumed( + $current, + "lowerBound", + lv_lowerBound_10_0, + "org.eclipse.xtext.common.Terminals.INT"); + } + ) + ) + )? + ) + ) + otherlv_11='.' + { + newLeafNode(otherlv_11, grammarAccess.getBoundedScopeDefinitionAccess().getFullStopKeyword_2()); + } + ) +; + +// Entry rule entryRuleLowerBoundedScopeDefinition +entryRuleLowerBoundedScopeDefinition returns [EObject current=null]: + { newCompositeNode(grammarAccess.getLowerBoundedScopeDefinitionRule()); } + iv_ruleLowerBoundedScopeDefinition=ruleLowerBoundedScopeDefinition + { $current=$iv_ruleLowerBoundedScopeDefinition.current; } + EOF; + +// Rule LowerBoundedScopeDefinition +ruleLowerBoundedScopeDefinition returns [EObject current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + otherlv_0='scope' + { + newLeafNode(otherlv_0, grammarAccess.getLowerBoundedScopeDefinitionAccess().getScopeKeyword_0()); + } + ( + ( + ( + ( + lv_lowerBound_1_0=RULE_INT + { + newLeafNode(lv_lowerBound_1_0, grammarAccess.getLowerBoundedScopeDefinitionAccess().getLowerBoundINTTerminalRuleCall_1_0_0_0()); + } + { + if ($current==null) { + $current = createModelElement(grammarAccess.getLowerBoundedScopeDefinitionRule()); + } + setWithLastConsumed( + $current, + "lowerBound", + lv_lowerBound_1_0, + "org.eclipse.xtext.common.Terminals.INT"); + } + ) + ) + otherlv_2='<=' + { + newLeafNode(otherlv_2, grammarAccess.getLowerBoundedScopeDefinitionAccess().getLessThanSignEqualsSignKeyword_1_0_1()); + } + ( + ( + { + if ($current==null) { + $current = createModelElement(grammarAccess.getLowerBoundedScopeDefinitionRule()); + } + } + { + newCompositeNode(grammarAccess.getLowerBoundedScopeDefinitionAccess().getTypeNamedElementCrossReference_1_0_2_0()); + } + ruleQualifiedName + { + afterParserOrEnumRuleCall(); + } + ) + ) + ) + | + ( + ( + ( + { + if ($current==null) { + $current = createModelElement(grammarAccess.getLowerBoundedScopeDefinitionRule()); + } + } + { + newCompositeNode(grammarAccess.getLowerBoundedScopeDefinitionAccess().getTypeNamedElementCrossReference_1_1_0_0()); + } + ruleQualifiedName + { + afterParserOrEnumRuleCall(); + } + ) + ) + otherlv_5='>=' + { + newLeafNode(otherlv_5, grammarAccess.getLowerBoundedScopeDefinitionAccess().getGreaterThanSignEqualsSignKeyword_1_1_1()); + } + ( + ( + lv_lowerBound_6_0=RULE_INT + { + newLeafNode(lv_lowerBound_6_0, grammarAccess.getLowerBoundedScopeDefinitionAccess().getLowerBoundINTTerminalRuleCall_1_1_2_0()); + } + { + if ($current==null) { + $current = createModelElement(grammarAccess.getLowerBoundedScopeDefinitionRule()); + } + setWithLastConsumed( + $current, + "lowerBound", + lv_lowerBound_6_0, + "org.eclipse.xtext.common.Terminals.INT"); + } + ) + ) + ) + ) + otherlv_7='.' + { + newLeafNode(otherlv_7, grammarAccess.getLowerBoundedScopeDefinitionAccess().getFullStopKeyword_2()); + } + ) +; + +// Entry rule entryRuleObjectiveDefinition +entryRuleObjectiveDefinition returns [EObject current=null]: + { newCompositeNode(grammarAccess.getObjectiveDefinitionRule()); } + iv_ruleObjectiveDefinition=ruleObjectiveDefinition + { $current=$iv_ruleObjectiveDefinition.current; } + EOF; + +// Rule ObjectiveDefinition +ruleObjectiveDefinition returns [EObject current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + ( + ( + { + newCompositeNode(grammarAccess.getObjectiveDefinitionAccess().getKindObjectiveKindEnumRuleCall_0_0()); + } + lv_kind_0_0=ruleObjectiveKind + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getObjectiveDefinitionRule()); + } + set( + $current, + "kind", + lv_kind_0_0, + "org.eclipse.viatra.solver.language.SolverLanguage.ObjectiveKind"); + afterParserOrEnumRuleCall(); + } + ) + ) + ( + ( + { + newCompositeNode(grammarAccess.getObjectiveDefinitionAccess().getObjectiveExpressionParserRuleCall_1_0()); + } + lv_objective_1_0=ruleExpression + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getObjectiveDefinitionRule()); + } + set( + $current, + "objective", + lv_objective_1_0, + "org.eclipse.viatra.solver.language.SolverLanguage.Expression"); + afterParserOrEnumRuleCall(); + } + ) + ) + ) +; + +// Entry rule entryRuleUpperMultiplicty +entryRuleUpperMultiplicty returns [String current=null]: + { newCompositeNode(grammarAccess.getUpperMultiplictyRule()); } + iv_ruleUpperMultiplicty=ruleUpperMultiplicty + { $current=$iv_ruleUpperMultiplicty.current.getText(); } + EOF; + +// Rule UpperMultiplicty +ruleUpperMultiplicty returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + this_INT_0=RULE_INT + { + $current.merge(this_INT_0); + } + { + newLeafNode(this_INT_0, grammarAccess.getUpperMultiplictyAccess().getINTTerminalRuleCall_0()); + } + | + kw='*' + { + $current.merge(kw); + newLeafNode(kw, grammarAccess.getUpperMultiplictyAccess().getAsteriskKeyword_1()); + } + ) +; + +// Entry rule entryRuleReal +entryRuleReal returns [String current=null]@init { + HiddenTokens myHiddenTokenState = ((XtextTokenStream)input).setHiddenTokens(); +}: + { newCompositeNode(grammarAccess.getRealRule()); } + iv_ruleReal=ruleReal + { $current=$iv_ruleReal.current.getText(); } + EOF; +finally { + myHiddenTokenState.restore(); +} + +// Rule Real +ruleReal returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] +@init { + enterRule(); + HiddenTokens myHiddenTokenState = ((XtextTokenStream)input).setHiddenTokens(); +} +@after { + leaveRule(); +}: + ( + this_INT_0=RULE_INT + { + $current.merge(this_INT_0); + } + { + newLeafNode(this_INT_0, grammarAccess.getRealAccess().getINTTerminalRuleCall_0()); + } + ( + kw='.' + { + $current.merge(kw); + newLeafNode(kw, grammarAccess.getRealAccess().getFullStopKeyword_1_0()); + } + this_INT_2=RULE_INT + { + $current.merge(this_INT_2); + } + { + newLeafNode(this_INT_2, grammarAccess.getRealAccess().getINTTerminalRuleCall_1_1()); + } + )? + ) +; +finally { + myHiddenTokenState.restore(); +} + +// Entry rule entryRuleQualifiedName +entryRuleQualifiedName returns [String current=null]@init { + HiddenTokens myHiddenTokenState = ((XtextTokenStream)input).setHiddenTokens(); +}: + { newCompositeNode(grammarAccess.getQualifiedNameRule()); } + iv_ruleQualifiedName=ruleQualifiedName + { $current=$iv_ruleQualifiedName.current.getText(); } + EOF; +finally { + myHiddenTokenState.restore(); +} + +// Rule QualifiedName +ruleQualifiedName returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] +@init { + enterRule(); + HiddenTokens myHiddenTokenState = ((XtextTokenStream)input).setHiddenTokens(); +} +@after { + leaveRule(); +}: + ( + ( + this_ID_0=RULE_ID + { + $current.merge(this_ID_0); + } + { + newLeafNode(this_ID_0, grammarAccess.getQualifiedNameAccess().getIDTerminalRuleCall_0_0()); + } + ( + kw='.' + { + $current.merge(kw); + newLeafNode(kw, grammarAccess.getQualifiedNameAccess().getFullStopKeyword_0_1_0()); + } + this_ID_2=RULE_ID + { + $current.merge(this_ID_2); + } + { + newLeafNode(this_ID_2, grammarAccess.getQualifiedNameAccess().getIDTerminalRuleCall_0_1_1()); + } + )* + ) + | + this_QUOTED_ID_3=RULE_QUOTED_ID + { + $current.merge(this_QUOTED_ID_3); + } + { + newLeafNode(this_QUOTED_ID_3, grammarAccess.getQualifiedNameAccess().getQUOTED_IDTerminalRuleCall_1()); + } + ) +; +finally { + myHiddenTokenState.restore(); +} + +// Rule MetricType +ruleMetricType returns [Enumerator current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + ( + enumLiteral_0='int' + { + $current = grammarAccess.getMetricTypeAccess().getINTEnumLiteralDeclaration_0().getEnumLiteral().getInstance(); + newLeafNode(enumLiteral_0, grammarAccess.getMetricTypeAccess().getINTEnumLiteralDeclaration_0()); + } + ) + | + ( + enumLiteral_1='real' + { + $current = grammarAccess.getMetricTypeAccess().getREALEnumLiteralDeclaration_1().getEnumLiteral().getInstance(); + newLeafNode(enumLiteral_1, grammarAccess.getMetricTypeAccess().getREALEnumLiteralDeclaration_1()); + } + ) + ) +; + +// Rule ComparisonOperator +ruleComparisonOperator returns [Enumerator current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + ( + enumLiteral_0='==' + { + $current = grammarAccess.getComparisonOperatorAccess().getEQEnumLiteralDeclaration_0().getEnumLiteral().getInstance(); + newLeafNode(enumLiteral_0, grammarAccess.getComparisonOperatorAccess().getEQEnumLiteralDeclaration_0()); + } + ) + | + ( + enumLiteral_1='!=' + { + $current = grammarAccess.getComparisonOperatorAccess().getNOT_EQEnumLiteralDeclaration_1().getEnumLiteral().getInstance(); + newLeafNode(enumLiteral_1, grammarAccess.getComparisonOperatorAccess().getNOT_EQEnumLiteralDeclaration_1()); + } + ) + | + ( + enumLiteral_2='<' + { + $current = grammarAccess.getComparisonOperatorAccess().getLESSEnumLiteralDeclaration_2().getEnumLiteral().getInstance(); + newLeafNode(enumLiteral_2, grammarAccess.getComparisonOperatorAccess().getLESSEnumLiteralDeclaration_2()); + } + ) + | + ( + enumLiteral_3='<=' + { + $current = grammarAccess.getComparisonOperatorAccess().getLESS_EQEnumLiteralDeclaration_3().getEnumLiteral().getInstance(); + newLeafNode(enumLiteral_3, grammarAccess.getComparisonOperatorAccess().getLESS_EQEnumLiteralDeclaration_3()); + } + ) + | + ( + enumLiteral_4='>' + { + $current = grammarAccess.getComparisonOperatorAccess().getGREATEREnumLiteralDeclaration_4().getEnumLiteral().getInstance(); + newLeafNode(enumLiteral_4, grammarAccess.getComparisonOperatorAccess().getGREATEREnumLiteralDeclaration_4()); + } + ) + | + ( + enumLiteral_5='>=' + { + $current = grammarAccess.getComparisonOperatorAccess().getGREATER_EQEnumLiteralDeclaration_5().getEnumLiteral().getInstance(); + newLeafNode(enumLiteral_5, grammarAccess.getComparisonOperatorAccess().getGREATER_EQEnumLiteralDeclaration_5()); + } + ) + | + ( + enumLiteral_6='in' + { + $current = grammarAccess.getComparisonOperatorAccess().getINEnumLiteralDeclaration_6().getEnumLiteral().getInstance(); + newLeafNode(enumLiteral_6, grammarAccess.getComparisonOperatorAccess().getINEnumLiteralDeclaration_6()); + } + ) + ) +; + +// Rule AdditiveBinaryOperator +ruleAdditiveBinaryOperator returns [Enumerator current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + ( + enumLiteral_0='+' + { + $current = grammarAccess.getAdditiveBinaryOperatorAccess().getADDEnumLiteralDeclaration_0().getEnumLiteral().getInstance(); + newLeafNode(enumLiteral_0, grammarAccess.getAdditiveBinaryOperatorAccess().getADDEnumLiteralDeclaration_0()); + } + ) + | + ( + enumLiteral_1='-' + { + $current = grammarAccess.getAdditiveBinaryOperatorAccess().getSUBEnumLiteralDeclaration_1().getEnumLiteral().getInstance(); + newLeafNode(enumLiteral_1, grammarAccess.getAdditiveBinaryOperatorAccess().getSUBEnumLiteralDeclaration_1()); + } + ) + ) +; + +// Rule MultiplicativeBinaryOperator +ruleMultiplicativeBinaryOperator returns [Enumerator current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + ( + enumLiteral_0='*' + { + $current = grammarAccess.getMultiplicativeBinaryOperatorAccess().getMULEnumLiteralDeclaration_0().getEnumLiteral().getInstance(); + newLeafNode(enumLiteral_0, grammarAccess.getMultiplicativeBinaryOperatorAccess().getMULEnumLiteralDeclaration_0()); + } + ) + | + ( + enumLiteral_1='/' + { + $current = grammarAccess.getMultiplicativeBinaryOperatorAccess().getDIVEnumLiteralDeclaration_1().getEnumLiteral().getInstance(); + newLeafNode(enumLiteral_1, grammarAccess.getMultiplicativeBinaryOperatorAccess().getDIVEnumLiteralDeclaration_1()); + } + ) + ) +; + +// Rule ExponentialOp +ruleExponentialOp returns [Enumerator current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + enumLiteral_0='^' + { + $current = grammarAccess.getExponentialOpAccess().getPOWEnumLiteralDeclaration().getEnumLiteral().getInstance(); + newLeafNode(enumLiteral_0, grammarAccess.getExponentialOpAccess().getPOWEnumLiteralDeclaration()); + } + ) +; + +// Rule UnaryOp +ruleUnaryOp returns [Enumerator current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + ( + enumLiteral_0='!' + { + $current = grammarAccess.getUnaryOpAccess().getNEGEnumLiteralDeclaration_0().getEnumLiteral().getInstance(); + newLeafNode(enumLiteral_0, grammarAccess.getUnaryOpAccess().getNEGEnumLiteralDeclaration_0()); + } + ) + | + ( + enumLiteral_1='+' + { + $current = grammarAccess.getUnaryOpAccess().getPLUSEnumLiteralDeclaration_1().getEnumLiteral().getInstance(); + newLeafNode(enumLiteral_1, grammarAccess.getUnaryOpAccess().getPLUSEnumLiteralDeclaration_1()); + } + ) + | + ( + enumLiteral_2='-' + { + $current = grammarAccess.getUnaryOpAccess().getMINUSEnumLiteralDeclaration_2().getEnumLiteral().getInstance(); + newLeafNode(enumLiteral_2, grammarAccess.getUnaryOpAccess().getMINUSEnumLiteralDeclaration_2()); + } + ) + | + ( + enumLiteral_3='may' + { + $current = grammarAccess.getUnaryOpAccess().getMAYEnumLiteralDeclaration_3().getEnumLiteral().getInstance(); + newLeafNode(enumLiteral_3, grammarAccess.getUnaryOpAccess().getMAYEnumLiteralDeclaration_3()); + } + ) + | + ( + enumLiteral_4='must' + { + $current = grammarAccess.getUnaryOpAccess().getMUSTEnumLiteralDeclaration_4().getEnumLiteral().getInstance(); + newLeafNode(enumLiteral_4, grammarAccess.getUnaryOpAccess().getMUSTEnumLiteralDeclaration_4()); + } + ) + | + ( + enumLiteral_5='current' + { + $current = grammarAccess.getUnaryOpAccess().getCURRENTEnumLiteralDeclaration_5().getEnumLiteral().getInstance(); + newLeafNode(enumLiteral_5, grammarAccess.getUnaryOpAccess().getCURRENTEnumLiteralDeclaration_5()); + } + ) + ) +; + +// Rule AggregationOp +ruleAggregationOp returns [Enumerator current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + ( + enumLiteral_0='only' + { + $current = grammarAccess.getAggregationOpAccess().getONLYEnumLiteralDeclaration_0().getEnumLiteral().getInstance(); + newLeafNode(enumLiteral_0, grammarAccess.getAggregationOpAccess().getONLYEnumLiteralDeclaration_0()); + } + ) + | + ( + enumLiteral_1='sum' + { + $current = grammarAccess.getAggregationOpAccess().getSUMEnumLiteralDeclaration_1().getEnumLiteral().getInstance(); + newLeafNode(enumLiteral_1, grammarAccess.getAggregationOpAccess().getSUMEnumLiteralDeclaration_1()); + } + ) + | + ( + enumLiteral_2='prod' + { + $current = grammarAccess.getAggregationOpAccess().getPRODEnumLiteralDeclaration_2().getEnumLiteral().getInstance(); + newLeafNode(enumLiteral_2, grammarAccess.getAggregationOpAccess().getPRODEnumLiteralDeclaration_2()); + } + ) + | + ( + enumLiteral_3='avg' + { + $current = grammarAccess.getAggregationOpAccess().getAVGEnumLiteralDeclaration_3().getEnumLiteral().getInstance(); + newLeafNode(enumLiteral_3, grammarAccess.getAggregationOpAccess().getAVGEnumLiteralDeclaration_3()); + } + ) + | + ( + enumLiteral_4='min' + { + $current = grammarAccess.getAggregationOpAccess().getMINEnumLiteralDeclaration_4().getEnumLiteral().getInstance(); + newLeafNode(enumLiteral_4, grammarAccess.getAggregationOpAccess().getMINEnumLiteralDeclaration_4()); + } + ) + | + ( + enumLiteral_5='max' + { + $current = grammarAccess.getAggregationOpAccess().getMAXEnumLiteralDeclaration_5().getEnumLiteral().getInstance(); + newLeafNode(enumLiteral_5, grammarAccess.getAggregationOpAccess().getMAXEnumLiteralDeclaration_5()); + } + ) + ) +; + +// Rule LogicValue +ruleLogicValue returns [Enumerator current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + ( + enumLiteral_0='true' + { + $current = grammarAccess.getLogicValueAccess().getTRUEEnumLiteralDeclaration_0().getEnumLiteral().getInstance(); + newLeafNode(enumLiteral_0, grammarAccess.getLogicValueAccess().getTRUEEnumLiteralDeclaration_0()); + } + ) + | + ( + enumLiteral_1='false' + { + $current = grammarAccess.getLogicValueAccess().getFALSEEnumLiteralDeclaration_1().getEnumLiteral().getInstance(); + newLeafNode(enumLiteral_1, grammarAccess.getLogicValueAccess().getFALSEEnumLiteralDeclaration_1()); + } + ) + | + ( + enumLiteral_2='unknown' + { + $current = grammarAccess.getLogicValueAccess().getUNKNOWNEnumLiteralDeclaration_2().getEnumLiteral().getInstance(); + newLeafNode(enumLiteral_2, grammarAccess.getLogicValueAccess().getUNKNOWNEnumLiteralDeclaration_2()); + } + ) + | + ( + enumLiteral_3='error' + { + $current = grammarAccess.getLogicValueAccess().getERROREnumLiteralDeclaration_3().getEnumLiteral().getInstance(); + newLeafNode(enumLiteral_3, grammarAccess.getLogicValueAccess().getERROREnumLiteralDeclaration_3()); + } + ) + ) +; + +// Rule ObjectiveKind +ruleObjectiveKind returns [Enumerator current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + ( + enumLiteral_0='minimize' + { + $current = grammarAccess.getObjectiveKindAccess().getMINIMIZEEnumLiteralDeclaration_0().getEnumLiteral().getInstance(); + newLeafNode(enumLiteral_0, grammarAccess.getObjectiveKindAccess().getMINIMIZEEnumLiteralDeclaration_0()); + } + ) + | + ( + enumLiteral_1='maximize' + { + $current = grammarAccess.getObjectiveKindAccess().getMAXIMIZEEnumLiteralDeclaration_1().getEnumLiteral().getInstance(); + newLeafNode(enumLiteral_1, grammarAccess.getObjectiveKindAccess().getMAXIMIZEEnumLiteralDeclaration_1()); + } + ) + ) +; + +RULE_STRING : '"' ('\\' .|~(('\\'|'"')))* '"'; + +RULE_QUOTED_ID : '\'' ('\\' .|~(('\\'|'\'')))* '\''; + +RULE_PLUS : 'synthetic::plus'; + +RULE_STAR : 'synthetic::star'; + +RULE_DOT : 'synthetic::dot'; RULE_ID : '^'? ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'_'|'0'..'9')*; -- cgit v1.2.3-70-g09d2