/* * generated by Xtext 2.26.0.M1 */ grammar InternalProblem; options { superClass=AbstractInternalAntlrParser; } @lexer::header { package org.eclipse.viatra.solver.language.parser.antlr.internal; // Hack: Use our own Lexer superclass by means of import. // Currently there is no other way to specify the superclass for the lexer. import org.eclipse.xtext.parser.antlr.Lexer; } @parser::header { package org.eclipse.viatra.solver.language.parser.antlr.internal; import org.eclipse.xtext.*; 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; import org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken; import org.eclipse.viatra.solver.language.services.ProblemGrammarAccess; } @parser::members { private ProblemGrammarAccess grammarAccess; public InternalProblemParser(TokenStream input, ProblemGrammarAccess grammarAccess) { this(input); this.grammarAccess = grammarAccess; registerRules(grammarAccess.getGrammar()); } @Override protected String getFirstRuleName() { return "Problem"; } @Override protected ProblemGrammarAccess getGrammarAccess() { return grammarAccess; } } @rulecatch { catch (RecognitionException re) { recover(input,re); appendSkippedTokens(); } } // Entry rule entryRuleProblem entryRuleProblem returns [EObject current=null]: { newCompositeNode(grammarAccess.getProblemRule()); } iv_ruleProblem=ruleProblem { $current=$iv_ruleProblem.current; } EOF; // Rule Problem ruleProblem returns [EObject current=null] @init { enterRule(); } @after { leaveRule(); }: ( ( otherlv_0='problem' { newLeafNode(otherlv_0, grammarAccess.getProblemAccess().getProblemKeyword_0_0()); } ( ( lv_name_1_0=RULE_ID { newLeafNode(lv_name_1_0, grammarAccess.getProblemAccess().getNameIDTerminalRuleCall_0_1_0()); } { if ($current==null) { $current = createModelElement(grammarAccess.getProblemRule()); } setWithLastConsumed( $current, "name", lv_name_1_0, "org.eclipse.xtext.common.Terminals.ID"); } ) ) otherlv_2='.' { newLeafNode(otherlv_2, grammarAccess.getProblemAccess().getFullStopKeyword_0_2()); } )? ( ( { newCompositeNode(grammarAccess.getProblemAccess().getStatementsStatementParserRuleCall_1_0()); } lv_statements_3_0=ruleStatement { if ($current==null) { $current = createModelElementForParent(grammarAccess.getProblemRule()); } add( $current, "statements", lv_statements_3_0, "org.eclipse.viatra.solver.language.Problem.Statement"); afterParserOrEnumRuleCall(); } ) )* ) ; // Entry rule entryRuleStatement entryRuleStatement returns [EObject current=null]: { newCompositeNode(grammarAccess.getStatementRule()); } iv_ruleStatement=ruleStatement { $current=$iv_ruleStatement.current; } EOF; // Rule Statement ruleStatement returns [EObject current=null] @init { enterRule(); } @after { leaveRule(); }: ( { newCompositeNode(grammarAccess.getStatementAccess().getClassDeclarationParserRuleCall_0()); } this_ClassDeclaration_0=ruleClassDeclaration { $current = $this_ClassDeclaration_0.current; afterParserOrEnumRuleCall(); } | { newCompositeNode(grammarAccess.getStatementAccess().getPredicateDefinitionParserRuleCall_1()); } this_PredicateDefinition_1=rulePredicateDefinition { $current = $this_PredicateDefinition_1.current; afterParserOrEnumRuleCall(); } | { newCompositeNode(grammarAccess.getStatementAccess().getAssertionParserRuleCall_2()); } this_Assertion_2=ruleAssertion { $current = $this_Assertion_2.current; afterParserOrEnumRuleCall(); } | { newCompositeNode(grammarAccess.getStatementAccess().getScopeDeclarationParserRuleCall_3()); } this_ScopeDeclaration_3=ruleScopeDeclaration { $current = $this_ScopeDeclaration_3.current; afterParserOrEnumRuleCall(); } ) ; // Entry rule entryRuleClassDeclaration entryRuleClassDeclaration returns [EObject current=null]: { newCompositeNode(grammarAccess.getClassDeclarationRule()); } iv_ruleClassDeclaration=ruleClassDeclaration { $current=$iv_ruleClassDeclaration.current; } EOF; // Rule ClassDeclaration ruleClassDeclaration returns [EObject current=null] @init { enterRule(); } @after { leaveRule(); }: ( ( ( lv_abstract_0_0='abstract' { newLeafNode(lv_abstract_0_0, grammarAccess.getClassDeclarationAccess().getAbstractAbstractKeyword_0_0()); } { if ($current==null) { $current = createModelElement(grammarAccess.getClassDeclarationRule()); } setWithLastConsumed($current, "abstract", lv_abstract_0_0 != null, "abstract"); } ) )? otherlv_1='class' { newLeafNode(otherlv_1, grammarAccess.getClassDeclarationAccess().getClassKeyword_1()); } ( ( lv_name_2_0=RULE_ID { newLeafNode(lv_name_2_0, grammarAccess.getClassDeclarationAccess().getNameIDTerminalRuleCall_2_0()); } { if ($current==null) { $current = createModelElement(grammarAccess.getClassDeclarationRule()); } setWithLastConsumed( $current, "name", lv_name_2_0, "org.eclipse.xtext.common.Terminals.ID"); } ) ) ( otherlv_3='extends' { newLeafNode(otherlv_3, grammarAccess.getClassDeclarationAccess().getExtendsKeyword_3_0()); } ( ( { if ($current==null) { $current = createModelElement(grammarAccess.getClassDeclarationRule()); } } { newCompositeNode(grammarAccess.getClassDeclarationAccess().getSuperTypesClassDeclarationCrossReference_3_1_0()); } ruleQualifiedName { afterParserOrEnumRuleCall(); } ) ) ( otherlv_5=',' { newLeafNode(otherlv_5, grammarAccess.getClassDeclarationAccess().getCommaKeyword_3_2_0()); } ( ( { if ($current==null) { $current = createModelElement(grammarAccess.getClassDeclarationRule()); } } { newCompositeNode(grammarAccess.getClassDeclarationAccess().getSuperTypesClassDeclarationCrossReference_3_2_1_0()); } ruleQualifiedName { afterParserOrEnumRuleCall(); } ) ) )* )? ( ( otherlv_7='{' { newLeafNode(otherlv_7, grammarAccess.getClassDeclarationAccess().getLeftCurlyBracketKeyword_4_0_0()); } ( ( ( { newCompositeNode(grammarAccess.getClassDeclarationAccess().getReferenceDeclarationsReferenceDeclarationParserRuleCall_4_0_1_0_0()); } lv_referenceDeclarations_8_0=ruleReferenceDeclaration { if ($current==null) { $current = createModelElementForParent(grammarAccess.getClassDeclarationRule()); } add( $current, "referenceDeclarations", lv_referenceDeclarations_8_0, "org.eclipse.viatra.solver.language.Problem.ReferenceDeclaration"); afterParserOrEnumRuleCall(); } ) ) ( otherlv_9=';' { newLeafNode(otherlv_9, grammarAccess.getClassDeclarationAccess().getSemicolonKeyword_4_0_1_1()); } )? )* otherlv_10='}' { newLeafNode(otherlv_10, grammarAccess.getClassDeclarationAccess().getRightCurlyBracketKeyword_4_0_2()); } ) | otherlv_11='.' { newLeafNode(otherlv_11, grammarAccess.getClassDeclarationAccess().getFullStopKeyword_4_1()); } ) ) ; // Entry rule entryRuleReferenceDeclaration entryRuleReferenceDeclaration returns [EObject current=null]: { newCompositeNode(grammarAccess.getReferenceDeclarationRule()); } iv_ruleReferenceDeclaration=ruleReferenceDeclaration { $current=$iv_ruleReferenceDeclaration.current; } EOF; // Rule ReferenceDeclaration ruleReferenceDeclaration returns [EObject current=null] @init { enterRule(); } @after { leaveRule(); }: ( ( ( ( lv_containment_0_0='contains' { newLeafNode(lv_containment_0_0, grammarAccess.getReferenceDeclarationAccess().getContainmentContainsKeyword_0_0_0()); } { if ($current==null) { $current = createModelElement(grammarAccess.getReferenceDeclarationRule()); } setWithLastConsumed($current, "containment", lv_containment_0_0 != null, "contains"); } ) ) | otherlv_1='refers' { newLeafNode(otherlv_1, grammarAccess.getReferenceDeclarationAccess().getRefersKeyword_0_1()); } ) ( ( { if ($current==null) { $current = createModelElement(grammarAccess.getReferenceDeclarationRule()); } } { newCompositeNode(grammarAccess.getReferenceDeclarationAccess().getReferenceTypeClassDeclarationCrossReference_1_0()); } ruleQualifiedName { afterParserOrEnumRuleCall(); } ) ) ( otherlv_3='[' { newLeafNode(otherlv_3, grammarAccess.getReferenceDeclarationAccess().getLeftSquareBracketKeyword_2_0()); } ( ( { newCompositeNode(grammarAccess.getReferenceDeclarationAccess().getMultiplicityMultiplicityParserRuleCall_2_1_0()); } lv_multiplicity_4_0=ruleMultiplicity { if ($current==null) { $current = createModelElementForParent(grammarAccess.getReferenceDeclarationRule()); } set( $current, "multiplicity", lv_multiplicity_4_0, "org.eclipse.viatra.solver.language.Problem.Multiplicity"); afterParserOrEnumRuleCall(); } ) ) otherlv_5=']' { newLeafNode(otherlv_5, grammarAccess.getReferenceDeclarationAccess().getRightSquareBracketKeyword_2_2()); } )? ( ( lv_name_6_0=RULE_ID { newLeafNode(lv_name_6_0, grammarAccess.getReferenceDeclarationAccess().getNameIDTerminalRuleCall_3_0()); } { if ($current==null) { $current = createModelElement(grammarAccess.getReferenceDeclarationRule()); } setWithLastConsumed( $current, "name", lv_name_6_0, "org.eclipse.xtext.common.Terminals.ID"); } ) ) ( otherlv_7='opposite' { newLeafNode(otherlv_7, grammarAccess.getReferenceDeclarationAccess().getOppositeKeyword_4_0()); } ( ( { if ($current==null) { $current = createModelElement(grammarAccess.getReferenceDeclarationRule()); } } { newCompositeNode(grammarAccess.getReferenceDeclarationAccess().getOppositeReferenceDeclarationCrossReference_4_1_0()); } ruleQualifiedName { afterParserOrEnumRuleCall(); } ) ) )? ) ; // Entry rule entryRulePredicateDefinition entryRulePredicateDefinition returns [EObject current=null]: { newCompositeNode(grammarAccess.getPredicateDefinitionRule()); } iv_rulePredicateDefinition=rulePredicateDefinition { $current=$iv_rulePredicateDefinition.current; } EOF; // Rule PredicateDefinition rulePredicateDefinition returns [EObject current=null] @init { enterRule(); } @after { leaveRule(); }: ( ( ( ( ( lv_error_0_0='error' { newLeafNode(lv_error_0_0, grammarAccess.getPredicateDefinitionAccess().getErrorErrorKeyword_0_0_0_0()); } { if ($current==null) { $current = createModelElement(grammarAccess.getPredicateDefinitionRule()); } setWithLastConsumed($current, "error", lv_error_0_0 != null, "error"); } ) ) ( otherlv_1='pred' { newLeafNode(otherlv_1, grammarAccess.getPredicateDefinitionAccess().getPredKeyword_0_0_1()); } )? ) | otherlv_2='pred' { newLeafNode(otherlv_2, grammarAccess.getPredicateDefinitionAccess().getPredKeyword_0_1()); } ) ( ( lv_name_3_0=RULE_ID { newLeafNode(lv_name_3_0, grammarAccess.getPredicateDefinitionAccess().getNameIDTerminalRuleCall_1_0()); } { if ($current==null) { $current = createModelElement(grammarAccess.getPredicateDefinitionRule()); } setWithLastConsumed( $current, "name", lv_name_3_0, "org.eclipse.xtext.common.Terminals.ID"); } ) ) otherlv_4='(' { newLeafNode(otherlv_4, grammarAccess.getPredicateDefinitionAccess().getLeftParenthesisKeyword_2()); } ( ( ( { newCompositeNode(grammarAccess.getPredicateDefinitionAccess().getParametersParameterParserRuleCall_3_0_0()); } lv_parameters_5_0=ruleParameter { if ($current==null) { $current = createModelElementForParent(grammarAccess.getPredicateDefinitionRule()); } add( $current, "parameters", lv_parameters_5_0, "org.eclipse.viatra.solver.language.Problem.Parameter"); afterParserOrEnumRuleCall(); } ) ) ( otherlv_6=',' { newLeafNode(otherlv_6, grammarAccess.getPredicateDefinitionAccess().getCommaKeyword_3_1_0()); } ( ( { newCompositeNode(grammarAccess.getPredicateDefinitionAccess().getParametersParameterParserRuleCall_3_1_1_0()); } lv_parameters_7_0=ruleParameter { if ($current==null) { $current = createModelElementForParent(grammarAccess.getPredicateDefinitionRule()); } add( $current, "parameters", lv_parameters_7_0, "org.eclipse.viatra.solver.language.Problem.Parameter"); afterParserOrEnumRuleCall(); } ) ) )* )? otherlv_8=')' { newLeafNode(otherlv_8, grammarAccess.getPredicateDefinitionAccess().getRightParenthesisKeyword_4()); } ( otherlv_9=':-' { newLeafNode(otherlv_9, grammarAccess.getPredicateDefinitionAccess().getColonHyphenMinusKeyword_5_0()); } ( ( { newCompositeNode(grammarAccess.getPredicateDefinitionAccess().getBodiesConjunctionParserRuleCall_5_1_0()); } lv_bodies_10_0=ruleConjunction { if ($current==null) { $current = createModelElementForParent(grammarAccess.getPredicateDefinitionRule()); } add( $current, "bodies", lv_bodies_10_0, "org.eclipse.viatra.solver.language.Problem.Conjunction"); afterParserOrEnumRuleCall(); } ) ) ( otherlv_11=';' { newLeafNode(otherlv_11, grammarAccess.getPredicateDefinitionAccess().getSemicolonKeyword_5_2_0()); } ( ( { newCompositeNode(grammarAccess.getPredicateDefinitionAccess().getBodiesConjunctionParserRuleCall_5_2_1_0()); } lv_bodies_12_0=ruleConjunction { if ($current==null) { $current = createModelElementForParent(grammarAccess.getPredicateDefinitionRule()); } add( $current, "bodies", lv_bodies_12_0, "org.eclipse.viatra.solver.language.Problem.Conjunction"); afterParserOrEnumRuleCall(); } ) ) )* )? otherlv_13='.' { newLeafNode(otherlv_13, grammarAccess.getPredicateDefinitionAccess().getFullStopKeyword_6()); } ) ; // Entry rule entryRuleParameter entryRuleParameter returns [EObject current=null]: { newCompositeNode(grammarAccess.getParameterRule()); } iv_ruleParameter=ruleParameter { $current=$iv_ruleParameter.current; } EOF; // Rule Parameter ruleParameter returns [EObject current=null] @init { enterRule(); } @after { leaveRule(); }: ( ( ( { if ($current==null) { $current = createModelElement(grammarAccess.getParameterRule()); } } otherlv_0=RULE_ID { newLeafNode(otherlv_0, grammarAccess.getParameterAccess().getParameterTypeClassDeclarationCrossReference_0_0()); } ) ) ( ( lv_name_1_0=RULE_ID { newLeafNode(lv_name_1_0, grammarAccess.getParameterAccess().getNameIDTerminalRuleCall_1_0()); } { if ($current==null) { $current = createModelElement(grammarAccess.getParameterRule()); } setWithLastConsumed( $current, "name", lv_name_1_0, "org.eclipse.xtext.common.Terminals.ID"); } ) ) ) ; // Entry rule entryRuleConjunction entryRuleConjunction returns [EObject current=null]: { newCompositeNode(grammarAccess.getConjunctionRule()); } iv_ruleConjunction=ruleConjunction { $current=$iv_ruleConjunction.current; } EOF; // Rule Conjunction ruleConjunction returns [EObject current=null] @init { enterRule(); } @after { leaveRule(); }: ( ( ( { newCompositeNode(grammarAccess.getConjunctionAccess().getLiteralsLiteralParserRuleCall_0_0()); } lv_literals_0_0=ruleLiteral { if ($current==null) { $current = createModelElementForParent(grammarAccess.getConjunctionRule()); } add( $current, "literals", lv_literals_0_0, "org.eclipse.viatra.solver.language.Problem.Literal"); afterParserOrEnumRuleCall(); } ) ) ( otherlv_1=',' { newLeafNode(otherlv_1, grammarAccess.getConjunctionAccess().getCommaKeyword_1_0()); } ( ( { newCompositeNode(grammarAccess.getConjunctionAccess().getLiteralsLiteralParserRuleCall_1_1_0()); } lv_literals_2_0=ruleLiteral { if ($current==null) { $current = createModelElementForParent(grammarAccess.getConjunctionRule()); } add( $current, "literals", lv_literals_2_0, "org.eclipse.viatra.solver.language.Problem.Literal"); afterParserOrEnumRuleCall(); } ) ) )* ) ; // 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().getAtomParserRuleCall_0()); } this_Atom_0=ruleAtom { $current = $this_Atom_0.current; afterParserOrEnumRuleCall(); } | { newCompositeNode(grammarAccess.getLiteralAccess().getNegativeLiteralParserRuleCall_1()); } this_NegativeLiteral_1=ruleNegativeLiteral { $current = $this_NegativeLiteral_1.current; afterParserOrEnumRuleCall(); } ) ; // Entry rule entryRuleNegativeLiteral entryRuleNegativeLiteral returns [EObject current=null]: { newCompositeNode(grammarAccess.getNegativeLiteralRule()); } iv_ruleNegativeLiteral=ruleNegativeLiteral { $current=$iv_ruleNegativeLiteral.current; } EOF; // Rule NegativeLiteral ruleNegativeLiteral returns [EObject current=null] @init { enterRule(); } @after { leaveRule(); }: ( otherlv_0='!' { newLeafNode(otherlv_0, grammarAccess.getNegativeLiteralAccess().getExclamationMarkKeyword_0()); } ( ( { newCompositeNode(grammarAccess.getNegativeLiteralAccess().getAtomAtomParserRuleCall_1_0()); } lv_atom_1_0=ruleAtom { if ($current==null) { $current = createModelElementForParent(grammarAccess.getNegativeLiteralRule()); } set( $current, "atom", lv_atom_1_0, "org.eclipse.viatra.solver.language.Problem.Atom"); afterParserOrEnumRuleCall(); } ) ) ) ; // Entry rule entryRuleAtom entryRuleAtom returns [EObject current=null]: { newCompositeNode(grammarAccess.getAtomRule()); } iv_ruleAtom=ruleAtom { $current=$iv_ruleAtom.current; } EOF; // Rule Atom ruleAtom returns [EObject current=null] @init { enterRule(); } @after { leaveRule(); }: ( ( ( { if ($current==null) { $current = createModelElement(grammarAccess.getAtomRule()); } } { newCompositeNode(grammarAccess.getAtomAccess().getRelationRelationCrossReference_0_0()); } ruleQualifiedName { afterParserOrEnumRuleCall(); } ) ) ( ( lv_transitiveClosure_1_0='+' { newLeafNode(lv_transitiveClosure_1_0, grammarAccess.getAtomAccess().getTransitiveClosurePlusSignKeyword_1_0()); } { if ($current==null) { $current = createModelElement(grammarAccess.getAtomRule()); } setWithLastConsumed($current, "transitiveClosure", lv_transitiveClosure_1_0 != null, "+"); } ) )? otherlv_2='(' { newLeafNode(otherlv_2, grammarAccess.getAtomAccess().getLeftParenthesisKeyword_2()); } ( ( ( { newCompositeNode(grammarAccess.getAtomAccess().getArgumentsArgumentParserRuleCall_3_0_0()); } lv_arguments_3_0=ruleArgument { if ($current==null) { $current = createModelElementForParent(grammarAccess.getAtomRule()); } add( $current, "arguments", lv_arguments_3_0, "org.eclipse.viatra.solver.language.Problem.Argument"); afterParserOrEnumRuleCall(); } ) ) ( otherlv_4=',' { newLeafNode(otherlv_4, grammarAccess.getAtomAccess().getCommaKeyword_3_1_0()); } ( ( { newCompositeNode(grammarAccess.getAtomAccess().getArgumentsArgumentParserRuleCall_3_1_1_0()); } lv_arguments_5_0=ruleArgument { if ($current==null) { $current = createModelElementForParent(grammarAccess.getAtomRule()); } add( $current, "arguments", lv_arguments_5_0, "org.eclipse.viatra.solver.language.Problem.Argument"); afterParserOrEnumRuleCall(); } ) ) )* )? otherlv_6=')' { newLeafNode(otherlv_6, grammarAccess.getAtomAccess().getRightParenthesisKeyword_4()); } ) ; // Entry rule entryRuleArgument entryRuleArgument returns [EObject current=null]: { newCompositeNode(grammarAccess.getArgumentRule()); } iv_ruleArgument=ruleArgument { $current=$iv_ruleArgument.current; } EOF; // Rule Argument ruleArgument returns [EObject current=null] @init { enterRule(); } @after { leaveRule(); }: ( ( { if ($current==null) { $current = createModelElement(grammarAccess.getArgumentRule()); } } otherlv_0=RULE_ID { newLeafNode(otherlv_0, grammarAccess.getArgumentAccess().getVariableVariableCrossReference_0()); } ) ) ; // Entry rule entryRuleAssertion entryRuleAssertion returns [EObject current=null]: { newCompositeNode(grammarAccess.getAssertionRule()); } iv_ruleAssertion=ruleAssertion { $current=$iv_ruleAssertion.current; } EOF; // Rule Assertion ruleAssertion returns [EObject current=null] @init { enterRule(); } @after { leaveRule(); }: ( ( ( ( ( { if ($current==null) { $current = createModelElement(grammarAccess.getAssertionRule()); } } { newCompositeNode(grammarAccess.getAssertionAccess().getRelationRelationCrossReference_0_0_0_0()); } ruleQualifiedName { afterParserOrEnumRuleCall(); } ) ) otherlv_1='(' { newLeafNode(otherlv_1, grammarAccess.getAssertionAccess().getLeftParenthesisKeyword_0_0_1()); } ( ( ( { if ($current==null) { $current = createModelElement(grammarAccess.getAssertionRule()); } } { newCompositeNode(grammarAccess.getAssertionAccess().getArgumentsNodeCrossReference_0_0_2_0_0()); } ruleQualifiedName { afterParserOrEnumRuleCall(); } ) ) ( otherlv_3=',' { newLeafNode(otherlv_3, grammarAccess.getAssertionAccess().getCommaKeyword_0_0_2_1_0()); } ( ( { if ($current==null) { $current = createModelElement(grammarAccess.getAssertionRule()); } } { newCompositeNode(grammarAccess.getAssertionAccess().getArgumentsNodeCrossReference_0_0_2_1_1_0()); } ruleQualifiedName { afterParserOrEnumRuleCall(); } ) ) )* )? otherlv_5=')' { newLeafNode(otherlv_5, grammarAccess.getAssertionAccess().getRightParenthesisKeyword_0_0_3()); } otherlv_6=':' { newLeafNode(otherlv_6, grammarAccess.getAssertionAccess().getColonKeyword_0_0_4()); } ( ( { newCompositeNode(grammarAccess.getAssertionAccess().getValueLogicValueEnumRuleCall_0_0_5_0()); } lv_value_7_0=ruleLogicValue { if ($current==null) { $current = createModelElementForParent(grammarAccess.getAssertionRule()); } set( $current, "value", lv_value_7_0, "org.eclipse.viatra.solver.language.Problem.LogicValue"); afterParserOrEnumRuleCall(); } ) ) ) | ( ( ( { newCompositeNode(grammarAccess.getAssertionAccess().getValueShortLogicValueEnumRuleCall_0_1_0_0()); } lv_value_8_0=ruleShortLogicValue { if ($current==null) { $current = createModelElementForParent(grammarAccess.getAssertionRule()); } set( $current, "value", lv_value_8_0, "org.eclipse.viatra.solver.language.Problem.ShortLogicValue"); afterParserOrEnumRuleCall(); } ) )? ( ( { if ($current==null) { $current = createModelElement(grammarAccess.getAssertionRule()); } } { newCompositeNode(grammarAccess.getAssertionAccess().getRelationRelationCrossReference_0_1_1_0()); } ruleQualifiedName { afterParserOrEnumRuleCall(); } ) ) otherlv_10='(' { newLeafNode(otherlv_10, grammarAccess.getAssertionAccess().getLeftParenthesisKeyword_0_1_2()); } ( ( ( { if ($current==null) { $current = createModelElement(grammarAccess.getAssertionRule()); } } { newCompositeNode(grammarAccess.getAssertionAccess().getArgumentsNodeCrossReference_0_1_3_0_0()); } ruleQualifiedName { afterParserOrEnumRuleCall(); } ) ) ( otherlv_12=',' { newLeafNode(otherlv_12, grammarAccess.getAssertionAccess().getCommaKeyword_0_1_3_1_0()); } ( ( { if ($current==null) { $current = createModelElement(grammarAccess.getAssertionRule()); } } { newCompositeNode(grammarAccess.getAssertionAccess().getArgumentsNodeCrossReference_0_1_3_1_1_0()); } ruleQualifiedName { afterParserOrEnumRuleCall(); } ) ) )* )? otherlv_14=')' { newLeafNode(otherlv_14, grammarAccess.getAssertionAccess().getRightParenthesisKeyword_0_1_4()); } ) ) otherlv_15='.' { newLeafNode(otherlv_15, grammarAccess.getAssertionAccess().getFullStopKeyword_1()); } ) ; // Entry rule entryRuleScopeDeclaration entryRuleScopeDeclaration returns [EObject current=null]: { newCompositeNode(grammarAccess.getScopeDeclarationRule()); } iv_ruleScopeDeclaration=ruleScopeDeclaration { $current=$iv_ruleScopeDeclaration.current; } EOF; // Rule ScopeDeclaration ruleScopeDeclaration returns [EObject current=null] @init { enterRule(); } @after { leaveRule(); }: ( otherlv_0='scope' { newLeafNode(otherlv_0, grammarAccess.getScopeDeclarationAccess().getScopeKeyword_0()); } ( ( { newCompositeNode(grammarAccess.getScopeDeclarationAccess().getTypeScopesTypeScopeParserRuleCall_1_0()); } lv_typeScopes_1_0=ruleTypeScope { if ($current==null) { $current = createModelElementForParent(grammarAccess.getScopeDeclarationRule()); } add( $current, "typeScopes", lv_typeScopes_1_0, "org.eclipse.viatra.solver.language.Problem.TypeScope"); afterParserOrEnumRuleCall(); } ) ) ( otherlv_2=',' { newLeafNode(otherlv_2, grammarAccess.getScopeDeclarationAccess().getCommaKeyword_2_0()); } ( ( { newCompositeNode(grammarAccess.getScopeDeclarationAccess().getTypeScopesTypeScopeParserRuleCall_2_1_0()); } lv_typeScopes_3_0=ruleTypeScope { if ($current==null) { $current = createModelElementForParent(grammarAccess.getScopeDeclarationRule()); } add( $current, "typeScopes", lv_typeScopes_3_0, "org.eclipse.viatra.solver.language.Problem.TypeScope"); afterParserOrEnumRuleCall(); } ) ) )* otherlv_4='.' { newLeafNode(otherlv_4, grammarAccess.getScopeDeclarationAccess().getFullStopKeyword_3()); } ) ; // Entry rule entryRuleTypeScope entryRuleTypeScope returns [EObject current=null]: { newCompositeNode(grammarAccess.getTypeScopeRule()); } iv_ruleTypeScope=ruleTypeScope { $current=$iv_ruleTypeScope.current; } EOF; // Rule TypeScope ruleTypeScope returns [EObject current=null] @init { enterRule(); } @after { leaveRule(); }: ( ( ( { if ($current==null) { $current = createModelElement(grammarAccess.getTypeScopeRule()); } } otherlv_0=RULE_ID { newLeafNode(otherlv_0, grammarAccess.getTypeScopeAccess().getTargetTypeClassDeclarationCrossReference_0_0()); } ) ) ( ( ( lv_increment_1_0='+=' { newLeafNode(lv_increment_1_0, grammarAccess.getTypeScopeAccess().getIncrementPlusSignEqualsSignKeyword_1_0_0()); } { if ($current==null) { $current = createModelElement(grammarAccess.getTypeScopeRule()); } setWithLastConsumed($current, "increment", lv_increment_1_0 != null, "+="); } ) ) | otherlv_2='=' { newLeafNode(otherlv_2, grammarAccess.getTypeScopeAccess().getEqualsSignKeyword_1_1()); } ) ( ( { newCompositeNode(grammarAccess.getTypeScopeAccess().getMultiplicityDefiniteMultiplicityParserRuleCall_2_0()); } lv_multiplicity_3_0=ruleDefiniteMultiplicity { if ($current==null) { $current = createModelElementForParent(grammarAccess.getTypeScopeRule()); } set( $current, "multiplicity", lv_multiplicity_3_0, "org.eclipse.viatra.solver.language.Problem.DefiniteMultiplicity"); afterParserOrEnumRuleCall(); } ) ) ) ; // 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().getUnboundedMultiplicityParserRuleCall_0()); } this_UnboundedMultiplicity_0=ruleUnboundedMultiplicity { $current = $this_UnboundedMultiplicity_0.current; afterParserOrEnumRuleCall(); } | { newCompositeNode(grammarAccess.getMultiplicityAccess().getDefiniteMultiplicityParserRuleCall_1()); } this_DefiniteMultiplicity_1=ruleDefiniteMultiplicity { $current = $this_DefiniteMultiplicity_1.current; afterParserOrEnumRuleCall(); } ) ; // Entry rule entryRuleDefiniteMultiplicity entryRuleDefiniteMultiplicity returns [EObject current=null]: { newCompositeNode(grammarAccess.getDefiniteMultiplicityRule()); } iv_ruleDefiniteMultiplicity=ruleDefiniteMultiplicity { $current=$iv_ruleDefiniteMultiplicity.current; } EOF; // Rule DefiniteMultiplicity ruleDefiniteMultiplicity returns [EObject current=null] @init { enterRule(); } @after { leaveRule(); }: ( { newCompositeNode(grammarAccess.getDefiniteMultiplicityAccess().getRangeMultiplicityParserRuleCall_0()); } this_RangeMultiplicity_0=ruleRangeMultiplicity { $current = $this_RangeMultiplicity_0.current; afterParserOrEnumRuleCall(); } | { newCompositeNode(grammarAccess.getDefiniteMultiplicityAccess().getExactMultiplicityParserRuleCall_1()); } this_ExactMultiplicity_1=ruleExactMultiplicity { $current = $this_ExactMultiplicity_1.current; afterParserOrEnumRuleCall(); } ) ; // Entry rule entryRuleUnboundedMultiplicity entryRuleUnboundedMultiplicity returns [EObject current=null]: { newCompositeNode(grammarAccess.getUnboundedMultiplicityRule()); } iv_ruleUnboundedMultiplicity=ruleUnboundedMultiplicity { $current=$iv_ruleUnboundedMultiplicity.current; } EOF; // Rule UnboundedMultiplicity ruleUnboundedMultiplicity returns [EObject current=null] @init { enterRule(); } @after { leaveRule(); }: ( { $current = forceCreateModelElement( grammarAccess.getUnboundedMultiplicityAccess().getUnboundedMultiplicityAction(), $current); } ) ; // Entry rule entryRuleRangeMultiplicity entryRuleRangeMultiplicity returns [EObject current=null]: { newCompositeNode(grammarAccess.getRangeMultiplicityRule()); } iv_ruleRangeMultiplicity=ruleRangeMultiplicity { $current=$iv_ruleRangeMultiplicity.current; } EOF; // Rule RangeMultiplicity ruleRangeMultiplicity returns [EObject current=null] @init { enterRule(); } @after { leaveRule(); }: ( ( ( lv_lowerBound_0_0=RULE_INT { newLeafNode(lv_lowerBound_0_0, grammarAccess.getRangeMultiplicityAccess().getLowerBoundINTTerminalRuleCall_0_0()); } { if ($current==null) { $current = createModelElement(grammarAccess.getRangeMultiplicityRule()); } setWithLastConsumed( $current, "lowerBound", lv_lowerBound_0_0, "org.eclipse.xtext.common.Terminals.INT"); } ) ) otherlv_1='..' { newLeafNode(otherlv_1, grammarAccess.getRangeMultiplicityAccess().getFullStopFullStopKeyword_1()); } ( ( { newCompositeNode(grammarAccess.getRangeMultiplicityAccess().getUpperBoundUpperBoundParserRuleCall_2_0()); } lv_upperBound_2_0=ruleUpperBound { if ($current==null) { $current = createModelElementForParent(grammarAccess.getRangeMultiplicityRule()); } set( $current, "upperBound", lv_upperBound_2_0, "org.eclipse.viatra.solver.language.Problem.UpperBound"); afterParserOrEnumRuleCall(); } ) ) ) ; // 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(); }: ( ( lv_exactValue_0_0=RULE_INT { newLeafNode(lv_exactValue_0_0, grammarAccess.getExactMultiplicityAccess().getExactValueINTTerminalRuleCall_0()); } { if ($current==null) { $current = createModelElement(grammarAccess.getExactMultiplicityRule()); } setWithLastConsumed( $current, "exactValue", lv_exactValue_0_0, "org.eclipse.xtext.common.Terminals.INT"); } ) ) ; // Entry rule entryRuleUpperBound entryRuleUpperBound returns [String current=null]: { newCompositeNode(grammarAccess.getUpperBoundRule()); } iv_ruleUpperBound=ruleUpperBound { $current=$iv_ruleUpperBound.current.getText(); } EOF; // Rule UpperBound ruleUpperBound returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] @init { enterRule(); } @after { leaveRule(); }: ( this_INT_0=RULE_INT { $current.merge(this_INT_0); } { newLeafNode(this_INT_0, grammarAccess.getUpperBoundAccess().getINTTerminalRuleCall_0()); } | kw='*' { $current.merge(kw); newLeafNode(kw, grammarAccess.getUpperBoundAccess().getAsteriskKeyword_1()); } ) ; // Entry rule entryRuleQualifiedName entryRuleQualifiedName returns [String current=null]: { newCompositeNode(grammarAccess.getQualifiedNameRule()); } iv_ruleQualifiedName=ruleQualifiedName { $current=$iv_ruleQualifiedName.current.getText(); } EOF; // Rule QualifiedName ruleQualifiedName returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] @init { enterRule(); } @after { leaveRule(); }: ( this_QUOTED_ID_0=RULE_QUOTED_ID { $current.merge(this_QUOTED_ID_0); } { newLeafNode(this_QUOTED_ID_0, grammarAccess.getQualifiedNameAccess().getQUOTED_IDTerminalRuleCall_0()); } | ( this_ID_1=RULE_ID { $current.merge(this_ID_1); } { newLeafNode(this_ID_1, grammarAccess.getQualifiedNameAccess().getIDTerminalRuleCall_1_0()); } ( kw=':' { $current.merge(kw); newLeafNode(kw, grammarAccess.getQualifiedNameAccess().getColonKeyword_1_1_0()); } this_ID_3=RULE_ID { $current.merge(this_ID_3); } { newLeafNode(this_ID_3, grammarAccess.getQualifiedNameAccess().getIDTerminalRuleCall_1_1_1()); } )* ( kw=':' { $current.merge(kw); newLeafNode(kw, grammarAccess.getQualifiedNameAccess().getColonKeyword_1_2_0()); } this_QUOTED_ID_5=RULE_QUOTED_ID { $current.merge(this_QUOTED_ID_5); } { newLeafNode(this_QUOTED_ID_5, grammarAccess.getQualifiedNameAccess().getQUOTED_IDTerminalRuleCall_1_2_1()); } )? ) ) ; // 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()); } ) ) ; // Rule ShortLogicValue ruleShortLogicValue returns [Enumerator current=null] @init { enterRule(); } @after { leaveRule(); }: ( ( enumLiteral_0='!' { $current = grammarAccess.getShortLogicValueAccess().getFALSEEnumLiteralDeclaration_0().getEnumLiteral().getInstance(); newLeafNode(enumLiteral_0, grammarAccess.getShortLogicValueAccess().getFALSEEnumLiteralDeclaration_0()); } ) | ( enumLiteral_1='?' { $current = grammarAccess.getShortLogicValueAccess().getUNKNOWNEnumLiteralDeclaration_1().getEnumLiteral().getInstance(); newLeafNode(enumLiteral_1, grammarAccess.getShortLogicValueAccess().getUNKNOWNEnumLiteralDeclaration_1()); } ) ) ; RULE_STRING : '"' ('\\' .|~(('\\'|'"')))* '"'; RULE_QUOTED_ID : '\'' ('\\' .|~(('\\'|'\'')))* '\''; RULE_ID : '^'? ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'_'|'0'..'9')*; RULE_INT : ('0'..'9')+; RULE_ML_COMMENT : '/*' ( options {greedy=false;} : . )*'*/'; RULE_SL_COMMENT : '//' ~(('\n'|'\r'))* ('\r'? '\n')?; RULE_WS : (' '|'\t'|'\r'|'\n')+; RULE_ANY_OTHER : .;