/* * generated by Xtext */ grammar InternalEbnf; options { superClass=AbstractInternalAntlrParser; } @lexer::header { package de.ugoe.cs.swe.bnftools.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 de.ugoe.cs.swe.bnftools.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.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 de.ugoe.cs.swe.bnftools.services.EbnfGrammarAccess; } @parser::members { private EbnfGrammarAccess grammarAccess; public InternalEbnfParser(TokenStream input, EbnfGrammarAccess grammarAccess) { this(input); this.grammarAccess = grammarAccess; registerRules(grammarAccess.getGrammar()); } @Override protected String getFirstRuleName() { return "EtsiBnf"; } @Override protected EbnfGrammarAccess getGrammarAccess() { return grammarAccess; } } @rulecatch { catch (RecognitionException re) { recover(input,re); appendSkippedTokens(); } } // Entry rule entryRuleEtsiBnf entryRuleEtsiBnf returns [EObject current=null] : { newCompositeNode(grammarAccess.getEtsiBnfRule()); } iv_ruleEtsiBnf=ruleEtsiBnf { $current=$iv_ruleEtsiBnf.current; } EOF ; // Rule EtsiBnf ruleEtsiBnf returns [EObject current=null] @init { enterRule(); } @after { leaveRule(); }: (( otherlv_0='grammar' { newLeafNode(otherlv_0, grammarAccess.getEtsiBnfAccess().getGrammarKeyword_0_0()); } ( ( lv_name_1_0=RULE_ID { newLeafNode(lv_name_1_0, grammarAccess.getEtsiBnfAccess().getNameIDTerminalRuleCall_0_1_0()); } { if ($current==null) { $current = createModelElement(grammarAccess.getEtsiBnfRule()); } setWithLastConsumed( $current, "name", lv_name_1_0, "ID"); } ) )(( ( lv_type_2_0= '/bnf' { newLeafNode(lv_type_2_0, grammarAccess.getEtsiBnfAccess().getTypeBnfKeyword_0_2_0_0()); } { if ($current==null) { $current = createModelElement(grammarAccess.getEtsiBnfRule()); } setWithLastConsumed($current, "type", lv_type_2_0, "/bnf"); } ) )? otherlv_3=';' { newLeafNode(otherlv_3, grammarAccess.getEtsiBnfAccess().getSemicolonKeyword_0_2_1()); } ( ( { newCompositeNode(grammarAccess.getEtsiBnfAccess().getImportSectionImportSectionParserRuleCall_0_2_2_0()); } lv_importSection_4_0=ruleImportSection { if ($current==null) { $current = createModelElementForParent(grammarAccess.getEtsiBnfRule()); } set( $current, "importSection", lv_importSection_4_0, "ImportSection"); afterParserOrEnumRuleCall(); } ) )?( ( { newCompositeNode(grammarAccess.getEtsiBnfAccess().getBnfEntryBnfEntryParserRuleCall_0_2_3_0()); } lv_bnfEntry_5_0=ruleBnfEntry { if ($current==null) { $current = createModelElementForParent(grammarAccess.getEtsiBnfRule()); } add( $current, "bnfEntry", lv_bnfEntry_5_0, "BnfEntry"); afterParserOrEnumRuleCall(); } ) )+)) |(( ( lv_type_6_0= '/delta' { newLeafNode(lv_type_6_0, grammarAccess.getEtsiBnfAccess().getTypeDeltaKeyword_1_0_0()); } { if ($current==null) { $current = createModelElement(grammarAccess.getEtsiBnfRule()); } setWithLastConsumed($current, "type", lv_type_6_0, "/delta"); } ) ) otherlv_7=';' { newLeafNode(otherlv_7, grammarAccess.getEtsiBnfAccess().getSemicolonKeyword_1_1()); } ( ( { newCompositeNode(grammarAccess.getEtsiBnfAccess().getImportSectionImportSectionParserRuleCall_1_2_0()); } lv_importSection_8_0=ruleImportSection { if ($current==null) { $current = createModelElementForParent(grammarAccess.getEtsiBnfRule()); } set( $current, "importSection", lv_importSection_8_0, "ImportSection"); afterParserOrEnumRuleCall(); } ) )?( ( { newCompositeNode(grammarAccess.getEtsiBnfAccess().getDeltaEntryDeltaEntryParserRuleCall_1_3_0()); } lv_deltaEntry_9_0=ruleDeltaEntry { if ($current==null) { $current = createModelElementForParent(grammarAccess.getEtsiBnfRule()); } add( $current, "deltaEntry", lv_deltaEntry_9_0, "DeltaEntry"); afterParserOrEnumRuleCall(); } ) )*) |(( ( lv_type_10_0= '/merge' { newLeafNode(lv_type_10_0, grammarAccess.getEtsiBnfAccess().getTypeMergeKeyword_2_0_0()); } { if ($current==null) { $current = createModelElement(grammarAccess.getEtsiBnfRule()); } setWithLastConsumed($current, "type", lv_type_10_0, "/merge"); } ) ) otherlv_11=';' { newLeafNode(otherlv_11, grammarAccess.getEtsiBnfAccess().getSemicolonKeyword_2_1()); } ( ( { newCompositeNode(grammarAccess.getEtsiBnfAccess().getImportSectionImportSectionParserRuleCall_2_2_0()); } lv_importSection_12_0=ruleImportSection { if ($current==null) { $current = createModelElementForParent(grammarAccess.getEtsiBnfRule()); } set( $current, "importSection", lv_importSection_12_0, "ImportSection"); afterParserOrEnumRuleCall(); } ) )?( ( { newCompositeNode(grammarAccess.getEtsiBnfAccess().getMergeEntryMergeEntryParserRuleCall_2_3_0()); } lv_mergeEntry_13_0=ruleMergeEntry { if ($current==null) { $current = createModelElementForParent(grammarAccess.getEtsiBnfRule()); } add( $current, "mergeEntry", lv_mergeEntry_13_0, "MergeEntry"); afterParserOrEnumRuleCall(); } ) )*)) ; // Entry rule entryRuleImportSection entryRuleImportSection returns [EObject current=null] : { newCompositeNode(grammarAccess.getImportSectionRule()); } iv_ruleImportSection=ruleImportSection { $current=$iv_ruleImportSection.current; } EOF ; // Rule ImportSection ruleImportSection returns [EObject current=null] @init { enterRule(); } @after { leaveRule(); }: ( ( { newCompositeNode(grammarAccess.getImportSectionAccess().getImportsImportParserRuleCall_0()); } lv_imports_0_0=ruleImport { if ($current==null) { $current = createModelElementForParent(grammarAccess.getImportSectionRule()); } add( $current, "imports", lv_imports_0_0, "Import"); afterParserOrEnumRuleCall(); } ) )+ ; // Entry rule entryRuleBnfEntry entryRuleBnfEntry returns [EObject current=null] : { newCompositeNode(grammarAccess.getBnfEntryRule()); } iv_ruleBnfEntry=ruleBnfEntry { $current=$iv_ruleBnfEntry.current; } EOF ; // Rule BnfEntry ruleBnfEntry returns [EObject current=null] @init { enterRule(); } @after { leaveRule(); }: (( ( { newCompositeNode(grammarAccess.getBnfEntryAccess().getSectionheaderSectionHeadingParserRuleCall_0_0()); } lv_sectionheader_0_0=ruleSectionHeading { if ($current==null) { $current = createModelElementForParent(grammarAccess.getBnfEntryRule()); } set( $current, "sectionheader", lv_sectionheader_0_0, "SectionHeading"); afterParserOrEnumRuleCall(); } ) ) |( ( { newCompositeNode(grammarAccess.getBnfEntryAccess().getRuleRuleParserRuleCall_1_0()); } lv_rule_1_0=ruleRule { if ($current==null) { $current = createModelElementForParent(grammarAccess.getBnfEntryRule()); } set( $current, "rule", lv_rule_1_0, "Rule"); afterParserOrEnumRuleCall(); } ) )) ; // Entry rule entryRuleDeltaEntry entryRuleDeltaEntry returns [EObject current=null] : { newCompositeNode(grammarAccess.getDeltaEntryRule()); } iv_ruleDeltaEntry=ruleDeltaEntry { $current=$iv_ruleDeltaEntry.current; } EOF ; // Rule DeltaEntry ruleDeltaEntry returns [EObject current=null] @init { enterRule(); } @after { leaveRule(); }: (( ( { newCompositeNode(grammarAccess.getDeltaEntryAccess().getRuleRuleParserRuleCall_0_0()); } lv_rule_0_0=ruleRule { if ($current==null) { $current = createModelElementForParent(grammarAccess.getDeltaEntryRule()); } set( $current, "rule", lv_rule_0_0, "Rule"); afterParserOrEnumRuleCall(); } ) ) |( ( { newCompositeNode(grammarAccess.getDeltaEntryAccess().getSectionheaderSectionHeadingParserRuleCall_1_0()); } lv_sectionheader_1_0=ruleSectionHeading { if ($current==null) { $current = createModelElementForParent(grammarAccess.getDeltaEntryRule()); } set( $current, "sectionheader", lv_sectionheader_1_0, "SectionHeading"); afterParserOrEnumRuleCall(); } ) ) |( ( { newCompositeNode(grammarAccess.getDeltaEntryAccess().getExtRuleExtRuleParserRuleCall_2_0()); } lv_extRule_2_0=ruleExtRule { if ($current==null) { $current = createModelElementForParent(grammarAccess.getDeltaEntryRule()); } set( $current, "extRule", lv_extRule_2_0, "ExtRule"); afterParserOrEnumRuleCall(); } ) )) ; // Entry rule entryRuleMergeEntry entryRuleMergeEntry returns [EObject current=null] : { newCompositeNode(grammarAccess.getMergeEntryRule()); } iv_ruleMergeEntry=ruleMergeEntry { $current=$iv_ruleMergeEntry.current; } EOF ; // Rule MergeEntry ruleMergeEntry returns [EObject current=null] @init { enterRule(); } @after { leaveRule(); }: (( ( { newCompositeNode(grammarAccess.getMergeEntryAccess().getSectionheaderSectionHeadingParserRuleCall_0_0()); } lv_sectionheader_0_0=ruleSectionHeading { if ($current==null) { $current = createModelElementForParent(grammarAccess.getMergeEntryRule()); } set( $current, "sectionheader", lv_sectionheader_0_0, "SectionHeading"); afterParserOrEnumRuleCall(); } ) ) |( ( { newCompositeNode(grammarAccess.getMergeEntryAccess().getMergeRuleMergeRuleParserRuleCall_1_0()); } lv_mergeRule_1_0=ruleMergeRule { if ($current==null) { $current = createModelElementForParent(grammarAccess.getMergeEntryRule()); } set( $current, "mergeRule", lv_mergeRule_1_0, "MergeRule"); afterParserOrEnumRuleCall(); } ) )) ; // Entry rule entryRuleSectionHeading entryRuleSectionHeading returns [EObject current=null] : { newCompositeNode(grammarAccess.getSectionHeadingRule()); } iv_ruleSectionHeading=ruleSectionHeading { $current=$iv_ruleSectionHeading.current; } EOF ; // Rule SectionHeading ruleSectionHeading returns [EObject current=null] @init { enterRule(); } @after { leaveRule(); }: (( { $current = forceCreateModelElement( grammarAccess.getSectionHeadingAccess().getSectionHeadingAction_0(), $current); } )( ( lv_sectionHeader_1_0=RULE_SECTIONHEADER { newLeafNode(lv_sectionHeader_1_0, grammarAccess.getSectionHeadingAccess().getSectionHeaderSECTIONHEADERTerminalRuleCall_1_0()); } { if ($current==null) { $current = createModelElement(grammarAccess.getSectionHeadingRule()); } setWithLastConsumed( $current, "sectionHeader", lv_sectionHeader_1_0, "SECTIONHEADER"); } ) )) ; // Entry rule entryRuleImport entryRuleImport returns [EObject current=null] : { newCompositeNode(grammarAccess.getImportRule()); } iv_ruleImport=ruleImport { $current=$iv_ruleImport.current; } EOF ; // Rule Import ruleImport returns [EObject current=null] @init { enterRule(); } @after { leaveRule(); }: ( otherlv_0='import' { newLeafNode(otherlv_0, grammarAccess.getImportAccess().getImportKeyword_0()); } ( ( lv_importURI_1_0=RULE_STRING { newLeafNode(lv_importURI_1_0, grammarAccess.getImportAccess().getImportURISTRINGTerminalRuleCall_1_0()); } { if ($current==null) { $current = createModelElement(grammarAccess.getImportRule()); } setWithLastConsumed( $current, "importURI", lv_importURI_1_0, "STRING"); } ) )( otherlv_2='/' { newLeafNode(otherlv_2, grammarAccess.getImportAccess().getSolidusKeyword_2_0()); } (( ( lv_grammarType_3_0= 'core' { newLeafNode(lv_grammarType_3_0, grammarAccess.getImportAccess().getGrammarTypeCoreKeyword_2_1_0_0()); } { if ($current==null) { $current = createModelElement(grammarAccess.getImportRule()); } setWithLastConsumed($current, "grammarType", lv_grammarType_3_0, "core"); } ) ) |( ( lv_grammarType_4_0= 'package' { newLeafNode(lv_grammarType_4_0, grammarAccess.getImportAccess().getGrammarTypePackageKeyword_2_1_1_0()); } { if ($current==null) { $current = createModelElement(grammarAccess.getImportRule()); } setWithLastConsumed($current, "grammarType", lv_grammarType_4_0, "package"); } ) ) |( ( lv_grammarType_5_0= 'update' { newLeafNode(lv_grammarType_5_0, grammarAccess.getImportAccess().getGrammarTypeUpdateKeyword_2_1_2_0()); } { if ($current==null) { $current = createModelElement(grammarAccess.getImportRule()); } setWithLastConsumed($current, "grammarType", lv_grammarType_5_0, "update"); } ) )))?( otherlv_6='label:' { newLeafNode(otherlv_6, grammarAccess.getImportAccess().getLabelKeyword_3_0()); } ( ( lv_label_7_0=RULE_ID { newLeafNode(lv_label_7_0, grammarAccess.getImportAccess().getLabelIDTerminalRuleCall_3_1_0()); } { if ($current==null) { $current = createModelElement(grammarAccess.getImportRule()); } setWithLastConsumed( $current, "label", lv_label_7_0, "ID"); } ) ))? otherlv_8=';' { newLeafNode(otherlv_8, grammarAccess.getImportAccess().getSemicolonKeyword_4()); } ) ; // Entry rule entryRuleRule entryRuleRule returns [EObject current=null] : { newCompositeNode(grammarAccess.getRuleRule()); } iv_ruleRule=ruleRule { $current=$iv_ruleRule.current; } EOF ; // Rule Rule ruleRule returns [EObject current=null] @init { enterRule(); } @after { leaveRule(); }: ((( ( lv_rulenumber_0_0=RULE_INT { newLeafNode(lv_rulenumber_0_0, grammarAccess.getRuleAccess().getRulenumberINTTerminalRuleCall_0_0_0()); } { if ($current==null) { $current = createModelElement(grammarAccess.getRuleRule()); } setWithLastConsumed( $current, "rulenumber", lv_rulenumber_0_0, "INT"); } ) )( ( lv_rulevariant_1_0=RULE_ID { newLeafNode(lv_rulevariant_1_0, grammarAccess.getRuleAccess().getRulevariantIDTerminalRuleCall_0_1_0()); } { if ($current==null) { $current = createModelElement(grammarAccess.getRuleRule()); } setWithLastConsumed( $current, "rulevariant", lv_rulevariant_1_0, "ID"); } ) )? otherlv_2='.' { newLeafNode(otherlv_2, grammarAccess.getRuleAccess().getFullStopKeyword_0_2()); } )?( ( lv_name_3_0=RULE_ID { newLeafNode(lv_name_3_0, grammarAccess.getRuleAccess().getNameIDTerminalRuleCall_1_0()); } { if ($current==null) { $current = createModelElement(grammarAccess.getRuleRule()); } setWithLastConsumed( $current, "name", lv_name_3_0, "ID"); } ) ) otherlv_4='::=' { newLeafNode(otherlv_4, grammarAccess.getRuleAccess().getColonColonEqualsSignKeyword_2()); } ( ( { newCompositeNode(grammarAccess.getRuleAccess().getDefinitionListDefinitionListParserRuleCall_3_0()); } lv_definitionList_5_0=ruleDefinitionList { if ($current==null) { $current = createModelElementForParent(grammarAccess.getRuleRule()); } set( $current, "definitionList", lv_definitionList_5_0, "DefinitionList"); afterParserOrEnumRuleCall(); } ) )?( otherlv_6=';' { newLeafNode(otherlv_6, grammarAccess.getRuleAccess().getSemicolonKeyword_4()); } )?) ; // Entry rule entryRuleExtRule entryRuleExtRule returns [EObject current=null] : { newCompositeNode(grammarAccess.getExtRuleRule()); } iv_ruleExtRule=ruleExtRule { $current=$iv_ruleExtRule.current; } EOF ; // Rule ExtRule ruleExtRule returns [EObject current=null] @init { enterRule(); } @after { leaveRule(); }: ((( ( lv_rulenumber_0_0=RULE_INT { newLeafNode(lv_rulenumber_0_0, grammarAccess.getExtRuleAccess().getRulenumberINTTerminalRuleCall_0_0_0()); } { if ($current==null) { $current = createModelElement(grammarAccess.getExtRuleRule()); } setWithLastConsumed( $current, "rulenumber", lv_rulenumber_0_0, "INT"); } ) )( ( lv_rulevariant_1_0=RULE_ID { newLeafNode(lv_rulevariant_1_0, grammarAccess.getExtRuleAccess().getRulevariantIDTerminalRuleCall_0_1_0()); } { if ($current==null) { $current = createModelElement(grammarAccess.getExtRuleRule()); } setWithLastConsumed( $current, "rulevariant", lv_rulevariant_1_0, "ID"); } ) )? otherlv_2='.' { newLeafNode(otherlv_2, grammarAccess.getExtRuleAccess().getFullStopKeyword_0_2()); } )?( ( lv_name_3_0=RULE_ID { newLeafNode(lv_name_3_0, grammarAccess.getExtRuleAccess().getNameIDTerminalRuleCall_1_0()); } { if ($current==null) { $current = createModelElement(grammarAccess.getExtRuleRule()); } setWithLastConsumed( $current, "name", lv_name_3_0, "ID"); } ) )( otherlv_4='(' { newLeafNode(otherlv_4, grammarAccess.getExtRuleAccess().getLeftParenthesisKeyword_2_0()); } ( ( lv_ruleext_5_0=RULE_INT { newLeafNode(lv_ruleext_5_0, grammarAccess.getExtRuleAccess().getRuleextINTTerminalRuleCall_2_1_0()); } { if ($current==null) { $current = createModelElement(grammarAccess.getExtRuleRule()); } setWithLastConsumed( $current, "ruleext", lv_ruleext_5_0, "INT"); } ) ) otherlv_6=')' { newLeafNode(otherlv_6, grammarAccess.getExtRuleAccess().getRightParenthesisKeyword_2_2()); } ) otherlv_7='<-' { newLeafNode(otherlv_7, grammarAccess.getExtRuleAccess().getLessThanSignHyphenMinusKeyword_3()); } (( ( { newCompositeNode(grammarAccess.getExtRuleAccess().getElementsAtomParserRuleCall_4_0_0()); } lv_elements_8_0=ruleAtom { if ($current==null) { $current = createModelElementForParent(grammarAccess.getExtRuleRule()); } add( $current, "elements", lv_elements_8_0, "Atom"); afterParserOrEnumRuleCall(); } ) ) | otherlv_9=')' { newLeafNode(otherlv_9, grammarAccess.getExtRuleAccess().getRightParenthesisKeyword_4_1()); } | otherlv_10=']' { newLeafNode(otherlv_10, grammarAccess.getExtRuleAccess().getRightSquareBracketKeyword_4_2()); } | otherlv_11='}' { newLeafNode(otherlv_11, grammarAccess.getExtRuleAccess().getRightCurlyBracketKeyword_4_3()); } | otherlv_12='|' { newLeafNode(otherlv_12, grammarAccess.getExtRuleAccess().getVerticalLineKeyword_4_4()); } | otherlv_13='(' { newLeafNode(otherlv_13, grammarAccess.getExtRuleAccess().getLeftParenthesisKeyword_4_5()); } | otherlv_14='[' { newLeafNode(otherlv_14, grammarAccess.getExtRuleAccess().getLeftSquareBracketKeyword_4_6()); } | otherlv_15='{' { newLeafNode(otherlv_15, grammarAccess.getExtRuleAccess().getLeftCurlyBracketKeyword_4_7()); } | otherlv_16='*' { newLeafNode(otherlv_16, grammarAccess.getExtRuleAccess().getAsteriskKeyword_4_8()); } | otherlv_17='+' { newLeafNode(otherlv_17, grammarAccess.getExtRuleAccess().getPlusSignKeyword_4_9()); } )*( otherlv_18=';' { newLeafNode(otherlv_18, grammarAccess.getExtRuleAccess().getSemicolonKeyword_5()); } )?) ; // Entry rule entryRuleMergeRule entryRuleMergeRule returns [EObject current=null] : { newCompositeNode(grammarAccess.getMergeRuleRule()); } iv_ruleMergeRule=ruleMergeRule { $current=$iv_ruleMergeRule.current; } EOF ; // Rule MergeRule ruleMergeRule returns [EObject current=null] @init { enterRule(); } @after { leaveRule(); }: ( { newCompositeNode(grammarAccess.getMergeRuleAccess().getGlobalCombinatorParserRuleCall_0()); } this_GlobalCombinator_0=ruleGlobalCombinator { $current = $this_GlobalCombinator_0.current; afterParserOrEnumRuleCall(); } | { newCompositeNode(grammarAccess.getMergeRuleAccess().getRuleCombinatorParserRuleCall_1()); } this_RuleCombinator_1=ruleRuleCombinator { $current = $this_RuleCombinator_1.current; afterParserOrEnumRuleCall(); } | { newCompositeNode(grammarAccess.getMergeRuleAccess().getHookCombinatorParserRuleCall_2()); } this_HookCombinator_2=ruleHookCombinator { $current = $this_HookCombinator_2.current; afterParserOrEnumRuleCall(); } ) ; // Entry rule entryRuleGlobalCombinator entryRuleGlobalCombinator returns [EObject current=null] : { newCompositeNode(grammarAccess.getGlobalCombinatorRule()); } iv_ruleGlobalCombinator=ruleGlobalCombinator { $current=$iv_ruleGlobalCombinator.current; } EOF ; // Rule GlobalCombinator ruleGlobalCombinator returns [EObject current=null] @init { enterRule(); } @after { leaveRule(); }: (( otherlv_0='global' { newLeafNode(otherlv_0, grammarAccess.getGlobalCombinatorAccess().getGlobalKeyword_0_0()); } otherlv_1='combinator:' { newLeafNode(otherlv_1, grammarAccess.getGlobalCombinatorAccess().getCombinatorKeyword_0_1()); } )( ( lv_logic_2_0=RULE_LOGIC { newLeafNode(lv_logic_2_0, grammarAccess.getGlobalCombinatorAccess().getLogicLOGICTerminalRuleCall_1_0()); } { if ($current==null) { $current = createModelElement(grammarAccess.getGlobalCombinatorRule()); } setWithLastConsumed( $current, "logic", lv_logic_2_0, "LOGIC"); } ) )( otherlv_3=';' { newLeafNode(otherlv_3, grammarAccess.getGlobalCombinatorAccess().getSemicolonKeyword_2()); } )?) ; // Entry rule entryRuleRuleCombinator entryRuleRuleCombinator returns [EObject current=null] : { newCompositeNode(grammarAccess.getRuleCombinatorRule()); } iv_ruleRuleCombinator=ruleRuleCombinator { $current=$iv_ruleRuleCombinator.current; } EOF ; // Rule RuleCombinator ruleRuleCombinator returns [EObject current=null] @init { enterRule(); } @after { leaveRule(); }: (( otherlv_0='rule' { newLeafNode(otherlv_0, grammarAccess.getRuleCombinatorAccess().getRuleKeyword_0_0()); } otherlv_1='combinator:' { newLeafNode(otherlv_1, grammarAccess.getRuleCombinatorAccess().getCombinatorKeyword_0_1()); } ( ( lv_name_2_0=RULE_ID { newLeafNode(lv_name_2_0, grammarAccess.getRuleCombinatorAccess().getNameIDTerminalRuleCall_0_2_0()); } { if ($current==null) { $current = createModelElement(grammarAccess.getRuleCombinatorRule()); } setWithLastConsumed( $current, "name", lv_name_2_0, "ID"); } ) ))( ( lv_logic_3_0=RULE_LOGIC { newLeafNode(lv_logic_3_0, grammarAccess.getRuleCombinatorAccess().getLogicLOGICTerminalRuleCall_1_0()); } { if ($current==null) { $current = createModelElement(grammarAccess.getRuleCombinatorRule()); } setWithLastConsumed( $current, "logic", lv_logic_3_0, "LOGIC"); } ) )( otherlv_4='(' { newLeafNode(otherlv_4, grammarAccess.getRuleCombinatorAccess().getLeftParenthesisKeyword_2_0()); } ( ( lv_LABEL_5_0=RULE_STRING { newLeafNode(lv_LABEL_5_0, grammarAccess.getRuleCombinatorAccess().getLABELSTRINGTerminalRuleCall_2_1_0()); } { if ($current==null) { $current = createModelElement(grammarAccess.getRuleCombinatorRule()); } addWithLastConsumed( $current, "LABEL", lv_LABEL_5_0, "STRING"); } ) ) otherlv_6=')' { newLeafNode(otherlv_6, grammarAccess.getRuleCombinatorAccess().getRightParenthesisKeyword_2_2()); } )*( otherlv_7=';' { newLeafNode(otherlv_7, grammarAccess.getRuleCombinatorAccess().getSemicolonKeyword_3()); } )?) ; // Entry rule entryRuleHookCombinator entryRuleHookCombinator returns [EObject current=null] : { newCompositeNode(grammarAccess.getHookCombinatorRule()); } iv_ruleHookCombinator=ruleHookCombinator { $current=$iv_ruleHookCombinator.current; } EOF ; // Rule HookCombinator ruleHookCombinator returns [EObject current=null] @init { enterRule(); } @after { leaveRule(); }: ( otherlv_0='hook' { newLeafNode(otherlv_0, grammarAccess.getHookCombinatorAccess().getHookKeyword_0()); } otherlv_1='combinator:' { newLeafNode(otherlv_1, grammarAccess.getHookCombinatorAccess().getCombinatorKeyword_1()); } ( ( lv_name_2_0=RULE_ID { newLeafNode(lv_name_2_0, grammarAccess.getHookCombinatorAccess().getNameIDTerminalRuleCall_2_0()); } { if ($current==null) { $current = createModelElement(grammarAccess.getHookCombinatorRule()); } setWithLastConsumed( $current, "name", lv_name_2_0, "ID"); } ) ) otherlv_3='(' { newLeafNode(otherlv_3, grammarAccess.getHookCombinatorAccess().getLeftParenthesisKeyword_3()); } ( ( lv_ruleext_4_0=RULE_INT { newLeafNode(lv_ruleext_4_0, grammarAccess.getHookCombinatorAccess().getRuleextINTTerminalRuleCall_4_0()); } { if ($current==null) { $current = createModelElement(grammarAccess.getHookCombinatorRule()); } setWithLastConsumed( $current, "ruleext", lv_ruleext_4_0, "INT"); } ) ) otherlv_5=')' { newLeafNode(otherlv_5, grammarAccess.getHookCombinatorAccess().getRightParenthesisKeyword_5()); } ( ( lv_logic_6_0=RULE_LOGIC { newLeafNode(lv_logic_6_0, grammarAccess.getHookCombinatorAccess().getLogicLOGICTerminalRuleCall_6_0()); } { if ($current==null) { $current = createModelElement(grammarAccess.getHookCombinatorRule()); } setWithLastConsumed( $current, "logic", lv_logic_6_0, "LOGIC"); } ) )?( otherlv_7='(' { newLeafNode(otherlv_7, grammarAccess.getHookCombinatorAccess().getLeftParenthesisKeyword_7_0()); } ( ( lv_LABEL_8_0=RULE_STRING { newLeafNode(lv_LABEL_8_0, grammarAccess.getHookCombinatorAccess().getLABELSTRINGTerminalRuleCall_7_1_0()); } { if ($current==null) { $current = createModelElement(grammarAccess.getHookCombinatorRule()); } addWithLastConsumed( $current, "LABEL", lv_LABEL_8_0, "STRING"); } ) ) otherlv_9=')' { newLeafNode(otherlv_9, grammarAccess.getHookCombinatorAccess().getRightParenthesisKeyword_7_2()); } )+( otherlv_10=';' { newLeafNode(otherlv_10, grammarAccess.getHookCombinatorAccess().getSemicolonKeyword_8()); } )?) ; // Entry rule entryRuleDefinitionList entryRuleDefinitionList returns [EObject current=null] : { newCompositeNode(grammarAccess.getDefinitionListRule()); } iv_ruleDefinitionList=ruleDefinitionList { $current=$iv_ruleDefinitionList.current; } EOF ; // Rule DefinitionList ruleDefinitionList returns [EObject current=null] @init { enterRule(); } @after { leaveRule(); }: (( ( { newCompositeNode(grammarAccess.getDefinitionListAccess().getSingleDefinitionSingleDefinitionParserRuleCall_0_0()); } lv_singleDefinition_0_0=ruleSingleDefinition { if ($current==null) { $current = createModelElementForParent(grammarAccess.getDefinitionListRule()); } add( $current, "singleDefinition", lv_singleDefinition_0_0, "SingleDefinition"); afterParserOrEnumRuleCall(); } ) )( otherlv_1='|' { newLeafNode(otherlv_1, grammarAccess.getDefinitionListAccess().getVerticalLineKeyword_1_0()); } ( ( { newCompositeNode(grammarAccess.getDefinitionListAccess().getSingleDefinitionSingleDefinitionParserRuleCall_1_1_0()); } lv_singleDefinition_2_0=ruleSingleDefinition { if ($current==null) { $current = createModelElementForParent(grammarAccess.getDefinitionListRule()); } add( $current, "singleDefinition", lv_singleDefinition_2_0, "SingleDefinition"); afterParserOrEnumRuleCall(); } ) ))*) ; // Entry rule entryRuleSingleDefinition entryRuleSingleDefinition returns [EObject current=null] : { newCompositeNode(grammarAccess.getSingleDefinitionRule()); } iv_ruleSingleDefinition=ruleSingleDefinition { $current=$iv_ruleSingleDefinition.current; } EOF ; // Rule SingleDefinition ruleSingleDefinition returns [EObject current=null] @init { enterRule(); } @after { leaveRule(); }: ( ( { newCompositeNode(grammarAccess.getSingleDefinitionAccess().getTermsTermParserRuleCall_0()); } lv_terms_0_0=ruleTerm { if ($current==null) { $current = createModelElementForParent(grammarAccess.getSingleDefinitionRule()); } add( $current, "terms", lv_terms_0_0, "Term"); afterParserOrEnumRuleCall(); } ) )+ ; // Entry rule entryRuleTerm entryRuleTerm returns [EObject current=null] : { newCompositeNode(grammarAccess.getTermRule()); } iv_ruleTerm=ruleTerm { $current=$iv_ruleTerm.current; } EOF ; // Rule Term ruleTerm returns [EObject current=null] @init { enterRule(); } @after { leaveRule(); }: (( ( { newCompositeNode(grammarAccess.getTermAccess().getTermAtomAtomParserRuleCall_0_0()); } lv_termAtom_0_0=ruleAtom { if ($current==null) { $current = createModelElementForParent(grammarAccess.getTermRule()); } set( $current, "termAtom", lv_termAtom_0_0, "Atom"); afterParserOrEnumRuleCall(); } ) ) |( ( { newCompositeNode(grammarAccess.getTermAccess().getTermGroupedSequenceGroupedSequenceParserRuleCall_1_0()); } lv_termGroupedSequence_1_0=ruleGroupedSequence { if ($current==null) { $current = createModelElementForParent(grammarAccess.getTermRule()); } set( $current, "termGroupedSequence", lv_termGroupedSequence_1_0, "GroupedSequence"); afterParserOrEnumRuleCall(); } ) ) |( ( { newCompositeNode(grammarAccess.getTermAccess().getTermOptionalSequenceOptionalSequenceParserRuleCall_2_0()); } lv_termOptionalSequence_2_0=ruleOptionalSequence { if ($current==null) { $current = createModelElementForParent(grammarAccess.getTermRule()); } set( $current, "termOptionalSequence", lv_termOptionalSequence_2_0, "OptionalSequence"); afterParserOrEnumRuleCall(); } ) ) |( ( { newCompositeNode(grammarAccess.getTermAccess().getTermRepeatedSequenceRepeatedSequenceParserRuleCall_3_0()); } lv_termRepeatedSequence_3_0=ruleRepeatedSequence { if ($current==null) { $current = createModelElementForParent(grammarAccess.getTermRule()); } set( $current, "termRepeatedSequence", lv_termRepeatedSequence_3_0, "RepeatedSequence"); 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(); }: (( ( { newCompositeNode(grammarAccess.getAtomAccess().getAtomStringRuleStringRuleParserRuleCall_0_0()); } lv_atomStringRule_0_0=ruleStringRule { if ($current==null) { $current = createModelElementForParent(grammarAccess.getAtomRule()); } set( $current, "atomStringRule", lv_atomStringRule_0_0, "StringRule"); afterParserOrEnumRuleCall(); } ) ) |( ( { newCompositeNode(grammarAccess.getAtomAccess().getAtomRuleReferenceRuleReferenceParserRuleCall_1_0()); } lv_atomRuleReference_1_0=ruleRuleReference { if ($current==null) { $current = createModelElementForParent(grammarAccess.getAtomRule()); } set( $current, "atomRuleReference", lv_atomRuleReference_1_0, "RuleReference"); afterParserOrEnumRuleCall(); } ) )) ; // Entry rule entryRuleRuleReference entryRuleRuleReference returns [EObject current=null] : { newCompositeNode(grammarAccess.getRuleReferenceRule()); } iv_ruleRuleReference=ruleRuleReference { $current=$iv_ruleRuleReference.current; } EOF ; // Rule RuleReference ruleRuleReference returns [EObject current=null] @init { enterRule(); } @after { leaveRule(); }: ( ( { if ($current==null) { $current = createModelElement(grammarAccess.getRuleReferenceRule()); } } otherlv_0=RULE_ID { newLeafNode(otherlv_0, grammarAccess.getRuleReferenceAccess().getRulerefRuleCrossReference_0()); } ) ) ; // Entry rule entryRuleStringRule entryRuleStringRule returns [EObject current=null] : { newCompositeNode(grammarAccess.getStringRuleRule()); } iv_ruleStringRule=ruleStringRule { $current=$iv_ruleStringRule.current; } EOF ; // Rule StringRule ruleStringRule returns [EObject current=null] @init { enterRule(); } @after { leaveRule(); }: (( ( lv_literal_0_0=RULE_STRING { newLeafNode(lv_literal_0_0, grammarAccess.getStringRuleAccess().getLiteralSTRINGTerminalRuleCall_0_0()); } { if ($current==null) { $current = createModelElement(grammarAccess.getStringRuleRule()); } setWithLastConsumed( $current, "literal", lv_literal_0_0, "STRING"); } ) ) |( ( lv_colon_1_0=RULE_COLON { newLeafNode(lv_colon_1_0, grammarAccess.getStringRuleAccess().getColonCOLONTerminalRuleCall_1_0()); } { if ($current==null) { $current = createModelElement(grammarAccess.getStringRuleRule()); } setWithLastConsumed( $current, "colon", lv_colon_1_0, "COLON"); } ) )) ; // Entry rule entryRuleGroupedSequence entryRuleGroupedSequence returns [EObject current=null] : { newCompositeNode(grammarAccess.getGroupedSequenceRule()); } iv_ruleGroupedSequence=ruleGroupedSequence { $current=$iv_ruleGroupedSequence.current; } EOF ; // Rule GroupedSequence ruleGroupedSequence returns [EObject current=null] @init { enterRule(); } @after { leaveRule(); }: ( otherlv_0='(' { newLeafNode(otherlv_0, grammarAccess.getGroupedSequenceAccess().getLeftParenthesisKeyword_0()); } ( ( { newCompositeNode(grammarAccess.getGroupedSequenceAccess().getDefinitionListDefinitionListParserRuleCall_1_0()); } lv_definitionList_1_0=ruleDefinitionList { if ($current==null) { $current = createModelElementForParent(grammarAccess.getGroupedSequenceRule()); } add( $current, "definitionList", lv_definitionList_1_0, "DefinitionList"); afterParserOrEnumRuleCall(); } ) ) otherlv_2=')' { newLeafNode(otherlv_2, grammarAccess.getGroupedSequenceAccess().getRightParenthesisKeyword_2()); } ) ; // Entry rule entryRuleOptionalSequence entryRuleOptionalSequence returns [EObject current=null] : { newCompositeNode(grammarAccess.getOptionalSequenceRule()); } iv_ruleOptionalSequence=ruleOptionalSequence { $current=$iv_ruleOptionalSequence.current; } EOF ; // Rule OptionalSequence ruleOptionalSequence returns [EObject current=null] @init { enterRule(); } @after { leaveRule(); }: ( otherlv_0='[' { newLeafNode(otherlv_0, grammarAccess.getOptionalSequenceAccess().getLeftSquareBracketKeyword_0()); } ( ( { newCompositeNode(grammarAccess.getOptionalSequenceAccess().getDefinitionListDefinitionListParserRuleCall_1_0()); } lv_definitionList_1_0=ruleDefinitionList { if ($current==null) { $current = createModelElementForParent(grammarAccess.getOptionalSequenceRule()); } add( $current, "definitionList", lv_definitionList_1_0, "DefinitionList"); afterParserOrEnumRuleCall(); } ) ) otherlv_2=']' { newLeafNode(otherlv_2, grammarAccess.getOptionalSequenceAccess().getRightSquareBracketKeyword_2()); } ) ; // Entry rule entryRuleRepeatedSequence entryRuleRepeatedSequence returns [EObject current=null] : { newCompositeNode(grammarAccess.getRepeatedSequenceRule()); } iv_ruleRepeatedSequence=ruleRepeatedSequence { $current=$iv_ruleRepeatedSequence.current; } EOF ; // Rule RepeatedSequence ruleRepeatedSequence returns [EObject current=null] @init { enterRule(); } @after { leaveRule(); }: ( otherlv_0='{' { newLeafNode(otherlv_0, grammarAccess.getRepeatedSequenceAccess().getLeftCurlyBracketKeyword_0()); } ( ( { newCompositeNode(grammarAccess.getRepeatedSequenceAccess().getDefinitionsDefinitionListParserRuleCall_1_0()); } lv_definitions_1_0=ruleDefinitionList { if ($current==null) { $current = createModelElementForParent(grammarAccess.getRepeatedSequenceRule()); } add( $current, "definitions", lv_definitions_1_0, "DefinitionList"); afterParserOrEnumRuleCall(); } ) ) otherlv_2='}' { newLeafNode(otherlv_2, grammarAccess.getRepeatedSequenceAccess().getRightCurlyBracketKeyword_2()); } ( ( lv_morethanonce_3_0= '+' { newLeafNode(lv_morethanonce_3_0, grammarAccess.getRepeatedSequenceAccess().getMorethanoncePlusSignKeyword_3_0()); } { if ($current==null) { $current = createModelElement(grammarAccess.getRepeatedSequenceRule()); } setWithLastConsumed($current, "morethanonce", true, "+"); } ) )?) ; RULE_ID : ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'0'..'9'|'_')*; RULE_INT : ('0'..'9')+; RULE_WS : (' '|'\t'|'\r'? '\n')+; RULE_COLON : '"' '"' '"'; RULE_STRING : ('"' ~('"')* '"'|'\'' ~('\'')* '\''); RULE_SECTIONHEADER : ('a'..'z'|'A'..'Z') ('.'|'0'..'9')+ (' '|'\t') ~(('\n'|'\r'))* '\r'? '\n'; RULE_SL_COMMENT : '//' ~(('\n'|'\r'))* ('\r'? '\n')?; RULE_ML_COMMENT : '/*' ( options {greedy=false;} : . )*'*/'; RULE_LOGIC : ('/and'|'/or'|'/andr'|'/orr'|'/any'|'/together');