aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormeysholdt2009-01-12 12:43:57 (EST)
committersefftinge2009-01-12 12:43:57 (EST)
commit32a0e7f2ce427473714405cb46dc2e1bd7e9ddac (patch)
treee91ce4583d9c724bdab91af64de445a05451c9a0
parent4ad595c1a5a813e78e643377906e08b766d9cf9b (diff)
downloadorg.eclipse.xtext-32a0e7f2ce427473714405cb46dc2e1bd7e9ddac.zip
org.eclipse.xtext-32a0e7f2ce427473714405cb46dc2e1bd7e9ddac.tar.gz
org.eclipse.xtext-32a0e7f2ce427473714405cb46dc2e1bd7e9ddac.tar.bz2
regenerated src-gen
-rw-r--r--devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/ReferenceGrammar.ecore6
-rw-r--r--devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/internal/InternalReferenceGrammarLexer.java2
-rw-r--r--devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/internal/InternalReferenceGrammarParser.java2
-rw-r--r--devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parsetree/reconstr/ReferenceGrammarParseTreeConstructor.java99
-rw-r--r--examples/org.eclipse.xtext.example.fowlerdsl/src-gen/org/eclipse/xtext/example/parser/internal/InternalFowlerDslLexer.java2
-rw-r--r--examples/org.eclipse.xtext.example.fowlerdsl/src-gen/org/eclipse/xtext/example/parser/internal/InternalFowlerDslParser.java2
-rw-r--r--examples/org.eclipse.xtext.example.fowlerdsl/src-gen/org/eclipse/xtext/example/parsetree/reconstr/FowlerDslParseTreeConstructor.java69
7 files changed, 76 insertions, 106 deletions
diff --git a/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/ReferenceGrammar.ecore b/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/ReferenceGrammar.ecore
index e234417..c70d0ae 100644
--- a/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/ReferenceGrammar.ecore
+++ b/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/ReferenceGrammar.ecore
@@ -16,12 +16,12 @@
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Person">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="age">
- <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
- </eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name">
<eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="age">
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ </eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Kind" eSuperTypes="//Person"/>
<eClassifiers xsi:type="ecore:EClass" name="Erwachsener" eSuperTypes="//Person"/>
diff --git a/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/internal/InternalReferenceGrammarLexer.java b/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/internal/InternalReferenceGrammarLexer.java
index 28bc2e6..0f0e15f 100644
--- a/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/internal/InternalReferenceGrammarLexer.java
+++ b/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/internal/InternalReferenceGrammarLexer.java
@@ -1,4 +1,4 @@
-// $ANTLR 3.0.1 ./src-gen/org/eclipse/xtext/reference/parser/internal/InternalReferenceGrammar.g 2009-01-04 17:10:21
+// $ANTLR 3.0.1 ./src-gen/org/eclipse/xtext/reference/parser/internal/InternalReferenceGrammar.g 2009-01-12 18:36:32
package org.eclipse.xtext.reference.parser.internal;
diff --git a/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/internal/InternalReferenceGrammarParser.java b/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/internal/InternalReferenceGrammarParser.java
index c70f1a7..c7a9900 100644
--- a/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/internal/InternalReferenceGrammarParser.java
+++ b/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/internal/InternalReferenceGrammarParser.java
@@ -1,4 +1,4 @@
-// $ANTLR 3.0.1 ./src-gen/org/eclipse/xtext/reference/parser/internal/InternalReferenceGrammar.g 2009-01-04 17:10:21
+// $ANTLR 3.0.1 ./src-gen/org/eclipse/xtext/reference/parser/internal/InternalReferenceGrammar.g 2009-01-12 18:36:32
package org.eclipse.xtext.reference.parser.internal;
diff --git a/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parsetree/reconstr/ReferenceGrammarParseTreeConstructor.java b/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parsetree/reconstr/ReferenceGrammarParseTreeConstructor.java
index 751f4be..2d753c5 100644
--- a/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parsetree/reconstr/ReferenceGrammarParseTreeConstructor.java
+++ b/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parsetree/reconstr/ReferenceGrammarParseTreeConstructor.java
@@ -14,41 +14,18 @@ import org.eclipse.xtext.reference.services.ReferenceGrammarGrammarAccess;
public class ReferenceGrammarParseTreeConstructor extends AbstractParseTreeConstructor {
-
- public IAbstractToken serialize(EObject object) {
- if(object == null) throw new IllegalArgumentException("The to-be-serialialized model is null");
- Solution t = internalSerialize(object);
- if(t == null) throw new XtextSerializationException(getDescr(object), "No rule found for serialization");
- return t.getPredecessor();
- }
-
+
protected Solution internalSerialize(EObject obj) {
IInstanceDescription inst = getDescr(obj);
Solution s;
-
- if(inst.isInstanceOf("Spielplatz") && (s = new Spielplatz_Group(inst, null).firstSolution()) != null) return s;
-
-
- if(inst.isInstanceOf("Person") && (s = new Person_Alternatives(inst, null).firstSolution()) != null) return s;
-
-
- if(inst.isInstanceOf("Kind") && (s = new Kind_Group(inst, null).firstSolution()) != null) return s;
-
-
- if(inst.isInstanceOf("Erwachsener") && (s = new Erwachsener_Group(inst, null).firstSolution()) != null) return s;
-
-
- if(inst.isInstanceOf("Spielzeug") && (s = new Spielzeug_Group(inst, null).firstSolution()) != null) return s;
-
-
- if(inst.isInstanceOf("Familie") && (s = new Familie_Group(inst, null).firstSolution()) != null) return s;
-
-
- if(inst.isInstanceOf("Farbe") && (s = new Farbe_Assignment_wert(inst, null).firstSolution()) != null) return s;
-
-
- if(inst.isInstanceOf("CustomType") && (s = new CustomTypeParserRule_Group(inst, null).firstSolution()) != null) return s;
-
+ if(inst.isInstanceOf("Spielplatz") && (s = new Spielplatz_Group(inst, null).firstSolution()) != null && isConsumed(s,null)) return s;
+ if(inst.isInstanceOf("Person") && (s = new Person_Alternatives(inst, null).firstSolution()) != null && isConsumed(s,null)) return s;
+ if(inst.isInstanceOf("Kind") && (s = new Kind_Group(inst, null).firstSolution()) != null && isConsumed(s,null)) return s;
+ if(inst.isInstanceOf("Erwachsener") && (s = new Erwachsener_Group(inst, null).firstSolution()) != null && isConsumed(s,null)) return s;
+ if(inst.isInstanceOf("Spielzeug") && (s = new Spielzeug_Group(inst, null).firstSolution()) != null && isConsumed(s,null)) return s;
+ if(inst.isInstanceOf("Familie") && (s = new Familie_Group(inst, null).firstSolution()) != null && isConsumed(s,null)) return s;
+ if(inst.isInstanceOf("Farbe") && (s = new Farbe_Assignment_wert(inst, null).firstSolution()) != null && isConsumed(s,null)) return s;
+ if(inst.isInstanceOf("CustomType") && (s = new CustomTypeParserRule_Group(inst, null).firstSolution()) != null && isConsumed(s,null)) return s;
return null;
}
@@ -76,7 +53,7 @@ protected class Spielplatz_Group extends GroupToken {
while(s1 != null) {
Solution s2 = new Spielplatz_0_Group(s1.getCurrent(), s1.getPredecessor()).firstSolution();
if(s2 == null) {
- s1 = s1.getPredecessor().nextSolution(this);
+ s1 = s1.getPredecessor().nextSolution(this,s1);
if(s1 == null) return null;
} else {
last = s2.getPredecessor();
@@ -104,7 +81,7 @@ protected class Spielplatz_0_Group extends GroupToken {
while(s1 != null) {
Solution s2 = new Spielplatz_0_0_Group(s1.getCurrent(), s1.getPredecessor()).firstSolution();
if(s2 == null) {
- s1 = s1.getPredecessor().nextSolution(this);
+ s1 = s1.getPredecessor().nextSolution(this,s1);
if(s1 == null) return null;
} else {
last = s2.getPredecessor();
@@ -132,7 +109,7 @@ protected class Spielplatz_0_0_Group extends GroupToken {
while(s1 != null) {
Solution s2 = new Spielplatz_0_0_0_Group(s1.getCurrent(), s1.getPredecessor()).firstSolution();
if(s2 == null) {
- s1 = s1.getPredecessor().nextSolution(this);
+ s1 = s1.getPredecessor().nextSolution(this,s1);
if(s1 == null) return null;
} else {
last = s2.getPredecessor();
@@ -160,7 +137,7 @@ protected class Spielplatz_0_0_0_Group extends GroupToken {
while(s1 != null) {
Solution s2 = new Spielplatz_0_0_0_0_Group(s1.getCurrent(), s1.getPredecessor()).firstSolution();
if(s2 == null) {
- s1 = s1.getPredecessor().nextSolution(this);
+ s1 = s1.getPredecessor().nextSolution(this,s1);
if(s1 == null) return null;
} else {
last = s2.getPredecessor();
@@ -188,7 +165,7 @@ protected class Spielplatz_0_0_0_0_Group extends GroupToken {
while(s1 != null) {
Solution s2 = new Spielplatz_0_0_0_0_0_Keyword_spielplatz(s1.getCurrent(), s1.getPredecessor()).firstSolution();
if(s2 == null) {
- s1 = s1.getPredecessor().nextSolution(this);
+ s1 = s1.getPredecessor().nextSolution(this,s1);
if(s1 == null) return null;
} else {
last = s2.getPredecessor();
@@ -376,6 +353,7 @@ protected class Spielplatz_0_1_0_0_0_0_Assignment_kinder extends AssignmentToken
IInstanceDescription param = getDescr((EObject)value);
if(param.isInstanceOf("Kind")) {
Solution s = new Kind_Group(param, this).firstSolution();
+ while(s != null && !isConsumed(s,this)) s = s.getPredecessor().nextSolution(this,s);
if(s != null) {
type = AssignmentType.PRC;
return new Solution(obj,s.getPredecessor());
@@ -406,6 +384,7 @@ protected class Spielplatz_0_1_0_0_0_1_Assignment_erzieher extends AssignmentTok
IInstanceDescription param = getDescr((EObject)value);
if(param.isInstanceOf("Erwachsener")) {
Solution s = new Erwachsener_Group(param, this).firstSolution();
+ while(s != null && !isConsumed(s,this)) s = s.getPredecessor().nextSolution(this,s);
if(s != null) {
type = AssignmentType.PRC;
return new Solution(obj,s.getPredecessor());
@@ -437,6 +416,7 @@ protected class Spielplatz_0_1_0_0_1_Assignment_spielzeuge extends AssignmentTok
IInstanceDescription param = getDescr((EObject)value);
if(param.isInstanceOf("Spielzeug")) {
Solution s = new Spielzeug_Group(param, this).firstSolution();
+ while(s != null && !isConsumed(s,this)) s = s.getPredecessor().nextSolution(this,s);
if(s != null) {
type = AssignmentType.PRC;
return new Solution(obj,s.getPredecessor());
@@ -468,6 +448,7 @@ protected class Spielplatz_0_1_0_1_Assignment_familie extends AssignmentToken {
IInstanceDescription param = getDescr((EObject)value);
if(param.isInstanceOf("Familie")) {
Solution s = new Familie_Group(param, this).firstSolution();
+ while(s != null && !isConsumed(s,this)) s = s.getPredecessor().nextSolution(this,s);
if(s != null) {
type = AssignmentType.PRC;
return new Solution(obj,s.getPredecessor());
@@ -499,6 +480,7 @@ protected class Spielplatz_0_1_1_Assignment_types extends AssignmentToken {
IInstanceDescription param = getDescr((EObject)value);
if(param.isInstanceOf("CustomType")) {
Solution s = new CustomTypeParserRule_Group(param, this).firstSolution();
+ while(s != null && !isConsumed(s,this)) s = s.getPredecessor().nextSolution(this,s);
if(s != null) {
type = AssignmentType.PRC;
return new Solution(obj,s.getPredecessor());
@@ -619,7 +601,7 @@ protected class Kind_Group extends GroupToken {
while(s1 != null) {
Solution s2 = new Kind_0_Group(s1.getCurrent(), s1.getPredecessor()).firstSolution();
if(s2 == null) {
- s1 = s1.getPredecessor().nextSolution(this);
+ s1 = s1.getPredecessor().nextSolution(this,s1);
if(s1 == null) return null;
} else {
last = s2.getPredecessor();
@@ -647,7 +629,7 @@ protected class Kind_0_Group extends GroupToken {
while(s1 != null) {
Solution s2 = new Kind_0_0_Group(s1.getCurrent(), s1.getPredecessor()).firstSolution();
if(s2 == null) {
- s1 = s1.getPredecessor().nextSolution(this);
+ s1 = s1.getPredecessor().nextSolution(this,s1);
if(s1 == null) return null;
} else {
last = s2.getPredecessor();
@@ -675,7 +657,7 @@ protected class Kind_0_0_Group extends GroupToken {
while(s1 != null) {
Solution s2 = new Kind_0_0_0_Group(s1.getCurrent(), s1.getPredecessor()).firstSolution();
if(s2 == null) {
- s1 = s1.getPredecessor().nextSolution(this);
+ s1 = s1.getPredecessor().nextSolution(this,s1);
if(s1 == null) return null;
} else {
last = s2.getPredecessor();
@@ -703,7 +685,7 @@ protected class Kind_0_0_0_Group extends GroupToken {
while(s1 != null) {
Solution s2 = new Kind_0_0_0_0_Keyword_kind(s1.getCurrent(), s1.getPredecessor()).firstSolution();
if(s2 == null) {
- s1 = s1.getPredecessor().nextSolution(this);
+ s1 = s1.getPredecessor().nextSolution(this,s1);
if(s1 == null) return null;
} else {
last = s2.getPredecessor();
@@ -827,7 +809,7 @@ protected class Erwachsener_Group extends GroupToken {
while(s1 != null) {
Solution s2 = new Erwachsener_0_Group(s1.getCurrent(), s1.getPredecessor()).firstSolution();
if(s2 == null) {
- s1 = s1.getPredecessor().nextSolution(this);
+ s1 = s1.getPredecessor().nextSolution(this,s1);
if(s1 == null) return null;
} else {
last = s2.getPredecessor();
@@ -855,7 +837,7 @@ protected class Erwachsener_0_Group extends GroupToken {
while(s1 != null) {
Solution s2 = new Erwachsener_0_0_Group(s1.getCurrent(), s1.getPredecessor()).firstSolution();
if(s2 == null) {
- s1 = s1.getPredecessor().nextSolution(this);
+ s1 = s1.getPredecessor().nextSolution(this,s1);
if(s1 == null) return null;
} else {
last = s2.getPredecessor();
@@ -883,7 +865,7 @@ protected class Erwachsener_0_0_Group extends GroupToken {
while(s1 != null) {
Solution s2 = new Erwachsener_0_0_0_Group(s1.getCurrent(), s1.getPredecessor()).firstSolution();
if(s2 == null) {
- s1 = s1.getPredecessor().nextSolution(this);
+ s1 = s1.getPredecessor().nextSolution(this,s1);
if(s1 == null) return null;
} else {
last = s2.getPredecessor();
@@ -911,7 +893,7 @@ protected class Erwachsener_0_0_0_Group extends GroupToken {
while(s1 != null) {
Solution s2 = new Erwachsener_0_0_0_0_Keyword_erwachsener(s1.getCurrent(), s1.getPredecessor()).firstSolution();
if(s2 == null) {
- s1 = s1.getPredecessor().nextSolution(this);
+ s1 = s1.getPredecessor().nextSolution(this,s1);
if(s1 == null) return null;
} else {
last = s2.getPredecessor();
@@ -1035,7 +1017,7 @@ protected class Spielzeug_Group extends GroupToken {
while(s1 != null) {
Solution s2 = new Spielzeug_0_Group(s1.getCurrent(), s1.getPredecessor()).firstSolution();
if(s2 == null) {
- s1 = s1.getPredecessor().nextSolution(this);
+ s1 = s1.getPredecessor().nextSolution(this,s1);
if(s1 == null) return null;
} else {
last = s2.getPredecessor();
@@ -1063,7 +1045,7 @@ protected class Spielzeug_0_Group extends GroupToken {
while(s1 != null) {
Solution s2 = new Spielzeug_0_0_Group(s1.getCurrent(), s1.getPredecessor()).firstSolution();
if(s2 == null) {
- s1 = s1.getPredecessor().nextSolution(this);
+ s1 = s1.getPredecessor().nextSolution(this,s1);
if(s1 == null) return null;
} else {
last = s2.getPredecessor();
@@ -1091,7 +1073,7 @@ protected class Spielzeug_0_0_Group extends GroupToken {
while(s1 != null) {
Solution s2 = new Spielzeug_0_0_0_Group(s1.getCurrent(), s1.getPredecessor()).firstSolution();
if(s2 == null) {
- s1 = s1.getPredecessor().nextSolution(this);
+ s1 = s1.getPredecessor().nextSolution(this,s1);
if(s1 == null) return null;
} else {
last = s2.getPredecessor();
@@ -1119,7 +1101,7 @@ protected class Spielzeug_0_0_0_Group extends GroupToken {
while(s1 != null) {
Solution s2 = new Spielzeug_0_0_0_0_Keyword_spielzeug(s1.getCurrent(), s1.getPredecessor()).firstSolution();
if(s2 == null) {
- s1 = s1.getPredecessor().nextSolution(this);
+ s1 = s1.getPredecessor().nextSolution(this,s1);
if(s1 == null) return null;
} else {
last = s2.getPredecessor();
@@ -1199,6 +1181,7 @@ protected class Spielzeug_0_1_Assignment_farbe extends AssignmentToken {
IInstanceDescription param = getDescr((EObject)value);
if(param.isInstanceOf("Farbe")) {
Solution s = new Farbe_Assignment_wert(param, this).firstSolution();
+ while(s != null && !isConsumed(s,this)) s = s.getPredecessor().nextSolution(this,s);
if(s != null) {
type = AssignmentType.PRC;
return new Solution(obj,s.getPredecessor());
@@ -1250,7 +1233,7 @@ protected class Familie_Group extends GroupToken {
while(s1 != null) {
Solution s2 = new Familie_0_Group(s1.getCurrent(), s1.getPredecessor()).firstSolution();
if(s2 == null) {
- s1 = s1.getPredecessor().nextSolution(this);
+ s1 = s1.getPredecessor().nextSolution(this,s1);
if(s1 == null) return null;
} else {
last = s2.getPredecessor();
@@ -1278,7 +1261,7 @@ protected class Familie_0_Group extends GroupToken {
while(s1 != null) {
Solution s2 = new Familie_0_0_Group(s1.getCurrent(), s1.getPredecessor()).firstSolution();
if(s2 == null) {
- s1 = s1.getPredecessor().nextSolution(this);
+ s1 = s1.getPredecessor().nextSolution(this,s1);
if(s1 == null) return null;
} else {
last = s2.getPredecessor();
@@ -1306,7 +1289,7 @@ protected class Familie_0_0_Group extends GroupToken {
while(s1 != null) {
Solution s2 = new Familie_0_0_0_Group(s1.getCurrent(), s1.getPredecessor()).firstSolution();
if(s2 == null) {
- s1 = s1.getPredecessor().nextSolution(this);
+ s1 = s1.getPredecessor().nextSolution(this,s1);
if(s1 == null) return null;
} else {
last = s2.getPredecessor();
@@ -1334,7 +1317,7 @@ protected class Familie_0_0_0_Group extends GroupToken {
while(s1 != null) {
Solution s2 = new Familie_0_0_0_0_Group(s1.getCurrent(), s1.getPredecessor()).firstSolution();
if(s2 == null) {
- s1 = s1.getPredecessor().nextSolution(this);
+ s1 = s1.getPredecessor().nextSolution(this,s1);
if(s1 == null) return null;
} else {
last = s2.getPredecessor();
@@ -1362,7 +1345,7 @@ protected class Familie_0_0_0_0_Group extends GroupToken {
while(s1 != null) {
Solution s2 = new Familie_0_0_0_0_0_Group(s1.getCurrent(), s1.getPredecessor()).firstSolution();
if(s2 == null) {
- s1 = s1.getPredecessor().nextSolution(this);
+ s1 = s1.getPredecessor().nextSolution(this,s1);
if(s1 == null) return null;
} else {
last = s2.getPredecessor();
@@ -1390,7 +1373,7 @@ protected class Familie_0_0_0_0_0_Group extends GroupToken {
while(s1 != null) {
Solution s2 = new Familie_0_0_0_0_0_0_Group(s1.getCurrent(), s1.getPredecessor()).firstSolution();
if(s2 == null) {
- s1 = s1.getPredecessor().nextSolution(this);
+ s1 = s1.getPredecessor().nextSolution(this,s1);
if(s1 == null) return null;
} else {
last = s2.getPredecessor();
@@ -1418,7 +1401,7 @@ protected class Familie_0_0_0_0_0_0_Group extends GroupToken {
while(s1 != null) {
Solution s2 = new Familie_0_0_0_0_0_0_0_Keyword_familie(s1.getCurrent(), s1.getPredecessor()).firstSolution();
if(s2 == null) {
- s1 = s1.getPredecessor().nextSolution(this);
+ s1 = s1.getPredecessor().nextSolution(this,s1);
if(s1 == null) return null;
} else {
last = s2.getPredecessor();
@@ -1586,7 +1569,7 @@ protected class Familie_0_1_Group extends GroupToken {
while(s1 != null) {
Solution s2 = new Familie_0_1_0_Keyword(s1.getCurrent(), s1.getPredecessor()).firstSolution();
if(s2 == null) {
- s1 = s1.getPredecessor().nextSolution(this);
+ s1 = s1.getPredecessor().nextSolution(this,s1);
if(s1 == null) return null;
} else {
last = s2.getPredecessor();
@@ -1725,7 +1708,7 @@ protected class CustomTypeParserRule_Group extends GroupToken {
while(s1 != null) {
Solution s2 = new CustomTypeParserRule_0_Keyword_type(s1.getCurrent(), s1.getPredecessor()).firstSolution();
if(s2 == null) {
- s1 = s1.getPredecessor().nextSolution(this);
+ s1 = s1.getPredecessor().nextSolution(this,s1);
if(s1 == null) return null;
} else {
last = s2.getPredecessor();
diff --git a/examples/org.eclipse.xtext.example.fowlerdsl/src-gen/org/eclipse/xtext/example/parser/internal/InternalFowlerDslLexer.java b/examples/org.eclipse.xtext.example.fowlerdsl/src-gen/org/eclipse/xtext/example/parser/internal/InternalFowlerDslLexer.java
index 07e05a8..0feb5fc 100644
--- a/examples/org.eclipse.xtext.example.fowlerdsl/src-gen/org/eclipse/xtext/example/parser/internal/InternalFowlerDslLexer.java
+++ b/examples/org.eclipse.xtext.example.fowlerdsl/src-gen/org/eclipse/xtext/example/parser/internal/InternalFowlerDslLexer.java
@@ -1,4 +1,4 @@
-// $ANTLR 3.0.1 ./src-gen/org/eclipse/xtext/example/parser/internal/InternalFowlerDsl.g 2009-01-04 17:10:39
+// $ANTLR 3.0.1 ./src-gen/org/eclipse/xtext/example/parser/internal/InternalFowlerDsl.g 2009-01-12 18:37:36
package org.eclipse.xtext.example.parser.internal;
diff --git a/examples/org.eclipse.xtext.example.fowlerdsl/src-gen/org/eclipse/xtext/example/parser/internal/InternalFowlerDslParser.java b/examples/org.eclipse.xtext.example.fowlerdsl/src-gen/org/eclipse/xtext/example/parser/internal/InternalFowlerDslParser.java
index 48a05cf..b1bd0c4 100644
--- a/examples/org.eclipse.xtext.example.fowlerdsl/src-gen/org/eclipse/xtext/example/parser/internal/InternalFowlerDslParser.java
+++ b/examples/org.eclipse.xtext.example.fowlerdsl/src-gen/org/eclipse/xtext/example/parser/internal/InternalFowlerDslParser.java
@@ -1,4 +1,4 @@
-// $ANTLR 3.0.1 ./src-gen/org/eclipse/xtext/example/parser/internal/InternalFowlerDsl.g 2009-01-04 17:10:38
+// $ANTLR 3.0.1 ./src-gen/org/eclipse/xtext/example/parser/internal/InternalFowlerDsl.g 2009-01-12 18:37:35
package org.eclipse.xtext.example.parser.internal;
diff --git a/examples/org.eclipse.xtext.example.fowlerdsl/src-gen/org/eclipse/xtext/example/parsetree/reconstr/FowlerDslParseTreeConstructor.java b/examples/org.eclipse.xtext.example.fowlerdsl/src-gen/org/eclipse/xtext/example/parsetree/reconstr/FowlerDslParseTreeConstructor.java
index 1e162b2..99292b8 100644
--- a/examples/org.eclipse.xtext.example.fowlerdsl/src-gen/org/eclipse/xtext/example/parsetree/reconstr/FowlerDslParseTreeConstructor.java
+++ b/examples/org.eclipse.xtext.example.fowlerdsl/src-gen/org/eclipse/xtext/example/parsetree/reconstr/FowlerDslParseTreeConstructor.java
@@ -14,32 +14,15 @@ import org.eclipse.xtext.example.services.FowlerDslGrammarAccess;
public class FowlerDslParseTreeConstructor extends AbstractParseTreeConstructor {
-
- public IAbstractToken serialize(EObject object) {
- if(object == null) throw new IllegalArgumentException("The to-be-serialialized model is null");
- Solution t = internalSerialize(object);
- if(t == null) throw new XtextSerializationException(getDescr(object), "No rule found for serialization");
- return t.getPredecessor();
- }
-
+
protected Solution internalSerialize(EObject obj) {
IInstanceDescription inst = getDescr(obj);
Solution s;
-
- if(inst.isInstanceOf("Statemachine") && (s = new Statemachine_Group(inst, null).firstSolution()) != null) return s;
-
-
- if(inst.isInstanceOf("Event") && (s = new Event_Group(inst, null).firstSolution()) != null) return s;
-
-
- if(inst.isInstanceOf("Command") && (s = new Command_Group(inst, null).firstSolution()) != null) return s;
-
-
- if(inst.isInstanceOf("State") && (s = new State_Group(inst, null).firstSolution()) != null) return s;
-
-
- if(inst.isInstanceOf("Transition") && (s = new Transition_Group(inst, null).firstSolution()) != null) return s;
-
+ if(inst.isInstanceOf("Statemachine") && (s = new Statemachine_Group(inst, null).firstSolution()) != null && isConsumed(s,null)) return s;
+ if(inst.isInstanceOf("Event") && (s = new Event_Group(inst, null).firstSolution()) != null && isConsumed(s,null)) return s;
+ if(inst.isInstanceOf("Command") && (s = new Command_Group(inst, null).firstSolution()) != null && isConsumed(s,null)) return s;
+ if(inst.isInstanceOf("State") && (s = new State_Group(inst, null).firstSolution()) != null && isConsumed(s,null)) return s;
+ if(inst.isInstanceOf("Transition") && (s = new Transition_Group(inst, null).firstSolution()) != null && isConsumed(s,null)) return s;
return null;
}
@@ -67,7 +50,7 @@ protected class Statemachine_Group extends GroupToken {
while(s1 != null) {
Solution s2 = new Statemachine_0_Group(s1.getCurrent(), s1.getPredecessor()).firstSolution();
if(s2 == null) {
- s1 = s1.getPredecessor().nextSolution(this);
+ s1 = s1.getPredecessor().nextSolution(this,s1);
if(s1 == null) return null;
} else {
last = s2.getPredecessor();
@@ -95,7 +78,7 @@ protected class Statemachine_0_Group extends GroupToken {
while(s1 != null) {
Solution s2 = new Statemachine_0_0_Group(s1.getCurrent(), s1.getPredecessor()).firstSolution();
if(s2 == null) {
- s1 = s1.getPredecessor().nextSolution(this);
+ s1 = s1.getPredecessor().nextSolution(this,s1);
if(s1 == null) return null;
} else {
last = s2.getPredecessor();
@@ -123,7 +106,7 @@ protected class Statemachine_0_0_Group extends GroupToken {
while(s1 != null) {
Solution s2 = new Statemachine_0_0_0_Group(s1.getCurrent(), s1.getPredecessor()).firstSolution();
if(s2 == null) {
- s1 = s1.getPredecessor().nextSolution(this);
+ s1 = s1.getPredecessor().nextSolution(this,s1);
if(s1 == null) return null;
} else {
last = s2.getPredecessor();
@@ -151,7 +134,7 @@ protected class Statemachine_0_0_0_Group extends GroupToken {
while(s1 != null) {
Solution s2 = new Statemachine_0_0_0_0_Group(s1.getCurrent(), s1.getPredecessor()).firstSolution();
if(s2 == null) {
- s1 = s1.getPredecessor().nextSolution(this);
+ s1 = s1.getPredecessor().nextSolution(this,s1);
if(s1 == null) return null;
} else {
last = s2.getPredecessor();
@@ -179,7 +162,7 @@ protected class Statemachine_0_0_0_0_Group extends GroupToken {
while(s1 != null) {
Solution s2 = new Statemachine_0_0_0_0_0_Group(s1.getCurrent(), s1.getPredecessor()).firstSolution();
if(s2 == null) {
- s1 = s1.getPredecessor().nextSolution(this);
+ s1 = s1.getPredecessor().nextSolution(this,s1);
if(s1 == null) return null;
} else {
last = s2.getPredecessor();
@@ -207,7 +190,7 @@ protected class Statemachine_0_0_0_0_0_Group extends GroupToken {
while(s1 != null) {
Solution s2 = new Statemachine_0_0_0_0_0_0_Keyword_events(s1.getCurrent(), s1.getPredecessor()).firstSolution();
if(s2 == null) {
- s1 = s1.getPredecessor().nextSolution(this);
+ s1 = s1.getPredecessor().nextSolution(this,s1);
if(s1 == null) return null;
} else {
last = s2.getPredecessor();
@@ -250,6 +233,7 @@ protected class Statemachine_0_0_0_0_0_1_Assignment_events extends AssignmentTok
IInstanceDescription param = getDescr((EObject)value);
if(param.isInstanceOf("Event")) {
Solution s = new Event_Group(param, this).firstSolution();
+ while(s != null && !isConsumed(s,this)) s = s.getPredecessor().nextSolution(this,s);
if(s != null) {
type = AssignmentType.PRC;
return new Solution(obj,s.getPredecessor());
@@ -307,6 +291,7 @@ protected class Statemachine_0_0_1_Assignment_commands extends AssignmentToken
IInstanceDescription param = getDescr((EObject)value);
if(param.isInstanceOf("Command")) {
Solution s = new Command_Group(param, this).firstSolution();
+ while(s != null && !isConsumed(s,this)) s = s.getPredecessor().nextSolution(this,s);
if(s != null) {
type = AssignmentType.PRC;
return new Solution(obj,s.getPredecessor());
@@ -351,6 +336,7 @@ protected class Statemachine_1_Assignment_states extends AssignmentToken {
IInstanceDescription param = getDescr((EObject)value);
if(param.isInstanceOf("State")) {
Solution s = new State_Group(param, this).firstSolution();
+ while(s != null && !isConsumed(s,this)) s = s.getPredecessor().nextSolution(this,s);
if(s != null) {
type = AssignmentType.PRC;
return new Solution(obj,s.getPredecessor());
@@ -389,7 +375,7 @@ protected class Event_Group extends GroupToken {
while(s1 != null) {
Solution s2 = new Event_0_Group(s1.getCurrent(), s1.getPredecessor()).firstSolution();
if(s2 == null) {
- s1 = s1.getPredecessor().nextSolution(this);
+ s1 = s1.getPredecessor().nextSolution(this,s1);
if(s1 == null) return null;
} else {
last = s2.getPredecessor();
@@ -417,7 +403,7 @@ protected class Event_0_Group extends GroupToken {
while(s1 != null) {
Solution s2 = new Event_0_0_Assignment_resetting(s1.getCurrent(), s1.getPredecessor()).firstSolution();
if(s2 == null) {
- s1 = s1.getPredecessor().nextSolution(this);
+ s1 = s1.getPredecessor().nextSolution(this,s1);
if(s1 == null) return null;
} else {
last = s2.getPredecessor();
@@ -526,7 +512,7 @@ protected class Command_Group extends GroupToken {
while(s1 != null) {
Solution s2 = new Command_0_Assignment_name(s1.getCurrent(), s1.getPredecessor()).firstSolution();
if(s2 == null) {
- s1 = s1.getPredecessor().nextSolution(this);
+ s1 = s1.getPredecessor().nextSolution(this,s1);
if(s1 == null) return null;
} else {
last = s2.getPredecessor();
@@ -611,7 +597,7 @@ protected class State_Group extends GroupToken {
while(s1 != null) {
Solution s2 = new State_0_Group(s1.getCurrent(), s1.getPredecessor()).firstSolution();
if(s2 == null) {
- s1 = s1.getPredecessor().nextSolution(this);
+ s1 = s1.getPredecessor().nextSolution(this,s1);
if(s1 == null) return null;
} else {
last = s2.getPredecessor();
@@ -639,7 +625,7 @@ protected class State_0_Group extends GroupToken {
while(s1 != null) {
Solution s2 = new State_0_0_Group(s1.getCurrent(), s1.getPredecessor()).firstSolution();
if(s2 == null) {
- s1 = s1.getPredecessor().nextSolution(this);
+ s1 = s1.getPredecessor().nextSolution(this,s1);
if(s1 == null) return null;
} else {
last = s2.getPredecessor();
@@ -667,7 +653,7 @@ protected class State_0_0_Group extends GroupToken {
while(s1 != null) {
Solution s2 = new State_0_0_0_Group(s1.getCurrent(), s1.getPredecessor()).firstSolution();
if(s2 == null) {
- s1 = s1.getPredecessor().nextSolution(this);
+ s1 = s1.getPredecessor().nextSolution(this,s1);
if(s1 == null) return null;
} else {
last = s2.getPredecessor();
@@ -695,7 +681,7 @@ protected class State_0_0_0_Group extends GroupToken {
while(s1 != null) {
Solution s2 = new State_0_0_0_0_Keyword_state(s1.getCurrent(), s1.getPredecessor()).firstSolution();
if(s2 == null) {
- s1 = s1.getPredecessor().nextSolution(this);
+ s1 = s1.getPredecessor().nextSolution(this,s1);
if(s1 == null) return null;
} else {
last = s2.getPredecessor();
@@ -759,7 +745,7 @@ protected class State_0_0_1_Group extends GroupToken {
while(s1 != null) {
Solution s2 = new State_0_0_1_0_Group(s1.getCurrent(), s1.getPredecessor()).firstSolution();
if(s2 == null) {
- s1 = s1.getPredecessor().nextSolution(this);
+ s1 = s1.getPredecessor().nextSolution(this,s1);
if(s1 == null) return null;
} else {
last = s2.getPredecessor();
@@ -787,7 +773,7 @@ protected class State_0_0_1_0_Group extends GroupToken {
while(s1 != null) {
Solution s2 = new State_0_0_1_0_0_Group(s1.getCurrent(), s1.getPredecessor()).firstSolution();
if(s2 == null) {
- s1 = s1.getPredecessor().nextSolution(this);
+ s1 = s1.getPredecessor().nextSolution(this,s1);
if(s1 == null) return null;
} else {
last = s2.getPredecessor();
@@ -815,7 +801,7 @@ protected class State_0_0_1_0_0_Group extends GroupToken {
while(s1 != null) {
Solution s2 = new State_0_0_1_0_0_0_Keyword_actions(s1.getCurrent(), s1.getPredecessor()).firstSolution();
if(s2 == null) {
- s1 = s1.getPredecessor().nextSolution(this);
+ s1 = s1.getPredecessor().nextSolution(this,s1);
if(s1 == null) return null;
} else {
last = s2.getPredecessor();
@@ -912,6 +898,7 @@ protected class State_0_1_Assignment_transitions extends AssignmentToken {
IInstanceDescription param = getDescr((EObject)value);
if(param.isInstanceOf("Transition")) {
Solution s = new Transition_Group(param, this).firstSolution();
+ while(s != null && !isConsumed(s,this)) s = s.getPredecessor().nextSolution(this,s);
if(s != null) {
type = AssignmentType.PRC;
return new Solution(obj,s.getPredecessor());
@@ -963,7 +950,7 @@ protected class Transition_Group extends GroupToken {
while(s1 != null) {
Solution s2 = new Transition_0_Group(s1.getCurrent(), s1.getPredecessor()).firstSolution();
if(s2 == null) {
- s1 = s1.getPredecessor().nextSolution(this);
+ s1 = s1.getPredecessor().nextSolution(this,s1);
if(s1 == null) return null;
} else {
last = s2.getPredecessor();
@@ -991,7 +978,7 @@ protected class Transition_0_Group extends GroupToken {
while(s1 != null) {
Solution s2 = new Transition_0_0_Assignment_event(s1.getCurrent(), s1.getPredecessor()).firstSolution();
if(s2 == null) {
- s1 = s1.getPredecessor().nextSolution(this);
+ s1 = s1.getPredecessor().nextSolution(this,s1);
if(s1 == null) return null;
} else {
last = s2.getPredecessor();