| /* |
| * generated by Xtext |
| */ |
| grammar InternalGolang; |
| |
| options { |
| superClass=AbstractInternalContentAssistParser; |
| |
| } |
| |
| @lexer::header { |
| package me.dollyn.goide.ui.contentassist.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.ui.editor.contentassist.antlr.internal.Lexer; |
| } |
| |
| @parser::header { |
| package me.dollyn.goide.ui.contentassist.antlr.internal; |
| |
| import java.io.InputStream; |
| 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.XtextTokenStream; |
| import org.eclipse.xtext.parser.antlr.XtextTokenStream.HiddenTokens; |
| import org.eclipse.xtext.ui.editor.contentassist.antlr.internal.AbstractInternalContentAssistParser; |
| import org.eclipse.xtext.ui.editor.contentassist.antlr.internal.DFA; |
| import me.dollyn.goide.services.GolangGrammarAccess; |
| |
| } |
| |
| @parser::members { |
| |
| private GolangGrammarAccess grammarAccess; |
| |
| public void setGrammarAccess(GolangGrammarAccess grammarAccess) { |
| this.grammarAccess = grammarAccess; |
| } |
| |
| @Override |
| protected Grammar getGrammar() { |
| return grammarAccess.getGrammar(); |
| } |
| |
| @Override |
| protected String getValueForTokenName(String tokenName) { |
| return tokenName; |
| } |
| |
| } |
| |
| |
| |
| |
| // Entry rule entryRuleGoModel |
| entryRuleGoModel |
| : |
| { before(grammarAccess.getGoModelRule()); } |
| ruleGoModel |
| { after(grammarAccess.getGoModelRule()); } |
| EOF |
| ; |
| |
| // Rule GoModel |
| ruleGoModel |
| @init { |
| int stackSize = keepStackSize(); |
| } |
| : |
| ( |
| { before(grammarAccess.getGoModelAccess().getGroup()); } |
| (rule__GoModel__Group__0) |
| { after(grammarAccess.getGoModelAccess().getGroup()); } |
| ) |
| |
| ; |
| finally { |
| restoreStackSize(stackSize); |
| } |
| |
| |
| |
| // Entry rule entryRulePackage |
| entryRulePackage |
| : |
| { before(grammarAccess.getPackageRule()); } |
| rulePackage |
| { after(grammarAccess.getPackageRule()); } |
| EOF |
| ; |
| |
| // Rule Package |
| rulePackage |
| @init { |
| int stackSize = keepStackSize(); |
| } |
| : |
| ( |
| { before(grammarAccess.getPackageAccess().getGroup()); } |
| (rule__Package__Group__0) |
| { after(grammarAccess.getPackageAccess().getGroup()); } |
| ) |
| |
| ; |
| finally { |
| restoreStackSize(stackSize); |
| } |
| |
| |
| |
| // Entry rule entryRuleImport |
| entryRuleImport |
| : |
| { before(grammarAccess.getImportRule()); } |
| ruleImport |
| { after(grammarAccess.getImportRule()); } |
| EOF |
| ; |
| |
| // Rule Import |
| ruleImport |
| @init { |
| int stackSize = keepStackSize(); |
| } |
| : |
| ( |
| { before(grammarAccess.getImportAccess().getGroup()); } |
| (rule__Import__Group__0) |
| { after(grammarAccess.getImportAccess().getGroup()); } |
| ) |
| |
| ; |
| finally { |
| restoreStackSize(stackSize); |
| } |
| |
| |
| |
| |
| |
| |
| rule__GoModel__Group__0 |
| @init { |
| int stackSize = keepStackSize(); |
| } |
| : |
| rule__GoModel__Group__0__Impl |
| rule__GoModel__Group__1 |
| ; |
| finally { |
| restoreStackSize(stackSize); |
| } |
| |
| rule__GoModel__Group__0__Impl |
| @init { |
| int stackSize = keepStackSize(); |
| } |
| : |
| ( |
| { before(grammarAccess.getGoModelAccess().getPackageAssignment_0()); } |
| (rule__GoModel__PackageAssignment_0) |
| { after(grammarAccess.getGoModelAccess().getPackageAssignment_0()); } |
| ) |
| |
| ; |
| finally { |
| restoreStackSize(stackSize); |
| } |
| |
| |
| rule__GoModel__Group__1 |
| @init { |
| int stackSize = keepStackSize(); |
| } |
| : |
| rule__GoModel__Group__1__Impl |
| ; |
| finally { |
| restoreStackSize(stackSize); |
| } |
| |
| rule__GoModel__Group__1__Impl |
| @init { |
| int stackSize = keepStackSize(); |
| } |
| : |
| ( |
| { before(grammarAccess.getGoModelAccess().getImportsAssignment_1()); } |
| (rule__GoModel__ImportsAssignment_1)* |
| { after(grammarAccess.getGoModelAccess().getImportsAssignment_1()); } |
| ) |
| |
| ; |
| finally { |
| restoreStackSize(stackSize); |
| } |
| |
| |
| |
| |
| |
| |
| rule__Package__Group__0 |
| @init { |
| int stackSize = keepStackSize(); |
| } |
| : |
| rule__Package__Group__0__Impl |
| rule__Package__Group__1 |
| ; |
| finally { |
| restoreStackSize(stackSize); |
| } |
| |
| rule__Package__Group__0__Impl |
| @init { |
| int stackSize = keepStackSize(); |
| } |
| : |
| ( |
| { before(grammarAccess.getPackageAccess().getPackageKeyword_0()); } |
| |
| 'package' |
| |
| { after(grammarAccess.getPackageAccess().getPackageKeyword_0()); } |
| ) |
| |
| ; |
| finally { |
| restoreStackSize(stackSize); |
| } |
| |
| |
| rule__Package__Group__1 |
| @init { |
| int stackSize = keepStackSize(); |
| } |
| : |
| rule__Package__Group__1__Impl |
| ; |
| finally { |
| restoreStackSize(stackSize); |
| } |
| |
| rule__Package__Group__1__Impl |
| @init { |
| int stackSize = keepStackSize(); |
| } |
| : |
| ( |
| { before(grammarAccess.getPackageAccess().getNameAssignment_1()); } |
| (rule__Package__NameAssignment_1) |
| { after(grammarAccess.getPackageAccess().getNameAssignment_1()); } |
| ) |
| |
| ; |
| finally { |
| restoreStackSize(stackSize); |
| } |
| |
| |
| |
| |
| |
| |
| rule__Import__Group__0 |
| @init { |
| int stackSize = keepStackSize(); |
| } |
| : |
| rule__Import__Group__0__Impl |
| rule__Import__Group__1 |
| ; |
| finally { |
| restoreStackSize(stackSize); |
| } |
| |
| rule__Import__Group__0__Impl |
| @init { |
| int stackSize = keepStackSize(); |
| } |
| : |
| ( |
| { before(grammarAccess.getImportAccess().getImportKeyword_0()); } |
| |
| 'import' |
| |
| { after(grammarAccess.getImportAccess().getImportKeyword_0()); } |
| ) |
| |
| ; |
| finally { |
| restoreStackSize(stackSize); |
| } |
| |
| |
| rule__Import__Group__1 |
| @init { |
| int stackSize = keepStackSize(); |
| } |
| : |
| rule__Import__Group__1__Impl |
| ; |
| finally { |
| restoreStackSize(stackSize); |
| } |
| |
| rule__Import__Group__1__Impl |
| @init { |
| int stackSize = keepStackSize(); |
| } |
| : |
| ( |
| { before(grammarAccess.getImportAccess().getPathAssignment_1()); } |
| (rule__Import__PathAssignment_1) |
| { after(grammarAccess.getImportAccess().getPathAssignment_1()); } |
| ) |
| |
| ; |
| finally { |
| restoreStackSize(stackSize); |
| } |
| |
| |
| |
| |
| |
| |
| |
| rule__GoModel__PackageAssignment_0 |
| @init { |
| int stackSize = keepStackSize(); |
| } |
| : |
| ( |
| { before(grammarAccess.getGoModelAccess().getPackagePackageParserRuleCall_0_0()); } |
| rulePackage{ after(grammarAccess.getGoModelAccess().getPackagePackageParserRuleCall_0_0()); } |
| ) |
| |
| ; |
| finally { |
| restoreStackSize(stackSize); |
| } |
| |
| rule__GoModel__ImportsAssignment_1 |
| @init { |
| int stackSize = keepStackSize(); |
| } |
| : |
| ( |
| { before(grammarAccess.getGoModelAccess().getImportsImportParserRuleCall_1_0()); } |
| ruleImport{ after(grammarAccess.getGoModelAccess().getImportsImportParserRuleCall_1_0()); } |
| ) |
| |
| ; |
| finally { |
| restoreStackSize(stackSize); |
| } |
| |
| rule__Package__NameAssignment_1 |
| @init { |
| int stackSize = keepStackSize(); |
| } |
| : |
| ( |
| { before(grammarAccess.getPackageAccess().getNameIDTerminalRuleCall_1_0()); } |
| RULE_ID{ after(grammarAccess.getPackageAccess().getNameIDTerminalRuleCall_1_0()); } |
| ) |
| |
| ; |
| finally { |
| restoreStackSize(stackSize); |
| } |
| |
| rule__Import__PathAssignment_1 |
| @init { |
| int stackSize = keepStackSize(); |
| } |
| : |
| ( |
| { before(grammarAccess.getImportAccess().getPathSTRINGTerminalRuleCall_1_0()); } |
| RULE_STRING{ after(grammarAccess.getImportAccess().getPathSTRINGTerminalRuleCall_1_0()); } |
| ) |
| |
| ; |
| finally { |
| restoreStackSize(stackSize); |
| } |
| |
| |
| RULE_ID : '^'? ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'_'|'0'..'9')*; |
| |
| RULE_INT : ('0'..'9')+; |
| |
| RULE_STRING : ('"' ('\\' ('b'|'t'|'n'|'f'|'r'|'u'|'"'|'\''|'\\')|~(('\\'|'"')))* '"'|'\'' ('\\' ('b'|'t'|'n'|'f'|'r'|'u'|'"'|'\''|'\\')|~(('\\'|'\'')))* '\''); |
| |
| RULE_ML_COMMENT : '/*' ( options {greedy=false;} : . )*'*/'; |
| |
| RULE_SL_COMMENT : '//' ~(('\n'|'\r'))* ('\r'? '\n')?; |
| |
| RULE_WS : (' '|'\t'|'\r'|'\n')+; |
| |
| RULE_ANY_OTHER : .; |
| |
| |