aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorszarnekow2009-02-05 04:22:45 (EST)
committersefftinge2009-02-05 04:22:45 (EST)
commit5f1632aba4b9f0c90c5a9cfc3cc350be64179e40 (patch)
tree9bc3586670d6c9aba6bdf5fbf32d648805905fbc
parent41f78ea9728ab73439d3bb36564682ece886d87c (diff)
downloadorg.eclipse.xtext-5f1632aba4b9f0c90c5a9cfc3cc350be64179e40.zip
org.eclipse.xtext-5f1632aba4b9f0c90c5a9cfc3cc350be64179e40.tar.gz
org.eclipse.xtext-5f1632aba4b9f0c90c5a9cfc3cc350be64179e40.tar.bz2
Fix: Keywords were not properly escaped in Antlr-Grammar (https://bugs.eclipse.org/bugs/show_bug.cgi?id=258642)
-rw-r--r--devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/ReferenceGrammar.ecore6
-rw-r--r--devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/antlr/internal/InternalReferenceGrammar.g2
-rw-r--r--devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/antlr/internal/InternalReferenceGrammar.tokens2
-rw-r--r--devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/antlr/internal/InternalReferenceGrammarLexer.java6
-rw-r--r--devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/antlr/internal/InternalReferenceGrammarParser.java18
-rw-r--r--devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/antlr/internal/InternalReferenceGrammar__.g2
-rw-r--r--tests/org.eclipse.xtext.generator.tests/META-INF/MANIFEST.MF1
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/XtextTest.ecore8
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/epatch/EpatchTestLanguage.ecore2
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/AbstractKeywordsTestLanguageRuntimeModule.java72
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/IKeywordsTestLanguage.java24
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/KeywordsTestLanguage.ecore17
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/KeywordsTestLanguage.xmi38
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/KeywordsTestLanguageStandaloneSetup.java59
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/KeywordsTestLanguageAntlrTokenFileProvider.java15
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/KeywordsTestLanguageParser.java44
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g190
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.tokens11
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguageLexer.java800
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguageParser.java333
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage__.g36
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/packrat/KeywordsTestLanguageDelimiters.java26
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/packrat/KeywordsTestLanguagePackratParser.java16
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/packrat/KeywordsTestLanguageParserConfiguration.java92
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/packrat/consumers/KeywordsTestLanguageModelConsumer.java173
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parsetree/reconstr/KeywordsTestLanguageParseTreeConstructor.java201
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/services/KeywordsTestLanguageGrammarAccess.java89
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/services/KeywordsTestLanguageMetamodelAccess.java51
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/services/KeywordsTestLanguageResourceFactory.java27
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/ReferenceGrammar.ecore6
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalReferenceGrammarTestLanguage.g2
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalReferenceGrammarTestLanguage.tokens2
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalReferenceGrammarTestLanguageLexer.java6
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalReferenceGrammarTestLanguageParser.java14
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalReferenceGrammarTestLanguage__.g2
-rwxr-xr-xtests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/GenerateAllTestGrammars.java4
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parser/ParserTestHelper.java5
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parser/keywords/GrammarAccessTest.java34
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parser/keywords/KeywordsTestLanguage.java15
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parser/keywords/KeywordsTestLanguage.xtext14
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parser/keywords/KeywordsTestLanguageChecks.chk7
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parser/keywords/KeywordsTestLanguageRuntimeModule.java18
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parser/keywords/ParserTest.java94
-rwxr-xr-xtests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/tests/AbstractGeneratorTest.java10
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/parser/keywords/AbstractKeywordsTestLanguageUiModule.java28
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/parser/keywords/GenKeywordsTestLanguageProposalProvider.java82
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/parser/keywords/KeywordsTestLanguageUiSetup.java36
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/parser/keywords/ui/editor/KeywordsTestLanguageEditor.java6
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/parser/keywords/ui/internal/KeywordsTestLanguageActivator.java15
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/parser/keywords/KeywordsTestLanguageUIModule.java14
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/ui/common/GenerateAllTestGrammarsWithUiConfig.java11
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/DefaultContentAssistProcessorTest.java6
52 files changed, 2750 insertions, 42 deletions
diff --git a/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/ReferenceGrammar.ecore b/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/ReferenceGrammar.ecore
index c70d0ae..e234417 100644
--- a/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/ReferenceGrammar.ecore
+++ b/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/ReferenceGrammar.ecore
@@ -16,12 +16,12 @@
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Person">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name">
- <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- </eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="age">
<eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
</eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name">
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Kind" eSuperTypes="//Person"/>
<eClassifiers xsi:type="ecore:EClass" name="Erwachsener" eSuperTypes="//Person"/>
diff --git a/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/antlr/internal/InternalReferenceGrammar.g b/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/antlr/internal/InternalReferenceGrammar.g
index e9b019a..282b6ed 100644
--- a/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/antlr/internal/InternalReferenceGrammar.g
+++ b/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/antlr/internal/InternalReferenceGrammar.g
@@ -631,7 +631,7 @@ ruleFarbe returns [EObject current=null]
createLeafNode("classpath:/org/eclipse/xtext/reference/ReferenceGrammar.xmi#//@rules.6/@alternatives/@terminal/@groups.0/@groups.1" /* xtext::Keyword */, "wert");
}
)
- |'GRÜN'
+ |'GR\u00DCN'
{
createLeafNode("classpath:/org/eclipse/xtext/reference/ReferenceGrammar.xmi#//@rules.6/@alternatives/@terminal/@groups.1" /* xtext::Keyword */, "wert");
}
diff --git a/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/antlr/internal/InternalReferenceGrammar.tokens b/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/antlr/internal/InternalReferenceGrammar.tokens
index 5ee8a58..cdbc2b6 100644
--- a/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/antlr/internal/InternalReferenceGrammar.tokens
+++ b/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/antlr/internal/InternalReferenceGrammar.tokens
@@ -5,12 +5,12 @@ RULE_INT=4
RULE_STRING=5
RULE_ANY_OTHER=10
RULE_SL_COMMENT=8
+'GR\u00DCN'=25
'ROT'=22
'spielzeug'=18
'spielplatz'=11
')'=16
'type'=26
-'GRÜN'=25
'kind'=14
'GELB'=24
'{'=12
diff --git a/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/antlr/internal/InternalReferenceGrammarLexer.java b/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/antlr/internal/InternalReferenceGrammarLexer.java
index 3649fa2..af3d8b2 100644
--- a/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/antlr/internal/InternalReferenceGrammarLexer.java
+++ b/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/antlr/internal/InternalReferenceGrammarLexer.java
@@ -307,10 +307,10 @@ public class InternalReferenceGrammarLexer extends Lexer {
public final void mT25() throws RecognitionException {
try {
int _type = T25;
- // ../org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/antlr/internal/InternalReferenceGrammar.g:24:5: ( 'GRÜN' )
- // ../org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/antlr/internal/InternalReferenceGrammar.g:24:7: 'GRÜN'
+ // ../org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/antlr/internal/InternalReferenceGrammar.g:24:5: ( 'GR\\u00DCN' )
+ // ../org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/antlr/internal/InternalReferenceGrammar.g:24:7: 'GR\\u00DCN'
{
- match("GRÜN");
+ match("GR\u00DCN");
}
diff --git a/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/antlr/internal/InternalReferenceGrammarParser.java b/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/antlr/internal/InternalReferenceGrammarParser.java
index dee579f..bede4b1 100644
--- a/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/antlr/internal/InternalReferenceGrammarParser.java
+++ b/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/antlr/internal/InternalReferenceGrammarParser.java
@@ -22,7 +22,7 @@ import java.util.ArrayList;
public class InternalReferenceGrammarParser extends AbstractInternalAntlrParser {
public static final String[] tokenNames = new String[] {
- "<invalid>", "<EOR>", "<DOWN>", "<UP>", "RULE_INT", "RULE_STRING", "RULE_ID", "RULE_ML_COMMENT", "RULE_SL_COMMENT", "RULE_WS", "RULE_ANY_OTHER", "'spielplatz'", "'{'", "'}'", "'kind'", "'('", "')'", "'erwachsener'", "'spielzeug'", "'familie'", "'keyword'", "','", "'ROT'", "'BLAU'", "'GELB'", "'GRÜN'", "'type'"
+ "<invalid>", "<EOR>", "<DOWN>", "<UP>", "RULE_INT", "RULE_STRING", "RULE_ID", "RULE_ML_COMMENT", "RULE_SL_COMMENT", "RULE_WS", "RULE_ANY_OTHER", "'spielplatz'", "'{'", "'}'", "'kind'", "'('", "')'", "'erwachsener'", "'spielzeug'", "'familie'", "'keyword'", "','", "'ROT'", "'BLAU'", "'GELB'", "'GR\\u00DCN'", "'type'"
};
public static final int RULE_ML_COMMENT=7;
public static final int RULE_ID=6;
@@ -1325,7 +1325,7 @@ public class InternalReferenceGrammarParser extends AbstractInternalAntlrParser
// $ANTLR start ruleFarbe
- // ../org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/antlr/internal/InternalReferenceGrammar.g:612:1: ruleFarbe returns [EObject current=null] : (lv_wert= ( ( ( 'ROT' | 'BLAU' ) | 'GELB' ) | 'GRÜN' ) ) ;
+ // ../org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/antlr/internal/InternalReferenceGrammar.g:612:1: ruleFarbe returns [EObject current=null] : (lv_wert= ( ( ( 'ROT' | 'BLAU' ) | 'GELB' ) | 'GR\\u00DCN' ) ) ;
public final EObject ruleFarbe() throws RecognitionException {
EObject current = null;
@@ -1334,13 +1334,13 @@ public class InternalReferenceGrammarParser extends AbstractInternalAntlrParser
EObject temp=null; setCurrentLookahead(); resetLookahead();
try {
- // ../org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/antlr/internal/InternalReferenceGrammar.g:616:6: ( (lv_wert= ( ( ( 'ROT' | 'BLAU' ) | 'GELB' ) | 'GRÜN' ) ) )
- // ../org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/antlr/internal/InternalReferenceGrammar.g:617:1: (lv_wert= ( ( ( 'ROT' | 'BLAU' ) | 'GELB' ) | 'GRÜN' ) )
+ // ../org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/antlr/internal/InternalReferenceGrammar.g:616:6: ( (lv_wert= ( ( ( 'ROT' | 'BLAU' ) | 'GELB' ) | 'GR\\u00DCN' ) ) )
+ // ../org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/antlr/internal/InternalReferenceGrammar.g:617:1: (lv_wert= ( ( ( 'ROT' | 'BLAU' ) | 'GELB' ) | 'GR\\u00DCN' ) )
{
- // ../org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/antlr/internal/InternalReferenceGrammar.g:617:1: (lv_wert= ( ( ( 'ROT' | 'BLAU' ) | 'GELB' ) | 'GRÜN' ) )
- // ../org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/antlr/internal/InternalReferenceGrammar.g:619:6: lv_wert= ( ( ( 'ROT' | 'BLAU' ) | 'GELB' ) | 'GRÜN' )
+ // ../org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/antlr/internal/InternalReferenceGrammar.g:617:1: (lv_wert= ( ( ( 'ROT' | 'BLAU' ) | 'GELB' ) | 'GR\\u00DCN' ) )
+ // ../org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/antlr/internal/InternalReferenceGrammar.g:619:6: lv_wert= ( ( ( 'ROT' | 'BLAU' ) | 'GELB' ) | 'GR\\u00DCN' )
{
- // ../org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/antlr/internal/InternalReferenceGrammar.g:619:14: ( ( ( 'ROT' | 'BLAU' ) | 'GELB' ) | 'GRÜN' )
+ // ../org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/antlr/internal/InternalReferenceGrammar.g:619:14: ( ( ( 'ROT' | 'BLAU' ) | 'GELB' ) | 'GR\\u00DCN' )
int alt12=2;
int LA12_0 = input.LA(1);
@@ -1352,7 +1352,7 @@ public class InternalReferenceGrammarParser extends AbstractInternalAntlrParser
}
else {
NoViableAltException nvae =
- new NoViableAltException("619:14: ( ( ( 'ROT' | 'BLAU' ) | 'GELB' ) | 'GRÜN' )", 12, 0, input);
+ new NoViableAltException("619:14: ( ( ( 'ROT' | 'BLAU' ) | 'GELB' ) | 'GR\\u00DCN' )", 12, 0, input);
throw nvae;
}
@@ -1440,7 +1440,7 @@ public class InternalReferenceGrammarParser extends AbstractInternalAntlrParser
}
break;
case 2 :
- // ../org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/antlr/internal/InternalReferenceGrammar.g:634:6: 'GRÜN'
+ // ../org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/antlr/internal/InternalReferenceGrammar.g:634:6: 'GR\\u00DCN'
{
match(input,25,FOLLOW_25_in_ruleFarbe1378);
diff --git a/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/antlr/internal/InternalReferenceGrammar__.g b/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/antlr/internal/InternalReferenceGrammar__.g
index 57709a4..b420b53 100644
--- a/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/antlr/internal/InternalReferenceGrammar__.g
+++ b/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/antlr/internal/InternalReferenceGrammar__.g
@@ -21,7 +21,7 @@ T21 : ',' ;
T22 : 'ROT' ;
T23 : 'BLAU' ;
T24 : 'GELB' ;
-T25 : 'GRÜN' ;
+T25 : 'GR\u00DCN' ;
T26 : 'type' ;
// $ANTLR src "../org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/antlr/internal/InternalReferenceGrammar.g" 722
diff --git a/tests/org.eclipse.xtext.generator.tests/META-INF/MANIFEST.MF b/tests/org.eclipse.xtext.generator.tests/META-INF/MANIFEST.MF
index de687c8..30c387b 100644
--- a/tests/org.eclipse.xtext.generator.tests/META-INF/MANIFEST.MF
+++ b/tests/org.eclipse.xtext.generator.tests/META-INF/MANIFEST.MF
@@ -19,6 +19,7 @@ Require-Bundle: org.eclipse.xtext,
org.easymock;bundle-version="2.3.0"
Export-Package: org.eclipse.xtext,
org.eclipse.xtext.crossrefs,
+ org.eclipse.xtext.parser.keywords,
org.eclipse.xtext.testlanguages,
org.eclipse.xtext.testlanguages.parser.antlr.internal,
org.eclipse.xtext.testlanguages.parsetree.reconstr,
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/XtextTest.ecore b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/XtextTest.ecore
index 050e1ba..30c6432 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/XtextTest.ecore
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/XtextTest.ecore
@@ -14,18 +14,18 @@
<eStructuralFeatures xsi:type="ecore:EReference" name="rules" unique="false" upperBound="-1" eType="//AbstractRule" containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="AbstractRule">
- <eStructuralFeatures xsi:type="ecore:EReference" name="type" eType="//TypeRef" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name">
<eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="type" eType="//TypeRef" containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="AbstractMetamodelDeclaration">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="alias">
- <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- </eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="ePackage">
<eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//EPackage"/>
</eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="alias">
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="GeneratedMetamodel" eSuperTypes="//AbstractMetamodelDeclaration">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name">
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/epatch/EpatchTestLanguage.ecore b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/epatch/EpatchTestLanguage.ecore
index dc92726..e5bdf15 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/epatch/EpatchTestLanguage.ecore
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/epatch/EpatchTestLanguage.ecore
@@ -49,10 +49,10 @@
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="NamedObject">
<eStructuralFeatures xsi:type="ecore:EReference" name="leftMig" eType="//Migration" containment="true"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="assignments" unique="false" upperBound="-1" eType="//Assignment" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name">
<eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EReference" name="assignments" unique="false" upperBound="-1" eType="//Assignment" containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="ObjectRef" eSuperTypes="//NamedObject">
<eStructuralFeatures xsi:type="ecore:EReference" name="leftRes" eType="//NamedResource"/>
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/AbstractKeywordsTestLanguageRuntimeModule.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/AbstractKeywordsTestLanguageRuntimeModule.java
new file mode 100644
index 0000000..12f1961
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/AbstractKeywordsTestLanguageRuntimeModule.java
@@ -0,0 +1,72 @@
+/*
+Generated with Xtext
+*/
+package org.eclipse.xtext.parser.keywords;
+
+import org.eclipse.xtext.service.DefaultRuntimeModule;
+import org.eclipse.xtext.service.IServiceScope;
+
+import com.google.inject.Binder;
+
+/**
+ * GENERATED! Manual modification goes to KeywordsTestLanguageRuntimeModule
+ */
+public abstract class AbstractKeywordsTestLanguageRuntimeModule extends DefaultRuntimeModule {
+
+ @Override
+ public void configure(Binder binder) {
+ super.configure(binder);
+ binder.bind(IServiceScope.class).toInstance(org.eclipse.xtext.parser.keywords.IKeywordsTestLanguage.SCOPE);
+ }
+
+ public Class<? extends org.eclipse.xtext.IMetamodelAccess> bindIMetamodelAccess() {
+ return org.eclipse.xtext.parser.keywords.services.KeywordsTestLanguageMetamodelAccess.class;
+ }
+ public Class<? extends org.eclipse.xtext.IGrammarAccess> bindIGrammarAccess() {
+ return org.eclipse.xtext.parser.keywords.services.KeywordsTestLanguageGrammarAccess.class;
+ }
+ public Class<? extends org.eclipse.xtext.parser.IAstFactory> bindIAstFactory() {
+ return org.eclipse.xtext.parser.DefaultEcoreElementFactory.class;
+ }
+ public Class<? extends org.eclipse.xtext.resource.IResourceFactory> bindIResourceFactory() {
+ return org.eclipse.xtext.parser.keywords.services.KeywordsTestLanguageResourceFactory.class;
+ }
+ public Class<? extends org.eclipse.xtext.parsetree.reconstr.IParseTreeConstructor> bindIParseTreeConstructor() {
+ return org.eclipse.xtext.parser.keywords.parsetree.reconstr.KeywordsTestLanguageParseTreeConstructor.class;
+ }
+ public Class<? extends org.eclipse.xtext.parsetree.reconstr.ITokenSerializer> bindITokenSerializer() {
+ return org.eclipse.xtext.parsetree.reconstr.impl.WhitespacePreservingTokenSerializer.class;
+ }
+ public Class<? extends org.eclipse.xtext.parsetree.reconstr.ICrossReferenceSerializer> bindICrossReferenceSerializer() {
+ return org.eclipse.xtext.parsetree.reconstr.impl.SimpleCrossReferenceSerializer.class;
+ }
+ public Class<? extends org.eclipse.xtext.parsetree.reconstr.ITransientValueService> bindITransientValueService() {
+ return org.eclipse.xtext.parsetree.reconstr.impl.SimpleTransientValueService.class;
+ }
+ public Class<? extends org.eclipse.xtext.parser.antlr.IAntlrParser> bindIAntlrParser() {
+ return org.eclipse.xtext.parser.keywords.parser.antlr.KeywordsTestLanguageParser.class;
+ }
+ public Class<? extends org.eclipse.xtext.parser.ITokenToStringConverter> bindITokenToStringConverter() {
+ return org.eclipse.xtext.parser.antlr.AntlrTokenToStringConverter.class;
+ }
+ public Class<? extends org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider> bindIAntlrTokenFileProvider() {
+ return org.eclipse.xtext.parser.keywords.parser.antlr.KeywordsTestLanguageAntlrTokenFileProvider.class;
+ }
+ public Class<? extends org.eclipse.xtext.parser.antlr.Lexer> bindLexer() {
+ return org.eclipse.xtext.parser.keywords.parser.antlr.internal.InternalKeywordsTestLanguageLexer.class;
+ }
+ public Class<? extends org.eclipse.xtext.parser.antlr.ITokenDefProvider> bindITokenDefProvider() {
+ return org.eclipse.xtext.parser.antlr.AntlrTokenDefProvider.class;
+ }
+ public Class<? extends org.eclipse.xtext.parser.packrat.IPackratParser> bindIPackratParser() {
+ return org.eclipse.xtext.parser.keywords.parser.packrat.KeywordsTestLanguagePackratParser.class;
+ }
+ public Class<? extends org.eclipse.xtext.parser.packrat.IParseResultFactory> bindIParseResultFactory() {
+ return org.eclipse.xtext.parser.packrat.ParseResultFactory.class;
+ }
+ public Class<? extends org.eclipse.xtext.parser.ISwitchingParser> bindISwitchingParser() {
+ return org.eclipse.xtext.parser.SwitchingParser.class;
+ }
+
+
+}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/IKeywordsTestLanguage.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/IKeywordsTestLanguage.java
new file mode 100644
index 0000000..0b6ff80
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/IKeywordsTestLanguage.java
@@ -0,0 +1,24 @@
+/*
+Generated with Xtext
+*/
+package org.eclipse.xtext.parser.keywords;
+
+import org.eclipse.xtext.service.IServiceScope;
+import org.eclipse.xtext.service.ServiceScopeFactory;
+import org.eclipse.xtext.ILanguage;
+
+public interface IKeywordsTestLanguage extends ILanguage {
+
+ /**
+ * the unique identifier of this language.
+ * To be used to get the language descriptor and related services from the registry.
+ * Within ILanguageServices it is encouraged to use dependency injection instead
+ * of directly accessing the ServiceRegistry
+ */
+ public static final String ID = "org.eclipse.xtext.parser.keywords.KeywordsTestLanguage";
+ public static final String NAME = "KeywordsTestLanguage";
+ public static final String NAMESPACE = "org.eclipse.xtext.parser.keywords";
+ public static final String[] FILE_EXTENSIONS = new String[]{"keywordstestlanguage"};
+ public static final IServiceScope SCOPE = ServiceScopeFactory.createScope(ID);
+
+}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/KeywordsTestLanguage.ecore b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/KeywordsTestLanguage.ecore
new file mode 100644
index 0000000..2edcd72
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/KeywordsTestLanguage.ecore
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="ASCII"?>
+<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="KeywordsTestLanguage" nsURI="http://www.eclipse.org/2009/tmf/xtext/KeywordsTestLanguage" nsPrefix="KeywordsTestLanguage">
+ <eClassifiers xsi:type="ecore:EClass" name="Model">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="first">
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="second">
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="third">
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="forth">
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
+ </eStructuralFeatures>
+ </eClassifiers>
+</ecore:EPackage>
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/KeywordsTestLanguage.xmi b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/KeywordsTestLanguage.xmi
new file mode 100644
index 0000000..06ee09c
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/KeywordsTestLanguage.xmi
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="ASCII"?>
+<xtext:Grammar xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:xtext="http://www.eclipse.org/2008/Xtext">
+ <idElements>org</idElements>
+ <idElements>eclipse</idElements>
+ <idElements>xtext</idElements>
+ <idElements>parser</idElements>
+ <idElements>keywords</idElements>
+ <idElements>KeywordsTestLanguage</idElements>
+ <metamodelDeclarations xsi:type="xtext:GeneratedMetamodel" name="KeywordsTestLanguage">
+ <ePackage href="http://www.eclipse.org/2009/tmf/xtext/KeywordsTestLanguage#/"/>
+ </metamodelDeclarations>
+ <rules xsi:type="xtext:ParserRule" name="Model" definesHiddenTokens="true">
+ <type metamodel="//@metamodelDeclarations.0">
+ <type xsi:type="ecore:EClass" href="http://www.eclipse.org/2009/tmf/xtext/KeywordsTestLanguage#//Model"/>
+ </type>
+ <hiddenTokens href="classpath:/org/eclipse/xtext/builtin/XtextBuiltin.xmi#//@rules.5"/>
+ <hiddenTokens href="classpath:/org/eclipse/xtext/builtin/XtextBuiltin.xmi#//@rules.3"/>
+ <hiddenTokens href="classpath:/org/eclipse/xtext/builtin/XtextBuiltin.xmi#//@rules.4"/>
+ <alternatives xsi:type="xtext:Alternatives">
+ <groups xsi:type="xtext:Alternatives">
+ <groups xsi:type="xtext:Alternatives">
+ <groups xsi:type="xtext:Assignment" feature="first" operator="?=">
+ <terminal xsi:type="xtext:Keyword" value="foo\bar"/>
+ </groups>
+ <groups xsi:type="xtext:Assignment" feature="second" operator="?=">
+ <terminal xsi:type="xtext:Keyword" value="foo\"/>
+ </groups>
+ </groups>
+ <groups xsi:type="xtext:Assignment" feature="third" operator="?=">
+ <terminal xsi:type="xtext:Keyword" value="\bar"/>
+ </groups>
+ </groups>
+ <groups xsi:type="xtext:Assignment" feature="forth" operator="?=">
+ <terminal xsi:type="xtext:Keyword" value="\"/>
+ </groups>
+ </alternatives>
+ </rules>
+</xtext:Grammar>
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/KeywordsTestLanguageStandaloneSetup.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/KeywordsTestLanguageStandaloneSetup.java
new file mode 100644
index 0000000..1cdac41
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/KeywordsTestLanguageStandaloneSetup.java
@@ -0,0 +1,59 @@
+/*
+Generated with Xtext
+*/
+package org.eclipse.xtext.parser.keywords;
+
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.xtext.EcoreUtil2;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.xtext.resource.IResourceFactory;
+import org.eclipse.xtext.service.IServiceScope;
+import org.eclipse.xtext.service.ServiceRegistry;
+
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+
+import org.eclipse.xtext.parser.keywords.IKeywordsTestLanguage;
+
+public abstract class KeywordsTestLanguageStandaloneSetup {
+
+ private static boolean isInitialized = false;
+
+ public synchronized static void doSetup() {
+ if(!isInitialized) {
+
+ Injector injector = Guice.createInjector(new org.eclipse.xtext.parser.keywords.KeywordsTestLanguageRuntimeModule());
+ ServiceRegistry.registerInjector(org.eclipse.xtext.parser.keywords.IKeywordsTestLanguage.SCOPE, injector);
+
+
+
+ org.eclipse.xtext.builtin.XtextBuiltinStandaloneSetup.doSetup();
+
+
+ // register resource factory to EMF
+ IResourceFactory resourceFactory = new org.eclipse.xtext.parser.keywords.services.KeywordsTestLanguageResourceFactory();
+ Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("keywordstestlanguage", resourceFactory);
+
+
+ // initialize EPackages
+
+ if (!EPackage.Registry.INSTANCE.containsKey("http://www.eclipse.org/2009/tmf/xtext/KeywordsTestLanguage")) {
+ EPackage KeywordsTestLanguage = EcoreUtil2.loadEPackage(
+ "classpath:/org/eclipse/xtext/parser/keywords/KeywordsTestLanguage.ecore",
+ KeywordsTestLanguageStandaloneSetup.class.getClassLoader());
+ if (KeywordsTestLanguage == null)
+ throw new IllegalStateException(
+ "Couldn't load EPackage from 'classpath:/org/eclipse/xtext/parser/keywords/KeywordsTestLanguage.ecore'");
+ EPackage.Registry.INSTANCE.put("http://www.eclipse.org/2009/tmf/xtext/KeywordsTestLanguage", KeywordsTestLanguage);
+ }
+
+ isInitialized = true;
+ }
+ }
+
+ public static IServiceScope getServiceScope() {
+ doSetup();
+ return org.eclipse.xtext.parser.keywords.IKeywordsTestLanguage.SCOPE;
+ }
+
+}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/KeywordsTestLanguageAntlrTokenFileProvider.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/KeywordsTestLanguageAntlrTokenFileProvider.java
new file mode 100644
index 0000000..35c35e9
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/KeywordsTestLanguageAntlrTokenFileProvider.java
@@ -0,0 +1,15 @@
+/*
+Generated with Xtext
+*/
+package org.eclipse.xtext.parser.keywords.parser.antlr;
+
+import java.io.InputStream;
+import org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider;
+
+public class KeywordsTestLanguageAntlrTokenFileProvider implements IAntlrTokenFileProvider {
+
+ public InputStream getAntlrTokenFile() {
+ ClassLoader classLoader = KeywordsTestLanguageAntlrTokenFileProvider.class.getClassLoader();
+ return classLoader.getResourceAsStream("org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.tokens");
+ }
+}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/KeywordsTestLanguageParser.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/KeywordsTestLanguageParser.java
new file mode 100644
index 0000000..7863221
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/KeywordsTestLanguageParser.java
@@ -0,0 +1,44 @@
+/*
+Generated with Xtext
+*/
+package org.eclipse.xtext.parser.keywords.parser.antlr;
+
+import org.antlr.runtime.ANTLRInputStream;
+import org.eclipse.xtext.parser.antlr.ITokenDefProvider;
+import org.eclipse.xtext.parser.IParseResult;
+import org.eclipse.xtext.parser.ParseException;
+import org.eclipse.xtext.parser.antlr.XtextTokenStream;
+
+import com.google.inject.Inject;
+
+import org.eclipse.xtext.parser.keywords.parser.antlr.internal.InternalKeywordsTestLanguageLexer;
+import org.eclipse.xtext.parser.keywords.parser.antlr.internal.InternalKeywordsTestLanguageParser;
+
+public class KeywordsTestLanguageParser extends org.eclipse.xtext.parser.antlr.AbstractAntlrParser {
+
+ @Inject
+ protected ITokenDefProvider antlrTokenDefProvider;
+
+ @Override
+ protected IParseResult parse(String ruleName, ANTLRInputStream in) {
+ InternalKeywordsTestLanguageLexer lexer = new InternalKeywordsTestLanguageLexer(in);
+ XtextTokenStream stream = new XtextTokenStream(lexer, antlrTokenDefProvider);
+ InternalKeywordsTestLanguageParser parser = new InternalKeywordsTestLanguageParser(
+ stream, getElementFactory(), grammarAccess.getGrammar());
+ parser.setTokenTypeMap(antlrTokenDefProvider.getTokenDefMap());
+ try {
+ if(ruleName != null) {
+ return parser.parse(ruleName);
+ } else {
+ return parser.parse();
+ }
+ } catch (Exception re) {
+ throw new ParseException(re.getMessage(),re);
+ }
+ }
+
+ @Override
+ protected String getDefaultRuleName() {
+ return "Model";
+ }
+}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g
new file mode 100644
index 0000000..319822f
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g
@@ -0,0 +1,190 @@
+/*
+Generated with Xtext
+*/
+grammar InternalKeywordsTestLanguage;
+
+options {
+ superClass=AbstractInternalAntlrParser;
+}
+
+@lexer::header {
+package org.eclipse.xtext.parser.keywords.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.xtext.parser.keywords.parser.antlr.internal;
+
+import java.io.InputStream;
+import org.eclipse.xtext.*;
+import org.eclipse.xtext.parser.*;
+import org.eclipse.xtext.parser.impl.*;
+import org.eclipse.xtext.parsetree.*;
+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 org.eclipse.xtext.conversion.ValueConverterException;
+
+}
+
+@parser::members {
+
+ public InternalKeywordsTestLanguageParser(TokenStream input, IAstFactory factory, Grammar g) {
+ this(input);
+ this.factory = factory;
+ grammar = g;
+ }
+
+ @Override
+ protected InputStream getTokenFile() {
+ ClassLoader classLoader = InternalKeywordsTestLanguageParser.class.getClassLoader();
+ return classLoader.getResourceAsStream("org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.tokens");
+ }
+
+ @Override
+ protected String getFirstRuleName() {
+ return "Model";
+ }
+}
+
+@rulecatch {
+ catch (RecognitionException re) {
+ recover(input,re);
+ appendSkippedTokens();
+ }
+}
+
+
+
+
+
+// Entry rule entryRuleModel
+entryRuleModel returns [EObject current=null] :
+ { currentNode = createCompositeNode("classpath:/org/eclipse/xtext/parser/keywords/KeywordsTestLanguage.xmi#//@rules.0" /* xtext::ParserRule */, currentNode); }
+ iv_ruleModel=ruleModel
+ { $current=$iv_ruleModel.current; }
+ EOF
+;
+
+// Rule Model
+ruleModel returns [EObject current=null]
+ @init { EObject temp=null; setCurrentLookahead(); resetLookahead();
+ HiddenTokens myHiddenTokenState = ((XtextTokenStream)input).setHiddenTokens("RULE_WS", "RULE_ML_COMMENT", "RULE_SL_COMMENT");
+ }
+ @after { resetLookahead();
+ myHiddenTokenState.restore();
+ }:
+((((
+
+ lv_first='foo\\bar'
+ {
+ createLeafNode("classpath:/org/eclipse/xtext/parser/keywords/KeywordsTestLanguage.xmi#//@rules.0/@alternatives/@groups.0/@groups.0/@groups.0/@terminal" /* xtext::Keyword */, "first");
+ }
+
+ {
+ if ($current==null) {
+ $current = factory.create("Model");
+ associateNodeWithAstElement(currentNode, $current);
+ }
+
+ try {
+ factory.set($current, "first", true, "foo\\bar", currentNode);
+ } catch (ValueConverterException vce) {
+ handleValueConverterException(vce);
+ }
+ }
+
+)
+ |(
+
+ lv_second='foo\\'
+ {
+ createLeafNode("classpath:/org/eclipse/xtext/parser/keywords/KeywordsTestLanguage.xmi#//@rules.0/@alternatives/@groups.0/@groups.0/@groups.1/@terminal" /* xtext::Keyword */, "second");
+ }
+
+ {
+ if ($current==null) {
+ $current = factory.create("Model");
+ associateNodeWithAstElement(currentNode, $current);
+ }
+
+ try {
+ factory.set($current, "second", true, "foo\\", currentNode);
+ } catch (ValueConverterException vce) {
+ handleValueConverterException(vce);
+ }
+ }
+
+))
+ |(
+
+ lv_third='\\bar'
+ {
+ createLeafNode("classpath:/org/eclipse/xtext/parser/keywords/KeywordsTestLanguage.xmi#//@rules.0/@alternatives/@groups.0/@groups.1/@terminal" /* xtext::Keyword */, "third");
+ }
+
+ {
+ if ($current==null) {
+ $current = factory.create("Model");
+ associateNodeWithAstElement(currentNode, $current);
+ }
+
+ try {
+ factory.set($current, "third", true, "\\bar", currentNode);
+ } catch (ValueConverterException vce) {
+ handleValueConverterException(vce);
+ }
+ }
+
+))
+ |(
+
+ lv_forth='\\'
+ {
+ createLeafNode("classpath:/org/eclipse/xtext/parser/keywords/KeywordsTestLanguage.xmi#//@rules.0/@alternatives/@groups.1/@terminal" /* xtext::Keyword */, "forth");
+ }
+
+ {
+ if ($current==null) {
+ $current = factory.create("Model");
+ associateNodeWithAstElement(currentNode, $current);
+ }
+
+ try {
+ factory.set($current, "forth", true, "\\", currentNode);
+ } catch (ValueConverterException vce) {
+ handleValueConverterException(vce);
+ }
+ }
+
+));
+
+
+
+
+
+
+
+
+
+RULE_ID : ('^')?('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'_'|'0'..'9')*;
+
+RULE_INT : ('0'..'9')+;
+
+RULE_STRING : '"' ( '\\' ('b'|'t'|'n'|'f'|'r'|'\"'|'\''|'\\') | ~('\\'|'"') )* '"' | '\'' ( '\\' ('b'|'t'|'n'|'f'|'r'|'\"'|'\''|'\\') | ~('\\'|'\'') )* '\'';
+
+RULE_ML_COMMENT : '/*' ( options {greedy=false;} : . )* '*/' {$channel=HIDDEN;};
+
+RULE_SL_COMMENT : '//' ~('\n'|'\r')* ('\r'? '\n')? {$channel=HIDDEN;};
+
+RULE_WS : (' '|'\t'|'\r'|'\n')+ {$channel=HIDDEN;};
+
+RULE_ANY_OTHER : .;
+
+
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.tokens b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.tokens
new file mode 100644
index 0000000..544b4f5
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.tokens
@@ -0,0 +1,11 @@
+RULE_ML_COMMENT=7
+RULE_ID=4
+RULE_WS=9
+RULE_INT=5
+RULE_STRING=6
+RULE_ANY_OTHER=10
+RULE_SL_COMMENT=8
+'foo\\bar'=11
+'foo\\'=12
+'\\'=14
+'\\bar'=13
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguageLexer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguageLexer.java
new file mode 100644
index 0000000..a426271
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguageLexer.java
@@ -0,0 +1,800 @@
+package org.eclipse.xtext.parser.keywords.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;
+
+
+import org.antlr.runtime.*;
+import java.util.Stack;
+import java.util.List;
+import java.util.ArrayList;
+
+public class InternalKeywordsTestLanguageLexer extends Lexer {
+ public static final int RULE_ML_COMMENT=7;
+ public static final int T14=14;
+ public static final int RULE_ID=4;
+ public static final int RULE_WS=9;
+ public static final int T11=11;
+ public static final int EOF=-1;
+ public static final int RULE_INT=5;
+ public static final int RULE_STRING=6;
+ public static final int T12=12;
+ public static final int Tokens=15;
+ public static final int RULE_ANY_OTHER=10;
+ public static final int RULE_SL_COMMENT=8;
+ public static final int T13=13;
+ public InternalKeywordsTestLanguageLexer() {;}
+ public InternalKeywordsTestLanguageLexer(CharStream input) {
+ super(input);
+ }
+ public String getGrammarFileName() { return "../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g"; }
+
+ // $ANTLR start T11
+ public final void mT11() throws RecognitionException {
+ try {
+ int _type = T11;
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:10:5: ( 'foo\\\\bar' )
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:10:7: 'foo\\\\bar'
+ {
+ match("foo\\bar");
+
+
+ }
+
+ this.type = _type;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end T11
+
+ // $ANTLR start T12
+ public final void mT12() throws RecognitionException {
+ try {
+ int _type = T12;
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:11:5: ( 'foo\\\\' )
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:11:7: 'foo\\\\'
+ {
+ match("foo\\");
+
+
+ }
+
+ this.type = _type;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end T12
+
+ // $ANTLR start T13
+ public final void mT13() throws RecognitionException {
+ try {
+ int _type = T13;
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:12:5: ( '\\\\bar' )
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:12:7: '\\\\bar'
+ {
+ match("\\bar");
+
+
+ }
+
+ this.type = _type;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end T13
+
+ // $ANTLR start T14
+ public final void mT14() throws RecognitionException {
+ try {
+ int _type = T14;
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:13:5: ( '\\\\' )
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:13:7: '\\\\'
+ {
+ match('\\');
+
+ }
+
+ this.type = _type;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end T14
+
+ // $ANTLR start RULE_ID
+ public final void mRULE_ID() throws RecognitionException {
+ try {
+ int _type = RULE_ID;
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:176:9: ( ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* )
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:176:11: ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )*
+ {
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:176:11: ( '^' )?
+ int alt1=2;
+ int LA1_0 = input.LA(1);
+
+ if ( (LA1_0=='^') ) {
+ alt1=1;
+ }
+ switch (alt1) {
+ case 1 :
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:176:12: '^'
+ {
+ match('^');
+
+ }
+ break;
+
+ }
+
+ if ( (input.LA(1)>='A' && input.LA(1)<='Z')||input.LA(1)=='_'||(input.LA(1)>='a' && input.LA(1)<='z') ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse =
+ new MismatchedSetException(null,input);
+ recover(mse); throw mse;
+ }
+
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:176:41: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )*
+ loop2:
+ do {
+ int alt2=2;
+ int LA2_0 = input.LA(1);
+
+ if ( ((LA2_0>='0' && LA2_0<='9')||(LA2_0>='A' && LA2_0<='Z')||LA2_0=='_'||(LA2_0>='a' && LA2_0<='z')) ) {
+ alt2=1;
+ }
+
+
+ switch (alt2) {
+ case 1 :
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:
+ {
+ if ( (input.LA(1)>='0' && input.LA(1)<='9')||(input.LA(1)>='A' && input.LA(1)<='Z')||input.LA(1)=='_'||(input.LA(1)>='a' && input.LA(1)<='z') ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse =
+ new MismatchedSetException(null,input);
+ recover(mse); throw mse;
+ }
+
+
+ }
+ break;
+
+ default :
+ break loop2;
+ }
+ } while (true);
+
+
+ }
+
+ this.type = _type;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end RULE_ID
+
+ // $ANTLR start RULE_INT
+ public final void mRULE_INT() throws RecognitionException {
+ try {
+ int _type = RULE_INT;
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:178:10: ( ( '0' .. '9' )+ )
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:178:12: ( '0' .. '9' )+
+ {
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:178:12: ( '0' .. '9' )+
+ int cnt3=0;
+ loop3:
+ do {
+ int alt3=2;
+ int LA3_0 = input.LA(1);
+
+ if ( ((LA3_0>='0' && LA3_0<='9')) ) {
+ alt3=1;
+ }
+
+
+ switch (alt3) {
+ case 1 :
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:178:13: '0' .. '9'
+ {
+ matchRange('0','9');
+
+ }
+ break;
+
+ default :
+ if ( cnt3 >= 1 ) break loop3;
+ EarlyExitException eee =
+ new EarlyExitException(3, input);
+ throw eee;
+ }
+ cnt3++;
+ } while (true);
+
+
+ }
+
+ this.type = _type;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end RULE_INT
+
+ // $ANTLR start RULE_STRING
+ public final void mRULE_STRING() throws RecognitionException {
+ try {
+ int _type = RULE_STRING;
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:180:13: ( '\"' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | ~ ( '\\\\' | '\"' ) )* '\"' | '\\'' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | ~ ( '\\\\' | '\\'' ) )* '\\'' )
+ int alt6=2;
+ int LA6_0 = input.LA(1);
+
+ if ( (LA6_0=='\"') ) {
+ alt6=1;
+ }
+ else if ( (LA6_0=='\'') ) {
+ alt6=2;
+ }
+ else {
+ NoViableAltException nvae =
+ new NoViableAltException("180:1: RULE_STRING : ( '\"' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | ~ ( '\\\\' | '\"' ) )* '\"' | '\\'' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | ~ ( '\\\\' | '\\'' ) )* '\\'' );", 6, 0, input);
+
+ throw nvae;
+ }
+ switch (alt6) {
+ case 1 :
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:180:15: '\"' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | ~ ( '\\\\' | '\"' ) )* '\"'
+ {
+ match('\"');
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:180:19: ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | ~ ( '\\\\' | '\"' ) )*
+ loop4:
+ do {
+ int alt4=3;
+ int LA4_0 = input.LA(1);
+
+ if ( (LA4_0=='\\') ) {
+ alt4=1;
+ }
+ else if ( ((LA4_0>='\u0000' && LA4_0<='!')||(LA4_0>='#' && LA4_0<='[')||(LA4_0>=']' && LA4_0<='\uFFFE')) ) {
+ alt4=2;
+ }
+
+
+ switch (alt4) {
+ case 1 :
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:180:21: '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' )
+ {
+ match('\\');
+ if ( input.LA(1)=='\"'||input.LA(1)=='\''||input.LA(1)=='\\'||input.LA(1)=='b'||input.LA(1)=='f'||input.LA(1)=='n'||input.LA(1)=='r'||input.LA(1)=='t' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse =
+ new MismatchedSetException(null,input);
+ recover(mse); throw mse;
+ }
+
+
+ }
+ break;
+ case 2 :
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:180:65: ~ ( '\\\\' | '\"' )
+ {
+ if ( (input.LA(1)>='\u0000' && input.LA(1)<='!')||(input.LA(1)>='#' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFE') ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse =
+ new MismatchedSetException(null,input);
+ recover(mse); throw mse;
+ }
+
+
+ }
+ break;
+
+ default :
+ break loop4;
+ }
+ } while (true);
+
+ match('\"');
+
+ }
+ break;
+ case 2 :
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:180:101: '\\'' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | ~ ( '\\\\' | '\\'' ) )* '\\''
+ {
+ match('\'');
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:180:106: ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | ~ ( '\\\\' | '\\'' ) )*
+ loop5:
+ do {
+ int alt5=3;
+ int LA5_0 = input.LA(1);
+
+ if ( (LA5_0=='\\') ) {
+ alt5=1;
+ }
+ else if ( ((LA5_0>='\u0000' && LA5_0<='&')||(LA5_0>='(' && LA5_0<='[')||(LA5_0>=']' && LA5_0<='\uFFFE')) ) {
+ alt5=2;
+ }
+
+
+ switch (alt5) {
+ case 1 :
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:180:108: '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' )
+ {
+ match('\\');
+ if ( input.LA(1)=='\"'||input.LA(1)=='\''||input.LA(1)=='\\'||input.LA(1)=='b'||input.LA(1)=='f'||input.LA(1)=='n'||input.LA(1)=='r'||input.LA(1)=='t' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse =
+ new MismatchedSetException(null,input);
+ recover(mse); throw mse;
+ }
+
+
+ }
+ break;
+ case 2 :
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:180:152: ~ ( '\\\\' | '\\'' )
+ {
+ if ( (input.LA(1)>='\u0000' && input.LA(1)<='&')||(input.LA(1)>='(' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFE') ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse =
+ new MismatchedSetException(null,input);
+ recover(mse); throw mse;
+ }
+
+
+ }
+ break;
+
+ default :
+ break loop5;
+ }
+ } while (true);
+
+ match('\'');
+
+ }
+ break;
+
+ }
+ this.type = _type;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end RULE_STRING
+
+ // $ANTLR start RULE_ML_COMMENT
+ public final void mRULE_ML_COMMENT() throws RecognitionException {
+ try {
+ int _type = RULE_ML_COMMENT;
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:182:17: ( '/*' ( options {greedy=false; } : . )* '*/' )
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:182:19: '/*' ( options {greedy=false; } : . )* '*/'
+ {
+ match("/*");
+
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:182:24: ( options {greedy=false; } : . )*
+ loop7:
+ do {
+ int alt7=2;
+ int LA7_0 = input.LA(1);
+
+ if ( (LA7_0=='*') ) {
+ int LA7_1 = input.LA(2);
+
+ if ( (LA7_1=='/') ) {
+ alt7=2;
+ }
+ else if ( ((LA7_1>='\u0000' && LA7_1<='.')||(LA7_1>='0' && LA7_1<='\uFFFE')) ) {
+ alt7=1;
+ }
+
+
+ }
+ else if ( ((LA7_0>='\u0000' && LA7_0<=')')||(LA7_0>='+' && LA7_0<='\uFFFE')) ) {
+ alt7=1;
+ }
+
+
+ switch (alt7) {
+ case 1 :
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:182:52: .
+ {
+ matchAny();
+
+ }
+ break;
+
+ default :
+ break loop7;
+ }
+ } while (true);
+
+ match("*/");
+
+ channel=HIDDEN;
+
+ }
+
+ this.type = _type;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end RULE_ML_COMMENT
+
+ // $ANTLR start RULE_SL_COMMENT
+ public final void mRULE_SL_COMMENT() throws RecognitionException {
+ try {
+ int _type = RULE_SL_COMMENT;
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:184:17: ( '//' (~ ( '\\n' | '\\r' ) )* ( ( '\\r' )? '\\n' )? )
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:184:19: '//' (~ ( '\\n' | '\\r' ) )* ( ( '\\r' )? '\\n' )?
+ {
+ match("//");
+
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:184:24: (~ ( '\\n' | '\\r' ) )*
+ loop8:
+ do {
+ int alt8=2;
+ int LA8_0 = input.LA(1);
+
+ if ( ((LA8_0>='\u0000' && LA8_0<='\t')||(LA8_0>='\u000B' && LA8_0<='\f')||(LA8_0>='\u000E' && LA8_0<='\uFFFE')) ) {
+ alt8=1;
+ }
+
+
+ switch (alt8) {
+ case 1 :
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:184:24: ~ ( '\\n' | '\\r' )
+ {
+ if ( (input.LA(1)>='\u0000' && input.LA(1)<='\t')||(input.LA(1)>='\u000B' && input.LA(1)<='\f')||(input.LA(1)>='\u000E' && input.LA(1)<='\uFFFE') ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse =
+ new MismatchedSetException(null,input);
+ recover(mse); throw mse;
+ }
+
+
+ }
+ break;
+
+ default :
+ break loop8;
+ }
+ } while (true);
+
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:184:38: ( ( '\\r' )? '\\n' )?
+ int alt10=2;
+ int LA10_0 = input.LA(1);
+
+ if ( (LA10_0=='\n'||LA10_0=='\r') ) {
+ alt10=1;
+ }
+ switch (alt10) {
+ case 1 :
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:184:39: ( '\\r' )? '\\n'
+ {
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:184:39: ( '\\r' )?
+ int alt9=2;
+ int LA9_0 = input.LA(1);
+
+ if ( (LA9_0=='\r') ) {
+ alt9=1;
+ }
+ switch (alt9) {
+ case 1 :
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:184:39: '\\r'
+ {
+ match('\r');
+
+ }
+ break;
+
+ }
+
+ match('\n');
+
+ }
+ break;
+
+ }
+
+ channel=HIDDEN;
+
+ }
+
+ this.type = _type;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end RULE_SL_COMMENT
+
+ // $ANTLR start RULE_WS
+ public final void mRULE_WS() throws RecognitionException {
+ try {
+ int _type = RULE_WS;
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:186:9: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ )
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:186:11: ( ' ' | '\\t' | '\\r' | '\\n' )+
+ {
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:186:11: ( ' ' | '\\t' | '\\r' | '\\n' )+
+ int cnt11=0;
+ loop11:
+ do {
+ int alt11=2;
+ int LA11_0 = input.LA(1);
+
+ if ( ((LA11_0>='\t' && LA11_0<='\n')||LA11_0=='\r'||LA11_0==' ') ) {
+ alt11=1;
+ }
+
+
+ switch (alt11) {
+ case 1 :
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:
+ {
+ if ( (input.LA(1)>='\t' && input.LA(1)<='\n')||input.LA(1)=='\r'||input.LA(1)==' ' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse =
+ new MismatchedSetException(null,input);
+ recover(mse); throw mse;
+ }
+
+
+ }
+ break;
+
+ default :
+ if ( cnt11 >= 1 ) break loop11;
+ EarlyExitException eee =
+ new EarlyExitException(11, input);
+ throw eee;
+ }
+ cnt11++;
+ } while (true);
+
+ channel=HIDDEN;
+
+ }
+
+ this.type = _type;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end RULE_WS
+
+ // $ANTLR start RULE_ANY_OTHER
+ public final void mRULE_ANY_OTHER() throws RecognitionException {
+ try {
+ int _type = RULE_ANY_OTHER;
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:188:16: ( . )
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:188:18: .
+ {
+ matchAny();
+
+ }
+
+ this.type = _type;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end RULE_ANY_OTHER
+
+ public void mTokens() throws RecognitionException {
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:1:8: ( T11 | T12 | T13 | T14 | RULE_ID | RULE_INT | RULE_STRING | RULE_ML_COMMENT | RULE_SL_COMMENT | RULE_WS | RULE_ANY_OTHER )
+ int alt12=11;
+ int LA12_0 = input.LA(1);
+
+ if ( (LA12_0=='f') ) {
+ int LA12_1 = input.LA(2);
+
+ if ( (LA12_1=='o') ) {
+ int LA12_11 = input.LA(3);
+
+ if ( (LA12_11=='o') ) {
+ int LA12_20 = input.LA(4);
+
+ if ( (LA12_20=='\\') ) {
+ int LA12_21 = input.LA(5);
+
+ if ( (LA12_21=='b') ) {
+ alt12=1;
+ }
+ else {
+ alt12=2;}
+ }
+ else {
+ alt12=5;}
+ }
+ else {
+ alt12=5;}
+ }
+ else {
+ alt12=5;}
+ }
+ else if ( (LA12_0=='\\') ) {
+ int LA12_2 = input.LA(2);
+
+ if ( (LA12_2=='b') ) {
+ alt12=3;
+ }
+ else {
+ alt12=4;}
+ }
+ else if ( (LA12_0=='^') ) {
+ int LA12_3 = input.LA(2);
+
+ if ( ((LA12_3>='A' && LA12_3<='Z')||LA12_3=='_'||(LA12_3>='a' && LA12_3<='z')) ) {
+ alt12=5;
+ }
+ else {
+ alt12=11;}
+ }
+ else if ( ((LA12_0>='A' && LA12_0<='Z')||LA12_0=='_'||(LA12_0>='a' && LA12_0<='e')||(LA12_0>='g' && LA12_0<='z')) ) {
+ alt12=5;
+ }
+ else if ( ((LA12_0>='0' && LA12_0<='9')) ) {
+ alt12=6;
+ }
+ else if ( (LA12_0=='\"') ) {
+ int LA12_6 = input.LA(2);
+
+ if ( ((LA12_6>='\u0000' && LA12_6<='\uFFFE')) ) {
+ alt12=7;
+ }
+ else {
+ alt12=11;}
+ }
+ else if ( (LA12_0=='\'') ) {
+ int LA12_7 = input.LA(2);
+
+ if ( ((LA12_7>='\u0000' && LA12_7<='\uFFFE')) ) {
+ alt12=7;
+ }
+ else {
+ alt12=11;}
+ }
+ else if ( (LA12_0=='/') ) {
+ switch ( input.LA(2) ) {
+ case '/':
+ {
+ alt12=9;
+ }
+ break;
+ case '*':
+ {
+ alt12=8;
+ }
+ break;
+ default:
+ alt12=11;}
+
+ }
+ else if ( ((LA12_0>='\t' && LA12_0<='\n')||LA12_0=='\r'||LA12_0==' ') ) {
+ alt12=10;
+ }
+ else if ( ((LA12_0>='\u0000' && LA12_0<='\b')||(LA12_0>='\u000B' && LA12_0<='\f')||(LA12_0>='\u000E' && LA12_0<='\u001F')||LA12_0=='!'||(LA12_0>='#' && LA12_0<='&')||(LA12_0>='(' && LA12_0<='.')||(LA12_0>=':' && LA12_0<='@')||LA12_0=='['||LA12_0==']'||LA12_0=='`'||(LA12_0>='{' && LA12_0<='\uFFFE')) ) {
+ alt12=11;
+ }
+ else {
+ NoViableAltException nvae =
+ new NoViableAltException("1:1: Tokens : ( T11 | T12 | T13 | T14 | RULE_ID | RULE_INT | RULE_STRING | RULE_ML_COMMENT | RULE_SL_COMMENT | RULE_WS | RULE_ANY_OTHER );", 12, 0, input);
+
+ throw nvae;
+ }
+ switch (alt12) {
+ case 1 :
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:1:10: T11
+ {
+ mT11();
+
+ }
+ break;
+ case 2 :
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:1:14: T12
+ {
+ mT12();
+
+ }
+ break;
+ case 3 :
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:1:18: T13
+ {
+ mT13();
+
+ }
+ break;
+ case 4 :
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:1:22: T14
+ {
+ mT14();
+
+ }
+ break;
+ case 5 :
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:1:26: RULE_ID
+ {
+ mRULE_ID();
+
+ }
+ break;
+ case 6 :
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:1:34: RULE_INT
+ {
+ mRULE_INT();
+
+ }
+ break;
+ case 7 :
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:1:43: RULE_STRING
+ {
+ mRULE_STRING();
+
+ }
+ break;
+ case 8 :
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:1:55: RULE_ML_COMMENT
+ {
+ mRULE_ML_COMMENT();
+
+ }
+ break;
+ case 9 :
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:1:71: RULE_SL_COMMENT
+ {
+ mRULE_SL_COMMENT();
+
+ }
+ break;
+ case 10 :
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:1:87: RULE_WS
+ {
+ mRULE_WS();
+
+ }
+ break;
+ case 11 :
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:1:95: RULE_ANY_OTHER
+ {
+ mRULE_ANY_OTHER();
+
+ }
+ break;
+
+ }
+
+ }
+
+
+
+
+} \ No newline at end of file
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguageParser.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguageParser.java
new file mode 100644
index 0000000..b0b332c
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguageParser.java
@@ -0,0 +1,333 @@
+package org.eclipse.xtext.parser.keywords.parser.antlr.internal;
+
+import java.io.InputStream;
+import org.eclipse.xtext.*;
+import org.eclipse.xtext.parser.*;
+import org.eclipse.xtext.parser.impl.*;
+import org.eclipse.xtext.parsetree.*;
+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 org.eclipse.xtext.conversion.ValueConverterException;
+
+
+
+import org.antlr.runtime.*;
+import java.util.Stack;
+import java.util.List;
+import java.util.ArrayList;
+
+public class InternalKeywordsTestLanguageParser extends AbstractInternalAntlrParser {
+ public static final String[] tokenNames = new String[] {
+ "<invalid>", "<EOR>", "<DOWN>", "<UP>", "RULE_ID", "RULE_INT", "RULE_STRING", "RULE_ML_COMMENT", "RULE_SL_COMMENT", "RULE_WS", "RULE_ANY_OTHER", "'foo\\\\bar'", "'foo\\\\'", "'\\\\bar'", "'\\\\'"
+ };
+ public static final int RULE_ML_COMMENT=7;
+ public static final int RULE_ID=4;
+ public static final int RULE_WS=9;
+ public static final int EOF=-1;
+ public static final int RULE_INT=5;
+ public static final int RULE_STRING=6;
+ public static final int RULE_ANY_OTHER=10;
+ public static final int RULE_SL_COMMENT=8;
+
+ public InternalKeywordsTestLanguageParser(TokenStream input) {
+ super(input);
+ }
+
+
+ public String[] getTokenNames() { return tokenNames; }
+ public String getGrammarFileName() { return "../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g"; }
+
+
+
+ public InternalKeywordsTestLanguageParser(TokenStream input, IAstFactory factory, Grammar g) {
+ this(input);
+ this.factory = factory;
+ grammar = g;
+ }
+
+ @Override
+ protected InputStream getTokenFile() {
+ ClassLoader classLoader = InternalKeywordsTestLanguageParser.class.getClassLoader();
+ return classLoader.getResourceAsStream("org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.tokens");
+ }
+
+ @Override
+ protected String getFirstRuleName() {
+ return "Model";
+ }
+
+
+
+ // $ANTLR start entryRuleModel
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:68:1: entryRuleModel returns [EObject current=null] : iv_ruleModel= ruleModel EOF ;
+ public final EObject entryRuleModel() throws RecognitionException {
+ EObject current = null;
+
+ EObject iv_ruleModel = null;
+
+
+ try {
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:68:47: (iv_ruleModel= ruleModel EOF )
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:69:2: iv_ruleModel= ruleModel EOF
+ {
+ currentNode = createCompositeNode("classpath:/org/eclipse/xtext/parser/keywords/KeywordsTestLanguage.xmi#//@rules.0" /* xtext::ParserRule */, currentNode);
+ pushFollow(FOLLOW_ruleModel_in_entryRuleModel72);
+ iv_ruleModel=ruleModel();
+ _fsp--;
+
+ current =iv_ruleModel;
+ match(input,EOF,FOLLOW_EOF_in_entryRuleModel82);
+
+ }
+
+ }
+
+ catch (RecognitionException re) {
+ recover(input,re);
+ appendSkippedTokens();
+ }
+ finally {
+ }
+ return current;
+ }
+ // $ANTLR end entryRuleModel
+
+
+ // $ANTLR start ruleModel
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:76:1: ruleModel returns [EObject current=null] : ( ( ( (lv_first= 'foo\\\\bar' ) | (lv_second= 'foo\\\\' ) ) | (lv_third= '\\\\bar' ) ) | (lv_forth= '\\\\' ) ) ;
+ public final EObject ruleModel() throws RecognitionException {
+ EObject current = null;
+
+ Token lv_first=null;
+ Token lv_second=null;
+ Token lv_third=null;
+ Token lv_forth=null;
+
+ EObject temp=null; setCurrentLookahead(); resetLookahead();
+ HiddenTokens myHiddenTokenState = ((XtextTokenStream)input).setHiddenTokens("RULE_WS", "RULE_ML_COMMENT", "RULE_SL_COMMENT");
+
+ try {
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:82:6: ( ( ( ( (lv_first= 'foo\\\\bar' ) | (lv_second= 'foo\\\\' ) ) | (lv_third= '\\\\bar' ) ) | (lv_forth= '\\\\' ) ) )
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:83:1: ( ( ( (lv_first= 'foo\\\\bar' ) | (lv_second= 'foo\\\\' ) ) | (lv_third= '\\\\bar' ) ) | (lv_forth= '\\\\' ) )
+ {
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:83:1: ( ( ( (lv_first= 'foo\\\\bar' ) | (lv_second= 'foo\\\\' ) ) | (lv_third= '\\\\bar' ) ) | (lv_forth= '\\\\' ) )
+ int alt3=2;
+ int LA3_0 = input.LA(1);
+
+ if ( ((LA3_0>=11 && LA3_0<=13)) ) {
+ alt3=1;
+ }
+ else if ( (LA3_0==14) ) {
+ alt3=2;
+ }
+ else {
+ NoViableAltException nvae =
+ new NoViableAltException("83:1: ( ( ( (lv_first= 'foo\\\\bar' ) | (lv_second= 'foo\\\\' ) ) | (lv_third= '\\\\bar' ) ) | (lv_forth= '\\\\' ) )", 3, 0, input);
+
+ throw nvae;
+ }
+ switch (alt3) {
+ case 1 :
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:83:2: ( ( (lv_first= 'foo\\\\bar' ) | (lv_second= 'foo\\\\' ) ) | (lv_third= '\\\\bar' ) )
+ {
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:83:2: ( ( (lv_first= 'foo\\\\bar' ) | (lv_second= 'foo\\\\' ) ) | (lv_third= '\\\\bar' ) )
+ int alt2=2;
+ int LA2_0 = input.LA(1);
+
+ if ( ((LA2_0>=11 && LA2_0<=12)) ) {
+ alt2=1;
+ }
+ else if ( (LA2_0==13) ) {
+ alt2=2;
+ }
+ else {
+ NoViableAltException nvae =
+ new NoViableAltException("83:2: ( ( (lv_first= 'foo\\\\bar' ) | (lv_second= 'foo\\\\' ) ) | (lv_third= '\\\\bar' ) )", 2, 0, input);
+
+ throw nvae;
+ }
+ switch (alt2) {
+ case 1 :
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:83:3: ( (lv_first= 'foo\\\\bar' ) | (lv_second= 'foo\\\\' ) )
+ {
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:83:3: ( (lv_first= 'foo\\\\bar' ) | (lv_second= 'foo\\\\' ) )
+ int alt1=2;
+ int LA1_0 = input.LA(1);
+
+ if ( (LA1_0==11) ) {
+ alt1=1;
+ }
+ else if ( (LA1_0==12) ) {
+ alt1=2;
+ }
+ else {
+ NoViableAltException nvae =
+ new NoViableAltException("83:3: ( (lv_first= 'foo\\\\bar' ) | (lv_second= 'foo\\\\' ) )", 1, 0, input);
+
+ throw nvae;
+ }
+ switch (alt1) {
+ case 1 :
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:83:4: (lv_first= 'foo\\\\bar' )
+ {
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:83:4: (lv_first= 'foo\\\\bar' )
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:85:6: lv_first= 'foo\\\\bar'
+ {
+ lv_first=(Token)input.LT(1);
+ match(input,11,FOLLOW_11_in_ruleModel130);
+
+ createLeafNode("classpath:/org/eclipse/xtext/parser/keywords/KeywordsTestLanguage.xmi#//@rules.0/@alternatives/@groups.0/@groups.0/@groups.0/@terminal" /* xtext::Keyword */, "first");
+
+
+ if (current==null) {
+ current = factory.create("Model");
+ associateNodeWithAstElement(currentNode, current);
+ }
+
+ try {
+ factory.set(current, "first", true, "foo\\bar", currentNode);
+ } catch (ValueConverterException vce) {
+ handleValueConverterException(vce);
+ }
+
+
+ }
+
+
+ }
+ break;
+ case 2 :
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:104:6: (lv_second= 'foo\\\\' )
+ {
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:104:6: (lv_second= 'foo\\\\' )
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:106:6: lv_second= 'foo\\\\'
+ {
+ lv_second=(Token)input.LT(1);
+ match(input,12,FOLLOW_12_in_ruleModel169);
+
+ createLeafNode("classpath:/org/eclipse/xtext/parser/keywords/KeywordsTestLanguage.xmi#//@rules.0/@alternatives/@groups.0/@groups.0/@groups.1/@terminal" /* xtext::Keyword */, "second");
+
+
+ if (current==null) {
+ current = factory.create("Model");
+ associateNodeWithAstElement(currentNode, current);
+ }
+
+ try {
+ factory.set(current, "second", true, "foo\\", currentNode);
+ } catch (ValueConverterException vce) {
+ handleValueConverterException(vce);
+ }
+
+
+ }
+
+
+ }
+ break;
+
+ }
+
+
+ }
+ break;
+ case 2 :
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:125:6: (lv_third= '\\\\bar' )
+ {
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:125:6: (lv_third= '\\\\bar' )
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:127:6: lv_third= '\\\\bar'
+ {
+ lv_third=(Token)input.LT(1);
+ match(input,13,FOLLOW_13_in_ruleModel209);
+
+ createLeafNode("classpath:/org/eclipse/xtext/parser/keywords/KeywordsTestLanguage.xmi#//@rules.0/@alternatives/@groups.0/@groups.1/@terminal" /* xtext::Keyword */, "third");
+
+
+ if (current==null) {
+ current = factory.create("Model");
+ associateNodeWithAstElement(currentNode, current);
+ }
+
+ try {
+ factory.set(current, "third", true, "\\bar", currentNode);
+ } catch (ValueConverterException vce) {
+ handleValueConverterException(vce);
+ }
+
+
+ }
+
+
+ }
+ break;
+
+ }
+
+
+ }
+ break;
+ case 2 :
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:146:6: (lv_forth= '\\\\' )
+ {
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:146:6: (lv_forth= '\\\\' )
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g:148:6: lv_forth= '\\\\'
+ {
+ lv_forth=(Token)input.LT(1);
+ match(input,14,FOLLOW_14_in_ruleModel249);
+
+ createLeafNode("classpath:/org/eclipse/xtext/parser/keywords/KeywordsTestLanguage.xmi#//@rules.0/@alternatives/@groups.1/@terminal" /* xtext::Keyword */, "forth");
+
+
+ if (current==null) {
+ current = factory.create("Model");
+ associateNodeWithAstElement(currentNode, current);
+ }
+
+ try {
+ factory.set(current, "forth", true, "\\", currentNode);
+ } catch (ValueConverterException vce) {
+ handleValueConverterException(vce);
+ }
+
+
+ }
+
+
+ }
+ break;
+
+ }
+
+
+ }
+
+ resetLookahead();
+ myHiddenTokenState.restore();
+
+ }
+
+ catch (RecognitionException re) {
+ recover(input,re);
+ appendSkippedTokens();
+ }
+ finally {
+ }
+ return current;
+ }
+ // $ANTLR end ruleModel
+
+
+
+
+ public static final BitSet FOLLOW_ruleModel_in_entryRuleModel72 = new BitSet(new long[]{0x0000000000000000L});
+ public static final BitSet FOLLOW_EOF_in_entryRuleModel82 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_11_in_ruleModel130 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_12_in_ruleModel169 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_13_in_ruleModel209 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_14_in_ruleModel249 = new BitSet(new long[]{0x0000000000000002L});
+
+} \ No newline at end of file
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage__.g b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage__.g
new file mode 100644
index 0000000..6b9b41e
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage__.g
@@ -0,0 +1,36 @@
+lexer grammar InternalKeywordsTestLanguage;
+@header {
+package org.eclipse.xtext.parser.keywords.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;
+}
+
+T11 : 'foo\\bar' ;
+T12 : 'foo\\' ;
+T13 : '\\bar' ;
+T14 : '\\' ;
+
+// $ANTLR src "../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g" 176
+RULE_ID : ('^')?('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'_'|'0'..'9')*;
+
+// $ANTLR src "../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g" 178
+RULE_INT : ('0'..'9')+;
+
+// $ANTLR src "../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g" 180
+RULE_STRING : '"' ( '\\' ('b'|'t'|'n'|'f'|'r'|'\"'|'\''|'\\') | ~('\\'|'"') )* '"' | '\'' ( '\\' ('b'|'t'|'n'|'f'|'r'|'\"'|'\''|'\\') | ~('\\'|'\'') )* '\'';
+
+// $ANTLR src "../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g" 182
+RULE_ML_COMMENT : '/*' ( options {greedy=false;} : . )* '*/' {$channel=HIDDEN;};
+
+// $ANTLR src "../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g" 184
+RULE_SL_COMMENT : '//' ~('\n'|'\r')* ('\r'? '\n')? {$channel=HIDDEN;};
+
+// $ANTLR src "../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g" 186
+RULE_WS : (' '|'\t'|'\r'|'\n')+ {$channel=HIDDEN;};
+
+// $ANTLR src "../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/antlr/internal/InternalKeywordsTestLanguage.g" 188
+RULE_ANY_OTHER : .;
+
+
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/packrat/KeywordsTestLanguageDelimiters.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/packrat/KeywordsTestLanguageDelimiters.java
new file mode 100644
index 0000000..918ab11
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/packrat/KeywordsTestLanguageDelimiters.java
@@ -0,0 +1,26 @@
+/*
+Generated with Xtext
+*/
+package org.eclipse.xtext.parser.keywords.parser.packrat;
+
+import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
+import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
+import org.eclipse.xtext.parser.packrat.matching.SetBasedKeywordMatcher;
+
+public final class KeywordsTestLanguageDelimiters {
+
+ private KeywordsTestLanguageDelimiters() {
+ throw new UnsupportedOperationException("Utility classes may not be initialized");
+ }
+
+ public static ICharacterClass keyword$11$Delimiter = ICharacterClass.Factory.nullClass();
+
+ // TODO: remove hardcoded character class from template
+ public static ICharacterClass keyword$7$Delimiter = ICharacterClass.Factory.join(
+ ICharacterClass.Factory.createRange('a', 'z'),
+ ICharacterClass.Factory.createRange('A', 'Z'),
+ ICharacterClass.Factory.create('_'),
+ ICharacterClass.Factory.createRange('0', '9')
+ );
+
+}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/packrat/KeywordsTestLanguagePackratParser.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/packrat/KeywordsTestLanguagePackratParser.java
new file mode 100644
index 0000000..102fd69
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/packrat/KeywordsTestLanguagePackratParser.java
@@ -0,0 +1,16 @@
+/*
+Generated with Xtext
+*/
+package org.eclipse.xtext.parser.keywords.parser.packrat;
+
+import org.eclipse.xtext.parser.packrat.AbstractPackratParser;
+import org.eclipse.xtext.parser.packrat.AbstractParserConfiguration.IInternalParserConfiguration;
+
+public class KeywordsTestLanguagePackratParser extends AbstractPackratParser {
+
+ @Override
+ protected KeywordsTestLanguageParserConfiguration createParserConfiguration(IInternalParserConfiguration configuration) {
+ return new KeywordsTestLanguageParserConfiguration(configuration);
+ }
+
+}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/packrat/KeywordsTestLanguageParserConfiguration.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/packrat/KeywordsTestLanguageParserConfiguration.java
new file mode 100644
index 0000000..7dfb3fc
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/packrat/KeywordsTestLanguageParserConfiguration.java
@@ -0,0 +1,92 @@
+/*
+Generated with Xtext
+*/
+package org.eclipse.xtext.parser.keywords.parser.packrat;
+
+import org.eclipse.xtext.parser.packrat.AbstractParserConfiguration;
+import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
+
+import org.eclipse.xtext.builtin.parser.packrat.XtextBuiltinParserConfiguration;
+
+import org.eclipse.xtext.parser.keywords.parser.packrat.consumers.KeywordsTestLanguageModelConsumer;
+import org.eclipse.xtext.builtin.parser.packrat.consumers.XtextBuiltinIDConsumer;
+import org.eclipse.xtext.builtin.parser.packrat.consumers.XtextBuiltinINTConsumer;
+import org.eclipse.xtext.builtin.parser.packrat.consumers.XtextBuiltinSTRINGConsumer;
+import org.eclipse.xtext.builtin.parser.packrat.consumers.XtextBuiltinML_COMMENTConsumer;
+import org.eclipse.xtext.builtin.parser.packrat.consumers.XtextBuiltinSL_COMMENTConsumer;
+import org.eclipse.xtext.builtin.parser.packrat.consumers.XtextBuiltinWSConsumer;
+import org.eclipse.xtext.builtin.parser.packrat.consumers.XtextBuiltinANY_OTHERConsumer;
+
+@SuppressWarnings("unused")
+public class KeywordsTestLanguageParserConfiguration extends AbstractParserConfiguration {
+
+ private XtextBuiltinParserConfiguration xtextBuiltinConfiguration;
+
+ private KeywordsTestLanguageModelConsumer modelConsumer;
+
+ public KeywordsTestLanguageParserConfiguration(IInternalParserConfiguration configuration) {
+ super(configuration);
+ this.xtextBuiltinConfiguration = new XtextBuiltinParserConfiguration(configuration);
+ }
+
+ public KeywordsTestLanguageModelConsumer getRootConsumer() {
+ return modelConsumer;
+ }
+
+ public void createNonTerminalConsumers() {
+ getXtextBuiltinConfiguration().createNonTerminalConsumers();
+ modelConsumer = new KeywordsTestLanguageModelConsumer(
+ this, new ITerminalConsumer[]{ getWsConsumer(), getMlCommentConsumer(), getSlCommentConsumer() }
+ );
+ }
+
+ public void createTerminalConsumers() {
+ getXtextBuiltinConfiguration().createTerminalConsumers();
+ }
+
+ public void configureConsumers() {
+ getModelConsumer().setKeyword$9$Delimiter(KeywordsTestLanguageDelimiters.keyword$11$Delimiter);
+ getModelConsumer().setKeyword$11$Delimiter(KeywordsTestLanguageDelimiters.keyword$11$Delimiter);
+ getModelConsumer().setKeyword$5$Delimiter(KeywordsTestLanguageDelimiters.keyword$7$Delimiter);
+ getModelConsumer().setKeyword$7$Delimiter(KeywordsTestLanguageDelimiters.keyword$7$Delimiter);
+ }
+
+ // TODO collect superGrammars transitive
+ public XtextBuiltinParserConfiguration getXtextBuiltinConfiguration() {
+ return xtextBuiltinConfiguration;
+ }
+
+ public KeywordsTestLanguageModelConsumer getModelConsumer() {
+ return modelConsumer;
+ }
+
+ public XtextBuiltinIDConsumer getIdConsumer() {
+ return getXtextBuiltinConfiguration().getIdConsumer();
+ }
+
+ public XtextBuiltinINTConsumer getIntConsumer() {
+ return getXtextBuiltinConfiguration().getIntConsumer();
+ }
+
+ public XtextBuiltinSTRINGConsumer getStringConsumer() {
+ return getXtextBuiltinConfiguration().getStringConsumer();
+ }
+
+ public XtextBuiltinML_COMMENTConsumer getMlCommentConsumer() {
+ return getXtextBuiltinConfiguration().getMlCommentConsumer();
+ }
+
+ public XtextBuiltinSL_COMMENTConsumer getSlCommentConsumer() {
+ return getXtextBuiltinConfiguration().getSlCommentConsumer();
+ }
+
+ public XtextBuiltinWSConsumer getWsConsumer() {
+ return getXtextBuiltinConfiguration().getWsConsumer();
+ }
+
+ public XtextBuiltinANY_OTHERConsumer getAnyOtherConsumer() {
+ return getXtextBuiltinConfiguration().getAnyOtherConsumer();
+ }
+
+
+}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/packrat/consumers/KeywordsTestLanguageModelConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/packrat/consumers/KeywordsTestLanguageModelConsumer.java
new file mode 100644
index 0000000..df4cde7
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parser/packrat/consumers/KeywordsTestLanguageModelConsumer.java
@@ -0,0 +1,173 @@
+/*
+Generated with Xtext
+*/
+package org.eclipse.xtext.parser.keywords.parser.packrat.consumers;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
+import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.INonTerminalConsumerConfiguration;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
+import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
+import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
+
+import org.eclipse.xtext.parser.keywords.services.KeywordsTestLanguageGrammarAccess;
+import org.eclipse.xtext.parser.keywords.services.KeywordsTestLanguageGrammarAccess.ModelElements;
+
+
+@SuppressWarnings("unused")
+public final class KeywordsTestLanguageModelConsumer extends NonTerminalConsumer {
+
+
+ private ICharacterClass keyword$9$Delimiter;
+
+ private ICharacterClass keyword$11$Delimiter;
+
+ private ICharacterClass keyword$5$Delimiter;
+
+ private ICharacterClass keyword$7$Delimiter;
+
+ public KeywordsTestLanguageModelConsumer(INonTerminalConsumerConfiguration configuration, ITerminalConsumer[] hiddenTokens) {
+ super(configuration, hiddenTokens);
+ keyword$9$Delimiter = ICharacterClass.Factory.nullClass();
+ keyword$11$Delimiter = ICharacterClass.Factory.nullClass();
+ keyword$5$Delimiter = ICharacterClass.Factory.nullClass();
+ keyword$7$Delimiter = ICharacterClass.Factory.nullClass();
+ }
+
+ protected int doConsume(int entryPoint) throws Exception {
+ return consumeAlternatives$1(entryPoint);
+ }
+
+ protected int consumeAlternatives$1(int entryPoint) throws Exception {
+ AlternativesResult result = createAlternativesResult();
+ switch(entryPoint) {
+ case -1: // use fall through semantics of switch case
+ result.reset();
+ case 0:
+ result.nextAlternative();
+ if (result.isAlternativeDone(consumeAssignment$4(nextEntryPoint()))) {
+ return result.getResult();
+ }
+ case 1:
+ result.nextAlternative();
+ if (result.isAlternativeDone(consumeAssignment$6(nextEntryPoint()))) {
+ return result.getResult();
+ }
+ case 2:
+ result.nextAlternative();
+ if (result.isAlternativeDone(consumeAssignment$8(nextEntryPoint()))) {
+ return result.getResult();
+ }
+ case 3:
+ result.nextAlternative();
+ if (result.isAlternativeDone(consumeAssignment$10(nextEntryPoint()))) {
+ return result.getResult();
+ }
+ }
+ return result.getResult();
+ }
+
+ protected int consumeAssignment$4(int entryPoint) throws Exception {
+ int result = ConsumeResult.EMPTY_MATCH;
+ int tempResult;
+ announceNextLevel();
+ tempResult = consumeKeyword(getRule().ele0000KeywordFooBar(), "first", false, true, getKeyword$5$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS) {
+ announceLevelFinished();
+ return tempResult;
+ }
+ result = tempResult >= result ? tempResult : result;
+ announceLevelFinished();
+ return result;
+ }
+
+ protected int consumeAssignment$6(int entryPoint) throws Exception {
+ int result = ConsumeResult.EMPTY_MATCH;
+ int tempResult;
+ announceNextLevel();
+ tempResult = consumeKeyword(getRule().ele0010KeywordFoo(), "second", false, true, getKeyword$7$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS) {
+ announceLevelFinished();
+ return tempResult;
+ }
+ result = tempResult >= result ? tempResult : result;
+ announceLevelFinished();
+ return result;
+ }
+
+ protected int consumeAssignment$8(int entryPoint) throws Exception {
+ int result = ConsumeResult.EMPTY_MATCH;
+ int tempResult;
+ announceNextLevel();
+ tempResult = consumeKeyword(getRule().ele010KeywordBar(), "third", false, true, getKeyword$9$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS) {
+ announceLevelFinished();
+ return tempResult;
+ }
+ result = tempResult >= result ? tempResult : result;
+ announceLevelFinished();
+ return result;
+ }
+
+ protected int consumeAssignment$10(int entryPoint) throws Exception {
+ int result = ConsumeResult.EMPTY_MATCH;
+ int tempResult;
+ announceNextLevel();
+ tempResult = consumeKeyword(getRule().ele10KeywordReverseSolidus(), "forth", false, true, getKeyword$11$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS) {
+ announceLevelFinished();
+ return tempResult;
+ }
+ result = tempResult >= result ? tempResult : result;
+ announceLevelFinished();
+ return result;
+ }
+
+ public ModelElements getRule() {
+ return KeywordsTestLanguageGrammarAccess.INSTANCE.prModel();
+ }
+
+ protected EObject getGrammarElement() {
+ return getRule().getRule();
+ }
+
+ @Override
+ protected String getDefaultTypeName() {
+ return "Model";
+ }
+
+ public ICharacterClass getKeyword$9$Delimiter() {
+ return keyword$9$Delimiter;
+ }
+
+ public void setKeyword$9$Delimiter(ICharacterClass characterClass) {
+ keyword$9$Delimiter = characterClass != null ? characterClass : ICharacterClass.Factory.nullClass();
+ }
+
+ public ICharacterClass getKeyword$11$Delimiter() {
+ return keyword$11$Delimiter;
+ }
+
+ public void setKeyword$11$Delimiter(ICharacterClass characterClass) {
+ keyword$11$Delimiter = characterClass != null ? characterClass : ICharacterClass.Factory.nullClass();
+ }
+
+ public ICharacterClass getKeyword$5$Delimiter() {
+ return keyword$5$Delimiter;
+ }
+
+ public void setKeyword$5$Delimiter(ICharacterClass characterClass) {
+ keyword$5$Delimiter = characterClass != null ? characterClass : ICharacterClass.Factory.nullClass();
+ }
+
+ public ICharacterClass getKeyword$7$Delimiter() {
+ return keyword$7$Delimiter;
+ }
+
+ public void setKeyword$7$Delimiter(ICharacterClass characterClass) {
+ keyword$7$Delimiter = characterClass != null ? characterClass : ICharacterClass.Factory.nullClass();
+ }
+
+}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parsetree/reconstr/KeywordsTestLanguageParseTreeConstructor.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parsetree/reconstr/KeywordsTestLanguageParseTreeConstructor.java
new file mode 100644
index 0000000..37587ad
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/parsetree/reconstr/KeywordsTestLanguageParseTreeConstructor.java
@@ -0,0 +1,201 @@
+/*
+Generated with Xtext
+*/
+package org.eclipse.xtext.parser.keywords.parsetree.reconstr;
+
+//import org.apache.log4j.Logger;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.xtext.*;
+import org.eclipse.xtext.parsetree.reconstr.*;
+import org.eclipse.xtext.parsetree.reconstr.impl.*;
+import org.eclipse.xtext.parsetree.reconstr.impl.AbstractParseTreeConstructor.AbstractToken.Solution;
+import org.eclipse.xtext.builtin.XtextBuiltinGrammarAccess;
+import org.eclipse.xtext.parser.keywords.services.KeywordsTestLanguageGrammarAccess;
+
+
+public class KeywordsTestLanguageParseTreeConstructor extends AbstractParseTreeConstructor {
+
+ protected Solution internalSerialize(EObject obj) {
+ IInstanceDescription inst = getDescr(obj);
+ Solution s;
+ if(inst.isInstanceOf("Model") && (s = new Model_Alternatives(inst, null).firstSolution()) != null && isConsumed(s,null)) return s;
+ return null;
+ }
+
+
+/************ begin Rule Model ****************
+ *
+ * Model hidden ( WS , ML_COMMENT , SL_COMMENT ) : first ?= "foo\\bar" | second ?= "foo\\" | third ?= "\\bar" | forth ?= "\\" ;
+ *
+ **/
+
+
+// first ?= "foo\\bar" | second ?= "foo\\" | third ?= "\\bar" | forth ?= "\\"
+protected class Model_Alternatives extends AlternativesToken {
+
+ public Model_Alternatives(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ public Alternatives getGrammarElement() {
+ return KeywordsTestLanguageGrammarAccess.INSTANCE.prModel().eleAlternatives();
+ }
+
+ protected Solution createSolution() {
+ AbstractToken t = (first) ? new Model_1_Assignment_forth(current, this) : new Model_0_Alternatives(current, this);
+ Solution s = t.firstSolution();
+ if(s == null && activateNextSolution()) s = createSolution();
+ if(s == null) return null;
+ last = s.getPredecessor();
+ return s;
+ }
+}
+
+// first ?= "foo\\bar" | second ?= "foo\\" | third ?= "\\bar"
+protected class Model_0_Alternatives extends AlternativesToken {
+
+ public Model_0_Alternatives(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ public Alternatives getGrammarElement() {
+ return KeywordsTestLanguageGrammarAccess.INSTANCE.prModel().ele0Alternatives();
+ }
+
+ protected Solution createSolution() {
+ AbstractToken t = (first) ? new Model_0_1_Assignment_third(current, this) : new Model_0_0_Alternatives(current, this);
+ Solution s = t.firstSolution();
+ if(s == null && activateNextSolution()) s = createSolution();
+ if(s == null) return null;
+ last = s.getPredecessor();
+ return s;
+ }
+}
+
+// first ?= "foo\\bar" | second ?= "foo\\"
+protected class Model_0_0_Alternatives extends AlternativesToken {
+
+ public Model_0_0_Alternatives(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ public Alternatives getGrammarElement() {
+ return KeywordsTestLanguageGrammarAccess.INSTANCE.prModel().ele00Alternatives();
+ }
+
+ protected Solution createSolution() {
+ AbstractToken t = (first) ? new Model_0_0_1_Assignment_second(current, this) : new Model_0_0_0_Assignment_first(current, this);
+ Solution s = t.firstSolution();
+ if(s == null && activateNextSolution()) s = createSolution();
+ if(s == null) return null;
+ last = s.getPredecessor();
+ return s;
+ }
+}
+
+// first ?= "foo\\bar"
+protected class Model_0_0_0_Assignment_first extends AssignmentToken {
+
+ public Model_0_0_0_Assignment_first(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ public Assignment getGrammarElement() {
+ return KeywordsTestLanguageGrammarAccess.INSTANCE.prModel().ele000AssignmentFirst();
+ }
+
+ protected Solution createSolution() {
+ if((value = current.getConsumable("first",IS_REQUIRED)) == null) return null;
+ IInstanceDescription obj = current.cloneAndConsume("first");
+
+ if(Boolean.TRUE.equals(value)) { // xtext::Keyword
+ type = AssignmentType.KW;
+ element = KeywordsTestLanguageGrammarAccess.INSTANCE.prModel().ele0000KeywordFooBar();
+ return new Solution(obj);
+ }
+
+ return null;
+ }
+}
+
+// second ?= "foo\\"
+protected class Model_0_0_1_Assignment_second extends AssignmentToken {
+
+ public Model_0_0_1_Assignment_second(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ public Assignment getGrammarElement() {
+ return KeywordsTestLanguageGrammarAccess.INSTANCE.prModel().ele001AssignmentSecond();
+ }
+
+ protected Solution createSolution() {
+ if((value = current.getConsumable("second",IS_REQUIRED)) == null) return null;
+ IInstanceDescription obj = current.cloneAndConsume("second");
+
+ if(Boolean.TRUE.equals(value)) { // xtext::Keyword
+ type = AssignmentType.KW;
+ element = KeywordsTestLanguageGrammarAccess.INSTANCE.prModel().ele0010KeywordFoo();
+ return new Solution(obj);
+ }
+
+ return null;
+ }
+}
+
+
+// third ?= "\\bar"
+protected class Model_0_1_Assignment_third extends AssignmentToken {
+
+ public Model_0_1_Assignment_third(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ public Assignment getGrammarElement() {
+ return KeywordsTestLanguageGrammarAccess.INSTANCE.prModel().ele01AssignmentThird();
+ }
+
+ protected Solution createSolution() {
+ if((value = current.getConsumable("third",IS_REQUIRED)) == null) return null;
+ IInstanceDescription obj = current.cloneAndConsume("third");
+
+ if(Boolean.TRUE.equals(value)) { // xtext::Keyword
+ type = AssignmentType.KW;
+ element = KeywordsTestLanguageGrammarAccess.INSTANCE.prModel().ele010KeywordBar();
+ return new Solution(obj);
+ }
+
+ return null;
+ }
+}
+
+
+// forth ?= "\\"
+protected class Model_1_Assignment_forth extends AssignmentToken {
+
+ public Model_1_Assignment_forth(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ public Assignment getGrammarElement() {
+ return KeywordsTestLanguageGrammarAccess.INSTANCE.prModel().ele1AssignmentForth();
+ }
+
+ protected Solution createSolution() {
+ if((value = current.getConsumable("forth",IS_REQUIRED)) == null) return null;
+ IInstanceDescription obj = current.cloneAndConsume("forth");
+
+ if(Boolean.TRUE.equals(value)) { // xtext::Keyword
+ type = AssignmentType.KW;
+ element = KeywordsTestLanguageGrammarAccess.INSTANCE.prModel().ele10KeywordReverseSolidus();
+ return new Solution(obj);
+ }
+
+ return null;
+ }
+}
+
+
+/************ end Rule Model ****************/
+
+}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/services/KeywordsTestLanguageGrammarAccess.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/services/KeywordsTestLanguageGrammarAccess.java
new file mode 100644
index 0000000..7edd993
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/services/KeywordsTestLanguageGrammarAccess.java
@@ -0,0 +1,89 @@
+/*
+Generated with Xtext
+*/
+
+package org.eclipse.xtext.parser.keywords.services;
+
+import org.eclipse.xtext.*;
+import org.eclipse.xtext.parser.BaseEPackageAccess;
+import org.eclipse.xtext.builtin.XtextBuiltinGrammarAccess;
+
+public class KeywordsTestLanguageGrammarAccess extends BaseEPackageAccess implements IGrammarAccess {
+
+ public class ModelElements implements IParserRuleAccess {
+ private final ParserRule rule = (ParserRule) getGrammar().eContents().get(1);
+ private final Alternatives cAlternatives = (Alternatives)rule.eContents().get(1);
+ private final Alternatives c0Alternatives = (Alternatives)cAlternatives.eContents().get(0);
+ private final Alternatives c00Alternatives = (Alternatives)c0Alternatives.eContents().get(0);
+ private final Assignment c000AssignmentFirst = (Assignment)c00Alternatives.eContents().get(0);
+ private final Keyword c0000KeywordFooBar = (Keyword)c000AssignmentFirst.eContents().get(0);
+ private final Assignment c001AssignmentSecond = (Assignment)c00Alternatives.eContents().get(1);
+ private final Keyword c0010KeywordFoo = (Keyword)c001AssignmentSecond.eContents().get(0);
+ private final Assignment c01AssignmentThird = (Assignment)c0Alternatives.eContents().get(1);
+ private final Keyword c010KeywordBar = (Keyword)c01AssignmentThird.eContents().get(0);
+ private final Assignment c1AssignmentForth = (Assignment)cAlternatives.eContents().get(1);
+ private final Keyword c10KeywordReverseSolidus = (Keyword)c1AssignmentForth.eContents().get(0);
+
+ // Model hidden ( WS , ML_COMMENT , SL_COMMENT ) : first ?= "foo\\bar" | second ?= "foo\\" | third ?= "\\bar" | forth ?= "\\" ;
+ public ParserRule getRule() { return rule; }
+
+ // first ?= "foo\\bar" | second ?= "foo\\" | third ?= "\\bar" | forth ?= "\\"
+ public Alternatives eleAlternatives() { return cAlternatives; }
+
+ // first ?= "foo\\bar" | second ?= "foo\\" | third ?= "\\bar"
+ public Alternatives ele0Alternatives() { return c0Alternatives; }
+
+ // first ?= "foo\\bar" | second ?= "foo\\"
+ public Alternatives ele00Alternatives() { return c00Alternatives; }
+
+ // first ?= "foo\\bar"
+ public Assignment ele000AssignmentFirst() { return c000AssignmentFirst; }
+
+ // "foo\\bar"
+ public Keyword ele0000KeywordFooBar() { return c0000KeywordFooBar; }
+
+ // second ?= "foo\\"
+ public Assignment ele001AssignmentSecond() { return c001AssignmentSecond; }
+
+ // "foo\\"
+ public Keyword ele0010KeywordFoo() { return c0010KeywordFoo; }
+
+ // third ?= "\\bar"
+ public Assignment ele01AssignmentThird() { return c01AssignmentThird; }
+
+ // "\\bar"
+ public Keyword ele010KeywordBar() { return c010KeywordBar; }
+
+ // forth ?= "\\"
+ public Assignment ele1AssignmentForth() { return c1AssignmentForth; }
+
+ // "\\"
+ public Keyword ele10KeywordReverseSolidus() { return c10KeywordReverseSolidus; }
+ }
+
+ public final static KeywordsTestLanguageGrammarAccess INSTANCE = new KeywordsTestLanguageGrammarAccess();
+
+ private static final String KEYWORDSTESTLANGUAGE_GRAMMAR_CP_URI = "classpath:/org/eclipse/xtext/parser/keywords/KeywordsTestLanguage.xmi";
+ private static Grammar GRAMMAR = null;
+ private static ModelElements pModel;
+
+ @SuppressWarnings("unused")
+ public synchronized Grammar getGrammar() {
+ if (GRAMMAR==null) {
+ // assert the XtextPackage implementation is loaded
+ XtextPackage xtextPackage = XtextPackage.eINSTANCE;
+ GRAMMAR = (Grammar) loadGrammarFile(KeywordsTestLanguageGrammarAccess.class.getClassLoader(),KEYWORDSTESTLANGUAGE_GRAMMAR_CP_URI);
+ }
+ return GRAMMAR;
+ }
+
+ public XtextBuiltinGrammarAccess getSuperGrammar() {
+ return XtextBuiltinGrammarAccess.INSTANCE;
+ }
+
+
+ // Model hidden ( WS , ML_COMMENT , SL_COMMENT ) : first ?= "foo\\bar" | second ?= "foo\\" | third ?= "\\bar" | forth ?= "\\" ;
+ public ModelElements prModel() {
+ return (pModel != null) ? pModel : (pModel = new ModelElements());
+ }
+}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/services/KeywordsTestLanguageMetamodelAccess.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/services/KeywordsTestLanguageMetamodelAccess.java
new file mode 100644
index 0000000..d921ce7
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/services/KeywordsTestLanguageMetamodelAccess.java
@@ -0,0 +1,51 @@
+/*
+Generated with Xtext
+*/
+package org.eclipse.xtext.parser.keywords.services;
+
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.xtext.IMetamodelAccess;
+import org.eclipse.xtext.parser.BaseEPackageAccess;
+
+public class KeywordsTestLanguageMetamodelAccess extends BaseEPackageAccess implements IMetamodelAccess {
+
+{
+
+ if (!EPackage.Registry.INSTANCE.containsKey(KEYWORDSTESTLANGUAGE_NS_URI))
+ EPackage.Registry.INSTANCE.put(KEYWORDSTESTLANGUAGE_NS_URI, loadEcoreFile(getClass().getClassLoader(), "classpath:/org/eclipse/xtext/parser/keywords/KeywordsTestLanguage.ecore"));
+
+}
+
+ private EPackage[] generated = new EPackage[] {
+
+ getKeywordsTestLanguageEPackage()
+
+ };
+
+ public EPackage[] getGeneratedEPackages() {
+ return generated;
+ }
+
+ private EPackage[] referenced = new EPackage[] {
+
+ };
+ public EPackage[] getReferencedEPackages() {
+ return referenced;
+ }
+
+ private EPackage[] all = new EPackage[] {
+ getKeywordsTestLanguageEPackage()
+ };
+
+ public EPackage[] getAllEPackages() {
+ return all;
+ }
+
+
+ protected static final String KEYWORDSTESTLANGUAGE_NS_URI = "http://www.eclipse.org/2009/tmf/xtext/KeywordsTestLanguage";
+
+ protected EPackage getKeywordsTestLanguageEPackage() {
+ return EPackage.Registry.INSTANCE.getEPackage(KEYWORDSTESTLANGUAGE_NS_URI);
+ }
+
+}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/services/KeywordsTestLanguageResourceFactory.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/services/KeywordsTestLanguageResourceFactory.java
new file mode 100644
index 0000000..403dda0
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/keywords/services/KeywordsTestLanguageResourceFactory.java
@@ -0,0 +1,27 @@
+/*
+Generated with Xtext
+*/
+package org.eclipse.xtext.parser.keywords.services;
+
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.xtext.resource.IResourceFactory;
+import org.eclipse.xtext.resource.XtextResource;
+import org.eclipse.xtext.service.ServiceRegistry;
+
+public class KeywordsTestLanguageResourceFactory implements IResourceFactory {
+
+ public String[] getModelFileExtensions() {
+ return new String[] { "keywordstestlanguage" };
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.emf.ecore.resource.Resource.Factory#createResource(org.eclipse.emf.common.util.URI)
+ */
+ public Resource createResource(URI uri) {
+ XtextResource resource = new XtextResource(uri);
+ ServiceRegistry.getInjector(org.eclipse.xtext.parser.keywords.IKeywordsTestLanguage.SCOPE).injectMembers(resource);
+ return resource;
+ }
+
+}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/ReferenceGrammar.ecore b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/ReferenceGrammar.ecore
index 8d02c8e..d0d0a55 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/ReferenceGrammar.ecore
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/ReferenceGrammar.ecore
@@ -13,12 +13,12 @@
<eStructuralFeatures xsi:type="ecore:EReference" name="familie" unique="false" upperBound="-1" eType="//Familie" containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Person">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name">
- <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- </eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="age">
<eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
</eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name">
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Kind" eSuperTypes="//Person"/>
<eClassifiers xsi:type="ecore:EClass" name="Erwachsener" eSuperTypes="//Person"/>
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalReferenceGrammarTestLanguage.g b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalReferenceGrammarTestLanguage.g
index da92c03..14ccc76 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalReferenceGrammarTestLanguage.g
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalReferenceGrammarTestLanguage.g
@@ -479,7 +479,7 @@ ruleFarbe returns [EObject current=null]
createLeafNode("classpath:/org/eclipse/xtext/testlanguages/ReferenceGrammarTestLanguage.xmi#//@rules.5/@alternatives/@groups.0/@groups.1" /* xtext::Keyword */, null);
}
)
- |'GRÜN'
+ |'GR\u00DCN'
{
createLeafNode("classpath:/org/eclipse/xtext/testlanguages/ReferenceGrammarTestLanguage.xmi#//@rules.5/@alternatives/@groups.1" /* xtext::Keyword */, null);
}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalReferenceGrammarTestLanguage.tokens b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalReferenceGrammarTestLanguage.tokens
index b5cbecf..309a0d4 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalReferenceGrammarTestLanguage.tokens
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalReferenceGrammarTestLanguage.tokens
@@ -5,11 +5,11 @@ RULE_INT=4
RULE_STRING=5
RULE_ANY_OTHER=10
RULE_SL_COMMENT=8
+'GR\u00DCN'=22
'ROT'=19
'spielzeug'=18
'spielplatz'=11
')'=16
-'GRÜN'=22
'kind'=14
'{'=12
'GELB'=21
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalReferenceGrammarTestLanguageLexer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalReferenceGrammarTestLanguageLexer.java
index 865d660..26866c1 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalReferenceGrammarTestLanguageLexer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalReferenceGrammarTestLanguageLexer.java
@@ -250,10 +250,10 @@ public class InternalReferenceGrammarTestLanguageLexer extends Lexer {
public final void mT22() throws RecognitionException {
try {
int _type = T22;
- // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalReferenceGrammarTestLanguage.g:21:5: ( 'GRÜN' )
- // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalReferenceGrammarTestLanguage.g:21:7: 'GRÜN'
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalReferenceGrammarTestLanguage.g:21:5: ( 'GR\\u00DCN' )
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalReferenceGrammarTestLanguage.g:21:7: 'GR\\u00DCN'
{
- match("GRÜN");
+ match("GR\u00DCN");
}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalReferenceGrammarTestLanguageParser.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalReferenceGrammarTestLanguageParser.java
index 4ed2c97..d0337ce 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalReferenceGrammarTestLanguageParser.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalReferenceGrammarTestLanguageParser.java
@@ -22,7 +22,7 @@ import java.util.ArrayList;
public class InternalReferenceGrammarTestLanguageParser extends AbstractInternalAntlrParser {
public static final String[] tokenNames = new String[] {
- "<invalid>", "<EOR>", "<DOWN>", "<UP>", "RULE_INT", "RULE_STRING", "RULE_ID", "RULE_ML_COMMENT", "RULE_SL_COMMENT", "RULE_WS", "RULE_ANY_OTHER", "'spielplatz'", "'{'", "'}'", "'kind'", "'('", "')'", "'erwachsener'", "'spielzeug'", "'ROT'", "'BLAU'", "'GELB'", "'GRÜN'", "'familie'", "'keyword'", "','"
+ "<invalid>", "<EOR>", "<DOWN>", "<UP>", "RULE_INT", "RULE_STRING", "RULE_ID", "RULE_ML_COMMENT", "RULE_SL_COMMENT", "RULE_WS", "RULE_ANY_OTHER", "'spielplatz'", "'{'", "'}'", "'kind'", "'('", "')'", "'erwachsener'", "'spielzeug'", "'ROT'", "'BLAU'", "'GELB'", "'GR\\u00DCN'", "'familie'", "'keyword'", "','"
};
public static final int RULE_ML_COMMENT=7;
public static final int RULE_ID=6;
@@ -935,17 +935,17 @@ public class InternalReferenceGrammarTestLanguageParser extends AbstractInternal
// $ANTLR start ruleFarbe
- // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalReferenceGrammarTestLanguage.g:462:1: ruleFarbe returns [EObject current=null] : ( ( ( 'ROT' | 'BLAU' ) | 'GELB' ) | 'GRÜN' ) ;
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalReferenceGrammarTestLanguage.g:462:1: ruleFarbe returns [EObject current=null] : ( ( ( 'ROT' | 'BLAU' ) | 'GELB' ) | 'GR\\u00DCN' ) ;
public final EObject ruleFarbe() throws RecognitionException {
EObject current = null;
EObject temp=null; setCurrentLookahead(); resetLookahead();
try {
- // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalReferenceGrammarTestLanguage.g:466:6: ( ( ( ( 'ROT' | 'BLAU' ) | 'GELB' ) | 'GRÜN' ) )
- // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalReferenceGrammarTestLanguage.g:467:1: ( ( ( 'ROT' | 'BLAU' ) | 'GELB' ) | 'GRÜN' )
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalReferenceGrammarTestLanguage.g:466:6: ( ( ( ( 'ROT' | 'BLAU' ) | 'GELB' ) | 'GR\\u00DCN' ) )
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalReferenceGrammarTestLanguage.g:467:1: ( ( ( 'ROT' | 'BLAU' ) | 'GELB' ) | 'GR\\u00DCN' )
{
- // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalReferenceGrammarTestLanguage.g:467:1: ( ( ( 'ROT' | 'BLAU' ) | 'GELB' ) | 'GRÜN' )
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalReferenceGrammarTestLanguage.g:467:1: ( ( ( 'ROT' | 'BLAU' ) | 'GELB' ) | 'GR\\u00DCN' )
int alt8=2;
int LA8_0 = input.LA(1);
@@ -957,7 +957,7 @@ public class InternalReferenceGrammarTestLanguageParser extends AbstractInternal
}
else {
NoViableAltException nvae =
- new NoViableAltException("467:1: ( ( ( 'ROT' | 'BLAU' ) | 'GELB' ) | 'GRÜN' )", 8, 0, input);
+ new NoViableAltException("467:1: ( ( ( 'ROT' | 'BLAU' ) | 'GELB' ) | 'GR\\u00DCN' )", 8, 0, input);
throw nvae;
}
@@ -1045,7 +1045,7 @@ public class InternalReferenceGrammarTestLanguageParser extends AbstractInternal
}
break;
case 2 :
- // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalReferenceGrammarTestLanguage.g:482:6: 'GRÜN'
+ // ../org.eclipse.xtext.ui.common.tests//../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalReferenceGrammarTestLanguage.g:482:6: 'GR\\u00DCN'
{
match(input,22,FOLLOW_22_in_ruleFarbe1022);
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalReferenceGrammarTestLanguage__.g b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalReferenceGrammarTestLanguage__.g
index ae247e8..357bf81 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalReferenceGrammarTestLanguage__.g
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalReferenceGrammarTestLanguage__.g
@@ -18,7 +18,7 @@ T18 : 'spielzeug' ;
T19 : 'ROT' ;
T20 : 'BLAU' ;
T21 : 'GELB' ;
-T22 : 'GRÜN' ;
+T22 : 'GR\u00DCN' ;
T23 : 'familie' ;
T24 : 'keyword' ;
T25 : ',' ;
diff --git a/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/GenerateAllTestGrammars.java b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/GenerateAllTestGrammars.java
index 834a387..64adbe6 100755
--- a/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/GenerateAllTestGrammars.java
+++ b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/GenerateAllTestGrammars.java
@@ -21,6 +21,7 @@ import org.eclipse.xtext.metamodelreferencing.tests.MetamodelRefTestLanguage;
import org.eclipse.xtext.metamodelreferencing.tests.MultiGenMMTestLanguage;
import org.eclipse.xtext.parser.datatyperules.DatatypeRulesTestLanguage;
import org.eclipse.xtext.parser.epatch.EpatchTestLanguage;
+import org.eclipse.xtext.parser.keywords.KeywordsTestLanguage;
import org.eclipse.xtext.parser.terminalrules.HiddenTerminalsTestLanguage;
import org.eclipse.xtext.parser.terminalrules.TerminalRulesTestLanguage;
import org.eclipse.xtext.parser.terminalrules.XtextTerminalsTestLanguage;
@@ -82,7 +83,8 @@ public class GenerateAllTestGrammars {
TerminalRulesTestLanguage.class,
XtextTerminalsTestLanguage.class,
HiddenTerminalsTestLanguage.class,
- EpatchTestLanguage.class
+ EpatchTestLanguage.class,
+ KeywordsTestLanguage.class
};
public static void main(String... args) throws Exception {
diff --git a/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parser/ParserTestHelper.java b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parser/ParserTestHelper.java
index 3519045..3944ea5 100644
--- a/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parser/ParserTestHelper.java
+++ b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parser/ParserTestHelper.java
@@ -15,6 +15,7 @@ import org.eclipse.emf.ecore.resource.Resource.Diagnostic;
import org.eclipse.xtext.resource.IResourceFactory;
import org.eclipse.xtext.resource.XtextResource;
import org.eclipse.xtext.resource.XtextResourceSet;
+import org.eclipse.xtext.util.StringInputStream;
/**
* @author Sebastian Zarnekow - Initial contribution and API
@@ -45,6 +46,10 @@ public class ParserTestHelper {
return resource;
}
+
+ public XtextResource getResourceFromString(String in) throws IOException {
+ return getResourceFromStream(new StringInputStream(in));
+ }
public XtextResource createResource(URI uri) {
XtextResource result = (XtextResource) factory.createResource(uri);
diff --git a/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parser/keywords/GrammarAccessTest.java b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parser/keywords/GrammarAccessTest.java
new file mode 100644
index 0000000..a817503
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parser/keywords/GrammarAccessTest.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2009 itemis AG (http://www.itemis.eu) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.xtext.parser.keywords;
+
+import org.eclipse.xtext.parser.keywords.services.KeywordsTestLanguageGrammarAccess;
+
+import junit.framework.TestCase;
+
+/**
+ * @author Sebastian Zarnekow - Initial contribution and API
+ */
+public class GrammarAccessTest extends TestCase {
+
+ private KeywordsTestLanguageGrammarAccess grammarAccess;
+
+ private KeywordsTestLanguageGrammarAccess.ModelElements modelElements;
+ @Override
+ protected void setUp() {
+ this.grammarAccess = KeywordsTestLanguageGrammarAccess.INSTANCE;
+ this.modelElements = grammarAccess.prModel();
+ }
+
+ public void testKeywordValues() {
+ assertEquals("foo\\bar", modelElements.ele0000KeywordFooBar().getValue());
+ assertEquals("foo\\", modelElements.ele0010KeywordFoo().getValue());
+ assertEquals("\\bar", modelElements.ele010KeywordBar().getValue());
+ assertEquals("\\", modelElements.ele10KeywordReverseSolidus().getValue());
+ }
+}
diff --git a/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parser/keywords/KeywordsTestLanguage.java b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parser/keywords/KeywordsTestLanguage.java
new file mode 100644
index 0000000..9094d5f
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parser/keywords/KeywordsTestLanguage.java
@@ -0,0 +1,15 @@
+/*******************************************************************************
+ * Copyright (c) 2009 itemis AG (http://www.itemis.eu) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.xtext.parser.keywords;
+
+/**
+ * @author Sebastian Zarnekow - Initial contribution and API
+ */
+public class KeywordsTestLanguage {
+
+}
diff --git a/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parser/keywords/KeywordsTestLanguage.xtext b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parser/keywords/KeywordsTestLanguage.xtext
new file mode 100644
index 0000000..e1161d5
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parser/keywords/KeywordsTestLanguage.xtext
@@ -0,0 +1,14 @@
+/*******************************************************************************
+ * Copyright (c) 2009 itemis AG (http://www.itemis.eu) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ *******************************************************************************/
+language org.eclipse.xtext.parser.keywords.KeywordsTestLanguage
+
+generate KeywordsTestLanguage "http://www.eclipse.org/2009/tmf/xtext/KeywordsTestLanguage"
+
+Model hidden(WS, ML_COMMENT, SL_COMMENT):
+ first?="foo\\bar" | second?="foo\\" | third?="\\bar" | forth?="\\";
diff --git a/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parser/keywords/KeywordsTestLanguageChecks.chk b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parser/keywords/KeywordsTestLanguageChecks.chk
new file mode 100644
index 0000000..ecd7309
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parser/keywords/KeywordsTestLanguageChecks.chk
@@ -0,0 +1,7 @@
+import KeywordsTestLanguage;
+/*
+ * this check file is used to specify constraints for the derived metamodels
+ * example:
+ * context Entity WARNING "Entity names should start with a capital" :
+ * name.toFirstUpper() == name;
+ */
diff --git a/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parser/keywords/KeywordsTestLanguageRuntimeModule.java b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parser/keywords/KeywordsTestLanguageRuntimeModule.java
new file mode 100644
index 0000000..45d7469
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parser/keywords/KeywordsTestLanguageRuntimeModule.java
@@ -0,0 +1,18 @@
+/*
+Generated with Xtext
+*/
+package org.eclipse.xtext.parser.keywords;
+
+import com.google.inject.Binder;
+
+/**
+ * used to register components to be used within the IDE.
+ */
+public class KeywordsTestLanguageRuntimeModule extends AbstractKeywordsTestLanguageRuntimeModule {
+
+ @Override
+ public void configure(Binder binder) {
+ super.configure(binder);
+ }
+
+}
diff --git a/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parser/keywords/ParserTest.java b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parser/keywords/ParserTest.java
new file mode 100644
index 0000000..39f9ff6
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parser/keywords/ParserTest.java
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * Copyright (c) 2009 itemis AG (http://www.itemis.eu) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.xtext.parser.keywords;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.xtext.parser.IParser;
+import org.eclipse.xtext.parser.ParserTestHelper;
+import org.eclipse.xtext.parser.antlr.IAntlrParser;
+import org.eclipse.xtext.parser.packrat.IPackratParser;
+import org.eclipse.xtext.resource.XtextResource;
+import org.eclipse.xtext.tests.AbstractGeneratorTest;
+
+/**
+ * @author Sebastian Zarnekow - Initial contribution and API
+ */
+public abstract class ParserTest extends AbstractGeneratorTest {
+
+ private ParserTestHelper helper;
+ private EStructuralFeature first;
+ private EStructuralFeature second;
+ private EStructuralFeature third;
+ private EStructuralFeature forth;
+
+ @Override
+ protected void setUp() throws Exception {
+ with(KeywordsTestLanguageStandaloneSetup.class);
+ helper = new ParserTestHelper(getResourceFactory(), getParserUnderTest());
+ EPackage pack = getMetamodelAccess().getGeneratedEPackages()[0];
+ EClass clazz = (EClass) pack.getEClassifier("Model");
+ first = clazz.getEStructuralFeature("first");
+ second = clazz.getEStructuralFeature("second");
+ third = clazz.getEStructuralFeature("third");
+ forth = clazz.getEStructuralFeature("forth");
+ }
+
+ protected abstract IParser getParserUnderTest();
+
+ private void checkModel(XtextResource resource, EStructuralFeature feature) {
+ EObject model = resource.getParseResult().getRootASTElement();
+ assertNotNull(model);
+ boolean value = (Boolean) model.eGet(feature);
+ assertTrue(value);
+ }
+
+ public void testFooBar() throws Exception {
+ XtextResource resource = helper.getResourceFromString("foo\\bar");
+ assertTrue(resource.getErrors().isEmpty());
+ checkModel(resource, first);
+ }
+
+ public void testFoo() throws Exception {
+ XtextResource resource = helper.getResourceFromString("foo\\");
+ assertTrue(resource.getErrors().isEmpty());
+ checkModel(resource, second);
+ }
+
+ public void testBar() throws Exception {
+ XtextResource resource = helper.getResourceFromString("\\bar");
+ assertTrue(resource.getErrors().isEmpty());
+ checkModel(resource, third);
+ }
+
+ public void testBackslash() throws Exception {
+ XtextResource resource = helper.getResourceFromString("\\");
+ assertTrue(resource.getErrors().isEmpty());
+ checkModel(resource, forth);
+ }
+
+ public static class Antlr extends ParserTest {
+
+ @Override
+ protected IAntlrParser getParserUnderTest() {
+ return getAntlrParser();
+ }
+
+ }
+
+ public static class Packrat extends ParserTest {
+
+ @Override
+ protected IPackratParser getParserUnderTest() {
+ return getPackratParser();
+ }
+
+ }
+}
diff --git a/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/tests/AbstractGeneratorTest.java b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/tests/AbstractGeneratorTest.java
index fb8e3f5..bc3c503 100755
--- a/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/tests/AbstractGeneratorTest.java
+++ b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/tests/AbstractGeneratorTest.java
@@ -31,7 +31,9 @@ import org.eclipse.xtext.parser.DefaultEcoreElementFactory;
import org.eclipse.xtext.parser.IAstFactory;
import org.eclipse.xtext.parser.IParser;
import org.eclipse.xtext.parser.ISwitchingParser;
+import org.eclipse.xtext.parser.antlr.IAntlrParser;
import org.eclipse.xtext.parser.packrat.AbstractPackratParser;
+import org.eclipse.xtext.parser.packrat.IPackratParser;
import org.eclipse.xtext.parser.packrat.ParseResultFactory;
import org.eclipse.xtext.parsetree.CompositeNode;
import org.eclipse.xtext.parsetree.reconstr.IParseTreeConstructor;
@@ -101,6 +103,14 @@ public abstract class AbstractGeneratorTest extends TestCase {
protected IParser getParser() {
return ServiceRegistry.getInjector(currentScope).getInstance(ISwitchingParser.class);
}
+
+ protected IAntlrParser getAntlrParser() {
+ return ServiceRegistry.getInjector(currentScope).getInstance(IAntlrParser.class);
+ }
+
+ protected IPackratParser getPackratParser() {
+ return ServiceRegistry.getInjector(currentScope).getInstance(IPackratParser.class);
+ }
protected IAstFactory getASTFactory() {
return ServiceRegistry.getInjector(currentScope).getInstance(IAstFactory.class);
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/parser/keywords/AbstractKeywordsTestLanguageUiModule.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/parser/keywords/AbstractKeywordsTestLanguageUiModule.java
new file mode 100644
index 0000000..07f7793
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/parser/keywords/AbstractKeywordsTestLanguageUiModule.java
@@ -0,0 +1,28 @@
+/*
+Generated with Xtext
+*/
+package org.eclipse.xtext.parser.keywords;
+
+import org.eclipse.xtext.ui.common.service.DefaultUIModule;
+
+/**
+ * GENERATED! Manual modification goes to KeywordsTestLanguageUIModule
+ */
+public abstract class AbstractKeywordsTestLanguageUiModule extends DefaultUIModule {
+
+
+ public Class<? extends org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider> bindIProposalProvider() {
+ return org.eclipse.xtext.parser.keywords.GenKeywordsTestLanguageProposalProvider.class;
+ }
+
+ public Class<? extends org.eclipse.xtext.ui.common.editor.syntaxcoloring.antlr.ITokenColorer> bindITokenColorer() {
+ return org.eclipse.xtext.ui.common.editor.syntaxcoloring.antlr.BuiltinAntlrTokenColorer.class;
+ }
+
+ public Class<? extends org.eclipse.jface.text.rules.ITokenScanner> bindITokenScanner() {
+ return org.eclipse.xtext.ui.common.editor.syntaxcoloring.antlr.AntlrTokenScanner.class;
+ }
+
+
+
+}
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/parser/keywords/GenKeywordsTestLanguageProposalProvider.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/parser/keywords/GenKeywordsTestLanguageProposalProvider.java
new file mode 100644
index 0000000..29b7c34
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/parser/keywords/GenKeywordsTestLanguageProposalProvider.java
@@ -0,0 +1,82 @@
+/*
+Generated with Xtext
+*/
+package org.eclipse.xtext.parser.keywords;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.xtext.Assignment;
+import org.eclipse.xtext.CrossReference;
+import org.eclipse.xtext.RuleCall;
+import org.eclipse.xtext.ui.common.editor.contentassist.impl.AbstractJavaProposalProvider;
+import org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider;
+import org.eclipse.xtext.ui.common.editor.contentassist.IContentAssistContext;
+
+/**
+ * Represents a generated, default implementation of interface {@link IProposalProvider}.
+ *
+ * @see org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider
+ */
+public class GenKeywordsTestLanguageProposalProvider extends AbstractJavaProposalProvider {
+ // constants
+ private static final String UI_PLUGIN_ID = "";
+
+
+
+ public List<? extends ICompletionProposal> completeModel_First(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeModel_First feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeModel_Second(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeModel_Second feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeModel_Third(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeModel_Third feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeModel_Forth(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeModel_Forth feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+
+ public List<? extends ICompletionProposal> complete(RuleCall ruleCall, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ @Override
+ protected String getDefaultImageFilePath() {
+ return "icons/editor.gif";
+ }
+
+ @Override
+ protected String getPluginId() {
+ return UI_PLUGIN_ID;
+ }
+}
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/parser/keywords/KeywordsTestLanguageUiSetup.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/parser/keywords/KeywordsTestLanguageUiSetup.java
new file mode 100644
index 0000000..679617b
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/parser/keywords/KeywordsTestLanguageUiSetup.java
@@ -0,0 +1,36 @@
+/*
+Generated with Xtext
+*/
+package org.eclipse.xtext.parser.keywords;
+
+import org.eclipse.xtext.service.IServiceScope;
+import org.eclipse.xtext.service.ServiceRegistry;
+
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+
+/**
+ * GENERATED!
+ */
+public class KeywordsTestLanguageUiSetup {
+
+ private static boolean initialized = false;
+
+ public synchronized static void doSetup() {
+ if (!initialized) {
+ org.eclipse.xtext.parser.keywords.KeywordsTestLanguageStandaloneSetup.doSetup();
+
+ // overwriting runtime configuration
+ Injector injector = Guice.createInjector(new org.eclipse.xtext.parser.keywords.KeywordsTestLanguageRuntimeModule(), new org.eclipse.xtext.parser.keywords.KeywordsTestLanguageUIModule());
+ ServiceRegistry.registerInjector(org.eclipse.xtext.parser.keywords.IKeywordsTestLanguage.SCOPE, injector);
+
+ initialized = true;
+ }
+ }
+
+ public static IServiceScope getServiceScope() {
+ doSetup();
+ return org.eclipse.xtext.parser.keywords.IKeywordsTestLanguage.SCOPE;
+ }
+
+}
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/parser/keywords/ui/editor/KeywordsTestLanguageEditor.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/parser/keywords/ui/editor/KeywordsTestLanguageEditor.java
new file mode 100644
index 0000000..e0b7642
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/parser/keywords/ui/editor/KeywordsTestLanguageEditor.java
@@ -0,0 +1,6 @@
+package org.eclipse.xtext.parser.keywords.ui.editor;
+
+public class KeywordsTestLanguageEditor extends org.eclipse.xtext.ui.core.editor.XtextEditor {
+
+}
+ \ No newline at end of file
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/parser/keywords/ui/internal/KeywordsTestLanguageActivator.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/parser/keywords/ui/internal/KeywordsTestLanguageActivator.java
new file mode 100644
index 0000000..8d5d21a
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/parser/keywords/ui/internal/KeywordsTestLanguageActivator.java
@@ -0,0 +1,15 @@
+package org.eclipse.xtext.parser.keywords.ui.internal;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+public class KeywordsTestLanguageActivator extends AbstractUIPlugin {
+
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ org.eclipse.xtext.parser.keywords.KeywordsTestLanguageUiSetup.doSetup();
+ }
+
+}
+ \ No newline at end of file
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/parser/keywords/KeywordsTestLanguageUIModule.java b/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/parser/keywords/KeywordsTestLanguageUIModule.java
new file mode 100644
index 0000000..a058b52
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/parser/keywords/KeywordsTestLanguageUIModule.java
@@ -0,0 +1,14 @@
+/*
+Generated with Xtext
+*/
+package org.eclipse.xtext.parser.keywords;
+
+import com.google.inject.Binder;
+
+/**
+ * used to manually extend and modify configuration for components used within the IDE.
+ */
+public class KeywordsTestLanguageUIModule extends AbstractKeywordsTestLanguageUiModule {
+
+
+}
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/ui/common/GenerateAllTestGrammarsWithUiConfig.java b/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/ui/common/GenerateAllTestGrammarsWithUiConfig.java
index 0a870b4..7e4f1d4 100644
--- a/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/ui/common/GenerateAllTestGrammarsWithUiConfig.java
+++ b/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/ui/common/GenerateAllTestGrammarsWithUiConfig.java
@@ -21,6 +21,7 @@ import org.eclipse.xtext.GeneratorFacade;
import org.eclipse.xtext.Grammar;
import org.eclipse.xtext.XtextGrammarTestLanguage;
import org.eclipse.xtext.XtextStandaloneSetup;
+import org.eclipse.xtext.parser.keywords.KeywordsTestLanguage;
import org.eclipse.xtext.resource.XtextResourceSet;
import org.eclipse.xtext.testlanguages.ContentAssistTestLanguage;
import org.eclipse.xtext.testlanguages.ReferenceGrammarTestLanguage;
@@ -44,8 +45,14 @@ public class GenerateAllTestGrammarsWithUiConfig {
private static Logger logger = Logger.getLogger(GenerateAllTestGrammarsWithUiConfig.class);
- private final static Class<?>[] testClasses = new Class[] { ReferenceGrammarTestLanguage.class, TreeTestLanguage.class,
- XtextGrammarTestLanguage.class, ContentAssistTestLanguage.class };
+ private final static Class<?>[] testClasses = new Class[] {
+ ReferenceGrammarTestLanguage.class,
+ TreeTestLanguage.class,
+ XtextGrammarTestLanguage.class,
+ ContentAssistTestLanguage.class,
+ KeywordsTestLanguage.class
+ };
+
/**
* @return the testclasses
*/
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/DefaultContentAssistProcessorTest.java b/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/DefaultContentAssistProcessorTest.java
index dd7a587..eedcd7d 100644
--- a/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/DefaultContentAssistProcessorTest.java
+++ b/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/DefaultContentAssistProcessorTest.java
@@ -15,6 +15,7 @@ package org.eclipse.xtext.ui.common.editor.contentassist.impl;
import org.eclipse.xtext.XtextGrammarTestLanguageUiSetup;
+import org.eclipse.xtext.parser.keywords.KeywordsTestLanguageUiSetup;
import org.eclipse.xtext.testlanguages.ContentAssistTestLanguageUiSetup;
import org.eclipse.xtext.testlanguages.ReferenceGrammarTestLanguageUiSetup;
import org.eclipse.xtext.tests.AbstractGeneratorTest;
@@ -191,6 +192,11 @@ public class DefaultContentAssistProcessorTest extends AbstractGeneratorTest
);
}
+
+ public void testKeywordWithBackslashes() throws Exception {
+ newBuilder(KeywordsTestLanguageUiSetup.class)
+ .assertText("foo\\bar", "foo\\", "\\bar", "\\");
+ }
private ContentAssistProcessorTestBuilder newBuilder(Class<?> standAloneSetup) throws Exception {
with(standAloneSetup);