/* * generated by Xtext 2.10.0 */ grammar InternalApplicationConfiguration; options { superClass=AbstractInternalAntlrParser; } @lexer::header { package hu.bme.mit.inf.dslreasoner.application.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 hu.bme.mit.inf.dslreasoner.application.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 hu.bme.mit.inf.dslreasoner.application.services.ApplicationConfigurationGrammarAccess; } @parser::members { private ApplicationConfigurationGrammarAccess grammarAccess; public InternalApplicationConfigurationParser(TokenStream input, ApplicationConfigurationGrammarAccess grammarAccess) { this(input); this.grammarAccess = grammarAccess; registerRules(grammarAccess.getGrammar()); } @Override protected String getFirstRuleName() { return "ConfigurationScript"; } @Override protected ApplicationConfigurationGrammarAccess getGrammarAccess() { return grammarAccess; } } @rulecatch { catch (RecognitionException re) { recover(input,re); appendSkippedTokens(); } } // Entry rule entryRuleConfigurationScript entryRuleConfigurationScript returns [EObject current=null]: { newCompositeNode(grammarAccess.getConfigurationScriptRule()); } iv_ruleConfigurationScript=ruleConfigurationScript { $current=$iv_ruleConfigurationScript.current; } EOF; // Rule ConfigurationScript ruleConfigurationScript returns [EObject current=null] @init { enterRule(); } @after { leaveRule(); }: ( ( ( { newCompositeNode(grammarAccess.getConfigurationScriptAccess().getImportsImportParserRuleCall_0_0()); } lv_imports_0_0=ruleImport { if ($current==null) { $current = createModelElementForParent(grammarAccess.getConfigurationScriptRule()); } add( $current, "imports", lv_imports_0_0, "hu.bme.mit.inf.dslreasoner.application.ApplicationConfiguration.Import"); afterParserOrEnumRuleCall(); } ) )* ( ( { newCompositeNode(grammarAccess.getConfigurationScriptAccess().getCommandsCommandParserRuleCall_1_0()); } lv_commands_1_0=ruleCommand { if ($current==null) { $current = createModelElementForParent(grammarAccess.getConfigurationScriptRule()); } add( $current, "commands", lv_commands_1_0, "hu.bme.mit.inf.dslreasoner.application.ApplicationConfiguration.Command"); afterParserOrEnumRuleCall(); } ) )* ) ; // Entry rule entryRuleCommand entryRuleCommand returns [EObject current=null]: { newCompositeNode(grammarAccess.getCommandRule()); } iv_ruleCommand=ruleCommand { $current=$iv_ruleCommand.current; } EOF; // Rule Command ruleCommand returns [EObject current=null] @init { enterRule(); } @after { leaveRule(); }: { newCompositeNode(grammarAccess.getCommandAccess().getDeclarationParserRuleCall()); } this_Declaration_0=ruleDeclaration { $current = $this_Declaration_0.current; afterParserOrEnumRuleCall(); } ; // Entry rule entryRuleDeclaration entryRuleDeclaration returns [EObject current=null]: { newCompositeNode(grammarAccess.getDeclarationRule()); } iv_ruleDeclaration=ruleDeclaration { $current=$iv_ruleDeclaration.current; } EOF; // Rule Declaration ruleDeclaration returns [EObject current=null] @init { enterRule(); } @after { leaveRule(); }: { newCompositeNode(grammarAccess.getDeclarationAccess().getMetamodelDeclarationParserRuleCall()); } this_MetamodelDeclaration_0=ruleMetamodelDeclaration { $current = $this_MetamodelDeclaration_0.current; afterParserOrEnumRuleCall(); } ; // 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(); }: ( { newCompositeNode(grammarAccess.getImportAccess().getEPackageImportParserRuleCall_0()); } this_EPackageImport_0=ruleEPackageImport { $current = $this_EPackageImport_0.current; afterParserOrEnumRuleCall(); } | { newCompositeNode(grammarAccess.getImportAccess().getViatraImportParserRuleCall_1()); } this_ViatraImport_1=ruleViatraImport { $current = $this_ViatraImport_1.current; afterParserOrEnumRuleCall(); } ) ; // Entry rule entryRuleEPackageImport entryRuleEPackageImport returns [EObject current=null]: { newCompositeNode(grammarAccess.getEPackageImportRule()); } iv_ruleEPackageImport=ruleEPackageImport { $current=$iv_ruleEPackageImport.current; } EOF; // Rule EPackageImport ruleEPackageImport returns [EObject current=null] @init { enterRule(); } @after { leaveRule(); }: ( otherlv_0='import' { newLeafNode(otherlv_0, grammarAccess.getEPackageImportAccess().getImportKeyword_0()); } otherlv_1='epackage' { newLeafNode(otherlv_1, grammarAccess.getEPackageImportAccess().getEpackageKeyword_1()); } ( ( { if ($current==null) { $current = createModelElement(grammarAccess.getEPackageImportRule()); } } otherlv_2=RULE_STRING { newLeafNode(otherlv_2, grammarAccess.getEPackageImportAccess().getImportedPackageEPackageCrossReference_2_0()); } ) ) ) ; // Entry rule entryRuleViatraImport entryRuleViatraImport returns [EObject current=null]: { newCompositeNode(grammarAccess.getViatraImportRule()); } iv_ruleViatraImport=ruleViatraImport { $current=$iv_ruleViatraImport.current; } EOF; // Rule ViatraImport ruleViatraImport returns [EObject current=null] @init { enterRule(); } @after { leaveRule(); }: ( otherlv_0='import' { newLeafNode(otherlv_0, grammarAccess.getViatraImportAccess().getImportKeyword_0()); } otherlv_1='viatra' { newLeafNode(otherlv_1, grammarAccess.getViatraImportAccess().getViatraKeyword_1()); } ( ( { if ($current==null) { $current = createModelElement(grammarAccess.getViatraImportRule()); } } otherlv_2=RULE_STRING { newLeafNode(otherlv_2, grammarAccess.getViatraImportAccess().getImportedViatraPatternModelCrossReference_2_0()); } ) ) ) ; // Entry rule entryRuleMetamodelSpecification entryRuleMetamodelSpecification returns [EObject current=null]: { newCompositeNode(grammarAccess.getMetamodelSpecificationRule()); } iv_ruleMetamodelSpecification=ruleMetamodelSpecification { $current=$iv_ruleMetamodelSpecification.current; } EOF; // Rule MetamodelSpecification ruleMetamodelSpecification returns [EObject current=null] @init { enterRule(); } @after { leaveRule(); }: ( otherlv_0='{' { newLeafNode(otherlv_0, grammarAccess.getMetamodelSpecificationAccess().getLeftCurlyBracketKeyword_0()); } ( ( { newCompositeNode(grammarAccess.getMetamodelSpecificationAccess().getEntriesMetamodelEntryParserRuleCall_1_0()); } lv_entries_1_0=ruleMetamodelEntry { if ($current==null) { $current = createModelElementForParent(grammarAccess.getMetamodelSpecificationRule()); } add( $current, "entries", lv_entries_1_0, "hu.bme.mit.inf.dslreasoner.application.ApplicationConfiguration.MetamodelEntry"); afterParserOrEnumRuleCall(); } ) ) ( otherlv_2=',' { newLeafNode(otherlv_2, grammarAccess.getMetamodelSpecificationAccess().getCommaKeyword_2_0()); } ( ( { newCompositeNode(grammarAccess.getMetamodelSpecificationAccess().getEntriesMetamodelEntryParserRuleCall_2_1_0()); } lv_entries_3_0=ruleMetamodelEntry { if ($current==null) { $current = createModelElementForParent(grammarAccess.getMetamodelSpecificationRule()); } add( $current, "entries", lv_entries_3_0, "hu.bme.mit.inf.dslreasoner.application.ApplicationConfiguration.MetamodelEntry"); afterParserOrEnumRuleCall(); } ) ) )* otherlv_4='}' { newLeafNode(otherlv_4, grammarAccess.getMetamodelSpecificationAccess().getRightCurlyBracketKeyword_3()); } ) ; // Entry rule entryRuleMetamodelEntry entryRuleMetamodelEntry returns [EObject current=null]: { newCompositeNode(grammarAccess.getMetamodelEntryRule()); } iv_ruleMetamodelEntry=ruleMetamodelEntry { $current=$iv_ruleMetamodelEntry.current; } EOF; // Rule MetamodelEntry ruleMetamodelEntry returns [EObject current=null] @init { enterRule(); } @after { leaveRule(); }: ( { newCompositeNode(grammarAccess.getMetamodelEntryAccess().getMetamodelElementParserRuleCall_0()); } this_MetamodelElement_0=ruleMetamodelElement { $current = $this_MetamodelElement_0.current; afterParserOrEnumRuleCall(); } | { newCompositeNode(grammarAccess.getMetamodelEntryAccess().getAllPackageEntryParserRuleCall_1()); } this_AllPackageEntry_1=ruleAllPackageEntry { $current = $this_AllPackageEntry_1.current; afterParserOrEnumRuleCall(); } ) ; // Entry rule entryRuleAllPackageEntry entryRuleAllPackageEntry returns [EObject current=null]: { newCompositeNode(grammarAccess.getAllPackageEntryRule()); } iv_ruleAllPackageEntry=ruleAllPackageEntry { $current=$iv_ruleAllPackageEntry.current; } EOF; // Rule AllPackageEntry ruleAllPackageEntry returns [EObject current=null] @init { enterRule(); } @after { leaveRule(); }: ( otherlv_0='package' { newLeafNode(otherlv_0, grammarAccess.getAllPackageEntryAccess().getPackageKeyword_0()); } ( ( { if ($current==null) { $current = createModelElement(grammarAccess.getAllPackageEntryRule()); } } otherlv_1=RULE_ID { newLeafNode(otherlv_1, grammarAccess.getAllPackageEntryAccess().getPackageEPackageCrossReference_1_0()); } ) ) ( otherlv_2='excluding' { newLeafNode(otherlv_2, grammarAccess.getAllPackageEntryAccess().getExcludingKeyword_2_0()); } otherlv_3='{' { newLeafNode(otherlv_3, grammarAccess.getAllPackageEntryAccess().getLeftCurlyBracketKeyword_2_1()); } ( ( { newCompositeNode(grammarAccess.getAllPackageEntryAccess().getExclusionMetamodelElementParserRuleCall_2_2_0()); } lv_exclusion_4_0=ruleMetamodelElement { if ($current==null) { $current = createModelElementForParent(grammarAccess.getAllPackageEntryRule()); } add( $current, "exclusion", lv_exclusion_4_0, "hu.bme.mit.inf.dslreasoner.application.ApplicationConfiguration.MetamodelElement"); afterParserOrEnumRuleCall(); } ) ) ( otherlv_5=',' { newLeafNode(otherlv_5, grammarAccess.getAllPackageEntryAccess().getCommaKeyword_2_3_0()); } ( ( { newCompositeNode(grammarAccess.getAllPackageEntryAccess().getExclusionMetamodelElementParserRuleCall_2_3_1_0()); } lv_exclusion_6_0=ruleMetamodelElement { if ($current==null) { $current = createModelElementForParent(grammarAccess.getAllPackageEntryRule()); } add( $current, "exclusion", lv_exclusion_6_0, "hu.bme.mit.inf.dslreasoner.application.ApplicationConfiguration.MetamodelElement"); afterParserOrEnumRuleCall(); } ) ) )* otherlv_7='}' { newLeafNode(otherlv_7, grammarAccess.getAllPackageEntryAccess().getRightCurlyBracketKeyword_2_4()); } )? ) ; // Entry rule entryRuleMetamodelElement entryRuleMetamodelElement returns [EObject current=null]: { newCompositeNode(grammarAccess.getMetamodelElementRule()); } iv_ruleMetamodelElement=ruleMetamodelElement { $current=$iv_ruleMetamodelElement.current; } EOF; // Rule MetamodelElement ruleMetamodelElement returns [EObject current=null] @init { enterRule(); } @after { leaveRule(); }: ( ( ( ( { if ($current==null) { $current = createModelElement(grammarAccess.getMetamodelElementRule()); } } otherlv_0=RULE_ID { newLeafNode(otherlv_0, grammarAccess.getMetamodelElementAccess().getPackageEPackageCrossReference_0_0_0()); } ) ) otherlv_1='::' { newLeafNode(otherlv_1, grammarAccess.getMetamodelElementAccess().getColonColonKeyword_0_1()); } )? ( ( { if ($current==null) { $current = createModelElement(grammarAccess.getMetamodelElementRule()); } } otherlv_2=RULE_ID { newLeafNode(otherlv_2, grammarAccess.getMetamodelElementAccess().getClassifierEClassifierCrossReference_1_0()); } ) ) ( otherlv_3='.' { newLeafNode(otherlv_3, grammarAccess.getMetamodelElementAccess().getFullStopKeyword_2_0()); } ( ( { if ($current==null) { $current = createModelElement(grammarAccess.getMetamodelElementRule()); } } otherlv_4=RULE_ID { newLeafNode(otherlv_4, grammarAccess.getMetamodelElementAccess().getFeatureENamedElementCrossReference_2_1_0()); } ) ) )? ) ; // Entry rule entryRuleMetamodelDeclaration entryRuleMetamodelDeclaration returns [EObject current=null]: { newCompositeNode(grammarAccess.getMetamodelDeclarationRule()); } iv_ruleMetamodelDeclaration=ruleMetamodelDeclaration { $current=$iv_ruleMetamodelDeclaration.current; } EOF; // Rule MetamodelDeclaration ruleMetamodelDeclaration returns [EObject current=null] @init { enterRule(); } @after { leaveRule(); }: ( otherlv_0='metamodel' { newLeafNode(otherlv_0, grammarAccess.getMetamodelDeclarationAccess().getMetamodelKeyword_0()); } ( ( lv_name_1_0=RULE_ID { newLeafNode(lv_name_1_0, grammarAccess.getMetamodelDeclarationAccess().getNameIDTerminalRuleCall_1_0()); } { if ($current==null) { $current = createModelElement(grammarAccess.getMetamodelDeclarationRule()); } setWithLastConsumed( $current, "name", lv_name_1_0, "org.eclipse.xtext.common.Terminals.ID"); } ) ) ( ( { newCompositeNode(grammarAccess.getMetamodelDeclarationAccess().getSpecificationMetamodelSpecificationParserRuleCall_2_0()); } lv_specification_2_0=ruleMetamodelSpecification { if ($current==null) { $current = createModelElementForParent(grammarAccess.getMetamodelDeclarationRule()); } set( $current, "specification", lv_specification_2_0, "hu.bme.mit.inf.dslreasoner.application.ApplicationConfiguration.MetamodelSpecification"); afterParserOrEnumRuleCall(); } ) ) ) ; // Entry rule entryRuleMetamodelReference entryRuleMetamodelReference returns [EObject current=null]: { newCompositeNode(grammarAccess.getMetamodelReferenceRule()); } iv_ruleMetamodelReference=ruleMetamodelReference { $current=$iv_ruleMetamodelReference.current; } EOF; // Rule MetamodelReference ruleMetamodelReference returns [EObject current=null] @init { enterRule(); } @after { leaveRule(); }: ( ( { if ($current==null) { $current = createModelElement(grammarAccess.getMetamodelReferenceRule()); } } otherlv_0=RULE_ID { newLeafNode(otherlv_0, grammarAccess.getMetamodelReferenceAccess().getReferredMetamodelDeclarationCrossReference_0()); } ) ) ; RULE_ID : '^'? ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'_'|'0'..'9')*; RULE_INT : ('0'..'9')+; RULE_STRING : ('"' ('\\' .|~(('\\'|'"')))* '"'|'\'' ('\\' .|~(('\\'|'\'')))* '\''); RULE_ML_COMMENT : '/*' ( options {greedy=false;} : . )*'*/'; RULE_SL_COMMENT : '//' ~(('\n'|'\r'))* ('\r'? '\n')?; RULE_WS : (' '|'\t'|'\r'|'\n')+; RULE_ANY_OTHER : .;