summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorszarnekow2009-03-19 10:28:22 (EDT)
committer sefftinge2009-03-19 10:28:22 (EDT)
commit400fb951b6c77f065956b332d5c7de2530567b9a (patch)
treef5caf4ac20010d0897490cc0edb459921c052235
parent3639004a4a6390af164aab3fe4acf0f4a572f90b (diff)
downloadorg.eclipse.xtext-400fb951b6c77f065956b332d5c7de2530567b9a.zip
org.eclipse.xtext-400fb951b6c77f065956b332d5c7de2530567b9a.tar.gz
org.eclipse.xtext-400fb951b6c77f065956b332d5c7de2530567b9a.tar.bz2
enum rule: serialization of enum features
-rw-r--r--tests/org.eclipse.xtext.generator.tests/META-INF/MANIFEST.MF3
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/EnumRulesTestLanguage.xmi6
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parseTreeConstruction/EnumRulesTestLanguageParsetreeConstructor.java98
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g31
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguageLexer.java76
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguageParser.java199
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage__.g14
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/packrat/EnumRulesTestLanguageParserConfiguration.java1
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/packrat/consumers/EnumRulesTestLanguageModelConsumer.java85
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/services/EnumRulesTestLanguageGrammarAccess.java24
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/AbstractSerializationBug269362TestLanguageRuntimeModule.java86
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/SerializationBug269362TestLanguage.ecore11
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/SerializationBug269362TestLanguage.genmodel15
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/SerializationBug269362TestLanguage.xmi184
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/SerializationBug269362TestLanguageCheckValidator.java24
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/SerializationBug269362TestLanguageStandaloneSetup.java44
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parseTreeConstruction/SerializationBug269362TestLanguageParsetreeConstructor.java263
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/SerializationBug269362TestLanguageAntlrTokenFileProvider.java15
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/SerializationBug269362TestLanguageParser.java56
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g176
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.tokens9
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguageLexer.java757
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguageParser.java289
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage__.g34
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/packrat/SerializationBug269362TestLanguageDelimiters.java27
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/packrat/SerializationBug269362TestLanguagePackratParser.java31
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/packrat/SerializationBug269362TestLanguageParserConfiguration.java114
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/packrat/consumers/SerializationBug269362TestLanguageModelConsumer.java328
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/serializationBug269362TestLanguage/Model.java81
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/serializationBug269362TestLanguage/SerializationBug269362TestLanguageFactory.java46
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/serializationBug269362TestLanguage/SerializationBug269362TestLanguagePackage.java182
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/serializationBug269362TestLanguage/impl/ModelImpl.java236
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/serializationBug269362TestLanguage/impl/SerializationBug269362TestLanguageFactoryImpl.java109
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/serializationBug269362TestLanguage/impl/SerializationBug269362TestLanguagePackageImpl.java207
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/serializationBug269362TestLanguage/util/SerializationBug269362TestLanguageAdapterFactory.java135
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/serializationBug269362TestLanguage/util/SerializationBug269362TestLanguageSwitch.java141
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/services/SerializationBug269362TestLanguageGrammarAccess.java154
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/GenerateAllTestLanguages.mwe3
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/enumrules/EnumRulesTestLanguage.xtext2
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/enumrules/SerializationTest.java65
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parsetree/reconstr/GenerateReconstrTestLanguages.mwe24
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parsetree/reconstr/SerializationBug269362Test.java46
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parsetree/reconstr/SerializationBug269362TestLanguage.xtext16
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parsetree/reconstr/SerializationBug269362TestLanguageChecks.chk11
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parsetree/reconstr/SerializationBug269362TestLanguageRuntimeModule.java11
45 files changed, 4321 insertions, 148 deletions
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 1816e02..7aa6c95 100644
--- a/tests/org.eclipse.xtext.generator.tests/META-INF/MANIFEST.MF
+++ b/tests/org.eclipse.xtext.generator.tests/META-INF/MANIFEST.MF
@@ -143,5 +143,6 @@ Export-Package: org.eclipse.xtext,
org.eclipse.xtext.enumrules.parser.packrat,
org.eclipse.xtext.enumrules.parser.packrat.consumers,
org.eclipse.xtext.enumrules.parseTreeConstruction,
- org.eclipse.xtext.enumrules.parser.antlr
+ org.eclipse.xtext.enumrules.parser.antlr,
+ org.eclipse.xtext.parsetree.reconstr.serializationBug269362TestLanguage
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/EnumRulesTestLanguage.xmi b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/EnumRulesTestLanguage.xmi
index 74e267c..ab97b93 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/EnumRulesTestLanguage.xmi
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/EnumRulesTestLanguage.xmi
@@ -17,6 +17,12 @@
<tokens xsi:type="xtext:Assignment" feature="existing" operator="=">
<terminal xsi:type="xtext:RuleCall" rule="/0/@rules.1"/>
</tokens>
+ <tokens xsi:type="xtext:Group" cardinality="?">
+ <tokens xsi:type="xtext:Keyword" value="generated"/>
+ <tokens xsi:type="xtext:Assignment" feature="generated" operator="=">
+ <terminal xsi:type="xtext:RuleCall" rule="/0/@rules.2"/>
+ </tokens>
+ </tokens>
</groups>
<groups xsi:type="xtext:Group">
<tokens xsi:type="xtext:Keyword" value="generated"/>
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parseTreeConstruction/EnumRulesTestLanguageParsetreeConstructor.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parseTreeConstruction/EnumRulesTestLanguageParsetreeConstructor.java
index 3adef08..0e092e4 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parseTreeConstruction/EnumRulesTestLanguageParsetreeConstructor.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parseTreeConstruction/EnumRulesTestLanguageParsetreeConstructor.java
@@ -30,11 +30,11 @@ public class EnumRulesTestLanguageParsetreeConstructor extends AbstractParseTree
/************ begin Rule Model ****************
*
* Model:
- * "existing" existing=ExistingEnum|"generated" generated=GeneratedEnum;
+ * "existing" existing=ExistingEnum ("generated" generated=GeneratedEnum)?|"generated" generated=GeneratedEnum;
*
**/
-// "existing" existing=ExistingEnum|"generated" generated=GeneratedEnum
+// "existing" existing=ExistingEnum ("generated" generated=GeneratedEnum)?|"generated" generated=GeneratedEnum
protected class Model_Alternatives extends AlternativesToken {
public Model_Alternatives(IInstanceDescription curr, AbstractToken pred) {
@@ -55,7 +55,7 @@ protected class Model_Alternatives extends AlternativesToken {
}
}
-// "existing" existing=ExistingEnum
+// "existing" existing=ExistingEnum ("generated" generated=GeneratedEnum)?
protected class Model_0_Group extends GroupToken {
public Model_0_Group(IInstanceDescription curr, AbstractToken pred) {
@@ -69,15 +69,19 @@ protected class Model_0_Group extends GroupToken {
@Override
protected Solution createSolution() {
- Solution s1 = new Model_0_1_Assignment_existing(current, this).firstSolution();
+ Solution s1 = new Model_0_2_Group(current, this).firstSolution();
while(s1 != null) {
- Solution s2 = new Model_0_0_Keyword_existing(s1.getCurrent(), s1.getPredecessor()).firstSolution();
- if(s2 != null) {
- last = s2.getPredecessor();
- return s2;
- } else {
- s1 = s1.getPredecessor().nextSolution(this,s1);
+ Solution s2 = new Model_0_1_Assignment_existing(s1.getCurrent(), s1.getPredecessor()).firstSolution();
+ while(s2 != null) {
+ Solution s3 = new Model_0_0_Keyword_existing(s2.getCurrent(), s2.getPredecessor()).firstSolution();
+ if(s3 != null) {
+ last = s3.getPredecessor();
+ return s3;
+ } else {
+ s2 = s2.getPredecessor().nextSolution(this,s2);
+ }
}
+ s1 = s1.getPredecessor().nextSolution(this,s1);
}
return null;
}
@@ -111,8 +115,8 @@ protected class Model_0_1_Assignment_existing extends AssignmentToken {
protected Solution createSolution() {
if((value = current.getConsumable("existing",IS_REQUIRED)) == null) return null;
IInstanceDescription obj = current.cloneAndConsume("existing");
- if(Boolean.TRUE.booleanValue()) { // xtext::RuleCall FIXME: check if value is valid for lexer rule
- type = AssignmentType.LRC;
+ if(Boolean.TRUE.booleanValue()) { // xtext::RuleCall FIXME: check if value is valid for datatype rule
+ type = AssignmentType.ERC;
element = grammarAccess.getModelAccess().getExistingExistingEnumEnumRuleCall_0_1_0();
return new Solution(obj);
}
@@ -120,6 +124,72 @@ protected class Model_0_1_Assignment_existing extends AssignmentToken {
}
}
+// ("generated" generated=GeneratedEnum)?
+protected class Model_0_2_Group extends GroupToken {
+
+ public Model_0_2_Group(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, !IS_REQUIRED);
+ }
+
+ @Override
+ public Group getGrammarElement() {
+ return grammarAccess.getModelAccess().getGroup_0_2();
+ }
+
+ @Override
+ protected Solution createSolution() {
+ Solution s1 = new Model_0_2_1_Assignment_generated(current, this).firstSolution();
+ while(s1 != null) {
+ Solution s2 = new Model_0_2_0_Keyword_generated(s1.getCurrent(), s1.getPredecessor()).firstSolution();
+ if(s2 != null) {
+ last = s2.getPredecessor();
+ return s2;
+ } else {
+ s1 = s1.getPredecessor().nextSolution(this,s1);
+ }
+ }
+ return null;
+ }
+}
+
+// "generated"
+protected class Model_0_2_0_Keyword_generated extends KeywordToken {
+
+ public Model_0_2_0_Keyword_generated(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ public Keyword getGrammarElement() {
+ return grammarAccess.getModelAccess().getGeneratedKeyword_0_2_0();
+ }
+}
+
+// generated=GeneratedEnum
+protected class Model_0_2_1_Assignment_generated extends AssignmentToken {
+
+ public Model_0_2_1_Assignment_generated(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ @Override
+ public Assignment getGrammarElement() {
+ return grammarAccess.getModelAccess().getGeneratedAssignment_0_2_1();
+ }
+
+ @Override
+ protected Solution createSolution() {
+ if((value = current.getConsumable("generated",!IS_REQUIRED)) == null) return null;
+ IInstanceDescription obj = current.cloneAndConsume("generated");
+ if(Boolean.TRUE.booleanValue()) { // xtext::RuleCall FIXME: check if value is valid for datatype rule
+ type = AssignmentType.ERC;
+ element = grammarAccess.getModelAccess().getGeneratedGeneratedEnumEnumRuleCall_0_2_1_0();
+ return new Solution(obj);
+ }
+ return null;
+ }
+}
+
+
// "generated" generated=GeneratedEnum
protected class Model_1_Group extends GroupToken {
@@ -177,8 +247,8 @@ protected class Model_1_1_Assignment_generated extends AssignmentToken {
protected Solution createSolution() {
if((value = current.getConsumable("generated",IS_REQUIRED)) == null) return null;
IInstanceDescription obj = current.cloneAndConsume("generated");
- if(Boolean.TRUE.booleanValue()) { // xtext::RuleCall FIXME: check if value is valid for lexer rule
- type = AssignmentType.LRC;
+ if(Boolean.TRUE.booleanValue()) { // xtext::RuleCall FIXME: check if value is valid for datatype rule
+ type = AssignmentType.ERC;
element = grammarAccess.getModelAccess().getGeneratedGeneratedEnumEnumRuleCall_1_1_0();
return new Solution(obj);
}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g
index 5534f7e..e11ab5d 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g
@@ -106,7 +106,32 @@ ruleModel returns [EObject current=null]
currentNode = currentNode.getParent();
}
-))
+)('generated'
+ {
+ createLeafNode(grammarAccess.getModelAccess().getGeneratedKeyword_0_2_0(), null);
+ }
+(
+
+
+ {
+ currentNode=createCompositeNode(grammarAccess.getModelAccess().getGeneratedGeneratedEnumEnumRuleCall_0_2_1_0(), currentNode);
+ }
+ lv_generated_3=ruleGeneratedEnum
+ {
+ if ($current==null) {
+ $current = factory.create(grammarAccess.getModelRule().getType().getClassifier());
+ associateNodeWithAstElement(currentNode, $current);
+ }
+
+ try {
+ set($current, "generated", lv_generated_3, "GeneratedEnum", lastConsumedNode);
+ } catch (ValueConverterException vce) {
+ handleValueConverterException(vce);
+ }
+ currentNode = currentNode.getParent();
+ }
+
+))?)
|('generated'
{
createLeafNode(grammarAccess.getModelAccess().getGeneratedKeyword_1_0(), null);
@@ -117,7 +142,7 @@ ruleModel returns [EObject current=null]
{
currentNode=createCompositeNode(grammarAccess.getModelAccess().getGeneratedGeneratedEnumEnumRuleCall_1_1_0(), currentNode);
}
- lv_generated_3=ruleGeneratedEnum
+ lv_generated_5=ruleGeneratedEnum
{
if ($current==null) {
$current = factory.create(grammarAccess.getModelRule().getType().getClassifier());
@@ -125,7 +150,7 @@ ruleModel returns [EObject current=null]
}
try {
- set($current, "generated", lv_generated_3, "GeneratedEnum", lastConsumedNode);
+ set($current, "generated", lv_generated_5, "GeneratedEnum", lastConsumedNode);
} catch (ValueConverterException vce) {
handleValueConverterException(vce);
}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguageLexer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguageLexer.java
index bd52e6a..25ca60d 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguageLexer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguageLexer.java
@@ -130,10 +130,10 @@ public class InternalEnumRulesTestLanguageLexer extends Lexer {
public final void mRULE_ID() throws RecognitionException {
try {
int _type = RULE_ID;
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:189:9: ( ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* )
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:189:11: ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )*
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:214:9: ( ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* )
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:214:11: ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )*
{
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:189:11: ( '^' )?
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:214:11: ( '^' )?
int alt1=2;
int LA1_0 = input.LA(1);
@@ -142,7 +142,7 @@ public class InternalEnumRulesTestLanguageLexer extends Lexer {
}
switch (alt1) {
case 1 :
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:189:11: '^'
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:214:11: '^'
{
match('^');
@@ -161,7 +161,7 @@ public class InternalEnumRulesTestLanguageLexer extends Lexer {
recover(mse); throw mse;
}
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:189:40: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )*
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:214:40: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )*
loop2:
do {
int alt2=2;
@@ -209,10 +209,10 @@ public class InternalEnumRulesTestLanguageLexer extends Lexer {
public final void mRULE_INT() throws RecognitionException {
try {
int _type = RULE_INT;
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:191:10: ( ( '0' .. '9' )+ )
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:191:12: ( '0' .. '9' )+
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:216:10: ( ( '0' .. '9' )+ )
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:216:12: ( '0' .. '9' )+
{
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:191:12: ( '0' .. '9' )+
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:216:12: ( '0' .. '9' )+
int cnt3=0;
loop3:
do {
@@ -226,7 +226,7 @@ public class InternalEnumRulesTestLanguageLexer extends Lexer {
switch (alt3) {
case 1 :
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:191:13: '0' .. '9'
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:216:13: '0' .. '9'
{
matchRange('0','9');
@@ -256,10 +256,10 @@ public class InternalEnumRulesTestLanguageLexer extends Lexer {
public final void mRULE_STRING() throws RecognitionException {
try {
int _type = RULE_STRING;
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:193:13: ( ( '\\\"' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\\"' ) ) )* '\\\"' | '\\'' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) )
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:193:15: ( '\\\"' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\\"' ) ) )* '\\\"' | '\\'' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' )
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:218:13: ( ( '\\\"' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\\"' ) ) )* '\\\"' | '\\'' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) )
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:218:15: ( '\\\"' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\\"' ) ) )* '\\\"' | '\\'' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' )
{
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:193:15: ( '\\\"' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\\"' ) ) )* '\\\"' | '\\'' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' )
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:218:15: ( '\\\"' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\\"' ) ) )* '\\\"' | '\\'' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' )
int alt6=2;
int LA6_0 = input.LA(1);
@@ -271,16 +271,16 @@ public class InternalEnumRulesTestLanguageLexer extends Lexer {
}
else {
NoViableAltException nvae =
- new NoViableAltException("193:15: ( '\\\"' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\\"' ) ) )* '\\\"' | '\\'' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' )", 6, 0, input);
+ new NoViableAltException("218:15: ( '\\\"' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\\"' ) ) )* '\\\"' | '\\'' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' )", 6, 0, input);
throw nvae;
}
switch (alt6) {
case 1 :
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:193:16: '\\\"' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\\"' ) ) )* '\\\"'
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:218:16: '\\\"' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\\"' ) ) )* '\\\"'
{
match('\"');
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:193:21: ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\\"' ) ) )*
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:218:21: ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\\"' ) ) )*
loop4:
do {
int alt4=3;
@@ -296,7 +296,7 @@ public class InternalEnumRulesTestLanguageLexer extends Lexer {
switch (alt4) {
case 1 :
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:193:22: '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' )
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:218:22: '\\\\' ( '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' ) {
@@ -313,7 +313,7 @@ public class InternalEnumRulesTestLanguageLexer extends Lexer {
}
break;
case 2 :
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:193:64: ~ ( ( '\\\\' | '\\\"' ) )
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:218:64: ~ ( ( '\\\\' | '\\\"' ) )
{
if ( (input.LA(1)>='\u0000' && input.LA(1)<='!')||(input.LA(1)>='#' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFE') ) {
input.consume();
@@ -339,10 +339,10 @@ public class InternalEnumRulesTestLanguageLexer extends Lexer {
}
break;
case 2 :
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:193:86: '\\'' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\'' ) ) )* '\\''
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:218:86: '\\'' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\'' ) ) )* '\\''
{
match('\'');
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:193:91: ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\'' ) ) )*
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:218:91: ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\'' ) ) )*
loop5:
do {
int alt5=3;
@@ -358,7 +358,7 @@ public class InternalEnumRulesTestLanguageLexer extends Lexer {
switch (alt5) {
case 1 :
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:193:92: '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' )
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:218:92: '\\\\' ( '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' ) {
@@ -375,7 +375,7 @@ public class InternalEnumRulesTestLanguageLexer extends Lexer {
}
break;
case 2 :
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:193:134: ~ ( ( '\\\\' | '\\'' ) )
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:218:134: ~ ( ( '\\\\' | '\\'' ) )
{
if ( (input.LA(1)>='\u0000' && input.LA(1)<='&')||(input.LA(1)>='(' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFE') ) {
input.consume();
@@ -417,12 +417,12 @@ public class InternalEnumRulesTestLanguageLexer extends Lexer {
public final void mRULE_ML_COMMENT() throws RecognitionException {
try {
int _type = RULE_ML_COMMENT;
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:195:17: ( '/*' ( options {greedy=false; } : . )* '*/' )
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:195:19: '/*' ( options {greedy=false; } : . )* '*/'
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:220:17: ( '/*' ( options {greedy=false; } : . )* '*/' )
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:220:19: '/*' ( options {greedy=false; } : . )* '*/'
{
match("/*");
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:195:24: ( options {greedy=false; } : . )*
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:220:24: ( options {greedy=false; } : . )*
loop7:
do {
int alt7=2;
@@ -447,7 +447,7 @@ public class InternalEnumRulesTestLanguageLexer extends Lexer {
switch (alt7) {
case 1 :
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:195:52: .
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:220:52: .
{
matchAny();
@@ -475,12 +475,12 @@ public class InternalEnumRulesTestLanguageLexer extends Lexer {
public final void mRULE_SL_COMMENT() throws RecognitionException {
try {
int _type = RULE_SL_COMMENT;
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:197:17: ( '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? )
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:197:19: '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )?
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:222:17: ( '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? )
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:222:19: '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )?
{
match("//");
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:197:24: (~ ( ( '\\n' | '\\r' ) ) )*
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:222:24: (~ ( ( '\\n' | '\\r' ) ) )*
loop8:
do {
int alt8=2;
@@ -493,7 +493,7 @@ public class InternalEnumRulesTestLanguageLexer extends Lexer {
switch (alt8) {
case 1 :
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:197:24: ~ ( ( '\\n' | '\\r' ) )
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:222: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();
@@ -514,7 +514,7 @@ public class InternalEnumRulesTestLanguageLexer extends Lexer {
}
} while (true);
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:197:40: ( ( '\\r' )? '\\n' )?
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:222:40: ( ( '\\r' )? '\\n' )?
int alt10=2;
int LA10_0 = input.LA(1);
@@ -523,9 +523,9 @@ public class InternalEnumRulesTestLanguageLexer extends Lexer {
}
switch (alt10) {
case 1 :
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:197:41: ( '\\r' )? '\\n'
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:222:41: ( '\\r' )? '\\n'
{
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:197:41: ( '\\r' )?
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:222:41: ( '\\r' )?
int alt9=2;
int LA9_0 = input.LA(1);
@@ -534,7 +534,7 @@ public class InternalEnumRulesTestLanguageLexer extends Lexer {
}
switch (alt9) {
case 1 :
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:197:41: '\\r'
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:222:41: '\\r'
{
match('\r');
@@ -564,10 +564,10 @@ public class InternalEnumRulesTestLanguageLexer extends Lexer {
public final void mRULE_WS() throws RecognitionException {
try {
int _type = RULE_WS;
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:199:9: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ )
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:199:11: ( ' ' | '\\t' | '\\r' | '\\n' )+
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:224:9: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ )
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:224:11: ( ' ' | '\\t' | '\\r' | '\\n' )+
{
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:199:11: ( ' ' | '\\t' | '\\r' | '\\n' )+
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:224:11: ( ' ' | '\\t' | '\\r' | '\\n' )+
int cnt11=0;
loop11:
do {
@@ -620,8 +620,8 @@ public class InternalEnumRulesTestLanguageLexer extends Lexer {
public final void mRULE_ANY_OTHER() throws RecognitionException {
try {
int _type = RULE_ANY_OTHER;
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:201:16: ( . )
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:201:18: .
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:226:16: ( . )
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:226:18: .
{
matchAny();
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguageParser.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguageParser.java
index b4b52aa..8163b16 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguageParser.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguageParser.java
@@ -101,7 +101,7 @@ public class InternalEnumRulesTestLanguageParser extends AbstractInternalAntlrPa
// $ANTLR start ruleModel
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:78:1: ruleModel returns [EObject current=null] : ( ( 'existing' (lv_existing_1= ruleExistingEnum ) ) | ( 'generated' (lv_generated_3= ruleGeneratedEnum ) ) ) ;
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:78:1: ruleModel returns [EObject current=null] : ( ( 'existing' (lv_existing_1= ruleExistingEnum ) ( 'generated' (lv_generated_3= ruleGeneratedEnum ) )? ) | ( 'generated' (lv_generated_5= ruleGeneratedEnum ) ) ) ;
public final EObject ruleModel() throws RecognitionException {
EObject current = null;
@@ -109,35 +109,37 @@ public class InternalEnumRulesTestLanguageParser extends AbstractInternalAntlrPa
Enumerator lv_generated_3 = null;
+ Enumerator lv_generated_5 = null;
+
EObject temp=null; setCurrentLookahead(); resetLookahead();
try {
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:83:6: ( ( ( 'existing' (lv_existing_1= ruleExistingEnum ) ) | ( 'generated' (lv_generated_3= ruleGeneratedEnum ) ) ) )
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:84:1: ( ( 'existing' (lv_existing_1= ruleExistingEnum ) ) | ( 'generated' (lv_generated_3= ruleGeneratedEnum ) ) )
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:83:6: ( ( ( 'existing' (lv_existing_1= ruleExistingEnum ) ( 'generated' (lv_generated_3= ruleGeneratedEnum ) )? ) | ( 'generated' (lv_generated_5= ruleGeneratedEnum ) ) ) )
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:84:1: ( ( 'existing' (lv_existing_1= ruleExistingEnum ) ( 'generated' (lv_generated_3= ruleGeneratedEnum ) )? ) | ( 'generated' (lv_generated_5= ruleGeneratedEnum ) ) )
{
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:84:1: ( ( 'existing' (lv_existing_1= ruleExistingEnum ) ) | ( 'generated' (lv_generated_3= ruleGeneratedEnum ) ) )
- int alt1=2;
- int LA1_0 = input.LA(1);
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:84:1: ( ( 'existing' (lv_existing_1= ruleExistingEnum ) ( 'generated' (lv_generated_3= ruleGeneratedEnum ) )? ) | ( 'generated' (lv_generated_5= ruleGeneratedEnum ) ) )
+ int alt2=2;
+ int LA2_0 = input.LA(1);
- if ( (LA1_0==11) ) {
- alt1=1;
+ if ( (LA2_0==11) ) {
+ alt2=1;
}
- else if ( (LA1_0==12) ) {
- alt1=2;
+ else if ( (LA2_0==12) ) {
+ alt2=2;
}
else {
NoViableAltException nvae =
- new NoViableAltException("84:1: ( ( 'existing' (lv_existing_1= ruleExistingEnum ) ) | ( 'generated' (lv_generated_3= ruleGeneratedEnum ) ) )", 1, 0, input);
+ new NoViableAltException("84:1: ( ( 'existing' (lv_existing_1= ruleExistingEnum ) ( 'generated' (lv_generated_3= ruleGeneratedEnum ) )? ) | ( 'generated' (lv_generated_5= ruleGeneratedEnum ) ) )", 2, 0, input);
throw nvae;
}
- switch (alt1) {
+ switch (alt2) {
case 1 :
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:84:2: ( 'existing' (lv_existing_1= ruleExistingEnum ) )
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:84:2: ( 'existing' (lv_existing_1= ruleExistingEnum ) ( 'generated' (lv_generated_3= ruleGeneratedEnum ) )? )
{
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:84:2: ( 'existing' (lv_existing_1= ruleExistingEnum ) )
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:84:3: 'existing' (lv_existing_1= ruleExistingEnum )
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:84:2: ( 'existing' (lv_existing_1= ruleExistingEnum ) ( 'generated' (lv_generated_3= ruleGeneratedEnum ) )? )
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:84:3: 'existing' (lv_existing_1= ruleExistingEnum ) ( 'generated' (lv_generated_3= ruleGeneratedEnum ) )?
{
match(input,11,FOLLOW_11_in_ruleModel116);
@@ -169,6 +171,53 @@ public class InternalEnumRulesTestLanguageParser extends AbstractInternalAntlrPa
}
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:109:2: ( 'generated' (lv_generated_3= ruleGeneratedEnum ) )?
+ int alt1=2;
+ int LA1_0 = input.LA(1);
+
+ if ( (LA1_0==12) ) {
+ alt1=1;
+ }
+ switch (alt1) {
+ case 1 :
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:109:3: 'generated' (lv_generated_3= ruleGeneratedEnum )
+ {
+ match(input,12,FOLLOW_12_in_ruleModel164);
+
+ createLeafNode(grammarAccess.getModelAccess().getGeneratedKeyword_0_2_0(), null);
+
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:113:1: (lv_generated_3= ruleGeneratedEnum )
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:116:6: lv_generated_3= ruleGeneratedEnum
+ {
+
+ currentNode=createCompositeNode(grammarAccess.getModelAccess().getGeneratedGeneratedEnumEnumRuleCall_0_2_1_0(), currentNode);
+
+ pushFollow(FOLLOW_ruleGeneratedEnum_in_ruleModel198);
+ lv_generated_3=ruleGeneratedEnum();
+ _fsp--;
+
+
+ if (current==null) {
+ current = factory.create(grammarAccess.getModelRule().getType().getClassifier());
+ associateNodeWithAstElement(currentNode, current);
+ }
+
+ try {
+ set(current, "generated", lv_generated_3, "GeneratedEnum", lastConsumedNode);
+ } catch (ValueConverterException vce) {
+ handleValueConverterException(vce);
+ }
+ currentNode = currentNode.getParent();
+
+
+ }
+
+
+ }
+ break;
+
+ }
+
}
@@ -176,23 +225,23 @@ public class InternalEnumRulesTestLanguageParser extends AbstractInternalAntlrPa
}
break;
case 2 :
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:110:6: ( 'generated' (lv_generated_3= ruleGeneratedEnum ) )
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:135:6: ( 'generated' (lv_generated_5= ruleGeneratedEnum ) )
{
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:110:6: ( 'generated' (lv_generated_3= ruleGeneratedEnum ) )
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:110:7: 'generated' (lv_generated_3= ruleGeneratedEnum )
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:135:6: ( 'generated' (lv_generated_5= ruleGeneratedEnum ) )
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:135:7: 'generated' (lv_generated_5= ruleGeneratedEnum )
{
- match(input,12,FOLLOW_12_in_ruleModel171);
+ match(input,12,FOLLOW_12_in_ruleModel221);
createLeafNode(grammarAccess.getModelAccess().getGeneratedKeyword_1_0(), null);
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:114:1: (lv_generated_3= ruleGeneratedEnum )
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:117:6: lv_generated_3= ruleGeneratedEnum
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:139:1: (lv_generated_5= ruleGeneratedEnum )
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:142:6: lv_generated_5= ruleGeneratedEnum
{
currentNode=createCompositeNode(grammarAccess.getModelAccess().getGeneratedGeneratedEnumEnumRuleCall_1_1_0(), currentNode);
- pushFollow(FOLLOW_ruleGeneratedEnum_in_ruleModel205);
- lv_generated_3=ruleGeneratedEnum();
+ pushFollow(FOLLOW_ruleGeneratedEnum_in_ruleModel255);
+ lv_generated_5=ruleGeneratedEnum();
_fsp--;
@@ -202,7 +251,7 @@ public class InternalEnumRulesTestLanguageParser extends AbstractInternalAntlrPa
}
try {
- set(current, "generated", lv_generated_3, "GeneratedEnum", lastConsumedNode);
+ set(current, "generated", lv_generated_5, "GeneratedEnum", lastConsumedNode);
} catch (ValueConverterException vce) {
handleValueConverterException(vce);
}
@@ -240,48 +289,48 @@ public class InternalEnumRulesTestLanguageParser extends AbstractInternalAntlrPa
// $ANTLR start ruleExistingEnum
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:142:1: ruleExistingEnum returns [Enumerator current=null] : ( ( 'SameName' ) | ( 'overridden' ) | ( 'DifferentLiteral' ) ) ;
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:167:1: ruleExistingEnum returns [Enumerator current=null] : ( ( 'SameName' ) | ( 'overridden' ) | ( 'DifferentLiteral' ) ) ;
public final Enumerator ruleExistingEnum() throws RecognitionException {
Enumerator current = null;
setCurrentLookahead(); resetLookahead();
try {
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:146:6: ( ( ( 'SameName' ) | ( 'overridden' ) | ( 'DifferentLiteral' ) ) )
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:147:1: ( ( 'SameName' ) | ( 'overridden' ) | ( 'DifferentLiteral' ) )
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:171:6: ( ( ( 'SameName' ) | ( 'overridden' ) | ( 'DifferentLiteral' ) ) )
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:172:1: ( ( 'SameName' ) | ( 'overridden' ) | ( 'DifferentLiteral' ) )
{
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:147:1: ( ( 'SameName' ) | ( 'overridden' ) | ( 'DifferentLiteral' ) )
- int alt2=3;
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:172:1: ( ( 'SameName' ) | ( 'overridden' ) | ( 'DifferentLiteral' ) )
+ int alt3=3;
switch ( input.LA(1) ) {
case 13:
{
- alt2=1;
+ alt3=1;
}
break;
case 14:
{
- alt2=2;
+ alt3=2;
}
break;
case 15:
{
- alt2=3;
+ alt3=3;
}
break;
default:
NoViableAltException nvae =
- new NoViableAltException("147:1: ( ( 'SameName' ) | ( 'overridden' ) | ( 'DifferentLiteral' ) )", 2, 0, input);
+ new NoViableAltException("172:1: ( ( 'SameName' ) | ( 'overridden' ) | ( 'DifferentLiteral' ) )", 3, 0, input);
throw nvae;
}
- switch (alt2) {
+ switch (alt3) {
case 1 :
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:147:2: ( 'SameName' )
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:172:2: ( 'SameName' )
{
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:147:2: ( 'SameName' )
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:147:4: 'SameName'
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:172:2: ( 'SameName' )
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:172:4: 'SameName'
{
- match(input,13,FOLLOW_13_in_ruleExistingEnum257);
+ match(input,13,FOLLOW_13_in_ruleExistingEnum307);
current = grammarAccess.getExistingEnumAccess().getSameNameEnumLiteralDeclaration_0().getEnumLiteral().getInstance();
createLeafNode(grammarAccess.getExistingEnumAccess().getSameNameEnumLiteralDeclaration_0(), null);
@@ -293,12 +342,12 @@ public class InternalEnumRulesTestLanguageParser extends AbstractInternalAntlrPa
}
break;
case 2 :
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:153:6: ( 'overridden' )
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:178:6: ( 'overridden' )
{
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:153:6: ( 'overridden' )
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:153:8: 'overridden'
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:178:6: ( 'overridden' )
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:178:8: 'overridden'
{
- match(input,14,FOLLOW_14_in_ruleExistingEnum272);
+ match(input,14,FOLLOW_14_in_ruleExistingEnum322);
current = grammarAccess.getExistingEnumAccess().getOverriddenLiteralEnumLiteralDeclaration_1().getEnumLiteral().getInstance();
createLeafNode(grammarAccess.getExistingEnumAccess().getOverriddenLiteralEnumLiteralDeclaration_1(), null);
@@ -310,12 +359,12 @@ public class InternalEnumRulesTestLanguageParser extends AbstractInternalAntlrPa
}
break;
case 3 :
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:159:6: ( 'DifferentLiteral' )
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:184:6: ( 'DifferentLiteral' )
{
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:159:6: ( 'DifferentLiteral' )
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:159:8: 'DifferentLiteral'
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:184:6: ( 'DifferentLiteral' )
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:184:8: 'DifferentLiteral'
{
- match(input,15,FOLLOW_15_in_ruleExistingEnum287);
+ match(input,15,FOLLOW_15_in_ruleExistingEnum337);
current = grammarAccess.getExistingEnumAccess().getDifferentNameEnumLiteralDeclaration_2().getEnumLiteral().getInstance();
createLeafNode(grammarAccess.getExistingEnumAccess().getDifferentNameEnumLiteralDeclaration_2(), null);
@@ -349,39 +398,39 @@ public class InternalEnumRulesTestLanguageParser extends AbstractInternalAntlrPa
// $ANTLR start ruleGeneratedEnum
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:169:1: ruleGeneratedEnum returns [Enumerator current=null] : ( ( 'SameName' ) | ( 'DifferentLiteral' ) ) ;
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:194:1: ruleGeneratedEnum returns [Enumerator current=null] : ( ( 'SameName' ) | ( 'DifferentLiteral' ) ) ;
public final Enumerator ruleGeneratedEnum() throws RecognitionException {
Enumerator current = null;
setCurrentLookahead(); resetLookahead();
try {
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:173:6: ( ( ( 'SameName' ) | ( 'DifferentLiteral' ) ) )
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:174:1: ( ( 'SameName' ) | ( 'DifferentLiteral' ) )
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:198:6: ( ( ( 'SameName' ) | ( 'DifferentLiteral' ) ) )
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:199:1: ( ( 'SameName' ) | ( 'DifferentLiteral' ) )
{
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:174:1: ( ( 'SameName' ) | ( 'DifferentLiteral' ) )
- int alt3=2;
- int LA3_0 = input.LA(1);
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:199:1: ( ( 'SameName' ) | ( 'DifferentLiteral' ) )
+ int alt4=2;
+ int LA4_0 = input.LA(1);
- if ( (LA3_0==13) ) {
- alt3=1;
+ if ( (LA4_0==13) ) {
+ alt4=1;
}
- else if ( (LA3_0==15) ) {
- alt3=2;
+ else if ( (LA4_0==15) ) {
+ alt4=2;
}
else {
NoViableAltException nvae =
- new NoViableAltException("174:1: ( ( 'SameName' ) | ( 'DifferentLiteral' ) )", 3, 0, input);
+ new NoViableAltException("199:1: ( ( 'SameName' ) | ( 'DifferentLiteral' ) )", 4, 0, input);
throw nvae;
}
- switch (alt3) {
+ switch (alt4) {
case 1 :
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:174:2: ( 'SameName' )
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:199:2: ( 'SameName' )
{
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:174:2: ( 'SameName' )
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:174:4: 'SameName'
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:199:2: ( 'SameName' )
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:199:4: 'SameName'
{
- match(input,13,FOLLOW_13_in_ruleGeneratedEnum330);
+ match(input,13,FOLLOW_13_in_ruleGeneratedEnum380);
current = grammarAccess.getGeneratedEnumAccess().getSameNameEnumLiteralDeclaration_0().getEnumLiteral().getInstance();
createLeafNode(grammarAccess.getGeneratedEnumAccess().getSameNameEnumLiteralDeclaration_0(), null);
@@ -393,12 +442,12 @@ public class InternalEnumRulesTestLanguageParser extends AbstractInternalAntlrPa
}
break;
case 2 :
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:180:6: ( 'DifferentLiteral' )
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:205:6: ( 'DifferentLiteral' )
{
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:180:6: ( 'DifferentLiteral' )
- // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:180:8: 'DifferentLiteral'
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:205:6: ( 'DifferentLiteral' )
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:205:8: 'DifferentLiteral'
{
- match(input,15,FOLLOW_15_in_ruleGeneratedEnum345);
+ match(input,15,FOLLOW_15_in_ruleGeneratedEnum395);
current = grammarAccess.getGeneratedEnumAccess().getDifferentNameEnumLiteralDeclaration_1().getEnumLiteral().getInstance();
createLeafNode(grammarAccess.getGeneratedEnumAccess().getDifferentNameEnumLiteralDeclaration_1(), null);
@@ -436,13 +485,15 @@ public class InternalEnumRulesTestLanguageParser extends AbstractInternalAntlrPa
public static final BitSet FOLLOW_ruleModel_in_entryRuleModel71 = new BitSet(new long[]{0x0000000000000000L});
public static final BitSet FOLLOW_EOF_in_entryRuleModel81 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_11_in_ruleModel116 = new BitSet(new long[]{0x000000000000E000L});
- public static final BitSet FOLLOW_ruleExistingEnum_in_ruleModel150 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_12_in_ruleModel171 = new BitSet(new long[]{0x000000000000A000L});
- public static final BitSet FOLLOW_ruleGeneratedEnum_in_ruleModel205 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_13_in_ruleExistingEnum257 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_14_in_ruleExistingEnum272 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_15_in_ruleExistingEnum287 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_13_in_ruleGeneratedEnum330 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_15_in_ruleGeneratedEnum345 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_ruleExistingEnum_in_ruleModel150 = new BitSet(new long[]{0x0000000000001002L});
+ public static final BitSet FOLLOW_12_in_ruleModel164 = new BitSet(new long[]{0x000000000000A000L});
+ public static final BitSet FOLLOW_ruleGeneratedEnum_in_ruleModel198 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_12_in_ruleModel221 = new BitSet(new long[]{0x000000000000A000L});
+ public static final BitSet FOLLOW_ruleGeneratedEnum_in_ruleModel255 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_13_in_ruleExistingEnum307 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_14_in_ruleExistingEnum322 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_15_in_ruleExistingEnum337 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_13_in_ruleGeneratedEnum380 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_15_in_ruleGeneratedEnum395 = 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/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage__.g b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage__.g
index 83ebe85..7f852dd 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage__.g
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage__.g
@@ -13,25 +13,25 @@ T13 : 'SameName' ;
T14 : 'overridden' ;
T15 : 'DifferentLiteral' ;
-// $ANTLR src "../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g" 189
+// $ANTLR src "../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g" 214
RULE_ID : '^'? ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'_'|'0'..'9')*;
-// $ANTLR src "../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g" 191
+// $ANTLR src "../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g" 216
RULE_INT : ('0'..'9')+;
-// $ANTLR src "../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g" 193
+// $ANTLR src "../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g" 218
RULE_STRING : ('\"' ('\\' ('b'|'t'|'n'|'f'|'r'|'\"'|'\''|'\\')|~(('\\'|'\"')))* '\"'|'\'' ('\\' ('b'|'t'|'n'|'f'|'r'|'\"'|'\''|'\\')|~(('\\'|'\'')))* '\'');
-// $ANTLR src "../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g" 195
+// $ANTLR src "../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g" 220
RULE_ML_COMMENT : '/*' ( options {greedy=false;} : . )*'*/';
-// $ANTLR src "../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g" 197
+// $ANTLR src "../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g" 222
RULE_SL_COMMENT : '//' ~(('\n'|'\r'))* ('\r'? '\n')?;
-// $ANTLR src "../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g" 199
+// $ANTLR src "../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g" 224
RULE_WS : (' '|'\t'|'\r'|'\n')+;
-// $ANTLR src "../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g" 201
+// $ANTLR src "../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g" 226
RULE_ANY_OTHER : .;
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/packrat/EnumRulesTestLanguageParserConfiguration.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/packrat/EnumRulesTestLanguageParserConfiguration.java
index 177d350..a43b665 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/packrat/EnumRulesTestLanguageParserConfiguration.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/packrat/EnumRulesTestLanguageParserConfiguration.java
@@ -71,6 +71,7 @@ public class EnumRulesTestLanguageParserConfiguration extends AbstractParserConf
getModelConsumer().setGeneratedEnumConsumer(getGeneratedEnumConsumer());
getModelConsumer().setKeyword$7$Delimiter(org.eclipse.xtext.enumrules.parser.packrat.EnumRulesTestLanguageDelimiters.keyword$6$Delimiter);
+ getModelConsumer().setKeyword$11$Delimiter(org.eclipse.xtext.enumrules.parser.packrat.EnumRulesTestLanguageDelimiters.keyword$6$Delimiter);
getModelConsumer().setKeyword$3$Delimiter(org.eclipse.xtext.enumrules.parser.packrat.EnumRulesTestLanguageDelimiters.keyword$6$Delimiter);
}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/packrat/consumers/EnumRulesTestLanguageModelConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/packrat/consumers/EnumRulesTestLanguageModelConsumer.java
index 56f9bd2..fc463c3 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/packrat/consumers/EnumRulesTestLanguageModelConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/parser/packrat/consumers/EnumRulesTestLanguageModelConsumer.java
@@ -47,8 +47,18 @@ public final class EnumRulesTestLanguageModelConsumer extends NonTerminalConsume
private IElementConsumer ruleCall$9$Consumer;
+ private IElementConsumer group$10$Consumer;
+
+ private IElementConsumer keyword$11$Consumer;
+
+ private IElementConsumer assignment$12$Consumer;
+
+ private IElementConsumer ruleCall$13$Consumer;
+
private ICharacterClass keyword$7$Delimiter;
+ private ICharacterClass keyword$11$Delimiter;
+
private ICharacterClass keyword$3$Delimiter;
protected class Alternatives$1$Consumer extends AlternativesConsumer {
@@ -60,7 +70,7 @@ public final class EnumRulesTestLanguageModelConsumer extends NonTerminalConsume
@Override
protected void doGetConsumers(ConsumerAcceptor acceptor) {
acceptor.accept(group$2$Consumer);
- acceptor.accept(group$6$Consumer);
+ acceptor.accept(group$10$Consumer);
}
}
@@ -74,6 +84,7 @@ public final class EnumRulesTestLanguageModelConsumer extends NonTerminalConsume
protected void doGetConsumers(ConsumerAcceptor acceptor) {
acceptor.accept(keyword$3$Consumer);
acceptor.accept(assignment$4$Consumer);
+ acceptor.accept(group$6$Consumer);
}
}
@@ -113,7 +124,7 @@ public final class EnumRulesTestLanguageModelConsumer extends NonTerminalConsume
}
}
- protected class Group$6$Consumer extends GroupConsumer {
+ protected class Group$6$Consumer extends OptionalGroupConsumer {
protected Group$6$Consumer(final Group group) {
super(group);
@@ -162,9 +173,59 @@ public final class EnumRulesTestLanguageModelConsumer extends NonTerminalConsume
}
}
+ protected class Group$10$Consumer extends GroupConsumer {
+
+ protected Group$10$Consumer(final Group group) {
+ super(group);
+ }
+
+ @Override
+ protected void doGetConsumers(ConsumerAcceptor acceptor) {
+ acceptor.accept(keyword$11$Consumer);
+ acceptor.accept(assignment$12$Consumer);
+ }
+ }
+
+ protected class Keyword$11$Consumer extends ElementConsumer<Keyword> {
+
+ protected Keyword$11$Consumer(final Keyword keyword) {
+ super(keyword);
+ }
+
+ @Override
+ protected int doConsume(boolean optional) throws Exception {
+ return consumeKeyword(getElement(), null, false, false, getKeyword$11$Delimiter(), optional);
+ }
+ }
+
+ protected class Assignment$12$Consumer extends AssignmentConsumer {
+
+ protected Assignment$12$Consumer(final Assignment assignment) {
+ super(assignment);
+ }
+
+ @Override
+ protected IElementConsumer getConsumer() {
+ return ruleCall$13$Consumer;
+ }
+ }
+
+ protected class RuleCall$13$Consumer extends ElementConsumer<RuleCall> {
+
+ protected RuleCall$13$Consumer(final RuleCall ruleCall) {
+ super(ruleCall);
+ }
+
+ @Override
+ protected int doConsume(boolean optional) throws Exception {
+ return consumeNonTerminal(generatedEnumConsumer, "generated", false, false, false, getElement(), optional);
+ }
+ }
+
public EnumRulesTestLanguageModelConsumer(INonTerminalConsumerConfiguration configuration, ITerminalConsumer[] hiddenTokens) {
super(configuration, hiddenTokens);
keyword$7$Delimiter = ICharacterClass.Factory.nullClass();
+ keyword$11$Delimiter = ICharacterClass.Factory.nullClass();
keyword$3$Delimiter = ICharacterClass.Factory.nullClass();
}
@@ -185,10 +246,14 @@ public final class EnumRulesTestLanguageModelConsumer extends NonTerminalConsume
keyword$3$Consumer = new Keyword$3$Consumer(rule.getExistingKeyword_0_0());
assignment$4$Consumer = new Assignment$4$Consumer(rule.getExistingAssignment_0_1());
ruleCall$5$Consumer = new RuleCall$5$Consumer(rule.getExistingExistingEnumEnumRuleCall_0_1_0());
- group$6$Consumer = new Group$6$Consumer(rule.getGroup_1());
- keyword$7$Consumer = new Keyword$7$Consumer(rule.getGeneratedKeyword_1_0());
- assignment$8$Consumer = new Assignment$8$Consumer(rule.getGeneratedAssignment_1_1());
- ruleCall$9$Consumer = new RuleCall$9$Consumer(rule.getGeneratedGeneratedEnumEnumRuleCall_1_1_0());
+ group$6$Consumer = new Group$6$Consumer(rule.getGroup_0_2());
+ keyword$7$Consumer = new Keyword$7$Consumer(rule.getGeneratedKeyword_0_2_0());
+ assignment$8$Consumer = new Assignment$8$Consumer(rule.getGeneratedAssignment_0_2_1());
+ ruleCall$9$Consumer = new RuleCall$9$Consumer(rule.getGeneratedGeneratedEnumEnumRuleCall_0_2_1_0());
+ group$10$Consumer = new Group$10$Consumer(rule.getGroup_1());
+ keyword$11$Consumer = new Keyword$11$Consumer(rule.getGeneratedKeyword_1_0());
+ assignment$12$Consumer = new Assignment$12$Consumer(rule.getGeneratedAssignment_1_1());
+ ruleCall$13$Consumer = new RuleCall$13$Consumer(rule.getGeneratedGeneratedEnumEnumRuleCall_1_1_0());
}
@Override
@@ -217,6 +282,14 @@ public final class EnumRulesTestLanguageModelConsumer extends NonTerminalConsume
keyword$7$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$3$Delimiter() {
return keyword$3$Delimiter;
}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/services/EnumRulesTestLanguageGrammarAccess.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/services/EnumRulesTestLanguageGrammarAccess.java
index 909f661..c03df87 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/services/EnumRulesTestLanguageGrammarAccess.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/enumrules/services/EnumRulesTestLanguageGrammarAccess.java
@@ -24,19 +24,23 @@ public class EnumRulesTestLanguageGrammarAccess implements IGrammarAccess {
private final Keyword cExistingKeyword_0_0 = (Keyword)cGroup_0.eContents().get(0);
private final Assignment cExistingAssignment_0_1 = (Assignment)cGroup_0.eContents().get(1);
private final RuleCall cExistingExistingEnumEnumRuleCall_0_1_0 = (RuleCall)cExistingAssignment_0_1.eContents().get(0);
+ private final Group cGroup_0_2 = (Group)cGroup_0.eContents().get(2);
+ private final Keyword cGeneratedKeyword_0_2_0 = (Keyword)cGroup_0_2.eContents().get(0);
+ private final Assignment cGeneratedAssignment_0_2_1 = (Assignment)cGroup_0_2.eContents().get(1);
+ private final RuleCall cGeneratedGeneratedEnumEnumRuleCall_0_2_1_0 = (RuleCall)cGeneratedAssignment_0_2_1.eContents().get(0);
private final Group cGroup_1 = (Group)cAlternatives.eContents().get(1);
private final Keyword cGeneratedKeyword_1_0 = (Keyword)cGroup_1.eContents().get(0);
private final Assignment cGeneratedAssignment_1_1 = (Assignment)cGroup_1.eContents().get(1);
private final RuleCall cGeneratedGeneratedEnumEnumRuleCall_1_1_0 = (RuleCall)cGeneratedAssignment_1_1.eContents().get(0);
//Model:
- // "existing" existing=ExistingEnum|"generated" generated=GeneratedEnum;
+ // "existing" existing=ExistingEnum ("generated" generated=GeneratedEnum)?|"generated" generated=GeneratedEnum;
public ParserRule getRule() { return rule; }
- //"existing" existing=ExistingEnum|"generated" generated=GeneratedEnum
+ //"existing" existing=ExistingEnum ("generated" generated=GeneratedEnum)?|"generated" generated=GeneratedEnum
public Alternatives getAlternatives() { return cAlternatives; }
- //"existing" existing=ExistingEnum
+ //"existing" existing=ExistingEnum ("generated" generated=GeneratedEnum)?
public Group getGroup_0() { return cGroup_0; }
//"existing"
@@ -48,6 +52,18 @@ public class EnumRulesTestLanguageGrammarAccess implements IGrammarAccess {
//ExistingEnum
public RuleCall getExistingExistingEnumEnumRuleCall_0_1_0() { return cExistingExistingEnumEnumRuleCall_0_1_0; }
+ //("generated" generated=GeneratedEnum)?
+ public Group getGroup_0_2() { return cGroup_0_2; }
+
+ //"generated"
+ public Keyword getGeneratedKeyword_0_2_0() { return cGeneratedKeyword_0_2_0; }
+
+ //generated=GeneratedEnum
+ public Assignment getGeneratedAssignment_0_2_1() { return cGeneratedAssignment_0_2_1; }
+
+ //GeneratedEnum
+ public RuleCall getGeneratedGeneratedEnumEnumRuleCall_0_2_1_0() { return cGeneratedGeneratedEnumEnumRuleCall_0_2_1_0; }
+
//"generated" generated=GeneratedEnum
public Group getGroup_1() { return cGroup_1; }
@@ -150,7 +166,7 @@ public class EnumRulesTestLanguageGrammarAccess implements IGrammarAccess {
//Model:
- // "existing" existing=ExistingEnum|"generated" generated=GeneratedEnum;
+ // "existing" existing=ExistingEnum ("generated" generated=GeneratedEnum)?|"generated" generated=GeneratedEnum;
public ModelElements getModelAccess() {
return (pModel != null) ? pModel : (pModel = new ModelElements());
}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/AbstractSerializationBug269362TestLanguageRuntimeModule.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/AbstractSerializationBug269362TestLanguageRuntimeModule.java
new file mode 100644
index 0000000..0a8bbb6
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/AbstractSerializationBug269362TestLanguageRuntimeModule.java
@@ -0,0 +1,86 @@
+
+/*
+ * generated by Xtext
+ */
+package org.eclipse.xtext.parsetree.reconstr;
+
+import org.eclipse.xtext.Constants;
+import org.eclipse.xtext.service.DefaultRuntimeModule;
+
+import com.google.inject.Binder;
+import com.google.inject.name.Names;
+
+/**
+ * Manual modifications go to {org.eclipse.xtext.parsetree.reconstr.SerializationBug269362TestLanguageRuntimeModule}
+ */
+public abstract class AbstractSerializationBug269362TestLanguageRuntimeModule extends DefaultRuntimeModule {
+
+ @Override
+ public void configure(Binder binder) {
+ super.configure(binder);
+ binder.bind(String.class).annotatedWith(Names.named(Constants.LANGUAGE_NAME)).toInstance(
+ "org.eclipse.xtext.parsetree.reconstr.SerializationBug269362TestLanguage");
+ }
+
+
+
+ public Class<? extends org.eclipse.xtext.IGrammarAccess> bindIGrammarAccess() {
+ return org.eclipse.xtext.parsetree.reconstr.services.SerializationBug269362TestLanguageGrammarAccess.class;
+ }
+
+
+ public Class<? extends org.eclipse.xtext.parser.packrat.IPackratParser> bindIPackratParser() {
+ return org.eclipse.xtext.parsetree.reconstr.parser.packrat.SerializationBug269362TestLanguagePackratParser.class;
+ }
+
+
+ public Class<? extends org.eclipse.xtext.parsetree.reconstr.IParseTreeConstructor> bindIParseTreeConstructor() {
+ return org.eclipse.xtext.parsetree.reconstr.parseTreeConstruction.SerializationBug269362TestLanguageParsetreeConstructor.class;
+ }
+
+ @org.eclipse.xtext.service.SingletonBinding
+ public Class<? extends org.eclipse.xtend.expression.ExecutionContext> bindExecutionContext() {
+ return org.eclipse.xtext.xtend.InjectableExecutionContext.class;
+ }
+
+ @org.eclipse.xtext.service.SingletonBinding
+ public Class<? extends org.eclipse.xtend.expression.ResourceManager> bindResourceManager() {
+ return org.eclipse.xtext.xtend.InjectableResourceManager.class;
+ }
+
+ @org.eclipse.xtext.service.SingletonBinding(eager=true)
+ public Class<? extends org.eclipse.xtext.parsetree.reconstr.SerializationBug269362TestLanguageCheckValidator> bindSerializationBug269362TestLanguageCheckValidator() {
+ return org.eclipse.xtext.parsetree.reconstr.SerializationBug269362TestLanguageCheckValidator.class;
+ }
+
+
+ public java.lang.ClassLoader bindClassLoader() {
+ return getClass().getClassLoader();
+ }
+
+
+ public Class<? extends org.eclipse.xtext.parser.antlr.IAntlrParser> bindIAntlrParser() {
+ return org.eclipse.xtext.parsetree.reconstr.parser.antlr.SerializationBug269362TestLanguageParser.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.parsetree.reconstr.parser.antlr.SerializationBug269362TestLanguageAntlrTokenFileProvider.class;
+ }
+
+
+ public Class<? extends org.eclipse.xtext.parser.antlr.Lexer> bindLexer() {
+ return org.eclipse.xtext.parsetree.reconstr.parser.antlr.internal.InternalSerializationBug269362TestLanguageLexer.class;
+ }
+
+
+ public Class<? extends org.eclipse.xtext.parser.antlr.ITokenDefProvider> bindITokenDefProvider() {
+ return org.eclipse.xtext.parser.antlr.AntlrTokenDefProvider.class;
+ }
+
+}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/SerializationBug269362TestLanguage.ecore b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/SerializationBug269362TestLanguage.ecore
new file mode 100644
index 0000000..f489e5f
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/SerializationBug269362TestLanguage.ecore
@@ -0,0 +1,11 @@
+<?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="serializationBug269362TestLanguage" nsURI="http://www.eclipse.org/2009/tmf/xtext/SerializationBugTest/269362" nsPrefix="serializationBug269362TestLanguage">
+ <eClassifiers xsi:type="ecore:EClass" name="Model">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="foo">
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="bar">
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eStructuralFeatures>
+ </eClassifiers>
+</ecore:EPackage>
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/SerializationBug269362TestLanguage.genmodel b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/SerializationBug269362TestLanguage.genmodel
new file mode 100644
index 0000000..e75951d
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/SerializationBug269362TestLanguage.genmodel
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="ASCII"?>
+<genmodel:GenModel 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:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="../org.eclipse.xtext.generator.tests/src-gen" forceOverwrite="true" rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container" bundleManifest="false" complianceLevel="5.0" copyrightFields="false">
+ <genPackages prefix="SerializationBug269362TestLanguage" basePackage="org.eclipse.xtext.parsetree.reconstr" disposableProviderFactory="true">
+ <ecorePackage href="SerializationBug269362TestLanguage.ecore#/"/>
+ <genClasses>
+ <ecoreClass href="SerializationBug269362TestLanguage.ecore#//Model"/>
+ <genFeatures createChild="false">
+ <ecoreFeature xsi:type="ecore:EAttribute" href="SerializationBug269362TestLanguage.ecore#//Model/foo"/>
+ </genFeatures>
+ <genFeatures createChild="false">
+ <ecoreFeature xsi:type="ecore:EAttribute" href="SerializationBug269362TestLanguage.ecore#//Model/bar"/>
+ </genFeatures>
+ </genClasses>
+ </genPackages>
+</genmodel:GenModel>
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/SerializationBug269362TestLanguage.xmi b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/SerializationBug269362TestLanguage.xmi
new file mode 100644
index 0000000..0d9b67e
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/SerializationBug269362TestLanguage.xmi
@@ -0,0 +1,184 @@
+<?xml version="1.0" encoding="ASCII"?>
+<xmi:XMI 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">
+ <xtext:Grammar name="org.eclipse.xtext.parsetree.reconstr.SerializationBug269362TestLanguage" usedGrammars="/1">
+ <metamodelDeclarations xsi:type="xtext:GeneratedMetamodel" name="serializationBug269362TestLanguage">
+ <ePackage href="http://www.eclipse.org/2009/tmf/xtext/SerializationBugTest/269362#/"/>
+ </metamodelDeclarations>
+ <rules xsi:type="xtext:ParserRule" name="Model">
+ <type metamodel="/0/@metamodelDeclarations.0">
+ <classifier xsi:type="ecore:EClass" href="http://www.eclipse.org/2009/tmf/xtext/SerializationBugTest/269362#//Model"/>
+ </type>
+ <alternatives xsi:type="xtext:Alternatives">
+ <groups xsi:type="xtext:Group">
+ <tokens xsi:type="xtext:Keyword" value="foo"/>
+ <tokens xsi:type="xtext:Assignment" feature="foo" operator="=">
+ <terminal xsi:type="xtext:RuleCall" rule="/1/@rules.0"/>
+ </tokens>
+ <tokens xsi:type="xtext:Group" cardinality="?">
+ <tokens xsi:type="xtext:Keyword" value="bar"/>
+ <tokens xsi:type="xtext:Assignment" feature="bar" operator="=">
+ <terminal xsi:type="xtext:RuleCall" rule="/1/@rules.0"/>
+ </tokens>
+ </tokens>
+ </groups>
+ <groups xsi:type="xtext:Group">
+ <tokens xsi:type="xtext:Keyword" value="bar"/>
+ <tokens xsi:type="xtext:Assignment" feature="bar" operator="=">
+ <terminal xsi:type="xtext:RuleCall" rule="/1/@rules.0"/>
+ </tokens>
+ </groups>
+ </alternatives>
+ </rules>
+ </xtext:Grammar>
+ <xtext:Grammar name="org.eclipse.xtext.common.Terminals" definesHiddenTokens="true" hiddenTokens="/1/@rules.5 /1/@rules.3 /1/@rules.4">
+ <metamodelDeclarations xsi:type="xtext:ReferencedMetamodel" alias="ecore">
+ <ePackage href="http://www.eclipse.org/emf/2002/Ecore#/"/>
+ </metamodelDeclarations>
+ <rules xsi:type="xtext:TerminalRule" name="ID">
+ <type metamodel="/1/@metamodelDeclarations.0">
+ <classifier xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </type>
+ <alternatives xsi:type="xtext:Group">
+ <tokens xsi:type="xtext:Keyword" cardinality="?" value="^"/>
+ <tokens xsi:type="xtext:Alternatives">
+ <groups xsi:type="xtext:CharacterRange">
+ <left value="a"/>
+ <right value="z"/>
+ </groups>
+ <groups xsi:type="xtext:CharacterRange">
+ <left value="A"/>
+ <right value="Z"/>
+ </groups>
+ <groups xsi:type="xtext:Keyword" value="_"/>
+ </tokens>
+ <tokens xsi:type="xtext:Alternatives" cardinality="*">
+ <groups xsi:type="xtext:CharacterRange">
+ <left value="a"/>
+ <right value="z"/>
+ </groups>
+ <groups xsi:type="xtext:CharacterRange">
+ <left value="A"/>
+ <right value="Z"/>
+ </groups>
+ <groups xsi:type="xtext:Keyword" value="_"/>
+ <groups xsi:type="xtext:CharacterRange">
+ <left value="0"/>
+ <right value="9"/>
+ </groups>
+ </tokens>
+ </alternatives>
+ </rules>
+ <rules xsi:type="xtext:TerminalRule" name="INT">
+ <type metamodel="/1/@metamodelDeclarations.0">
+ <classifier xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ </type>
+ <alternatives xsi:type="xtext:CharacterRange" cardinality="+">
+ <left value="0"/>
+ <right value="9"/>
+ </alternatives>
+ </rules>
+ <rules xsi:type="xtext:TerminalRule" name="STRING">
+ <type metamodel="/1/@metamodelDeclarations.0">
+ <classifier xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </type>
+ <alternatives xsi:type="xtext:Alternatives">
+ <groups xsi:type="xtext:Group">
+ <tokens xsi:type="xtext:Keyword" value="&quot;"/>
+ <tokens xsi:type="xtext:Alternatives" cardinality="*">
+ <groups xsi:type="xtext:Group">
+ <tokens xsi:type="xtext:Keyword" value="\"/>
+ <tokens xsi:type="xtext:Alternatives">
+ <groups xsi:type="xtext:Keyword" value="b"/>
+ <groups xsi:type="xtext:Keyword" value="t"/>
+ <groups xsi:type="xtext:Keyword" value="n"/>
+ <groups xsi:type="xtext:Keyword" value="f"/>
+ <groups xsi:type="xtext:Keyword" value="r"/>
+ <groups xsi:type="xtext:Keyword" value="&quot;"/>
+ <groups xsi:type="xtext:Keyword" value="'"/>
+ <groups xsi:type="xtext:Keyword" value="\"/>
+ </tokens>
+ </groups>
+ <groups xsi:type="xtext:NegatedToken">
+ <terminal xsi:type="xtext:Alternatives">
+ <groups xsi:type="xtext:Keyword" value="\"/>
+ <groups xsi:type="xtext:Keyword" value="&quot;"/>
+ </terminal>
+ </groups>
+ </tokens>
+ <tokens xsi:type="xtext:Keyword" value="&quot;"/>
+ </groups>
+ <groups xsi:type="xtext:Group">
+ <tokens xsi:type="xtext:Keyword" value="'"/>
+ <tokens xsi:type="xtext:Alternatives" cardinality="*">
+ <groups xsi:type="xtext:Group">
+ <tokens xsi:type="xtext:Keyword" value="\"/>
+ <tokens xsi:type="xtext:Alternatives">
+ <groups xsi:type="xtext:Keyword" value="b"/>
+ <groups xsi:type="xtext:Keyword" value="t"/>
+ <groups xsi:type="xtext:Keyword" value="n"/>
+ <groups xsi:type="xtext:Keyword" value="f"/>
+ <groups xsi:type="xtext:Keyword" value="r"/>
+ <groups xsi:type="xtext:Keyword" value="&quot;"/>
+ <groups xsi:type="xtext:Keyword" value="'"/>
+ <groups xsi:type="xtext:Keyword" value="\"/>
+ </tokens>
+ </groups>
+ <groups xsi:type="xtext:NegatedToken">
+ <terminal xsi:type="xtext:Alternatives">
+ <groups xsi:type="xtext:Keyword" value="\"/>
+ <groups xsi:type="xtext:Keyword" value="'"/>
+ </terminal>
+ </groups>
+ </tokens>
+ <tokens xsi:type="xtext:Keyword" value="'"/>
+ </groups>
+ </alternatives>
+ </rules>
+ <rules xsi:type="xtext:TerminalRule" name="ML_COMMENT">
+ <type metamodel="/1/@metamodelDeclarations.0">
+ <classifier xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </type>
+ <alternatives xsi:type="xtext:Group">
+ <tokens xsi:type="xtext:Keyword" value="/*"/>
+ <tokens xsi:type="xtext:UntilToken">
+ <terminal xsi:type="xtext:Keyword" value="*/"/>
+ </tokens>
+ </alternatives>
+ </rules>
+ <rules xsi:type="xtext:TerminalRule" name="SL_COMMENT">
+ <type metamodel="/1/@metamodelDeclarations.0">
+ <classifier xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </type>
+ <alternatives xsi:type="xtext:Group">
+ <tokens xsi:type="xtext:Keyword" value="//"/>
+ <tokens xsi:type="xtext:NegatedToken" cardinality="*">
+ <terminal xsi:type="xtext:Alternatives">
+ <groups xsi:type="xtext:Keyword" value="&#xA;"/>
+ <groups xsi:type="xtext:Keyword" value="&#xD;"/>
+ </terminal>
+ </tokens>
+ <tokens xsi:type="xtext:Group" cardinality="?">
+ <tokens xsi:type="xtext:Keyword" cardinality="?" value="&#xD;"/>
+ <tokens xsi:type="xtext:Keyword" value="&#xA;"/>
+ </tokens>
+ </alternatives>
+ </rules>
+ <rules xsi:type="xtext:TerminalRule" name="WS">
+ <type metamodel="/1/@metamodelDeclarations.0">
+ <classifier xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </type>
+ <alternatives xsi:type="xtext:Alternatives" cardinality="+">
+ <groups xsi:type="xtext:Keyword" value=" "/>
+ <groups xsi:type="xtext:Keyword" value="&#x9;"/>
+ <groups xsi:type="xtext:Keyword" value="&#xD;"/>
+ <groups xsi:type="xtext:Keyword" value="&#xA;"/>
+ </alternatives>
+ </rules>
+ <rules xsi:type="xtext:TerminalRule" name="ANY_OTHER">
+ <type metamodel="/1/@metamodelDeclarations.0">
+ <classifier xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </type>
+ <alternatives xsi:type="xtext:Wildcard"/>
+ </rules>
+ </xtext:Grammar>
+</xmi:XMI>
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/SerializationBug269362TestLanguageCheckValidator.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/SerializationBug269362TestLanguageCheckValidator.java
new file mode 100644
index 0000000..106654f
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/SerializationBug269362TestLanguageCheckValidator.java
@@ -0,0 +1,24 @@
+
+package org.eclipse.xtext.parsetree.reconstr;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.xtext.validator.CheckType;
+
+public class SerializationBug269362TestLanguageCheckValidator extends org.eclipse.xtext.check.AbstractCheckValidator {
+
+ public SerializationBug269362TestLanguageCheckValidator() {
+ addCheckFile("org::eclipse::xtext::parsetree::reconstr::SerializationBug269362TestLanguageChecks", CheckType.FAST);
+ }
+
+ @Override
+ protected List<? extends EPackage> getEPackages() {
+ List<EPackage> result = new ArrayList<EPackage>();
+
+ result.add(org.eclipse.xtext.parsetree.reconstr.serializationBug269362TestLanguage.SerializationBug269362TestLanguagePackage.eINSTANCE);
+
+ return result;
+ }
+
+}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/SerializationBug269362TestLanguageStandaloneSetup.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/SerializationBug269362TestLanguageStandaloneSetup.java
new file mode 100644
index 0000000..a9111fc
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/SerializationBug269362TestLanguageStandaloneSetup.java
@@ -0,0 +1,44 @@
+package org.eclipse.xtext.parsetree.reconstr;
+
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.xtext.EcoreUtil2;
+import org.eclipse.xtext.ISetup;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.xtext.resource.IResourceFactory;
+
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+
+/**
+ * Generated from StandaloneSetup.xpt!
+ */
+public class SerializationBug269362TestLanguageStandaloneSetup implements ISetup {
+
+ public static void doSetup() {
+ new SerializationBug269362TestLanguageStandaloneSetup().createInjectorAndDoEMFRegistration();
+ }
+
+ public Injector createInjectorAndDoEMFRegistration() {
+ org.eclipse.xtext.common.TerminalsStandaloneSetup.doSetup();
+
+ Injector injector = createInjector();
+ register(injector);
+ return injector;
+ }
+
+ public Injector createInjector() {
+ return Guice.createInjector(new org.eclipse.xtext.parsetree.reconstr.SerializationBug269362TestLanguageRuntimeModule());
+ }
+
+ public void register(Injector injector) {
+ if (!EPackage.Registry.INSTANCE.containsKey("http://www.eclipse.org/2009/tmf/xtext/SerializationBugTest/269362")) {
+ EPackage.Registry.INSTANCE.put("http://www.eclipse.org/2009/tmf/xtext/SerializationBugTest/269362", org.eclipse.xtext.parsetree.reconstr.serializationBug269362TestLanguage.SerializationBug269362TestLanguagePackage.eINSTANCE);
+ }
+ //TODO registration of EValidators should be added here, too
+
+ org.eclipse.xtext.resource.IResourceFactory resourceFactory = injector.getInstance(org.eclipse.xtext.resource.IResourceFactory.class);
+ Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("serializationbug269362testlanguage", resourceFactory);
+
+
+ }
+}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parseTreeConstruction/SerializationBug269362TestLanguageParsetreeConstructor.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parseTreeConstruction/SerializationBug269362TestLanguageParsetreeConstructor.java
new file mode 100644
index 0000000..c955c71
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parseTreeConstruction/SerializationBug269362TestLanguageParsetreeConstructor.java
@@ -0,0 +1,263 @@
+/*
+* generated by Xtext
+*/
+package org.eclipse.xtext.parsetree.reconstr.parseTreeConstruction;
+
+//import org.apache.log4j.Logger;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.xtext.*;
+import org.eclipse.xtext.parsetree.reconstr.IInstanceDescription;
+import org.eclipse.xtext.parsetree.reconstr.impl.AbstractParseTreeConstructor;
+import org.eclipse.xtext.parsetree.reconstr.impl.AbstractParseTreeConstructor.AbstractToken.Solution;
+import org.eclipse.xtext.parsetree.reconstr.services.SerializationBug269362TestLanguageGrammarAccess;
+
+import com.google.inject.Inject;
+
+public class SerializationBug269362TestLanguageParsetreeConstructor extends AbstractParseTreeConstructor {
+
+ @Inject
+ private SerializationBug269362TestLanguageGrammarAccess grammarAccess;
+
+ @Override
+ protected Solution internalSerialize(EObject obj) {
+ IInstanceDescription inst = getDescr(obj);
+ Solution s;
+ if(inst.isInstanceOf(grammarAccess.getModelRule().getType().getClassifier()) && (s = new Model_Alternatives(inst, null).firstSolution()) != null && isConsumed(s,null)) return s;
+ return null;
+ }
+
+
+/************ begin Rule Model ****************
+ *
+ * Model:
+ * "foo" foo=ID ("bar" bar=ID)?|"bar" bar=ID;
+ *
+ **/
+
+// "foo" foo=ID ("bar" bar=ID)?|"bar" bar=ID
+protected class Model_Alternatives extends AlternativesToken {
+
+ public Model_Alternatives(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ @Override
+ public Alternatives getGrammarElement() {
+ return grammarAccess.getModelAccess().getAlternatives();
+ }
+
+ protected AbstractToken createChild(int id) {
+ switch(id) {
+ case 0: return new Model_0_Group(current, this);
+ case 1: return new Model_1_Group(current, this);
+ default: return null;
+ }
+ }
+}
+
+// "foo" foo=ID ("bar" bar=ID)?
+protected class Model_0_Group extends GroupToken {
+
+ public Model_0_Group(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ @Override
+ public Group getGrammarElement() {
+ return grammarAccess.getModelAccess().getGroup_0();
+ }
+
+ @Override
+ protected Solution createSolution() {
+ Solution s1 = new Model_0_2_Group(current, this).firstSolution();
+ while(s1 != null) {
+ Solution s2 = new Model_0_1_Assignment_foo(s1.getCurrent(), s1.getPredecessor()).firstSolution();
+ while(s2 != null) {
+ Solution s3 = new Model_0_0_Keyword_foo(s2.getCurrent(), s2.getPredecessor()).firstSolution();
+ if(s3 != null) {
+ last = s3.getPredecessor();
+ return s3;
+ } else {
+ s2 = s2.getPredecessor().nextSolution(this,s2);
+ }
+ }
+ s1 = s1.getPredecessor().nextSolution(this,s1);
+ }
+ return null;
+ }
+}
+
+// "foo"
+protected class Model_0_0_Keyword_foo extends KeywordToken {
+
+ public Model_0_0_Keyword_foo(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ public Keyword getGrammarElement() {
+ return grammarAccess.getModelAccess().getFooKeyword_0_0();
+ }
+}
+
+// foo=ID
+protected class Model_0_1_Assignment_foo extends AssignmentToken {
+
+ public Model_0_1_Assignment_foo(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ @Override
+ public Assignment getGrammarElement() {
+ return grammarAccess.getModelAccess().getFooAssignment_0_1();
+ }
+
+ @Override
+ protected Solution createSolution() {
+ if((value = current.getConsumable("foo",IS_REQUIRED)) == null) return null;
+ IInstanceDescription obj = current.cloneAndConsume("foo");
+ if(Boolean.TRUE.booleanValue()) { // xtext::RuleCall FIXME: check if value is valid for lexer rule
+ type = AssignmentType.LRC;
+ element = grammarAccess.getModelAccess().getFooIDTerminalRuleCall_0_1_0();
+ return new Solution(obj);
+ }
+ return null;
+ }
+}
+
+// ("bar" bar=ID)?
+protected class Model_0_2_Group extends GroupToken {
+
+ public Model_0_2_Group(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, !IS_REQUIRED);
+ }
+
+ @Override
+ public Group getGrammarElement() {
+ return grammarAccess.getModelAccess().getGroup_0_2();
+ }
+
+ @Override
+ protected Solution createSolution() {
+ Solution s1 = new Model_0_2_1_Assignment_bar(current, this).firstSolution();
+ while(s1 != null) {
+ Solution s2 = new Model_0_2_0_Keyword_bar(s1.getCurrent(), s1.getPredecessor()).firstSolution();
+ if(s2 != null) {
+ last = s2.getPredecessor();
+ return s2;
+ } else {
+ s1 = s1.getPredecessor().nextSolution(this,s1);
+ }
+ }
+ return null;
+ }
+}
+
+// "bar"
+protected class Model_0_2_0_Keyword_bar extends KeywordToken {
+
+ public Model_0_2_0_Keyword_bar(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ public Keyword getGrammarElement() {
+ return grammarAccess.getModelAccess().getBarKeyword_0_2_0();
+ }
+}
+
+// bar=ID
+protected class Model_0_2_1_Assignment_bar extends AssignmentToken {
+
+ public Model_0_2_1_Assignment_bar(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ @Override
+ public Assignment getGrammarElement() {
+ return grammarAccess.getModelAccess().getBarAssignment_0_2_1();
+ }
+
+ @Override
+ protected Solution createSolution() {
+ if((value = current.getConsumable("bar",!IS_REQUIRED)) == null) return null;
+ IInstanceDescription obj = current.cloneAndConsume("bar");
+ if(Boolean.TRUE.booleanValue()) { // xtext::RuleCall FIXME: check if value is valid for lexer rule
+ type = AssignmentType.LRC;
+ element = grammarAccess.getModelAccess().getBarIDTerminalRuleCall_0_2_1_0();
+ return new Solution(obj);
+ }
+ return null;
+ }
+}
+
+
+
+// "bar" bar=ID
+protected class Model_1_Group extends GroupToken {
+
+ public Model_1_Group(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ @Override
+ public Group getGrammarElement() {
+ return grammarAccess.getModelAccess().getGroup_1();
+ }
+
+ @Override
+ protected Solution createSolution() {
+ Solution s1 = new Model_1_1_Assignment_bar(current, this).firstSolution();
+ while(s1 != null) {
+ Solution s2 = new Model_1_0_Keyword_bar(s1.getCurrent(), s1.getPredecessor()).firstSolution();
+ if(s2 != null) {
+ last = s2.getPredecessor();
+ return s2;
+ } else {
+ s1 = s1.getPredecessor().nextSolution(this,s1);
+ }
+ }
+ return null;
+ }
+}
+
+// "bar"
+protected class Model_1_0_Keyword_bar extends KeywordToken {
+
+ public Model_1_0_Keyword_bar(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ public Keyword getGrammarElement() {
+ return grammarAccess.getModelAccess().getBarKeyword_1_0();
+ }
+}
+
+// bar=ID
+protected class Model_1_1_Assignment_bar extends AssignmentToken {
+
+ public Model_1_1_Assignment_bar(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ @Override
+ public Assignment getGrammarElement() {
+ return grammarAccess.getModelAccess().getBarAssignment_1_1();
+ }
+
+ @Override
+ protected Solution createSolution() {
+ if((value = current.getConsumable("bar",IS_REQUIRED)) == null) return null;
+ IInstanceDescription obj = current.cloneAndConsume("bar");
+ if(Boolean.TRUE.booleanValue()) { // xtext::RuleCall FIXME: check if value is valid for lexer rule
+ type = AssignmentType.LRC;
+ element = grammarAccess.getModelAccess().getBarIDTerminalRuleCall_1_1_0();
+ return new Solution(obj);
+ }
+ return null;
+ }
+}
+
+
+
+/************ end Rule Model ****************/
+
+}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/SerializationBug269362TestLanguageAntlrTokenFileProvider.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/SerializationBug269362TestLanguageAntlrTokenFileProvider.java
new file mode 100644
index 0000000..d0e289c
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/SerializationBug269362TestLanguageAntlrTokenFileProvider.java
@@ -0,0 +1,15 @@
+/*
+* generated by Xtext
+*/
+package org.eclipse.xtext.parsetree.reconstr.parser.antlr;
+
+import java.io.InputStream;
+import org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider;
+
+public class SerializationBug269362TestLanguageAntlrTokenFileProvider implements IAntlrTokenFileProvider {
+
+ public InputStream getAntlrTokenFile() {
+ ClassLoader classLoader = getClass().getClassLoader();
+ return classLoader.getResourceAsStream("org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.tokens");
+ }
+}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/SerializationBug269362TestLanguageParser.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/SerializationBug269362TestLanguageParser.java
new file mode 100644
index 0000000..23db77d
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/SerializationBug269362TestLanguageParser.java
@@ -0,0 +1,56 @@
+/*
+* generated by Xtext
+*/
+package org.eclipse.xtext.parsetree.reconstr.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.parsetree.reconstr.parser.antlr.internal.InternalSerializationBug269362TestLanguageLexer;
+import org.eclipse.xtext.parsetree.reconstr.parser.antlr.internal.InternalSerializationBug269362TestLanguageParser;
+
+import org.eclipse.xtext.parsetree.reconstr.services.SerializationBug269362TestLanguageGrammarAccess;
+
+public class SerializationBug269362TestLanguageParser extends org.eclipse.xtext.parser.antlr.AbstractAntlrParser {
+
+ @Inject
+ protected ITokenDefProvider antlrTokenDefProvider;
+
+ @Inject
+ private SerializationBug269362TestLanguageGrammarAccess grammarAccess;
+
+ @Override
+ protected IParseResult parse(String ruleName, ANTLRInputStream in) {
+ org.eclipse.xtext.parsetree.reconstr.parser.antlr.internal.InternalSerializationBug269362TestLanguageLexer lexer = new org.eclipse.xtext.parsetree.reconstr.parser.antlr.internal.InternalSerializationBug269362TestLanguageLexer(in);
+ XtextTokenStream stream = new XtextTokenStream(lexer, antlrTokenDefProvider);
+ stream.setInitialHiddenTokens("RULE_WS", "RULE_ML_COMMENT", "RULE_SL_COMMENT");
+ org.eclipse.xtext.parsetree.reconstr.parser.antlr.internal.InternalSerializationBug269362TestLanguageParser parser = new org.eclipse.xtext.parsetree.reconstr.parser.antlr.internal.InternalSerializationBug269362TestLanguageParser(
+ stream, getElementFactory(), grammarAccess);
+ parser.setTokenTypeMap(antlrTokenDefProvider.getTokenDefMap());
+ try {
+ if(ruleName != null)
+ return parser.parse(ruleName);
+ return parser.parse();
+ } catch (Exception re) {
+ throw new ParseException(re.getMessage(),re);
+ }
+ }
+
+ @Override
+ protected String getDefaultRuleName() {
+ return "Model";
+ }
+
+ public SerializationBug269362TestLanguageGrammarAccess getGrammarAccess() {
+ return this.grammarAccess;
+ }
+
+ public void setGrammarAccess(SerializationBug269362TestLanguageGrammarAccess grammarAccess) {
+ this.grammarAccess = grammarAccess;
+ }
+}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g
new file mode 100644
index 0000000..0ad7e6b
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g
@@ -0,0 +1,176 @@
+/*
+* generated by Xtext
+*/
+grammar InternalSerializationBug269362TestLanguage;
+
+options {
+ superClass=AbstractInternalAntlrParser;
+}
+
+@lexer::header {
+package org.eclipse.xtext.parsetree.reconstr.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.parsetree.reconstr.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.eclipse.xtext.parsetree.reconstr.services.SerializationBug269362TestLanguageGrammarAccess;
+
+}
+
+@parser::members {
+
+ private SerializationBug269362TestLanguageGrammarAccess grammarAccess;
+
+ public InternalSerializationBug269362TestLanguageParser(TokenStream input, IAstFactory factory, SerializationBug269362TestLanguageGrammarAccess grammarAccess) {
+ super(input, factory, grammarAccess.getGrammar());
+ this.grammarAccess = grammarAccess;
+ }
+
+ @Override
+ protected InputStream getTokenFile() {
+ ClassLoader classLoader = getClass().getClassLoader();
+ return classLoader.getResourceAsStream("org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.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(grammarAccess.getModelRule(), currentNode); }
+ iv_ruleModel=ruleModel
+ { $current=$iv_ruleModel.current; }
+ EOF
+;
+
+// Rule Model
+ruleModel returns [EObject current=null]
+ @init { EObject temp=null; setCurrentLookahead(); resetLookahead();
+ }
+ @after { resetLookahead();
+ lastConsumedNode = currentNode;
+ }:
+(('foo'
+ {
+ createLeafNode(grammarAccess.getModelAccess().getFooKeyword_0_0(), null);
+ }
+(
+
+ lv_foo_1= RULE_ID
+ {
+ createLeafNode(grammarAccess.getModelAccess().getFooIDTerminalRuleCall_0_1_0(), "foo");
+ }
+
+ {
+ if ($current==null) {
+ $current = factory.create(grammarAccess.getModelRule().getType().getClassifier());
+ associateNodeWithAstElement(currentNode, $current);
+ }
+
+ try {
+ set($current, "foo", lv_foo_1, "ID", lastConsumedNode);
+ } catch (ValueConverterException vce) {
+ handleValueConverterException(vce);
+ }
+ }
+
+)('bar'
+ {
+ createLeafNode(grammarAccess.getModelAccess().getBarKeyword_0_2_0(), null);
+ }
+(
+
+ lv_bar_3= RULE_ID
+ {
+ createLeafNode(grammarAccess.getModelAccess().getBarIDTerminalRuleCall_0_2_1_0(), "bar");
+ }
+
+ {
+ if ($current==null) {
+ $current = factory.create(grammarAccess.getModelRule().getType().getClassifier());
+ associateNodeWithAstElement(currentNode, $current);
+ }
+
+ try {
+ set($current, "bar", lv_bar_3, "ID", lastConsumedNode);
+ } catch (ValueConverterException vce) {
+ handleValueConverterException(vce);
+ }
+ }
+
+))?)
+ |('bar'
+ {
+ createLeafNode(grammarAccess.getModelAccess().getBarKeyword_1_0(), null);
+ }
+(
+
+ lv_bar_5= RULE_ID
+ {
+ createLeafNode(grammarAccess.getModelAccess().getBarIDTerminalRuleCall_1_1_0(), "bar");
+ }
+
+ {
+ if ($current==null) {
+ $current = factory.create(grammarAccess.getModelRule().getType().getClassifier());
+ associateNodeWithAstElement(currentNode, $current);
+ }
+
+ try {
+ set($current, "bar", lv_bar_5, "ID", lastConsumedNode);
+ } 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;} : . )*'*/';
+
+RULE_SL_COMMENT : '//' ~(('\n'|'\r'))* ('\r'? '\n')?;
+
+RULE_WS : (' '|'\t'|'\r'|'\n')+;
+
+RULE_ANY_OTHER : .;
+
+
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.tokens b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.tokens
new file mode 100644
index 0000000..f6089bb
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.tokens
@@ -0,0 +1,9 @@
+RULE_ML_COMMENT=7
+RULE_ID=4
+RULE_WS=9
+RULE_INT=5
+RULE_STRING=6
+RULE_ANY_OTHER=10
+RULE_SL_COMMENT=8
+'bar'=12
+'foo'=11
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguageLexer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguageLexer.java
new file mode 100644
index 0000000..e7adf1e
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguageLexer.java
@@ -0,0 +1,757 @@
+package org.eclipse.xtext.parsetree.reconstr.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 InternalSerializationBug269362TestLanguageLexer extends Lexer {
+ 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 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=13;
+ public static final int RULE_ANY_OTHER=10;
+ public static final int RULE_SL_COMMENT=8;
+ public InternalSerializationBug269362TestLanguageLexer() {;}
+ public InternalSerializationBug269362TestLanguageLexer(CharStream input) {
+ super(input);
+ }
+ public String getGrammarFileName() { return "../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g"; }
+
+ // $ANTLR start T11
+ public final void mT11() throws RecognitionException {
+ try {
+ int _type = T11;
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:10:5: ( 'foo' )
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:10:7: 'foo'
+ {
+ match("foo");
+
+
+ }
+
+ this.type = _type;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end T11
+
+ // $ANTLR start T12
+ public final void mT12() throws RecognitionException {
+ try {
+ int _type = T12;
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:11:5: ( 'bar' )
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:11:7: 'bar'
+ {
+ match("bar");
+
+
+ }
+
+ this.type = _type;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end T12
+
+ // $ANTLR start RULE_ID
+ public final void mRULE_ID() throws RecognitionException {
+ try {
+ int _type = RULE_ID;
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:162:9: ( ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* )
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:162:11: ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )*
+ {
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:162:11: ( '^' )?
+ int alt1=2;
+ int LA1_0 = input.LA(1);
+
+ if ( (LA1_0=='^') ) {
+ alt1=1;
+ }
+ switch (alt1) {
+ case 1 :
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:162:11: '^'
+ {
+ 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.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:162:40: ( '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.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.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.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:164:10: ( ( '0' .. '9' )+ )
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:164:12: ( '0' .. '9' )+
+ {
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:164: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.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:164: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.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:166:13: ( ( '\\\"' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\\"' ) ) )* '\\\"' | '\\'' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) )
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:166:15: ( '\\\"' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\\"' ) ) )* '\\\"' | '\\'' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' )
+ {
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:166:15: ( '\\\"' ( '\\\\' ( '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("166:15: ( '\\\"' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\\"' ) ) )* '\\\"' | '\\'' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' )", 6, 0, input);
+
+ throw nvae;
+ }
+ switch (alt6) {
+ case 1 :
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:166:16: '\\\"' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\\"' ) ) )* '\\\"'
+ {
+ match('\"');
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:166:21: ( '\\\\' ( '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.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:166:22: '\\\\' ( '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.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:166:64: ~ ( ( '\\\\' | '\\\"' ) )
+ {
+ 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.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:166:86: '\\'' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\'' ) ) )* '\\''
+ {
+ match('\'');
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:166:91: ( '\\\\' ( '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.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:166:92: '\\\\' ( '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.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:166:134: ~ ( ( '\\\\' | '\\'' ) )
+ {
+ 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.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:168:17: ( '/*' ( options {greedy=false; } : . )* '*/' )
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:168:19: '/*' ( options {greedy=false; } : . )* '*/'
+ {
+ match("/*");
+
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:168: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.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:168:52: .
+ {
+ matchAny();
+
+ }
+ break;
+
+ default :
+ break loop7;
+ }
+ } while (true);
+
+ match("*/");
+
+
+ }
+
+ 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.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:170:17: ( '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? )
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:170:19: '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )?
+ {
+ match("//");
+
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:170: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.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:170: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.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:170:40: ( ( '\\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.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:170:41: ( '\\r' )? '\\n'
+ {
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:170:41: ( '\\r' )?
+ int alt9=2;
+ int LA9_0 = input.LA(1);
+
+ if ( (LA9_0=='\r') ) {
+ alt9=1;
+ }
+ switch (alt9) {
+ case 1 :
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:170:41: '\\r'
+ {
+ match('\r');
+
+ }
+ break;
+
+ }
+
+ match('\n');
+
+ }
+ break;
+
+ }
+
+
+ }
+
+ 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.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:172:9: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ )
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:172:11: ( ' ' | '\\t' | '\\r' | '\\n' )+
+ {
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:172: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.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.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);
+
+
+ }
+
+ 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.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:174:16: ( . )
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:174:18: .
+ {
+ matchAny();
+
+ }
+
+ this.type = _type;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end RULE_ANY_OTHER
+
+ public void mTokens() throws RecognitionException {
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:1:8: ( T11 | T12 | RULE_ID | RULE_INT | RULE_STRING | RULE_ML_COMMENT | RULE_SL_COMMENT | RULE_WS | RULE_ANY_OTHER )
+ int alt12=9;
+ 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_19 = input.LA(4);
+
+ if ( ((LA12_19>='0' && LA12_19<='9')||(LA12_19>='A' && LA12_19<='Z')||LA12_19=='_'||(LA12_19>='a' && LA12_19<='z')) ) {
+ alt12=3;
+ }
+ else {
+ alt12=1;}
+ }
+ else {
+ alt12=3;}
+ }
+ else {
+ alt12=3;}
+ }
+ else if ( (LA12_0=='b') ) {
+ int LA12_2 = input.LA(2);
+
+ if ( (LA12_2=='a') ) {
+ int LA12_13 = input.LA(3);
+
+ if ( (LA12_13=='r') ) {
+ int LA12_20 = input.LA(4);
+
+ if ( ((LA12_20>='0' && LA12_20<='9')||(LA12_20>='A' && LA12_20<='Z')||LA12_20=='_'||(LA12_20>='a' && LA12_20<='z')) ) {
+ alt12=3;
+ }
+ else {
+ alt12=2;}
+ }
+ else {
+ alt12=3;}
+ }
+ else {
+ alt12=3;}
+ }
+ 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=3;
+ }
+ else {
+ alt12=9;}
+ }
+ else if ( ((LA12_0>='A' && LA12_0<='Z')||LA12_0=='_'||LA12_0=='a'||(LA12_0>='c' && LA12_0<='e')||(LA12_0>='g' && LA12_0<='z')) ) {
+ alt12=3;
+ }
+ else if ( ((LA12_0>='0' && LA12_0<='9')) ) {
+ alt12=4;
+ }
+ else if ( (LA12_0=='\"') ) {
+ int LA12_6 = input.LA(2);
+
+ if ( ((LA12_6>='\u0000' && LA12_6<='\uFFFE')) ) {
+ alt12=5;
+ }
+ else {
+ alt12=9;}
+ }
+ else if ( (LA12_0=='\'') ) {
+ int LA12_7 = input.LA(2);
+
+ if ( ((LA12_7>='\u0000' && LA12_7<='\uFFFE')) ) {
+ alt12=5;
+ }
+ else {
+ alt12=9;}
+ }
+ else if ( (LA12_0=='/') ) {
+ switch ( input.LA(2) ) {
+ case '*':
+ {
+ alt12=6;
+ }
+ break;
+ case '/':
+ {
+ alt12=7;
+ }
+ break;
+ default:
+ alt12=9;}
+
+ }
+ else if ( ((LA12_0>='\t' && LA12_0<='\n')||LA12_0=='\r'||LA12_0==' ') ) {
+ alt12=8;
+ }
+ 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=9;
+ }
+ else {
+ NoViableAltException nvae =
+ new NoViableAltException("1:1: Tokens : ( T11 | T12 | 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.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:1:10: T11
+ {
+ mT11();
+
+ }
+ break;
+ case 2 :
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:1:14: T12
+ {
+ mT12();
+
+ }
+ break;
+ case 3 :
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:1:18: RULE_ID
+ {
+ mRULE_ID();
+
+ }
+ break;
+ case 4 :
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:1:26: RULE_INT
+ {
+ mRULE_INT();
+
+ }
+ break;
+ case 5 :
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:1:35: RULE_STRING
+ {
+ mRULE_STRING();
+
+ }
+ break;
+ case 6 :
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:1:47: RULE_ML_COMMENT
+ {
+ mRULE_ML_COMMENT();
+
+ }
+ break;
+ case 7 :
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:1:63: RULE_SL_COMMENT
+ {
+ mRULE_SL_COMMENT();
+
+ }
+ break;
+ case 8 :
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:1:79: RULE_WS
+ {
+ mRULE_WS();
+
+ }
+ break;
+ case 9 :
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:1:87: 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/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguageParser.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguageParser.java
new file mode 100644
index 0000000..b387248
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguageParser.java
@@ -0,0 +1,289 @@
+package org.eclipse.xtext.parsetree.reconstr.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.eclipse.xtext.parsetree.reconstr.services.SerializationBug269362TestLanguageGrammarAccess;
+
+
+
+import org.antlr.runtime.*;
+import java.util.Stack;
+import java.util.List;
+import java.util.ArrayList;
+
+public class InternalSerializationBug269362TestLanguageParser 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'"
+ };
+ 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 InternalSerializationBug269362TestLanguageParser(TokenStream input) {
+ super(input);
+ }
+
+
+ public String[] getTokenNames() { return tokenNames; }
+ public String getGrammarFileName() { return "../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g"; }
+
+
+
+ private SerializationBug269362TestLanguageGrammarAccess grammarAccess;
+
+ public InternalSerializationBug269362TestLanguageParser(TokenStream input, IAstFactory factory, SerializationBug269362TestLanguageGrammarAccess grammarAccess) {
+ super(input, factory, grammarAccess.getGrammar());
+ this.grammarAccess = grammarAccess;
+ }
+
+ @Override
+ protected InputStream getTokenFile() {
+ ClassLoader classLoader = getClass().getClassLoader();
+ return classLoader.getResourceAsStream("org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.tokens");
+ }
+
+ @Override
+ protected String getFirstRuleName() {
+ return "Model";
+ }
+
+
+
+ // $ANTLR start entryRuleModel
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:69: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.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:69:47: (iv_ruleModel= ruleModel EOF )
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:70:2: iv_ruleModel= ruleModel EOF
+ {
+ currentNode = createCompositeNode(grammarAccess.getModelRule(), currentNode);
+ pushFollow(FOLLOW_ruleModel_in_entryRuleModel71);
+ iv_ruleModel=ruleModel();
+ _fsp--;
+
+ current =iv_ruleModel;
+ match(input,EOF,FOLLOW_EOF_in_entryRuleModel81);
+
+ }
+
+ }
+
+ catch (RecognitionException re) {
+ recover(input,re);
+ appendSkippedTokens();
+ }
+ finally {
+ }
+ return current;
+ }
+ // $ANTLR end entryRuleModel
+
+
+ // $ANTLR start ruleModel
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:77:1: ruleModel returns [EObject current=null] : ( ( 'foo' (lv_foo_1= RULE_ID ) ( 'bar' (lv_bar_3= RULE_ID ) )? ) | ( 'bar' (lv_bar_5= RULE_ID ) ) ) ;
+ public final EObject ruleModel() throws RecognitionException {
+ EObject current = null;
+
+ Token lv_foo_1=null;
+ Token lv_bar_3=null;
+ Token lv_bar_5=null;
+
+ EObject temp=null; setCurrentLookahead(); resetLookahead();
+
+ try {
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:82:6: ( ( ( 'foo' (lv_foo_1= RULE_ID ) ( 'bar' (lv_bar_3= RULE_ID ) )? ) | ( 'bar' (lv_bar_5= RULE_ID ) ) ) )
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:83:1: ( ( 'foo' (lv_foo_1= RULE_ID ) ( 'bar' (lv_bar_3= RULE_ID ) )? ) | ( 'bar' (lv_bar_5= RULE_ID ) ) )
+ {
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:83:1: ( ( 'foo' (lv_foo_1= RULE_ID ) ( 'bar' (lv_bar_3= RULE_ID ) )? ) | ( 'bar' (lv_bar_5= RULE_ID ) ) )
+ int alt2=2;
+ int LA2_0 = input.LA(1);
+
+ if ( (LA2_0==11) ) {
+ alt2=1;
+ }
+ else if ( (LA2_0==12) ) {
+ alt2=2;
+ }
+ else {
+ NoViableAltException nvae =
+ new NoViableAltException("83:1: ( ( 'foo' (lv_foo_1= RULE_ID ) ( 'bar' (lv_bar_3= RULE_ID ) )? ) | ( 'bar' (lv_bar_5= RULE_ID ) ) )", 2, 0, input);
+
+ throw nvae;
+ }
+ switch (alt2) {
+ case 1 :
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:83:2: ( 'foo' (lv_foo_1= RULE_ID ) ( 'bar' (lv_bar_3= RULE_ID ) )? )
+ {
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:83:2: ( 'foo' (lv_foo_1= RULE_ID ) ( 'bar' (lv_bar_3= RULE_ID ) )? )
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:83:3: 'foo' (lv_foo_1= RULE_ID ) ( 'bar' (lv_bar_3= RULE_ID ) )?
+ {
+ match(input,11,FOLLOW_11_in_ruleModel116);
+
+ createLeafNode(grammarAccess.getModelAccess().getFooKeyword_0_0(), null);
+
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:87:1: (lv_foo_1= RULE_ID )
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:89:6: lv_foo_1= RULE_ID
+ {
+ lv_foo_1=(Token)input.LT(1);
+ match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleModel138);
+
+ createLeafNode(grammarAccess.getModelAccess().getFooIDTerminalRuleCall_0_1_0(), "foo");
+
+
+ if (current==null) {
+ current = factory.create(grammarAccess.getModelRule().getType().getClassifier());
+ associateNodeWithAstElement(currentNode, current);
+ }
+
+ try {
+ set(current, "foo", lv_foo_1, "ID", lastConsumedNode);
+ } catch (ValueConverterException vce) {
+ handleValueConverterException(vce);
+ }
+
+
+ }
+
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:107:2: ( 'bar' (lv_bar_3= RULE_ID ) )?
+ int alt1=2;
+ int LA1_0 = input.LA(1);
+
+ if ( (LA1_0==12) ) {
+ alt1=1;
+ }
+ switch (alt1) {
+ case 1 :
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:107:3: 'bar' (lv_bar_3= RULE_ID )
+ {
+ match(input,12,FOLLOW_12_in_ruleModel156);
+
+ createLeafNode(grammarAccess.getModelAccess().getBarKeyword_0_2_0(), null);
+
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:111:1: (lv_bar_3= RULE_ID )
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:113:6: lv_bar_3= RULE_ID
+ {
+ lv_bar_3=(Token)input.LT(1);
+ match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleModel178);
+
+ createLeafNode(grammarAccess.getModelAccess().getBarIDTerminalRuleCall_0_2_1_0(), "bar");
+
+
+ if (current==null) {
+ current = factory.create(grammarAccess.getModelRule().getType().getClassifier());
+ associateNodeWithAstElement(currentNode, current);
+ }
+
+ try {
+ set(current, "bar", lv_bar_3, "ID", lastConsumedNode);
+ } catch (ValueConverterException vce) {
+ handleValueConverterException(vce);
+ }
+
+
+ }
+
+
+ }
+ break;
+
+ }
+
+
+ }
+
+
+ }
+ break;
+ case 2 :
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:132:6: ( 'bar' (lv_bar_5= RULE_ID ) )
+ {
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:132:6: ( 'bar' (lv_bar_5= RULE_ID ) )
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:132:7: 'bar' (lv_bar_5= RULE_ID )
+ {
+ match(input,12,FOLLOW_12_in_ruleModel205);
+
+ createLeafNode(grammarAccess.getModelAccess().getBarKeyword_1_0(), null);
+
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:136:1: (lv_bar_5= RULE_ID )
+ // ../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g:138:6: lv_bar_5= RULE_ID
+ {
+ lv_bar_5=(Token)input.LT(1);
+ match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleModel227);
+
+ createLeafNode(grammarAccess.getModelAccess().getBarIDTerminalRuleCall_1_1_0(), "bar");
+
+
+ if (current==null) {
+ current = factory.create(grammarAccess.getModelRule().getType().getClassifier());
+ associateNodeWithAstElement(currentNode, current);
+ }
+
+ try {
+ set(current, "bar", lv_bar_5, "ID", lastConsumedNode);
+ } catch (ValueConverterException vce) {
+ handleValueConverterException(vce);
+ }
+
+
+ }
+
+
+ }
+
+
+ }
+ break;
+
+ }
+
+
+ }
+
+ resetLookahead();
+ lastConsumedNode = currentNode;
+
+ }
+
+ catch (RecognitionException re) {
+ recover(input,re);
+ appendSkippedTokens();
+ }
+ finally {
+ }
+ return current;
+ }
+ // $ANTLR end ruleModel
+
+
+
+
+ public static final BitSet FOLLOW_ruleModel_in_entryRuleModel71 = new BitSet(new long[]{0x0000000000000000L});
+ public static final BitSet FOLLOW_EOF_in_entryRuleModel81 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_11_in_ruleModel116 = new BitSet(new long[]{0x0000000000000010L});
+ public static final BitSet FOLLOW_RULE_ID_in_ruleModel138 = new BitSet(new long[]{0x0000000000001002L});
+ public static final BitSet FOLLOW_12_in_ruleModel156 = new BitSet(new long[]{0x0000000000000010L});
+ public static final BitSet FOLLOW_RULE_ID_in_ruleModel178 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_12_in_ruleModel205 = new BitSet(new long[]{0x0000000000000010L});
+ public static final BitSet FOLLOW_RULE_ID_in_ruleModel227 = 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/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage__.g b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage__.g
new file mode 100644
index 0000000..05bd148
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage__.g
@@ -0,0 +1,34 @@
+lexer grammar InternalSerializationBug269362TestLanguage;
+@header {
+package org.eclipse.xtext.parsetree.reconstr.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' ;
+T12 : 'bar' ;
+
+// $ANTLR src "../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g" 162
+RULE_ID : '^'? ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'_'|'0'..'9')*;
+
+// $ANTLR src "../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g" 164
+RULE_INT : ('0'..'9')+;
+
+// $ANTLR src "../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g" 166
+RULE_STRING : ('\"' ('\\' ('b'|'t'|'n'|'f'|'r'|'\"'|'\''|'\\')|~(('\\'|'\"')))* '\"'|'\'' ('\\' ('b'|'t'|'n'|'f'|'r'|'\"'|'\''|'\\')|~(('\\'|'\'')))* '\'');
+
+// $ANTLR src "../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g" 168
+RULE_ML_COMMENT : '/*' ( options {greedy=false;} : . )*'*/';
+
+// $ANTLR src "../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g" 170
+RULE_SL_COMMENT : '//' ~(('\n'|'\r'))* ('\r'? '\n')?;
+
+// $ANTLR src "../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g" 172
+RULE_WS : (' '|'\t'|'\r'|'\n')+;
+
+// $ANTLR src "../org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/antlr/internal/InternalSerializationBug269362TestLanguage.g" 174
+RULE_ANY_OTHER : .;
+
+
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/packrat/SerializationBug269362TestLanguageDelimiters.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/packrat/SerializationBug269362TestLanguageDelimiters.java
new file mode 100644
index 0000000..9753ca0
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/packrat/SerializationBug269362TestLanguageDelimiters.java
@@ -0,0 +1,27 @@
+/*
+* generated by Xtext
+*/
+package org.eclipse.xtext.parsetree.reconstr.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 SerializationBug269362TestLanguageDelimiters {
+
+ private SerializationBug269362TestLanguageDelimiters() {
+ throw new UnsupportedOperationException("Utility classes may not be initialized");
+ }
+
+ // TODO: remove hardcoded character class from template
+ public static final ICharacterClass keyword$5$Delimiter = ICharacterClass.Factory.join(
+ ICharacterClass.Factory.createRange('a', 'z'),
+ ICharacterClass.Factory.createRange('A', 'Z'),
+ ICharacterClass.Factory.create('_'),
+ ICharacterClass.Factory.createRange('0', '9')
+ );
+
+ public static final ISequenceMatcher ruleCall$7$Delimiter = new SetBasedKeywordMatcher(
+ "foo", "bar");
+
+}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/packrat/SerializationBug269362TestLanguagePackratParser.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/packrat/SerializationBug269362TestLanguagePackratParser.java
new file mode 100644
index 0000000..c3722b4
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/packrat/SerializationBug269362TestLanguagePackratParser.java
@@ -0,0 +1,31 @@
+/*
+* generated by Xtext
+*/
+package org.eclipse.xtext.parsetree.reconstr.parser.packrat;
+
+import com.google.inject.Inject;
+
+import org.eclipse.xtext.parser.packrat.AbstractPackratParser;
+import org.eclipse.xtext.parser.packrat.IParseResultFactory;
+import org.eclipse.xtext.parser.packrat.AbstractParserConfiguration.IInternalParserConfiguration;
+
+import org.eclipse.xtext.parsetree.reconstr.services.SerializationBug269362TestLanguageGrammarAccess;
+
+public class SerializationBug269362TestLanguagePackratParser extends AbstractPackratParser {
+
+ @Inject
+ public SerializationBug269362TestLanguagePackratParser(IParseResultFactory parseResultFactory, SerializationBug269362TestLanguageGrammarAccess grammarAccess) {
+ super(parseResultFactory, grammarAccess);
+ }
+
+ @Override
+ protected org.eclipse.xtext.parsetree.reconstr.parser.packrat.SerializationBug269362TestLanguageParserConfiguration createParserConfiguration(IInternalParserConfiguration configuration) {
+ return new org.eclipse.xtext.parsetree.reconstr.parser.packrat.SerializationBug269362TestLanguageParserConfiguration(configuration, getGrammarAccess());
+ }
+
+ @Override
+ protected SerializationBug269362TestLanguageGrammarAccess getGrammarAccess() {
+ return (SerializationBug269362TestLanguageGrammarAccess)super.getGrammarAccess();
+ }
+
+}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/packrat/SerializationBug269362TestLanguageParserConfiguration.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/packrat/SerializationBug269362TestLanguageParserConfiguration.java
new file mode 100644
index 0000000..75f1e69
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/packrat/SerializationBug269362TestLanguageParserConfiguration.java
@@ -0,0 +1,114 @@
+/*
+* generated by Xtext
+*/
+package org.eclipse.xtext.parsetree.reconstr.parser.packrat;
+
+import org.eclipse.xtext.parser.packrat.AbstractParserConfiguration;
+import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
+
+import org.eclipse.xtext.parsetree.reconstr.services.SerializationBug269362TestLanguageGrammarAccess;
+
+import org.eclipse.xtext.common.parser.packrat.TerminalsParserConfiguration;
+import org.eclipse.xtext.parsetree.reconstr.parser.packrat.consumers.SerializationBug269362TestLanguageModelConsumer;
+import org.eclipse.xtext.common.parser.packrat.consumers.TerminalsIDConsumer;
+import org.eclipse.xtext.common.parser.packrat.consumers.TerminalsINTConsumer;
+import org.eclipse.xtext.common.parser.packrat.consumers.TerminalsSTRINGConsumer;
+import org.eclipse.xtext.common.parser.packrat.consumers.TerminalsML_COMMENTConsumer;
+import org.eclipse.xtext.common.parser.packrat.consumers.TerminalsSL_COMMENTConsumer;
+import org.eclipse.xtext.common.parser.packrat.consumers.TerminalsWSConsumer;
+import org.eclipse.xtext.common.parser.packrat.consumers.TerminalsANY_OTHERConsumer;
+
+public class SerializationBug269362TestLanguageParserConfiguration extends AbstractParserConfiguration {
+
+ private final TerminalsParserConfiguration terminalsConfiguration;
+ private SerializationBug269362TestLanguageModelConsumer modelConsumer;
+
+ private SerializationBug269362TestLanguageGrammarAccess grammarAccess;
+
+ public SerializationBug269362TestLanguageParserConfiguration(IInternalParserConfiguration configuration, SerializationBug269362TestLanguageGrammarAccess grammarAccess) {
+ super(configuration);
+ this.grammarAccess = grammarAccess;
+ this.terminalsConfiguration = new TerminalsParserConfiguration(configuration, null);
+ }
+
+ public SerializationBug269362TestLanguageModelConsumer getRootConsumer() {
+ return modelConsumer;
+ }
+
+ public void createNonTerminalConsumers() {
+ getTerminalsConfiguration().createNonTerminalConsumers();
+ modelConsumer = new SerializationBug269362TestLanguageModelConsumer(
+ this, null
+ );
+ }
+
+ public void createTerminalConsumers() {
+ getTerminalsConfiguration().createTerminalConsumers();
+ }
+
+ public void configureConsumers() {
+ if (grammarAccess == null)
+ throw new NullPointerException("grammarAccess may not be null, you call configureConsumers");
+ getModelConsumer().setRule(grammarAccess.getModelAccess());
+ getIdConsumer().setRule(grammarAccess.getIDRule());
+ getIntConsumer().setRule(grammarAccess.getINTRule());
+ getStringConsumer().setRule(grammarAccess.getSTRINGRule());
+ getMlCommentConsumer().setRule(grammarAccess.getML_COMMENTRule());
+ getSlCommentConsumer().setRule(grammarAccess.getSL_COMMENTRule());
+ getWsConsumer().setRule(grammarAccess.getWSRule());
+ getAnyOtherConsumer().setRule(grammarAccess.getANY_OTHERRule());
+
+
+ getModelConsumer().setIdConsumer(getIdConsumer());
+
+ getModelConsumer().setKeyword$11$Delimiter(org.eclipse.xtext.parsetree.reconstr.parser.packrat.SerializationBug269362TestLanguageDelimiters.keyword$5$Delimiter);
+ getModelConsumer().setKeyword$3$Delimiter(org.eclipse.xtext.parsetree.reconstr.parser.packrat.SerializationBug269362TestLanguageDelimiters.keyword$5$Delimiter);
+ getModelConsumer().setKeyword$7$Delimiter(org.eclipse.xtext.parsetree.reconstr.parser.packrat.SerializationBug269362TestLanguageDelimiters.keyword$5$Delimiter);
+ getModelConsumer().setRuleCall$9$Delimiter(org.eclipse.xtext.parsetree.reconstr.parser.packrat.SerializationBug269362TestLanguageDelimiters.ruleCall$7$Delimiter);
+ getModelConsumer().setRuleCall$13$Delimiter(org.eclipse.xtext.parsetree.reconstr.parser.packrat.SerializationBug269362TestLanguageDelimiters.ruleCall$7$Delimiter);
+ getModelConsumer().setRuleCall$5$Delimiter(org.eclipse.xtext.parsetree.reconstr.parser.packrat.SerializationBug269362TestLanguageDelimiters.ruleCall$7$Delimiter);
+ }
+
+ public TerminalsParserConfiguration getTerminalsConfiguration() {
+ return terminalsConfiguration;
+ }
+
+ public SerializationBug269362TestLanguageModelConsumer getModelConsumer() {
+ return modelConsumer;
+ }
+
+ public TerminalsIDConsumer getIdConsumer() {
+ return getTerminalsConfiguration().getIdConsumer();
+ }
+
+ public TerminalsINTConsumer getIntConsumer() {
+ return getTerminalsConfiguration().getIntConsumer();
+ }
+
+ public TerminalsSTRINGConsumer getStringConsumer() {
+ return getTerminalsConfiguration().getStringConsumer();
+ }
+
+ public TerminalsML_COMMENTConsumer getMlCommentConsumer() {
+ return getTerminalsConfiguration().getMlCommentConsumer();
+ }
+
+ public TerminalsSL_COMMENTConsumer getSlCommentConsumer() {
+ return getTerminalsConfiguration().getSlCommentConsumer();
+ }
+
+ public TerminalsWSConsumer getWsConsumer() {
+ return getTerminalsConfiguration().getWsConsumer();
+ }
+
+ public TerminalsANY_OTHERConsumer getAnyOtherConsumer() {
+ return getTerminalsConfiguration().getAnyOtherConsumer();
+ }
+
+
+ @Override
+ public ITerminalConsumer[] getInitialHiddenTerminals() {
+ return getTerminalsConfiguration().getInitialHiddenTerminals();
+ }
+
+}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/packrat/consumers/SerializationBug269362TestLanguageModelConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/packrat/consumers/SerializationBug269362TestLanguageModelConsumer.java
new file mode 100644
index 0000000..143d743
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/packrat/consumers/SerializationBug269362TestLanguageModelConsumer.java
@@ -0,0 +1,328 @@
+/*
+* generated by Xtext
+*/
+package org.eclipse.xtext.parsetree.reconstr.parser.packrat.consumers;
+
+import org.eclipse.emf.ecore.EClassifier;
+
+import org.eclipse.xtext.AbstractRule;
+import org.eclipse.xtext.Alternatives;
+import org.eclipse.xtext.Assignment;
+import org.eclipse.xtext.Group;
+import org.eclipse.xtext.Keyword;
+import org.eclipse.xtext.RuleCall;
+
+import org.eclipse.xtext.parser.packrat.consumers.IElementConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.INonTerminalConsumerConfiguration;
+import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
+import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
+
+import org.eclipse.xtext.parsetree.reconstr.services.SerializationBug269362TestLanguageGrammarAccess.ModelElements;
+
+public final class SerializationBug269362TestLanguageModelConsumer extends NonTerminalConsumer {
+
+ private ModelElements rule;
+
+ private ITerminalConsumer idConsumer;
+
+ private IElementConsumer alternatives$1$Consumer;
+
+ private IElementConsumer group$2$Consumer;
+
+ private IElementConsumer keyword$3$Consumer;
+
+ private IElementConsumer assignment$4$Consumer;
+
+ private IElementConsumer ruleCall$5$Consumer;
+
+ private IElementConsumer group$6$Consumer;
+
+ private IElementConsumer keyword$7$Consumer;
+
+ private IElementConsumer assignment$8$Consumer;
+
+ private IElementConsumer ruleCall$9$Consumer;
+
+ private IElementConsumer group$10$Consumer;
+
+ private IElementConsumer keyword$11$Consumer;
+
+ private IElementConsumer assignment$12$Consumer;
+
+ private IElementConsumer ruleCall$13$Consumer;
+
+ private ICharacterClass keyword$11$Delimiter;
+
+ private ICharacterClass keyword$3$Delimiter;
+
+ private ICharacterClass keyword$7$Delimiter;
+
+ private ISequenceMatcher ruleCall$9$Delimiter;
+
+ private ISequenceMatcher ruleCall$13$Delimiter;
+
+ private ISequenceMatcher ruleCall$5$Delimiter;
+
+ protected class Alternatives$1$Consumer extends AlternativesConsumer {
+
+ protected Alternatives$1$Consumer(final Alternatives alternatives) {
+ super(alternatives);
+ }
+
+ @Override
+ protected void doGetConsumers(ConsumerAcceptor acceptor) {
+ acceptor.accept(group$2$Consumer);
+ acceptor.accept(group$10$Consumer);
+ }
+ }
+
+ protected class Group$2$Consumer extends GroupConsumer {
+
+ protected Group$2$Consumer(final Group group) {
+ super(group);
+ }
+
+ @Override
+ protected void doGetConsumers(ConsumerAcceptor acceptor) {
+ acceptor.accept(keyword$3$Consumer);
+ acceptor.accept(assignment$4$Consumer);
+ acceptor.accept(group$6$Consumer);
+ }
+ }
+
+ protected class Keyword$3$Consumer extends ElementConsumer<Keyword> {
+
+ protected Keyword$3$Consumer(final Keyword keyword) {
+ super(keyword);
+ }
+
+ @Override
+ protected int doConsume(boolean optional) throws Exception {
+ return consumeKeyword(getElement(), null, false, false, getKeyword$3$Delimiter(), optional);
+ }
+ }
+
+ protected class Assignment$4$Consumer extends AssignmentConsumer {
+
+ protected Assignment$4$Consumer(final Assignment assignment) {
+ super(assignment);
+ }
+
+ @Override
+ protected IElementConsumer getConsumer() {
+ return ruleCall$5$Consumer;
+ }
+ }
+
+ protected class RuleCall$5$Consumer extends ElementConsumer<RuleCall> {
+
+ protected RuleCall$5$Consumer(final RuleCall ruleCall) {
+ super(ruleCall);
+ }
+
+ @Override
+ protected int doConsume(boolean optional) throws Exception {
+ return consumeTerminal(idConsumer, "foo", false, false, getElement(), getRuleCall$5$Delimiter(), optional);
+ }
+ }
+
+ protected class Group$6$Consumer extends OptionalGroupConsumer {
+
+ protected Group$6$Consumer(final Group group) {
+ super(group);
+ }
+
+ @Override
+ protected void doGetConsumers(ConsumerAcceptor acceptor) {
+ acceptor.accept(keyword$7$Consumer);
+ acceptor.accept(assignment$8$Consumer);
+ }
+ }
+
+ protected class Keyword$7$Consumer extends ElementConsumer<Keyword> {
+
+ protected Keyword$7$Consumer(final Keyword keyword) {
+ super(keyword);
+ }
+
+ @Override
+ protected int doConsume(boolean optional) throws Exception {
+ return consumeKeyword(getElement(), null, false, false, getKeyword$7$Delimiter(), optional);
+ }
+ }
+
+ protected class Assignment$8$Consumer extends AssignmentConsumer {
+
+ protected Assignment$8$Consumer(final Assignment assignment) {
+ super(assignment);
+ }
+
+ @Override
+ protected IElementConsumer getConsumer() {
+ return ruleCall$9$Consumer;
+ }
+ }
+
+ protected class RuleCall$9$Consumer extends ElementConsumer<RuleCall> {
+
+ protected RuleCall$9$Consumer(final RuleCall ruleCall) {
+ super(ruleCall);
+ }
+
+ @Override
+ protected int doConsume(boolean optional) throws Exception {
+ return consumeTerminal(idConsumer, "bar", false, false, getElement(), getRuleCall$9$Delimiter(), optional);
+ }
+ }
+
+ protected class Group$10$Consumer extends GroupConsumer {
+
+ protected Group$10$Consumer(final Group group) {
+ super(group);
+ }
+
+ @Override
+ protected void doGetConsumers(ConsumerAcceptor acceptor) {
+ acceptor.accept(keyword$11$Consumer);
+ acceptor.accept(assignment$12$Consumer);
+ }
+ }
+
+ protected class Keyword$11$Consumer extends ElementConsumer<Keyword> {
+
+ protected Keyword$11$Consumer(final Keyword keyword) {
+ super(keyword);
+ }
+
+ @Override
+ protected int doConsume(boolean optional) throws Exception {
+ return consumeKeyword(getElement(), null, false, false, getKeyword$11$Delimiter(), optional);
+ }
+ }
+
+ protected class Assignment$12$Consumer extends AssignmentConsumer {
+
+ protected Assignment$12$Consumer(final Assignment assignment) {
+ super(assignment);
+ }
+
+ @Override
+ protected IElementConsumer getConsumer() {
+ return ruleCall$13$Consumer;
+ }
+ }
+
+ protected class RuleCall$13$Consumer extends ElementConsumer<RuleCall> {
+
+ protected RuleCall$13$Consumer(final RuleCall ruleCall) {
+ super(ruleCall);
+ }
+
+ @Override
+ protected int doConsume(boolean optional) throws Exception {
+ return consumeTerminal(idConsumer, "bar", false, false, getElement(), getRuleCall$13$Delimiter(), optional);
+ }
+ }
+
+ public SerializationBug269362TestLanguageModelConsumer(INonTerminalConsumerConfiguration configuration, ITerminalConsumer[] hiddenTokens) {
+ super(configuration, hiddenTokens);
+ keyword$11$Delimiter = ICharacterClass.Factory.nullClass();
+ keyword$3$Delimiter = ICharacterClass.Factory.nullClass();
+ keyword$7$Delimiter = ICharacterClass.Factory.nullClass();
+ ruleCall$9$Delimiter = ISequenceMatcher.Factory.nullMatcher();
+ ruleCall$13$Delimiter = ISequenceMatcher.Factory.nullMatcher();
+ ruleCall$5$Delimiter = ISequenceMatcher.Factory.nullMatcher();
+ }
+
+ @Override
+ protected int doConsume() throws Exception {
+ return alternatives$1$Consumer.consume();
+ }
+
+ public ModelElements getRule() {
+ return rule;
+ }
+
+ public void setRule(ModelElements rule) {
+ this.rule = rule;
+
+ alternatives$1$Consumer = new Alternatives$1$Consumer(rule.getAlternatives());
+ group$2$Consumer = new Group$2$Consumer(rule.getGroup_0());
+ keyword$3$Consumer = new Keyword$3$Consumer(rule.getFooKeyword_0_0());
+ assignment$4$Consumer = new Assignment$4$Consumer(rule.getFooAssignment_0_1());
+ ruleCall$5$Consumer = new RuleCall$5$Consumer(rule.getFooIDTerminalRuleCall_0_1_0());
+ group$6$Consumer = new Group$6$Consumer(rule.getGroup_0_2());
+ keyword$7$Consumer = new Keyword$7$Consumer(rule.getBarKeyword_0_2_0());
+ assignment$8$Consumer = new Assignment$8$Consumer(rule.getBarAssignment_0_2_1());
+ ruleCall$9$Consumer = new RuleCall$9$Consumer(rule.getBarIDTerminalRuleCall_0_2_1_0());
+ group$10$Consumer = new Group$10$Consumer(rule.getGroup_1());
+ keyword$11$Consumer = new Keyword$11$Consumer(rule.getBarKeyword_1_0());
+ assignment$12$Consumer = new Assignment$12$Consumer(rule.getBarAssignment_1_1());
+ ruleCall$13$Consumer = new RuleCall$13$Consumer(rule.getBarIDTerminalRuleCall_1_1_0());
+ }
+
+ @Override
+ protected AbstractRule getGrammarElement() {
+ return getRule().getRule();
+ }
+
+ @Override
+ protected EClassifier getDefaultType() {
+ return getGrammarElement().getType().getClassifier();
+ }
+
+ public void setIdConsumer(ITerminalConsumer idConsumer) {
+ this.idConsumer = idConsumer;
+ }
+
+ 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$3$Delimiter() {
+ return keyword$3$Delimiter;
+ }
+
+ public void setKeyword$3$Delimiter(ICharacterClass characterClass) {
+ keyword$3$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();
+ }
+
+ public ISequenceMatcher getRuleCall$9$Delimiter() {
+ return ruleCall$9$Delimiter;
+ }
+
+ public void setRuleCall$9$Delimiter(ISequenceMatcher matcher) {
+ ruleCall$9$Delimiter = matcher != null ? matcher : ISequenceMatcher.Factory.nullMatcher();
+ }
+
+ public ISequenceMatcher getRuleCall$13$Delimiter() {
+ return ruleCall$13$Delimiter;
+ }
+
+ public void setRuleCall$13$Delimiter(ISequenceMatcher matcher) {
+ ruleCall$13$Delimiter = matcher != null ? matcher : ISequenceMatcher.Factory.nullMatcher();
+ }
+
+ public ISequenceMatcher getRuleCall$5$Delimiter() {
+ return ruleCall$5$Delimiter;
+ }
+
+ public void setRuleCall$5$Delimiter(ISequenceMatcher matcher) {
+ ruleCall$5$Delimiter = matcher != null ? matcher : ISequenceMatcher.Factory.nullMatcher();
+ }
+
+}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/serializationBug269362TestLanguage/Model.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/serializationBug269362TestLanguage/Model.java
new file mode 100644
index 0000000..eef3edc
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/serializationBug269362TestLanguage/Model.java
@@ -0,0 +1,81 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ */
+package org.eclipse.xtext.parsetree.reconstr.serializationBug269362TestLanguage;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Model</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.xtext.parsetree.reconstr.serializationBug269362TestLanguage.Model#getFoo <em>Foo</em>}</li>
+ * <li>{@link org.eclipse.xtext.parsetree.reconstr.serializationBug269362TestLanguage.Model#getBar <em>Bar</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.xtext.parsetree.reconstr.serializationBug269362TestLanguage.SerializationBug269362TestLanguagePackage#getModel()
+ * @model
+ * @generated
+ */
+public interface Model extends EObject
+{
+ /**
+ * Returns the value of the '<em><b>Foo</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Foo</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Foo</em>' attribute.
+ * @see #setFoo(String)
+ * @see org.eclipse.xtext.parsetree.reconstr.serializationBug269362TestLanguage.SerializationBug269362TestLanguagePackage#getModel_Foo()
+ * @model
+ * @generated
+ */
+ String getFoo();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.xtext.parsetree.reconstr.serializationBug269362TestLanguage.Model#getFoo <em>Foo</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Foo</em>' attribute.
+ * @see #getFoo()
+ * @generated
+ */
+ void setFoo(String value);
+
+ /**
+ * Returns the value of the '<em><b>Bar</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Bar</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Bar</em>' attribute.
+ * @see #setBar(String)
+ * @see org.eclipse.xtext.parsetree.reconstr.serializationBug269362TestLanguage.SerializationBug269362TestLanguagePackage#getModel_Bar()
+ * @model
+ * @generated
+ */
+ String getBar();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.xtext.parsetree.reconstr.serializationBug269362TestLanguage.Model#getBar <em>Bar</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Bar</em>' attribute.
+ * @see #getBar()
+ * @generated
+ */
+ void setBar(String value);
+
+} // Model
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/serializationBug269362TestLanguage/SerializationBug269362TestLanguageFactory.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/serializationBug269362TestLanguage/SerializationBug269362TestLanguageFactory.java
new file mode 100644
index 0000000..1bd71eb
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/serializationBug269362TestLanguage/SerializationBug269362TestLanguageFactory.java
@@ -0,0 +1,46 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ */
+package org.eclipse.xtext.parsetree.reconstr.serializationBug269362TestLanguage;
+
+import org.eclipse.emf.ecore.EFactory;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Factory</b> for the model.
+ * It provides a create method for each non-abstract class of the model.
+ * <!-- end-user-doc -->
+ * @see org.eclipse.xtext.parsetree.reconstr.serializationBug269362TestLanguage.SerializationBug269362TestLanguagePackage
+ * @generated
+ */
+public interface SerializationBug269362TestLanguageFactory extends EFactory
+{
+ /**
+ * The singleton instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ SerializationBug269362TestLanguageFactory eINSTANCE = org.eclipse.xtext.parsetree.reconstr.serializationBug269362TestLanguage.impl.SerializationBug269362TestLanguageFactoryImpl.init();
+
+ /**
+ * Returns a new object of class '<em>Model</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Model</em>'.
+ * @generated
+ */
+ Model createModel();
+
+ /**
+ * Returns the package supported by this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the package supported by this factory.
+ * @generated
+ */
+ SerializationBug269362TestLanguagePackage getSerializationBug269362TestLanguagePackage();
+
+} //SerializationBug269362TestLanguageFactory
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/serializationBug269362TestLanguage/SerializationBug269362TestLanguagePackage.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/serializationBug269362TestLanguage/SerializationBug269362TestLanguagePackage.java
new file mode 100644
index 0000000..cf73a18
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/serializationBug269362TestLanguage/SerializationBug269362TestLanguagePackage.java
@@ -0,0 +1,182 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ */
+package org.eclipse.xtext.parsetree.reconstr.serializationBug269362TestLanguage;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EPackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Package</b> for the model.
+ * It contains accessors for the meta objects to represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ * @see org.eclipse.xtext.parsetree.reconstr.serializationBug269362TestLanguage.SerializationBug269362TestLanguageFactory
+ * @model kind="package"
+ * @generated
+ */
+public interface SerializationBug269362TestLanguagePackage extends EPackage
+{
+ /**
+ * The package name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNAME = "serializationBug269362TestLanguage";
+
+ /**
+ * The package namespace URI.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNS_URI = "http://www.eclipse.org/2009/tmf/xtext/SerializationBugTest/269362";
+
+ /**
+ * The package namespace name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNS_PREFIX = "serializationBug269362TestLanguage";
+
+ /**
+ * The singleton instance of the package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ SerializationBug269362TestLanguagePackage eINSTANCE = org.eclipse.xtext.parsetree.reconstr.serializationBug269362TestLanguage.impl.SerializationBug269362TestLanguagePackageImpl.init();
+
+ /**
+ * The meta object id for the '{@link org.eclipse.xtext.parsetree.reconstr.serializationBug269362TestLanguage.impl.ModelImpl <em>Model</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.xtext.parsetree.reconstr.serializationBug269362TestLanguage.impl.ModelImpl
+ * @see org.eclipse.xtext.parsetree.reconstr.serializationBug269362TestLanguage.impl.SerializationBug269362TestLanguagePackageImpl#getModel()
+ * @generated
+ */
+ int MODEL = 0;
+
+ /**
+ * The feature id for the '<em><b>Foo</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int MODEL__FOO = 0;
+
+ /**
+ * The feature id for the '<em><b>Bar</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int MODEL__BAR = 1;
+
+ /**
+ * The number of structural features of the '<em>Model</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int MODEL_FEATURE_COUNT = 2;
+
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.xtext.parsetree.reconstr.serializationBug269362TestLanguage.Model <em>Model</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Model</em>'.
+ * @see org.eclipse.xtext.parsetree.reconstr.serializationBug269362TestLanguage.Model
+ * @generated
+ */
+ EClass getModel();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.xtext.parsetree.reconstr.serializationBug269362TestLanguage.Model#getFoo <em>Foo</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Foo</em>'.
+ * @see org.eclipse.xtext.parsetree.reconstr.serializationBug269362TestLanguage.Model#getFoo()
+ * @see #getModel()
+ * @generated
+ */
+ EAttribute getModel_Foo();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.xtext.parsetree.reconstr.serializationBug269362TestLanguage.Model#getBar <em>Bar</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Bar</em>'.
+ * @see org.eclipse.xtext.parsetree.reconstr.serializationBug269362TestLanguage.Model#getBar()
+ * @see #getModel()
+ * @generated
+ */
+ EAttribute getModel_Bar();
+
+ /**
+ * Returns the factory that creates the instances of the model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the factory that creates the instances of the model.
+ * @generated
+ */
+ SerializationBug269362TestLanguageFactory getSerializationBug269362TestLanguageFactory();
+
+ /**
+ * <!-- begin-user-doc -->
+ * Defines literals for the meta objects that represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ interface Literals
+ {
+ /**
+ * The meta object literal for the '{@link org.eclipse.xtext.parsetree.reconstr.serializationBug269362TestLanguage.impl.ModelImpl <em>Model</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.xtext.parsetree.reconstr.serializationBug269362TestLanguage.impl.ModelImpl
+ * @see org.eclipse.xtext.parsetree.reconstr.serializationBug269362TestLanguage.impl.SerializationBug269362TestLanguagePackageImpl#getModel()
+ * @generated
+ */
+ EClass MODEL = eINSTANCE.getModel();
+
+ /**
+ * The meta object literal for the '<em><b>Foo</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute MODEL__FOO = eINSTANCE.getModel_Foo();
+
+ /**
+ * The meta object literal for the '<em><b>Bar</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute MODEL__BAR = eINSTANCE.getModel_Bar();
+
+ }
+
+} //SerializationBug269362TestLanguagePackage
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/serializationBug269362TestLanguage/impl/ModelImpl.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/serializationBug269362TestLanguage/impl/ModelImpl.java
new file mode 100644
index 0000000..c68d7d5
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/serializationBug269362TestLanguage/impl/ModelImpl.java
@@ -0,0 +1,236 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ */
+package org.eclipse.xtext.parsetree.reconstr.serializationBug269362TestLanguage.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.ecore.EClass;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
+
+import org.eclipse.xtext.parsetree.reconstr.serializationBug269362TestLanguage.Model;
+import org.eclipse.xtext.parsetree.reconstr.serializationBug269362TestLanguage.SerializationBug269362TestLanguagePackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Model</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.xtext.parsetree.reconstr.serializationBug269362TestLanguage.impl.ModelImpl#getFoo <em>Foo</em>}</li>
+ * <li>{@link org.eclipse.xtext.parsetree.reconstr.serializationBug269362TestLanguage.impl.ModelImpl#getBar <em>Bar</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class ModelImpl extends MinimalEObjectImpl.Container implements Model
+{
+ /**
+ * The default value of the '{@link #getFoo() <em>Foo</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getFoo()
+ * @generated
+ * @ordered
+ */
+ protected static final String FOO_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getFoo() <em>Foo</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getFoo()
+ * @generated
+ * @ordered
+ */
+ protected String foo = FOO_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getBar() <em>Bar</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getBar()
+ * @generated
+ * @ordered
+ */
+ protected static final String BAR_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getBar() <em>Bar</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getBar()
+ * @generated
+ * @ordered
+ */
+ protected String bar = BAR_EDEFAULT;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ModelImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass()
+ {
+ return SerializationBug269362TestLanguagePackage.Literals.MODEL;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getFoo()
+ {
+ return foo;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setFoo(String newFoo)
+ {
+ String oldFoo = foo;
+ foo = newFoo;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, SerializationBug269362TestLanguagePackage.MODEL__FOO, oldFoo, foo));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getBar()
+ {
+ return bar;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setBar(String newBar)
+ {
+ String oldBar = bar;
+ bar = newBar;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, SerializationBug269362TestLanguagePackage.MODEL__BAR, oldBar, bar));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType)
+ {
+ switch (featureID)
+ {
+ case SerializationBug269362TestLanguagePackage.MODEL__FOO:
+ return getFoo();
+ case SerializationBug269362TestLanguagePackage.MODEL__BAR:
+ return getBar();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue)
+ {
+ switch (featureID)
+ {
+ case SerializationBug269362TestLanguagePackage.MODEL__FOO:
+ setFoo((String)newValue);
+ return;
+ case SerializationBug269362TestLanguagePackage.MODEL__BAR:
+ setBar((String)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID)
+ {
+ switch (featureID)
+ {
+ case SerializationBug269362TestLanguagePackage.MODEL__FOO:
+ setFoo(FOO_EDEFAULT);
+ return;
+ case SerializationBug269362TestLanguagePackage.MODEL__BAR:
+ setBar(BAR_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID)
+ {
+ switch (featureID)
+ {
+ case SerializationBug269362TestLanguagePackage.MODEL__FOO:
+ return FOO_EDEFAULT == null ? foo != null : !FOO_EDEFAULT.equals(foo);
+ case SerializationBug269362TestLanguagePackage.MODEL__BAR:
+ return BAR_EDEFAULT == null ? bar != null : !BAR_EDEFAULT.equals(bar);
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString()
+ {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (foo: ");
+ result.append(foo);
+ result.append(", bar: ");
+ result.append(bar);
+ result.append(')');
+ return result.toString();
+ }
+
+} //ModelImpl
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/serializationBug269362TestLanguage/impl/SerializationBug269362TestLanguageFactoryImpl.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/serializationBug269362TestLanguage/impl/SerializationBug269362TestLanguageFactoryImpl.java
new file mode 100644
index 0000000..4b052e8
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/serializationBug269362TestLanguage/impl/SerializationBug269362TestLanguageFactoryImpl.java
@@ -0,0 +1,109 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ */
+package org.eclipse.xtext.parsetree.reconstr.serializationBug269362TestLanguage.impl;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.impl.EFactoryImpl;
+
+import org.eclipse.emf.ecore.plugin.EcorePlugin;
+
+import org.eclipse.xtext.parsetree.reconstr.serializationBug269362TestLanguage.*;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Factory</b>.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class SerializationBug269362TestLanguageFactoryImpl extends EFactoryImpl implements SerializationBug269362TestLanguageFactory
+{
+ /**
+ * Creates the default factory implementation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static SerializationBug269362TestLanguageFactory init()
+ {
+ try
+ {
+ SerializationBug269362TestLanguageFactory theSerializationBug269362TestLanguageFactory = (SerializationBug269362TestLanguageFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.eclipse.org/2009/tmf/xtext/SerializationBugTest/269362");
+ if (theSerializationBug269362TestLanguageFactory != null)
+ {
+ return theSerializationBug269362TestLanguageFactory;
+ }
+ }
+ catch (Exception exception)
+ {
+ EcorePlugin.INSTANCE.log(exception);
+ }
+ return new SerializationBug269362TestLanguageFactoryImpl();
+ }
+
+ /**
+ * Creates an instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public SerializationBug269362TestLanguageFactoryImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public EObject create(EClass eClass)
+ {
+ switch (eClass.getClassifierID())
+ {
+ case SerializationBug269362TestLanguagePackage.MODEL: return createModel();
+ default:
+ throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Model createModel()
+ {
+ ModelImpl model = new ModelImpl();
+ return model;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public SerializationBug269362TestLanguagePackage getSerializationBug269362TestLanguagePackage()
+ {
+ return (SerializationBug269362TestLanguagePackage)getEPackage();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @deprecated
+ * @generated
+ */
+ @Deprecated
+ public static SerializationBug269362TestLanguagePackage getPackage()
+ {
+ return SerializationBug269362TestLanguagePackage.eINSTANCE;
+ }
+
+} //SerializationBug269362TestLanguageFactoryImpl
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/serializationBug269362TestLanguage/impl/SerializationBug269362TestLanguagePackageImpl.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/serializationBug269362TestLanguage/impl/SerializationBug269362TestLanguagePackageImpl.java
new file mode 100644
index 0000000..2105bb6
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/serializationBug269362TestLanguage/impl/SerializationBug269362TestLanguagePackageImpl.java
@@ -0,0 +1,207 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ */
+package org.eclipse.xtext.parsetree.reconstr.serializationBug269362TestLanguage.impl;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.impl.EPackageImpl;
+
+import org.eclipse.xtext.parsetree.reconstr.serializationBug269362TestLanguage.Model;
+import org.eclipse.xtext.parsetree.reconstr.serializationBug269362TestLanguage.SerializationBug269362TestLanguageFactory;
+import org.eclipse.xtext.parsetree.reconstr.serializationBug269362TestLanguage.SerializationBug269362TestLanguagePackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Package</b>.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class SerializationBug269362TestLanguagePackageImpl extends EPackageImpl implements SerializationBug269362TestLanguagePackage
+{
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass modelEClass = null;
+
+ /**
+ * Creates an instance of the model <b>Package</b>, registered with
+ * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
+ * package URI value.
+ * <p>Note: the correct way to create the package is via the static
+ * factory method {@link #init init()}, which also performs
+ * initialization of the package, or returns the registered package,
+ * if one already exists.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.ecore.EPackage.Registry
+ * @see org.eclipse.xtext.parsetree.reconstr.serializationBug269362TestLanguage.SerializationBug269362TestLanguagePackage#eNS_URI
+ * @see #init()
+ * @generated
+ */
+ private SerializationBug269362TestLanguagePackageImpl()
+ {
+ super(eNS_URI, SerializationBug269362TestLanguageFactory.eINSTANCE);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static boolean isInited = false;
+
+ /**
+ * Creates, registers, and initializes the <b>Package</b> for this
+ * model, and for any others upon which it depends. Simple
+ * dependencies are satisfied by calling this method on all
+ * dependent packages before doing anything else. This method drives
+ * initialization for interdependent packages directly, in parallel
+ * with this package, itself.
+ * <p>Of this package and its interdependencies, all packages which
+ * have not yet been registered by their URI values are first created
+ * and registered. The packages are then initialized in two steps:
+ * meta-model objects for all of the packages are created before any
+ * are initialized, since one package's meta-model objects may refer to
+ * those of another.
+ * <p>Invocation of this method will not affect any packages that have
+ * already been initialized.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #eNS_URI
+ * @see #createPackageContents()
+ * @see #initializePackageContents()
+ * @generated
+ */
+ public static SerializationBug269362TestLanguagePackage init()
+ {
+ if (isInited) return (SerializationBug269362TestLanguagePackage)EPackage.Registry.INSTANCE.getEPackage(SerializationBug269362TestLanguagePackage.eNS_URI);
+
+ // Obtain or create and register package
+ SerializationBug269362TestLanguagePackageImpl theSerializationBug269362TestLanguagePackage = (SerializationBug269362TestLanguagePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof SerializationBug269362TestLanguagePackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new SerializationBug269362TestLanguagePackageImpl());
+
+ isInited = true;
+
+ // Create package meta-data objects
+ theSerializationBug269362TestLanguagePackage.createPackageContents();
+
+ // Initialize created meta-data
+ theSerializationBug269362TestLanguagePackage.initializePackageContents();
+
+ // Mark meta-data to indicate it can't be changed
+ theSerializationBug269362TestLanguagePackage.freeze();
+
+ return theSerializationBug269362TestLanguagePackage;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getModel()
+ {
+ return modelEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getModel_Foo()
+ {
+ return (EAttribute)modelEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getModel_Bar()
+ {
+ return (EAttribute)modelEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public SerializationBug269362TestLanguageFactory getSerializationBug269362TestLanguageFactory()
+ {
+ return (SerializationBug269362TestLanguageFactory)getEFactoryInstance();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private boolean isCreated = false;
+
+ /**
+ * Creates the meta-model objects for the package. This method is
+ * guarded to have no affect on any invocation but its first.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void createPackageContents()
+ {
+ if (isCreated) return;
+ isCreated = true;
+
+ // Create classes and their features
+ modelEClass = createEClass(MODEL);
+ createEAttribute(modelEClass, MODEL__FOO);
+ createEAttribute(modelEClass, MODEL__BAR);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private boolean isInitialized = false;
+
+ /**
+ * Complete the initialization of the package and its meta-model. This
+ * method is guarded to have no affect on any invocation but its first.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void initializePackageContents()
+ {
+ if (isInitialized) return;
+ isInitialized = true;
+
+ // Initialize package
+ setName(eNAME);
+ setNsPrefix(eNS_PREFIX);
+ setNsURI(eNS_URI);
+
+ // Create type parameters
+
+ // Set bounds for type parameters
+
+ // Add supertypes to classes
+
+ // Initialize classes and features; add operations and parameters
+ initEClass(modelEClass, Model.class, "Model", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getModel_Foo(), ecorePackage.getEString(), "foo", null, 0, 1, Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getModel_Bar(), ecorePackage.getEString(), "bar", null, 0, 1, Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ // Create resource
+ createResource(eNS_URI);
+ }
+
+} //SerializationBug269362TestLanguagePackageImpl
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/serializationBug269362TestLanguage/util/SerializationBug269362TestLanguageAdapterFactory.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/serializationBug269362TestLanguage/util/SerializationBug269362TestLanguageAdapterFactory.java
new file mode 100644
index 0000000..04ba2a6
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/serializationBug269362TestLanguage/util/SerializationBug269362TestLanguageAdapterFactory.java
@@ -0,0 +1,135 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ */
+package org.eclipse.xtext.parsetree.reconstr.serializationBug269362TestLanguage.util;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notifier;
+
+import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
+
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.xtext.parsetree.reconstr.serializationBug269362TestLanguage.*;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Adapter Factory</b> for the model.
+ * It provides an adapter <code>createXXX</code> method for each class of the model.
+ * <!-- end-user-doc -->
+ * @see org.eclipse.xtext.parsetree.reconstr.serializationBug269362TestLanguage.SerializationBug269362TestLanguagePackage
+ * @generated
+ */
+public class SerializationBug269362TestLanguageAdapterFactory extends AdapterFactoryImpl
+{
+ /**
+ * The cached model package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static SerializationBug269362TestLanguagePackage modelPackage;
+
+ /**
+ * Creates an instance of the adapter factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public SerializationBug269362TestLanguageAdapterFactory()
+ {
+ if (modelPackage == null)
+ {
+ modelPackage = SerializationBug269362TestLanguagePackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Returns whether this factory is applicable for the type of the object.
+ * <!-- begin-user-doc -->
+ * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model.
+ * <!-- end-user-doc -->
+ * @return whether this factory is applicable for the type of the object.
+ * @generated
+ */
+ @Override
+ public boolean isFactoryForType(Object object)
+ {
+ if (object == modelPackage)
+ {
+ return true;
+ }
+ if (object instanceof EObject)
+ {
+ return ((EObject)object).eClass().getEPackage() == modelPackage;
+ }
+ return false;
+ }
+
+ /**
+ * The switch that delegates to the <code>createXXX</code> methods.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected SerializationBug269362TestLanguageSwitch<Adapter> modelSwitch =
+ new SerializationBug269362TestLanguageSwitch<Adapter>()
+ {
+ @Override
+ public Adapter caseModel(Model object)
+ {
+ return createModelAdapter();
+ }
+ @Override
+ public Adapter defaultCase(EObject object)
+ {
+ return createEObjectAdapter();
+ }
+ };
+
+ /**
+ * Creates an adapter for the <code>target</code>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param target the object to adapt.
+ * @return the adapter for the <code>target</code>.
+ * @generated
+ */
+ @Override
+ public Adapter createAdapter(Notifier target)
+ {
+ return modelSwitch.doSwitch((EObject)target);
+ }
+
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.xtext.parsetree.reconstr.serializationBug269362TestLanguage.Model <em>Model</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.xtext.parsetree.reconstr.serializationBug269362TestLanguage.Model
+ * @generated
+ */
+ public Adapter createModelAdapter()
+ {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for the default case.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @generated
+ */
+ public Adapter createEObjectAdapter()
+ {
+ return null;
+ }
+
+} //SerializationBug269362TestLanguageAdapterFactory
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/serializationBug269362TestLanguage/util/SerializationBug269362TestLanguageSwitch.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/serializationBug269362TestLanguage/util/SerializationBug269362TestLanguageSwitch.java
new file mode 100644
index 0000000..d389289
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/serializationBug269362TestLanguage/util/SerializationBug269362TestLanguageSwitch.java
@@ -0,0 +1,141 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ */
+package org.eclipse.xtext.parsetree.reconstr.serializationBug269362TestLanguage.util;
+
+import java.util.List;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.xtext.parsetree.reconstr.serializationBug269362TestLanguage.*;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Switch</b> for the model's inheritance hierarchy.
+ * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
+ * to invoke the <code>caseXXX</code> method for each class of the model,
+ * starting with the actual class of the object
+ * and proceeding up the inheritance hierarchy
+ * until a non-null result is returned,
+ * which is the result of the switch.
+ * <!-- end-user-doc -->
+ * @see org.eclipse.xtext.parsetree.reconstr.serializationBug269362TestLanguage.SerializationBug269362TestLanguagePackage
+ * @generated
+ */
+public class SerializationBug269362TestLanguageSwitch<T>
+{
+ /**
+ * The cached model package
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static SerializationBug269362TestLanguagePackage modelPackage;
+
+ /**
+ * Creates an instance of the switch.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public SerializationBug269362TestLanguageSwitch()
+ {
+ if (modelPackage == null)
+ {
+ modelPackage = SerializationBug269362TestLanguagePackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the first non-null result returned by a <code>caseXXX</code> call.
+ * @generated
+ */
+ public T doSwitch(EObject theEObject)
+ {
+ return doSwitch(theEObject.eClass(), theEObject);
+ }
+
+ /**
+ * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the first non-null result returned by a <code>caseXXX</code> call.
+ * @generated
+ */
+ protected T doSwitch(EClass theEClass, EObject theEObject)
+ {
+ if (theEClass.eContainer() == modelPackage)
+ {
+ return doSwitch(theEClass.getClassifierID(), theEObject);
+ }
+ else
+ {
+ List<EClass> eSuperTypes = theEClass.getESuperTypes();
+ return
+ eSuperTypes.isEmpty() ?
+ defaultCase(theEObject) :
+ doSwitch(eSuperTypes.get(0), theEObject);
+ }
+ }
+
+ /**
+ * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the first non-null result returned by a <code>caseXXX</code> call.
+ * @generated
+ */
+ protected T doSwitch(int classifierID, EObject theEObject)
+ {
+ switch (classifierID)
+ {
+ case SerializationBug269362TestLanguagePackage.MODEL:
+ {
+ Model model = (Model)theEObject;
+ T result = caseModel(model);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ default: return defaultCase(theEObject);
+ }
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Model</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Model</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseModel(Model object)
+ {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch, but this is the last case anyway.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject)
+ * @generated
+ */
+ public T defaultCase(EObject object)
+ {
+ return null;
+ }
+
+} //SerializationBug269362TestLanguageSwitch
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/services/SerializationBug269362TestLanguageGrammarAccess.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/services/SerializationBug269362TestLanguageGrammarAccess.java
new file mode 100644
index 0000000..6c5e917
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/services/SerializationBug269362TestLanguageGrammarAccess.java
@@ -0,0 +1,154 @@
+/*
+* generated by Xtext
+*/
+
+package org.eclipse.xtext.parsetree.reconstr.services;
+
+import com.google.inject.Singleton;
+import com.google.inject.Inject;
+
+import org.eclipse.xtext.*;
+
+import org.eclipse.xtext.service.GrammarProvider;
+
+import org.eclipse.xtext.common.services.TerminalsGrammarAccess;
+
+@Singleton
+public class SerializationBug269362TestLanguageGrammarAccess implements IGrammarAccess {
+
+
+ public class ModelElements implements IParserRuleAccess {
+ private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "Model");
+ private final Alternatives cAlternatives = (Alternatives)rule.eContents().get(1);
+ private final Group cGroup_0 = (Group)cAlternatives.eContents().get(0);
+ private final Keyword cFooKeyword_0_0 = (Keyword)cGroup_0.eContents().get(0);
+ private final Assignment cFooAssignment_0_1 = (Assignment)cGroup_0.eContents().get(1);
+ private final RuleCall cFooIDTerminalRuleCall_0_1_0 = (RuleCall)cFooAssignment_0_1.eContents().get(0);
+ private final Group cGroup_0_2 = (Group)cGroup_0.eContents().get(2);
+ private final Keyword cBarKeyword_0_2_0 = (Keyword)cGroup_0_2.eContents().get(0);
+ private final Assignment cBarAssignment_0_2_1 = (Assignment)cGroup_0_2.eContents().get(1);
+ private final RuleCall cBarIDTerminalRuleCall_0_2_1_0 = (RuleCall)cBarAssignment_0_2_1.eContents().get(0);
+ private final Group cGroup_1 = (Group)cAlternatives.eContents().get(1);
+ private final Keyword cBarKeyword_1_0 = (Keyword)cGroup_1.eContents().get(0);
+ private final Assignment cBarAssignment_1_1 = (Assignment)cGroup_1.eContents().get(1);
+ private final RuleCall cBarIDTerminalRuleCall_1_1_0 = (RuleCall)cBarAssignment_1_1.eContents().get(0);
+
+ //Model:
+ // "foo" foo=ID ("bar" bar=ID)?|"bar" bar=ID;
+ public ParserRule getRule() { return rule; }
+
+ //"foo" foo=ID ("bar" bar=ID)?|"bar" bar=ID
+ public Alternatives getAlternatives() { return cAlternatives; }
+
+ //"foo" foo=ID ("bar" bar=ID)?
+ public Group getGroup_0() { return cGroup_0; }
+
+ //"foo"
+ public Keyword getFooKeyword_0_0() { return cFooKeyword_0_0; }
+
+ //foo=ID
+ public Assignment getFooAssignment_0_1() { return cFooAssignment_0_1; }
+
+ //ID
+ public RuleCall getFooIDTerminalRuleCall_0_1_0() { return cFooIDTerminalRuleCall_0_1_0; }
+
+ //("bar" bar=ID)?
+ public Group getGroup_0_2() { return cGroup_0_2; }
+
+ //"bar"
+ public Keyword getBarKeyword_0_2_0() { return cBarKeyword_0_2_0; }
+
+ //bar=ID
+ public Assignment getBarAssignment_0_2_1() { return cBarAssignment_0_2_1; }
+
+ //ID
+ public RuleCall getBarIDTerminalRuleCall_0_2_1_0() { return cBarIDTerminalRuleCall_0_2_1_0; }
+
+ //"bar" bar=ID
+ public Group getGroup_1() { return cGroup_1; }
+
+ //"bar"
+ public Keyword getBarKeyword_1_0() { return cBarKeyword_1_0; }
+
+ //bar=ID
+ public Assignment getBarAssignment_1_1() { return cBarAssignment_1_1; }
+
+ //ID
+ public RuleCall getBarIDTerminalRuleCall_1_1_0() { return cBarIDTerminalRuleCall_1_1_0; }
+ }
+
+
+ private ModelElements pModel;
+
+ private final GrammarProvider grammarProvider;
+
+ private TerminalsGrammarAccess gaTerminals;
+
+ @Inject
+ public SerializationBug269362TestLanguageGrammarAccess(GrammarProvider grammarProvider,
+ TerminalsGrammarAccess gaTerminals) {
+ this.grammarProvider = grammarProvider;
+ this.gaTerminals = gaTerminals;
+ }
+
+ public Grammar getGrammar() {
+ return grammarProvider.getGrammar(this);
+ }
+
+
+ public TerminalsGrammarAccess getTerminalsGrammarAccess() {
+ return gaTerminals;
+ }
+
+
+ //Model:
+ // "foo" foo=ID ("bar" bar=ID)?|"bar" bar=ID;
+ public ModelElements getModelAccess() {
+ return (pModel != null) ? pModel : (pModel = new ModelElements());
+ }
+
+ public ParserRule getModelRule() {
+ return getModelAccess().getRule();
+ }
+
+ //terminal ID:
+ // "^" ? ( "a" .. "z" | "A" .. "Z" | "_" ) ( "a" .. "z" | "A" .. "Z" | "_" | "0" .. "9" ) *;
+ public TerminalRule getIDRule() {
+ return gaTerminals.getIDRule();
+ }
+
+ //terminal INT returns ecore::EInt:
+ // "0" .. "9" +;
+ public TerminalRule getINTRule() {
+ return gaTerminals.getINTRule();
+ }
+
+ //terminal STRING:
+ // "\"" ( "\\" ( "b" | "t" | "n" | "f" | "r" | "\"" | "\'" | "\\" ) | ! ( "\\" | "\"" ) ) * "\"" | "\'" ( "\\" ( "b" | "t" | "n" | "f" | "r" | "\"" | "\'" | "\\" ) | ! ( "\\" | "\'" ) ) * "\'";
+ public TerminalRule getSTRINGRule() {
+ return gaTerminals.getSTRINGRule();
+ }
+
+ //terminal ML_COMMENT:
+ // "/*" -> "*/";
+ public TerminalRule getML_COMMENTRule() {
+ return gaTerminals.getML_COMMENTRule();
+ }
+
+ //terminal SL_COMMENT:
+ // "//" ! ( "\n" | "\r" ) * ( "\r" ? "\n" ) ?;
+ public TerminalRule getSL_COMMENTRule() {
+ return gaTerminals.getSL_COMMENTRule();
+ }
+
+ //terminal WS:
+ // ( " " | "\t" | "\r" | "\n" ) +;
+ public TerminalRule getWSRule() {
+ return gaTerminals.getWSRule();
+ }
+
+ //org.eclipse.xtext.parsetree.reconstr.XtextSerializationException: Serialization of TerminalRule failed.
+ public TerminalRule getANY_OTHERRule() {
+ return gaTerminals.getANY_OTHERRule();
+ }
+}
diff --git a/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/GenerateAllTestLanguages.mwe b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/GenerateAllTestLanguages.mwe
index 3482c23..e0b3312 100644
--- a/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/GenerateAllTestLanguages.mwe
+++ b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/GenerateAllTestLanguages.mwe
@@ -82,6 +82,9 @@
<language uri="classpath:/org/eclipse/xtext/parsetree/reconstr/SimpleReconstrTestLanguage.xtext">
<fragment file="${standardFragments}"/>
</language>
+ <language uri="classpath:/org/eclipse/xtext/parsetree/reconstr/SerializationBug269362TestLanguage.xtext">
+ <fragment file="${standardFragments}"/>
+ </language>
<language uri="classpath:/org/eclipse/xtext/parsetree/transientvalues/TransientValuesTest.xtext">
<fragment file="${standardFragments}"/>
</language>
diff --git a/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/enumrules/EnumRulesTestLanguage.xtext b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/enumrules/EnumRulesTestLanguage.xtext
index ee044db..c020502 100644
--- a/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/enumrules/EnumRulesTestLanguage.xtext
+++ b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/enumrules/EnumRulesTestLanguage.xtext
@@ -12,7 +12,7 @@ import "classpath:/org/eclipse/xtext/enumrules/enums.ecore"
generate enumRulesTestLanguage "http://www.eclipse.org/2009/tmf/xtext/EnumRulesTest"
Model:
- 'existing' existing=ExistingEnum | 'generated' generated=GeneratedEnum
+ 'existing' existing=ExistingEnum ('generated' generated=GeneratedEnum)? | 'generated' generated=GeneratedEnum
;
enum ExistingEnum:
diff --git a/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/enumrules/SerializationTest.java b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/enumrules/SerializationTest.java
new file mode 100644
index 0000000..fb5a9e7
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/enumrules/SerializationTest.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * 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.enumrules;
+
+import org.eclipse.xtext.enumrules.enumRulesTestLanguage.EnumRulesTestLanguageFactory;
+import org.eclipse.xtext.enumrules.enumRulesTestLanguage.GeneratedEnum;
+import org.eclipse.xtext.enumrules.enumRulesTestLanguage.Model;
+import org.eclipse.xtext.enumrules.enums.ExistingEnum;
+import org.eclipse.xtext.resource.XtextResource;
+import org.eclipse.xtext.resource.XtextResourceSet;
+
+/**
+ * @author Sebastian Zarnekow - Initial contribution and API
+ */
+public class SerializationTest extends AbstractEnumRulesTest {
+
+ private XtextResource resource;
+ private XtextResourceSet resourceSet;
+ private Model model;
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ with(EnumRulesTestLanguageStandaloneSetup.class);
+ resourceSet = get(XtextResourceSet.class);
+ resource = get(XtextResource.class);
+ resourceSet.getResources().add(resource);
+ model = EnumRulesTestLanguageFactory.eINSTANCE.createModel();
+ resource.getContents().add(model);
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ model = null;
+ resource = null;
+ resourceSet = null;
+ super.tearDown();
+ }
+
+ public void testSerialize_01() throws Exception {
+ String result = serialize(model);
+ assertEquals("generated SameName", result);
+ }
+
+ /**
+ * TODO fix me!
+ */
+ public void _testSerialize_02() throws Exception {
+ model.setExisting(ExistingEnum.DIFFERENT_NAME);
+ String result = serialize(model);
+ assertEquals("existing DifferentLiteral", result);
+ }
+
+ public void testSerialize_03() throws Exception {
+ model.setGenerated(GeneratedEnum.DIFFERENT_NAME);
+ String result = serialize(model);
+ assertEquals("generated DifferentLiteral", result);
+ }
+
+}
diff --git a/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parsetree/reconstr/GenerateReconstrTestLanguages.mwe b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parsetree/reconstr/GenerateReconstrTestLanguages.mwe
new file mode 100644
index 0000000..025e026
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parsetree/reconstr/GenerateReconstrTestLanguages.mwe
@@ -0,0 +1,24 @@
+<workflow>
+ <property name="standardFragments" value="org/eclipse/xtext/generator/StandardRuntimeFragments.mwe"/>
+ <property name="projectName" value="org.eclipse.xtext.generator.tests"/>
+ <property name="runtimeProject" value="../${projectName}"/>
+
+ <bean class="org.eclipse.emf.mwe.utils.StandaloneSetup" platformUri="${runtimeProject}/.."/>
+
+ <component class="org.eclipse.emf.mwe.utils.DirectoryCleaner" directory="${runtimeProject}/src-gen/org/eclipse/xtext/parsetree/reconstr"/>
+
+ <component class="org.eclipse.xtext.generator.Generator">
+ <pathRtProject value="${runtimeProject}"/>
+ <projectNameRt value="${projectName}"/>
+
+ <language uri="classpath:/org/eclipse/xtext/parsetree/reconstr/SerializationBug269362TestLanguage.xtext">
+ <fragment file="${standardFragments}"/>
+ </language>
+ <language uri="classpath:/org/eclipse/xtext/parsetree/reconstr/ComplexReconstrTestLanguage.xtext">
+ <fragment file="${standardFragments}"/>
+ </language>
+ <language uri="classpath:/org/eclipse/xtext/parsetree/reconstr/SimpleReconstrTestLanguage.xtext">
+ <fragment file="${standardFragments}"/>
+ </language>
+ </component>
+</workflow> \ No newline at end of file
diff --git a/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parsetree/reconstr/SerializationBug269362Test.java b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parsetree/reconstr/SerializationBug269362Test.java
new file mode 100644
index 0000000..e9c36db
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parsetree/reconstr/SerializationBug269362Test.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * 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.parsetree.reconstr;
+
+import org.eclipse.xtext.junit.AbstractXtextTests;
+import org.eclipse.xtext.parsetree.reconstr.serializationBug269362TestLanguage.Model;
+import org.eclipse.xtext.parsetree.reconstr.serializationBug269362TestLanguage.SerializationBug269362TestLanguageFactory;
+import org.eclipse.xtext.resource.XtextResource;
+import org.eclipse.xtext.resource.XtextResourceSet;
+
+/**
+ * @author Sebastian Zarnekow - Initial contribution and API
+ */
+public class SerializationBug269362Test extends AbstractXtextTests {
+
+ private XtextResource resource;
+ private XtextResourceSet resourceSet;
+ private Model model;
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ with(SerializationBug269362TestLanguageStandaloneSetup.class);
+ resourceSet = get(XtextResourceSet.class);
+ resource = get(XtextResource.class);
+ resourceSet.getResources().add(resource);
+ model = SerializationBug269362TestLanguageFactory.eINSTANCE.createModel();
+ resource.getContents().add(model);
+ }
+
+ /**
+ * TODO fix me!
+ */
+ public void _testSerialize_01() throws Exception {
+ model.setBar("bar");
+ model.setFoo("foo");
+ String result = serialize(model);
+ assertEquals("foo foo bar bar", result);
+ }
+
+}
diff --git a/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parsetree/reconstr/SerializationBug269362TestLanguage.xtext b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parsetree/reconstr/SerializationBug269362TestLanguage.xtext
new file mode 100644
index 0000000..e5ee457
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parsetree/reconstr/SerializationBug269362TestLanguage.xtext
@@ -0,0 +1,16 @@
+/*******************************************************************************
+ * 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
+ *
+ *******************************************************************************/
+grammar org.eclipse.xtext.parsetree.reconstr.SerializationBug269362TestLanguage with org.eclipse.xtext.common.Terminals
+
+generate serializationBug269362TestLanguage "http://www.eclipse.org/2009/tmf/xtext/SerializationBugTest/269362"
+
+Model:
+ 'foo' foo=ID ('bar' bar=ID)? | 'bar' bar=ID
+;
+
diff --git a/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parsetree/reconstr/SerializationBug269362TestLanguageChecks.chk b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parsetree/reconstr/SerializationBug269362TestLanguageChecks.chk
new file mode 100644
index 0000000..76d9697
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parsetree/reconstr/SerializationBug269362TestLanguageChecks.chk
@@ -0,0 +1,11 @@
+
+import serializationBug269362TestLanguage;
+
+import ecore;
+
+/*
+ * 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/parsetree/reconstr/SerializationBug269362TestLanguageRuntimeModule.java b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parsetree/reconstr/SerializationBug269362TestLanguageRuntimeModule.java
new file mode 100644
index 0000000..d743bd5
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parsetree/reconstr/SerializationBug269362TestLanguageRuntimeModule.java
@@ -0,0 +1,11 @@
+/*
+ * generated by Xtext
+ */
+package org.eclipse.xtext.parsetree.reconstr;
+
+/**
+ * Use this class to register components to be used within the IDE.
+ */
+public class SerializationBug269362TestLanguageRuntimeModule extends org.eclipse.xtext.parsetree.reconstr.AbstractSerializationBug269362TestLanguageRuntimeModule {
+
+}