| author | szarnekow | 2009-02-14 13:21:09 (EST) |
|---|---|---|
| committer | sefftinge | 2009-02-14 13:21:09 (EST) |
| commit | 9c89c6b2ea3694e291c6ccda90cc9700f9fe6ba2 (patch) (side-by-side diff) | |
| tree | 02be66d6e5322fdb40b3582decb2ed7ca347c3ef | |
| parent | 956bc245d22b9021386508a4cb888118ccc98d25 (diff) | |
| download | org.eclipse.xtext-9c89c6b2ea3694e291c6ccda90cc9700f9fe6ba2.zip org.eclipse.xtext-9c89c6b2ea3694e291c6ccda90cc9700f9fe6ba2.tar.gz org.eclipse.xtext-9c89c6b2ea3694e291c6ccda90cc9700f9fe6ba2.tar.bz2 | |
Fix: generated GrammarAccess is no longer a singleton and more designed to be reusable
Some fixes with assigned grammar elements in packrat parser
641 files changed, 16670 insertions, 14024 deletions
diff --git a/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/packrat/ReferenceGrammarPackratParser.java b/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/packrat/ReferenceGrammarPackratParser.java index 668e96b..7cefc10 100644 --- a/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/packrat/ReferenceGrammarPackratParser.java +++ b/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/packrat/ReferenceGrammarPackratParser.java @@ -3,14 +3,29 @@ Generated with Xtext */ package org.eclipse.xtext.reference.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; -public class ReferenceGrammarPackratParser extends AbstractPackratParser { +import org.eclipse.xtext.reference.services.ReferenceGrammarGrammarAccess; +public class ReferenceGrammarPackratParser extends AbstractPackratParser { + + @Inject + public ReferenceGrammarPackratParser(IParseResultFactory parseResultFactory, ReferenceGrammarGrammarAccess grammarAccess) { + super(parseResultFactory, grammarAccess); + } + @Override protected ReferenceGrammarParserConfiguration createParserConfiguration(IInternalParserConfiguration configuration) { - return new ReferenceGrammarParserConfiguration(configuration); + return new ReferenceGrammarParserConfiguration(configuration, getGrammarAccess()); + } + + @Override + protected ReferenceGrammarGrammarAccess getGrammarAccess() { + return (ReferenceGrammarGrammarAccess)super.getGrammarAccess(); } } diff --git a/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/packrat/ReferenceGrammarParserConfiguration.java b/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/packrat/ReferenceGrammarParserConfiguration.java index 8619d1a..52a6594 100644 --- a/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/packrat/ReferenceGrammarParserConfiguration.java +++ b/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/packrat/ReferenceGrammarParserConfiguration.java @@ -7,6 +7,8 @@ import org.eclipse.xtext.parser.packrat.AbstractParserConfiguration; import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer; import org.eclipse.xtext.parser.packrat.consumers.INonTerminalConsumer; +import org.eclipse.xtext.reference.services.ReferenceGrammarGrammarAccess; + import org.eclipse.xtext.builtin.parser.packrat.XtextBuiltinParserConfiguration; import org.eclipse.xtext.reference.parser.packrat.consumers.ReferenceGrammarSpielplatzConsumer; @@ -39,9 +41,12 @@ public class ReferenceGrammarParserConfiguration extends AbstractParserConfigura private ReferenceGrammarFarbeConsumer farbeConsumer; private ReferenceGrammarCustomTypeParserRuleConsumer customTypeParserRuleConsumer; - public ReferenceGrammarParserConfiguration(IInternalParserConfiguration configuration) { + private ReferenceGrammarGrammarAccess grammarAccess; + + public ReferenceGrammarParserConfiguration(IInternalParserConfiguration configuration, ReferenceGrammarGrammarAccess grammarAccess) { super(configuration); - this.xtextBuiltinConfiguration = new XtextBuiltinParserConfiguration(configuration); + this.grammarAccess = grammarAccess; + this.xtextBuiltinConfiguration = new XtextBuiltinParserConfiguration(configuration, null); } public ReferenceGrammarSpielplatzConsumer getRootConsumer() { @@ -81,6 +86,25 @@ public class ReferenceGrammarParserConfiguration extends AbstractParserConfigura } public void configureConsumers() { + if (grammarAccess == null) + throw new NullPointerException("grammarAccess may not be null, you call configureConsumers"); + getSpielplatzConsumer().setRule(grammarAccess.prSpielplatz()); + getPersonConsumer().setRule(grammarAccess.prPerson()); + getKindConsumer().setRule(grammarAccess.prKind()); + getErwachsenerConsumer().setRule(grammarAccess.prErwachsener()); + getSpielzeugConsumer().setRule(grammarAccess.prSpielzeug()); + getFamilieConsumer().setRule(grammarAccess.prFamilie()); + getFarbeConsumer().setRule(grammarAccess.prFarbe()); + getCustomTypeParserRuleConsumer().setRule(grammarAccess.prCustomTypeParserRule()); + getIdConsumer().setRule(grammarAccess.lrID()); + getIntConsumer().setRule(grammarAccess.lrINT()); + getStringConsumer().setRule(grammarAccess.lrSTRING()); + getMlCommentConsumer().setRule(grammarAccess.lrML_COMMENT()); + getSlCommentConsumer().setRule(grammarAccess.lrSL_COMMENT()); + getWsConsumer().setRule(grammarAccess.lrWS()); + getAnyOtherConsumer().setRule(grammarAccess.lrANY_OTHER()); + + getSpielplatzConsumer().setCustomTypeParserRuleConsumer(getCustomTypeParserRuleConsumer()); getSpielplatzConsumer().setErwachsenerConsumer(getErwachsenerConsumer()); getSpielplatzConsumer().setFamilieConsumer(getFamilieConsumer()); diff --git a/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/packrat/consumers/ReferenceGrammarCustomTypeParserRuleConsumer.java b/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/packrat/consumers/ReferenceGrammarCustomTypeParserRuleConsumer.java index 3052467..3d37bb1 100644 --- a/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/packrat/consumers/ReferenceGrammarCustomTypeParserRuleConsumer.java +++ b/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/packrat/consumers/ReferenceGrammarCustomTypeParserRuleConsumer.java @@ -21,6 +21,8 @@ import org.eclipse.xtext.builtin.parser.packrat.consumers.XtextBuiltinIDConsumer @SuppressWarnings("unused") public final class ReferenceGrammarCustomTypeParserRuleConsumer extends NonTerminalConsumer { + private CustomTypeParserRuleElements rule; + private ITerminalConsumer idConsumer; private ICharacterClass keyword$2$Delimiter; @@ -74,21 +76,20 @@ public final class ReferenceGrammarCustomTypeParserRuleConsumer extends NonTermi } protected int consumeAssignment$3(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeTerminal(idConsumer, "name", false, false, getRule().ele10LexerRuleCallID(), getRuleCall$4$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$4(entryPoint); + } + + protected int consumeRuleCall$4(int entryPoint) throws Exception { + return consumeTerminal(idConsumer, "name", false, false, getRule().ele10LexerRuleCallID(), getRuleCall$4$Delimiter()); } public CustomTypeParserRuleElements getRule() { - return ReferenceGrammarGrammarAccess.INSTANCE.prCustomTypeParserRule(); + // ReferenceGrammarGrammarAccess.INSTANCE.prCustomTypeParserRule() + return rule; + } + + public void setRule(CustomTypeParserRuleElements rule) { + this.rule = rule; } @Override diff --git a/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/packrat/consumers/ReferenceGrammarErwachsenerConsumer.java b/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/packrat/consumers/ReferenceGrammarErwachsenerConsumer.java index 83aa230..aee82a2 100644 --- a/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/packrat/consumers/ReferenceGrammarErwachsenerConsumer.java +++ b/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/packrat/consumers/ReferenceGrammarErwachsenerConsumer.java @@ -22,6 +22,8 @@ import org.eclipse.xtext.builtin.parser.packrat.consumers.XtextBuiltinINTConsume @SuppressWarnings("unused") public final class ReferenceGrammarErwachsenerConsumer extends NonTerminalConsumer { + private ErwachsenerElements rule; + private ITerminalConsumer idConsumer; private ITerminalConsumer intConsumer; @@ -116,31 +118,19 @@ public final class ReferenceGrammarErwachsenerConsumer extends NonTerminalConsum } protected int consumeAssignment$7(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeTerminal(idConsumer, "name", false, false, getRule().ele0010LexerRuleCallID(), getRuleCall$8$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$8(entryPoint); + } + + protected int consumeRuleCall$8(int entryPoint) throws Exception { + return consumeTerminal(idConsumer, "name", false, false, getRule().ele0010LexerRuleCallID(), getRuleCall$8$Delimiter()); } protected int consumeAssignment$9(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeTerminal(intConsumer, "age", false, false, getRule().ele010LexerRuleCallINT(), getRuleCall$10$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$10(entryPoint); + } + + protected int consumeRuleCall$10(int entryPoint) throws Exception { + return consumeTerminal(intConsumer, "age", false, false, getRule().ele010LexerRuleCallINT(), getRuleCall$10$Delimiter()); } protected int consumeKeyword$11(int entryPoint) throws Exception { @@ -148,7 +138,12 @@ public final class ReferenceGrammarErwachsenerConsumer extends NonTerminalConsum } public ErwachsenerElements getRule() { - return ReferenceGrammarGrammarAccess.INSTANCE.prErwachsener(); + // ReferenceGrammarGrammarAccess.INSTANCE.prErwachsener() + return rule; + } + + public void setRule(ErwachsenerElements rule) { + this.rule = rule; } @Override diff --git a/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/packrat/consumers/ReferenceGrammarFamilieConsumer.java b/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/packrat/consumers/ReferenceGrammarFamilieConsumer.java index f9b555e..2534733 100644 --- a/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/packrat/consumers/ReferenceGrammarFamilieConsumer.java +++ b/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/packrat/consumers/ReferenceGrammarFamilieConsumer.java @@ -22,6 +22,8 @@ import org.eclipse.xtext.builtin.parser.packrat.consumers.XtextBuiltinSTRINGCons @SuppressWarnings("unused") public final class ReferenceGrammarFamilieConsumer extends NonTerminalConsumer { + private FamilieElements rule; + private ITerminalConsumer idConsumer; private ITerminalConsumer stringConsumer; @@ -161,81 +163,67 @@ public final class ReferenceGrammarFamilieConsumer extends NonTerminalConsumer { } protected int consumeAssignment$10(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - // TODO use markers in assignments of alternatives to recover - announceNextPath(); - // TODO use markers in assignments of alternatives to recover - announceNextPath(); - tempResult = consumeKeyword(getRule().ele000001000KeywordKeyword(), "name", false, false, getKeyword$13$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - - announceNextPath(); - tempResult = consumeTerminal(stringConsumer, "name", false, false, getRule().ele000001001LexerRuleCallSTRING(), getRuleCall$14$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; + return consumeAlternatives$11(entryPoint); + } + protected int consumeAlternatives$11(int entryPoint) throws Exception { + AlternativesResult result = createAlternativesResult(); + switch(entryPoint) { + case -1: // use fall through semantics of switch case + result.reset(); + case 0: + result.nextAlternative(); + if (result.isAlternativeDone(consumeKeyword$13(nextEntryPoint()))) { + return result.getResult(); + } + case 1: + result.nextAlternative(); + if (result.isAlternativeDone(consumeRuleCall$14(nextEntryPoint()))) { + return result.getResult(); + } + case 2: + result.nextAlternative(); + if (result.isAlternativeDone(consumeRuleCall$15(nextEntryPoint()))) { + return result.getResult(); + } } - result = tempResult >= result ? tempResult : result; + return result.getResult(); + } + + protected int consumeKeyword$13(int entryPoint) throws Exception { + return consumeKeyword(getRule().ele000001000KeywordKeyword(), "name", false, false, getKeyword$13$Delimiter()); + } - announceNextPath(); - tempResult = consumeTerminal(idConsumer, "name", false, false, getRule().ele00000101LexerRuleCallID(), getRuleCall$15$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; + protected int consumeRuleCall$14(int entryPoint) throws Exception { + return consumeTerminal(stringConsumer, "name", false, false, getRule().ele000001001LexerRuleCallSTRING(), getRuleCall$14$Delimiter()); + } - announceLevelFinished(); - return result; + protected int consumeRuleCall$15(int entryPoint) throws Exception { + return consumeTerminal(idConsumer, "name", false, false, getRule().ele00000101LexerRuleCallID(), getRuleCall$15$Delimiter()); } protected int consumeAssignment$16(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeTerminal(idConsumer, "mutter", false, false, getRule().ele000010CrossReferenceEStringErwachsener(), getCrossReference$17$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeCrossReference$17(entryPoint); + } + + protected int consumeCrossReference$17(int entryPoint) throws Exception { + return consumeTerminal(idConsumer, "mutter", false, false, getRule().ele000010CrossReferenceEStringErwachsener(), getCrossReference$17$Delimiter()); } protected int consumeAssignment$19(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeTerminal(idConsumer, "vater", false, false, getRule().ele00010CrossReferenceEStringErwachsener(), getCrossReference$20$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeCrossReference$20(entryPoint); + } + + protected int consumeCrossReference$20(int entryPoint) throws Exception { + return consumeTerminal(idConsumer, "vater", false, false, getRule().ele00010CrossReferenceEStringErwachsener(), getCrossReference$20$Delimiter()); } protected int consumeAssignment$22(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeTerminal(idConsumer, "kinder", true, false, getRule().ele0010CrossReferenceEStringKind(), getCrossReference$23$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeCrossReference$23(entryPoint); + } + + protected int consumeCrossReference$23(int entryPoint) throws Exception { + return consumeTerminal(idConsumer, "kinder", true, false, getRule().ele0010CrossReferenceEStringKind(), getCrossReference$23$Delimiter()); } protected int consumeGroup$25(int entryPoint) throws Exception { @@ -283,17 +271,11 @@ public final class ReferenceGrammarFamilieConsumer extends NonTerminalConsumer { } protected int consumeAssignment$27(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeTerminal(idConsumer, "kinder", true, false, getRule().ele0110CrossReferenceEStringKind(), getCrossReference$28$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeCrossReference$28(entryPoint); + } + + protected int consumeCrossReference$28(int entryPoint) throws Exception { + return consumeTerminal(idConsumer, "kinder", true, false, getRule().ele0110CrossReferenceEStringKind(), getCrossReference$28$Delimiter()); } protected int consumeKeyword$30(int entryPoint) throws Exception { @@ -301,7 +283,12 @@ public final class ReferenceGrammarFamilieConsumer extends NonTerminalConsumer { } public FamilieElements getRule() { - return ReferenceGrammarGrammarAccess.INSTANCE.prFamilie(); + // ReferenceGrammarGrammarAccess.INSTANCE.prFamilie() + return rule; + } + + public void setRule(FamilieElements rule) { + this.rule = rule; } @Override diff --git a/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/packrat/consumers/ReferenceGrammarFarbeConsumer.java b/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/packrat/consumers/ReferenceGrammarFarbeConsumer.java index 2e8eeb1..5b1c527 100644 --- a/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/packrat/consumers/ReferenceGrammarFarbeConsumer.java +++ b/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/packrat/consumers/ReferenceGrammarFarbeConsumer.java @@ -20,6 +20,8 @@ import org.eclipse.xtext.reference.services.ReferenceGrammarGrammarAccess.FarbeE @SuppressWarnings("unused") public final class ReferenceGrammarFarbeConsumer extends NonTerminalConsumer { + private FarbeElements rule; + private ICharacterClass keyword$5$Delimiter; @@ -43,54 +45,61 @@ public final class ReferenceGrammarFarbeConsumer extends NonTerminalConsumer { } protected int consumeAssignment$1(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - // TODO use markers in assignments of alternatives to recover - announceNextPath(); - // TODO use markers in assignments of alternatives to recover - announceNextPath(); - // TODO use markers in assignments of alternatives to recover - announceNextPath(); - tempResult = consumeKeyword(getRule().ele0000KeywordROT(), "wert", false, false, getKeyword$5$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - - announceNextPath(); - tempResult = consumeKeyword(getRule().ele0001KeywordBLAU(), "wert", false, false, getKeyword$6$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; + return consumeAlternatives$2(entryPoint); + } + protected int consumeAlternatives$2(int entryPoint) throws Exception { + AlternativesResult result = createAlternativesResult(); + switch(entryPoint) { + case -1: // use fall through semantics of switch case + result.reset(); + case 0: + result.nextAlternative(); + if (result.isAlternativeDone(consumeKeyword$5(nextEntryPoint()))) { + return result.getResult(); + } + case 1: + result.nextAlternative(); + if (result.isAlternativeDone(consumeKeyword$6(nextEntryPoint()))) { + return result.getResult(); + } + case 2: + result.nextAlternative(); + if (result.isAlternativeDone(consumeKeyword$7(nextEntryPoint()))) { + return result.getResult(); + } + case 3: + result.nextAlternative(); + if (result.isAlternativeDone(consumeKeyword$8(nextEntryPoint()))) { + return result.getResult(); + } } - result = tempResult >= result ? tempResult : result; - + return result.getResult(); + } + - announceNextPath(); - tempResult = consumeKeyword(getRule().ele001KeywordGELB(), "wert", false, false, getKeyword$7$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; + protected int consumeKeyword$5(int entryPoint) throws Exception { + return consumeKeyword(getRule().ele0000KeywordROT(), "wert", false, false, getKeyword$5$Delimiter()); + } + protected int consumeKeyword$6(int entryPoint) throws Exception { + return consumeKeyword(getRule().ele0001KeywordBLAU(), "wert", false, false, getKeyword$6$Delimiter()); + } - announceNextPath(); - tempResult = consumeKeyword(getRule().ele01KeywordGRÜN(), "wert", false, false, getKeyword$8$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; + protected int consumeKeyword$7(int entryPoint) throws Exception { + return consumeKeyword(getRule().ele001KeywordGELB(), "wert", false, false, getKeyword$7$Delimiter()); + } - announceLevelFinished(); - return result; + protected int consumeKeyword$8(int entryPoint) throws Exception { + return consumeKeyword(getRule().ele01KeywordGRÜN(), "wert", false, false, getKeyword$8$Delimiter()); } public FarbeElements getRule() { - return ReferenceGrammarGrammarAccess.INSTANCE.prFarbe(); + // ReferenceGrammarGrammarAccess.INSTANCE.prFarbe() + return rule; + } + + public void setRule(FarbeElements rule) { + this.rule = rule; } @Override diff --git a/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/packrat/consumers/ReferenceGrammarKindConsumer.java b/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/packrat/consumers/ReferenceGrammarKindConsumer.java index cbe9a49..6a2ee13 100644 --- a/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/packrat/consumers/ReferenceGrammarKindConsumer.java +++ b/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/packrat/consumers/ReferenceGrammarKindConsumer.java @@ -22,6 +22,8 @@ import org.eclipse.xtext.builtin.parser.packrat.consumers.XtextBuiltinINTConsume @SuppressWarnings("unused") public final class ReferenceGrammarKindConsumer extends NonTerminalConsumer { + private KindElements rule; + private ITerminalConsumer idConsumer; private ITerminalConsumer intConsumer; @@ -116,31 +118,19 @@ public final class ReferenceGrammarKindConsumer extends NonTerminalConsumer { } protected int consumeAssignment$7(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeTerminal(idConsumer, "name", false, false, getRule().ele0010LexerRuleCallID(), getRuleCall$8$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$8(entryPoint); + } + + protected int consumeRuleCall$8(int entryPoint) throws Exception { + return consumeTerminal(idConsumer, "name", false, false, getRule().ele0010LexerRuleCallID(), getRuleCall$8$Delimiter()); } protected int consumeAssignment$9(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeTerminal(intConsumer, "age", false, false, getRule().ele010LexerRuleCallINT(), getRuleCall$10$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$10(entryPoint); + } + + protected int consumeRuleCall$10(int entryPoint) throws Exception { + return consumeTerminal(intConsumer, "age", false, false, getRule().ele010LexerRuleCallINT(), getRuleCall$10$Delimiter()); } protected int consumeKeyword$11(int entryPoint) throws Exception { @@ -148,7 +138,12 @@ public final class ReferenceGrammarKindConsumer extends NonTerminalConsumer { } public KindElements getRule() { - return ReferenceGrammarGrammarAccess.INSTANCE.prKind(); + // ReferenceGrammarGrammarAccess.INSTANCE.prKind() + return rule; + } + + public void setRule(KindElements rule) { + this.rule = rule; } @Override diff --git a/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/packrat/consumers/ReferenceGrammarPersonConsumer.java b/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/packrat/consumers/ReferenceGrammarPersonConsumer.java index a08517c..a63c6b8 100644 --- a/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/packrat/consumers/ReferenceGrammarPersonConsumer.java +++ b/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/packrat/consumers/ReferenceGrammarPersonConsumer.java @@ -22,6 +22,8 @@ import org.eclipse.xtext.reference.parser.packrat.consumers.ReferenceGrammarKind @SuppressWarnings("unused") public final class ReferenceGrammarPersonConsumer extends NonTerminalConsumer { + private PersonElements rule; + private INonTerminalConsumer erwachsenerConsumer; private INonTerminalConsumer kindConsumer; @@ -62,7 +64,12 @@ public final class ReferenceGrammarPersonConsumer extends NonTerminalConsumer { } public PersonElements getRule() { - return ReferenceGrammarGrammarAccess.INSTANCE.prPerson(); + // ReferenceGrammarGrammarAccess.INSTANCE.prPerson() + return rule; + } + + public void setRule(PersonElements rule) { + this.rule = rule; } @Override diff --git a/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/packrat/consumers/ReferenceGrammarSpielplatzConsumer.java b/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/packrat/consumers/ReferenceGrammarSpielplatzConsumer.java index 25cbc2e..4f9069b 100644 --- a/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/packrat/consumers/ReferenceGrammarSpielplatzConsumer.java +++ b/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/packrat/consumers/ReferenceGrammarSpielplatzConsumer.java @@ -27,6 +27,8 @@ import org.eclipse.xtext.builtin.parser.packrat.consumers.XtextBuiltinSTRINGCons @SuppressWarnings("unused") public final class ReferenceGrammarSpielplatzConsumer extends NonTerminalConsumer { + private SpielplatzElements rule; + private INonTerminalConsumer customTypeParserRuleConsumer; private INonTerminalConsumer erwachsenerConsumer; private INonTerminalConsumer familieConsumer; @@ -141,17 +143,11 @@ public final class ReferenceGrammarSpielplatzConsumer extends NonTerminalConsume } protected int consumeAssignment$7(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeTerminal(intConsumer, "groesse", false, false, getRule().ele000010LexerRuleCallINT(), getRuleCall$8$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$8(entryPoint); + } + + protected int consumeRuleCall$8(int entryPoint) throws Exception { + return consumeTerminal(intConsumer, "groesse", false, false, getRule().ele000010LexerRuleCallINT(), getRuleCall$8$Delimiter()); } protected int consumeAssignment$9(int entryPoint) throws Exception { @@ -165,17 +161,11 @@ public final class ReferenceGrammarSpielplatzConsumer extends NonTerminalConsume } protected int doConsumeAssignment$9(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeTerminal(stringConsumer, "beschreibung", false, false, getRule().ele00010LexerRuleCallSTRING(), getRuleCall$10$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$10(entryPoint); + } + + protected int consumeRuleCall$10(int entryPoint) throws Exception { + return consumeTerminal(stringConsumer, "beschreibung", false, false, getRule().ele00010LexerRuleCallSTRING(), getRuleCall$10$Delimiter()); } protected int consumeKeyword$11(int entryPoint) throws Exception { @@ -226,73 +216,43 @@ public final class ReferenceGrammarSpielplatzConsumer extends NonTerminalConsume } protected int consumeAssignment$16(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(kindConsumer, "kinder", true, false, false, getRule().ele0100000ParserRuleCallKind()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$17(entryPoint); + } + + protected int consumeRuleCall$17(int entryPoint) throws Exception { + return consumeNonTerminal(kindConsumer, "kinder", true, false, false, getRule().ele0100000ParserRuleCallKind()); } protected int consumeAssignment$18(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(erwachsenerConsumer, "erzieher", true, false, false, getRule().ele0100010ParserRuleCallErwachsener()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$19(entryPoint); + } + + protected int consumeRuleCall$19(int entryPoint) throws Exception { + return consumeNonTerminal(erwachsenerConsumer, "erzieher", true, false, false, getRule().ele0100010ParserRuleCallErwachsener()); } protected int consumeAssignment$20(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(spielzeugConsumer, "spielzeuge", true, false, false, getRule().ele010010ParserRuleCallSpielzeug()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$21(entryPoint); + } + + protected int consumeRuleCall$21(int entryPoint) throws Exception { + return consumeNonTerminal(spielzeugConsumer, "spielzeuge", true, false, false, getRule().ele010010ParserRuleCallSpielzeug()); } protected int consumeAssignment$22(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(familieConsumer, "familie", true, false, false, getRule().ele01010ParserRuleCallFamilie()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$23(entryPoint); + } + + protected int consumeRuleCall$23(int entryPoint) throws Exception { + return consumeNonTerminal(familieConsumer, "familie", true, false, false, getRule().ele01010ParserRuleCallFamilie()); } protected int consumeAssignment$24(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(customTypeParserRuleConsumer, "types", true, false, false, getRule().ele0110ParserRuleCallCustomTypeParserRule()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$25(entryPoint); + } + + protected int consumeRuleCall$25(int entryPoint) throws Exception { + return consumeNonTerminal(customTypeParserRuleConsumer, "types", true, false, false, getRule().ele0110ParserRuleCallCustomTypeParserRule()); } protected int consumeKeyword$26(int entryPoint) throws Exception { @@ -300,7 +260,12 @@ public final class ReferenceGrammarSpielplatzConsumer extends NonTerminalConsume } public SpielplatzElements getRule() { - return ReferenceGrammarGrammarAccess.INSTANCE.prSpielplatz(); + // ReferenceGrammarGrammarAccess.INSTANCE.prSpielplatz() + return rule; + } + + public void setRule(SpielplatzElements rule) { + this.rule = rule; } @Override diff --git a/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/packrat/consumers/ReferenceGrammarSpielzeugConsumer.java b/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/packrat/consumers/ReferenceGrammarSpielzeugConsumer.java index 04b2e76..9993f2b 100644 --- a/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/packrat/consumers/ReferenceGrammarSpielzeugConsumer.java +++ b/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/packrat/consumers/ReferenceGrammarSpielzeugConsumer.java @@ -22,6 +22,8 @@ import org.eclipse.xtext.builtin.parser.packrat.consumers.XtextBuiltinIDConsumer @SuppressWarnings("unused") public final class ReferenceGrammarSpielzeugConsumer extends NonTerminalConsumer { + private SpielzeugElements rule; + private INonTerminalConsumer farbeConsumer; private ITerminalConsumer idConsumer; @@ -113,31 +115,19 @@ public final class ReferenceGrammarSpielzeugConsumer extends NonTerminalConsumer } protected int consumeAssignment$7(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeTerminal(idConsumer, "name", false, false, getRule().ele0010LexerRuleCallID(), getRuleCall$8$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$8(entryPoint); + } + + protected int consumeRuleCall$8(int entryPoint) throws Exception { + return consumeTerminal(idConsumer, "name", false, false, getRule().ele0010LexerRuleCallID(), getRuleCall$8$Delimiter()); } protected int consumeAssignment$9(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(farbeConsumer, "farbe", false, false, false, getRule().ele010ParserRuleCallFarbe()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$10(entryPoint); + } + + protected int consumeRuleCall$10(int entryPoint) throws Exception { + return consumeNonTerminal(farbeConsumer, "farbe", false, false, false, getRule().ele010ParserRuleCallFarbe()); } protected int consumeKeyword$11(int entryPoint) throws Exception { @@ -145,7 +135,12 @@ public final class ReferenceGrammarSpielzeugConsumer extends NonTerminalConsumer } public SpielzeugElements getRule() { - return ReferenceGrammarGrammarAccess.INSTANCE.prSpielzeug(); + // ReferenceGrammarGrammarAccess.INSTANCE.prSpielzeug() + return rule; + } + + public void setRule(SpielzeugElements rule) { + this.rule = rule; } @Override 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 88390da..f1c3677 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 @@ -9,12 +9,15 @@ import org.eclipse.xtext.*; import org.eclipse.xtext.parsetree.reconstr.*; import org.eclipse.xtext.parsetree.reconstr.impl.*; import org.eclipse.xtext.parsetree.reconstr.impl.AbstractParseTreeConstructor.AbstractToken.Solution; -import org.eclipse.xtext.builtin.XtextBuiltinGrammarAccess; import org.eclipse.xtext.reference.services.ReferenceGrammarGrammarAccess; +import com.google.inject.Inject; public class ReferenceGrammarParseTreeConstructor extends AbstractParseTreeConstructor { + @Inject + private ReferenceGrammarGrammarAccess grammarAccess; + protected Solution internalSerialize(EObject obj) { IInstanceDescription inst = getDescr(obj); Solution s; @@ -45,7 +48,7 @@ protected class Spielplatz_Group extends GroupToken { } public Group getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prSpielplatz().eleGroup(); + return grammarAccess.prSpielplatz().eleGroup(); } @Override @@ -74,7 +77,7 @@ protected class Spielplatz_0_Group extends GroupToken { } public Group getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prSpielplatz().ele0Group(); + return grammarAccess.prSpielplatz().ele0Group(); } @Override @@ -103,7 +106,7 @@ protected class Spielplatz_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prSpielplatz().ele00Group(); + return grammarAccess.prSpielplatz().ele00Group(); } @Override @@ -132,7 +135,7 @@ protected class Spielplatz_0_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prSpielplatz().ele000Group(); + return grammarAccess.prSpielplatz().ele000Group(); } @Override @@ -161,7 +164,7 @@ protected class Spielplatz_0_0_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prSpielplatz().ele0000Group(); + return grammarAccess.prSpielplatz().ele0000Group(); } @Override @@ -190,7 +193,7 @@ protected class Spielplatz_0_0_0_0_0_Keyword_spielplatz extends KeywordToken { } public Keyword getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prSpielplatz().ele00000KeywordSpielplatz(); + return grammarAccess.prSpielplatz().ele00000KeywordSpielplatz(); } } @@ -202,7 +205,7 @@ protected class Spielplatz_0_0_0_0_1_Assignment_groesse extends AssignmentToken } public Assignment getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prSpielplatz().ele00001AssignmentGroesse(); + return grammarAccess.prSpielplatz().ele00001AssignmentGroesse(); } @Override @@ -211,7 +214,7 @@ protected class Spielplatz_0_0_0_0_1_Assignment_groesse extends AssignmentToken IInstanceDescription obj = current.cloneAndConsume("groesse"); if(Boolean.TRUE.booleanValue()) { // xtext::RuleCall FIXME: check if value is valid for lexer rule type = AssignmentType.LRC; - element = ReferenceGrammarGrammarAccess.INSTANCE.prSpielplatz().ele000010LexerRuleCallINT(); + element = grammarAccess.prSpielplatz().ele000010LexerRuleCallINT(); return new Solution(obj); } return null; @@ -227,7 +230,7 @@ protected class Spielplatz_0_0_0_1_Assignment_beschreibung extends AssignmentTok } public Assignment getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prSpielplatz().ele0001AssignmentBeschreibung(); + return grammarAccess.prSpielplatz().ele0001AssignmentBeschreibung(); } @Override @@ -236,7 +239,7 @@ protected class Spielplatz_0_0_0_1_Assignment_beschreibung extends AssignmentTok IInstanceDescription obj = current.cloneAndConsume("beschreibung"); if(Boolean.TRUE.booleanValue()) { // xtext::RuleCall FIXME: check if value is valid for lexer rule type = AssignmentType.LRC; - element = ReferenceGrammarGrammarAccess.INSTANCE.prSpielplatz().ele00010LexerRuleCallSTRING(); + element = grammarAccess.prSpielplatz().ele00010LexerRuleCallSTRING(); return new Solution(obj); } return null; @@ -252,7 +255,7 @@ protected class Spielplatz_0_0_1_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prSpielplatz().ele001KeywordLeftCurlyBracket(); + return grammarAccess.prSpielplatz().ele001KeywordLeftCurlyBracket(); } } @@ -265,7 +268,7 @@ protected class Spielplatz_0_1_Alternatives extends AlternativesToken { } public Alternatives getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prSpielplatz().ele01Alternatives(); + return grammarAccess.prSpielplatz().ele01Alternatives(); } @Override @@ -287,7 +290,7 @@ protected class Spielplatz_0_1_0_Alternatives extends AlternativesToken { } public Alternatives getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prSpielplatz().ele010Alternatives(); + return grammarAccess.prSpielplatz().ele010Alternatives(); } @Override @@ -309,7 +312,7 @@ protected class Spielplatz_0_1_0_0_Alternatives extends AlternativesToken { } public Alternatives getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prSpielplatz().ele0100Alternatives(); + return grammarAccess.prSpielplatz().ele0100Alternatives(); } @Override @@ -331,7 +334,7 @@ protected class Spielplatz_0_1_0_0_0_Alternatives extends AlternativesToken { } public Alternatives getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prSpielplatz().ele01000Alternatives(); + return grammarAccess.prSpielplatz().ele01000Alternatives(); } @Override @@ -353,7 +356,7 @@ protected class Spielplatz_0_1_0_0_0_0_Assignment_kinder extends AssignmentToken } public Assignment getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prSpielplatz().ele010000AssignmentKinder(); + return grammarAccess.prSpielplatz().ele010000AssignmentKinder(); } @Override @@ -385,7 +388,7 @@ protected class Spielplatz_0_1_0_0_0_1_Assignment_erzieher extends AssignmentTok } public Assignment getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prSpielplatz().ele010001AssignmentErzieher(); + return grammarAccess.prSpielplatz().ele010001AssignmentErzieher(); } @Override @@ -418,7 +421,7 @@ protected class Spielplatz_0_1_0_0_1_Assignment_spielzeuge extends AssignmentTok } public Assignment getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prSpielplatz().ele01001AssignmentSpielzeuge(); + return grammarAccess.prSpielplatz().ele01001AssignmentSpielzeuge(); } @Override @@ -451,7 +454,7 @@ protected class Spielplatz_0_1_0_1_Assignment_familie extends AssignmentToken { } public Assignment getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prSpielplatz().ele0101AssignmentFamilie(); + return grammarAccess.prSpielplatz().ele0101AssignmentFamilie(); } @Override @@ -484,7 +487,7 @@ protected class Spielplatz_0_1_1_Assignment_types extends AssignmentToken { } public Assignment getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prSpielplatz().ele011AssignmentTypes(); + return grammarAccess.prSpielplatz().ele011AssignmentTypes(); } @Override @@ -518,7 +521,7 @@ protected class Spielplatz_1_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prSpielplatz().ele1KeywordRightCurlyBracket(); + return grammarAccess.prSpielplatz().ele1KeywordRightCurlyBracket(); } } @@ -541,7 +544,7 @@ protected class Person_Alternatives extends AlternativesToken { } public Alternatives getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prPerson().eleAlternatives(); + return grammarAccess.prPerson().eleAlternatives(); } @Override @@ -563,7 +566,7 @@ protected class Person_0_RuleCall_Kind extends RuleCallToken { } public RuleCall getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prPerson().ele0ParserRuleCallKind(); + return grammarAccess.prPerson().ele0ParserRuleCallKind(); } @Override @@ -582,7 +585,7 @@ protected class Person_1_RuleCall_Erwachsener extends RuleCallToken { } public RuleCall getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prPerson().ele1ParserRuleCallErwachsener(); + return grammarAccess.prPerson().ele1ParserRuleCallErwachsener(); } @Override @@ -612,7 +615,7 @@ protected class Kind_Group extends GroupToken { } public Group getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prKind().eleGroup(); + return grammarAccess.prKind().eleGroup(); } @Override @@ -641,7 +644,7 @@ protected class Kind_0_Group extends GroupToken { } public Group getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prKind().ele0Group(); + return grammarAccess.prKind().ele0Group(); } @Override @@ -670,7 +673,7 @@ protected class Kind_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prKind().ele00Group(); + return grammarAccess.prKind().ele00Group(); } @Override @@ -699,7 +702,7 @@ protected class Kind_0_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prKind().ele000Group(); + return grammarAccess.prKind().ele000Group(); } @Override @@ -728,7 +731,7 @@ protected class Kind_0_0_0_0_Keyword_kind extends KeywordToken { } public Keyword getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prKind().ele0000KeywordKind(); + return grammarAccess.prKind().ele0000KeywordKind(); } } @@ -740,7 +743,7 @@ protected class Kind_0_0_0_1_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prKind().ele0001KeywordLeftParenthesis(); + return grammarAccess.prKind().ele0001KeywordLeftParenthesis(); } } @@ -753,7 +756,7 @@ protected class Kind_0_0_1_Assignment_name extends AssignmentToken { } public Assignment getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prKind().ele001AssignmentName(); + return grammarAccess.prKind().ele001AssignmentName(); } @Override @@ -762,7 +765,7 @@ protected class Kind_0_0_1_Assignment_name extends AssignmentToken { IInstanceDescription obj = current.cloneAndConsume("name"); if(Boolean.TRUE.booleanValue()) { // xtext::RuleCall FIXME: check if value is valid for lexer rule type = AssignmentType.LRC; - element = ReferenceGrammarGrammarAccess.INSTANCE.prKind().ele0010LexerRuleCallID(); + element = grammarAccess.prKind().ele0010LexerRuleCallID(); return new Solution(obj); } return null; @@ -778,7 +781,7 @@ protected class Kind_0_1_Assignment_age extends AssignmentToken { } public Assignment getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prKind().ele01AssignmentAge(); + return grammarAccess.prKind().ele01AssignmentAge(); } @Override @@ -787,7 +790,7 @@ protected class Kind_0_1_Assignment_age extends AssignmentToken { IInstanceDescription obj = current.cloneAndConsume("age"); if(Boolean.TRUE.booleanValue()) { // xtext::RuleCall FIXME: check if value is valid for lexer rule type = AssignmentType.LRC; - element = ReferenceGrammarGrammarAccess.INSTANCE.prKind().ele010LexerRuleCallINT(); + element = grammarAccess.prKind().ele010LexerRuleCallINT(); return new Solution(obj); } return null; @@ -803,7 +806,7 @@ protected class Kind_1_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prKind().ele1KeywordRightParenthesis(); + return grammarAccess.prKind().ele1KeywordRightParenthesis(); } } @@ -826,7 +829,7 @@ protected class Erwachsener_Group extends GroupToken { } public Group getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prErwachsener().eleGroup(); + return grammarAccess.prErwachsener().eleGroup(); } @Override @@ -855,7 +858,7 @@ protected class Erwachsener_0_Group extends GroupToken { } public Group getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prErwachsener().ele0Group(); + return grammarAccess.prErwachsener().ele0Group(); } @Override @@ -884,7 +887,7 @@ protected class Erwachsener_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prErwachsener().ele00Group(); + return grammarAccess.prErwachsener().ele00Group(); } @Override @@ -913,7 +916,7 @@ protected class Erwachsener_0_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prErwachsener().ele000Group(); + return grammarAccess.prErwachsener().ele000Group(); } @Override @@ -942,7 +945,7 @@ protected class Erwachsener_0_0_0_0_Keyword_erwachsener extends KeywordToken { } public Keyword getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prErwachsener().ele0000KeywordErwachsener(); + return grammarAccess.prErwachsener().ele0000KeywordErwachsener(); } } @@ -954,7 +957,7 @@ protected class Erwachsener_0_0_0_1_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prErwachsener().ele0001KeywordLeftParenthesis(); + return grammarAccess.prErwachsener().ele0001KeywordLeftParenthesis(); } } @@ -967,7 +970,7 @@ protected class Erwachsener_0_0_1_Assignment_name extends AssignmentToken { } public Assignment getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prErwachsener().ele001AssignmentName(); + return grammarAccess.prErwachsener().ele001AssignmentName(); } @Override @@ -976,7 +979,7 @@ protected class Erwachsener_0_0_1_Assignment_name extends AssignmentToken { IInstanceDescription obj = current.cloneAndConsume("name"); if(Boolean.TRUE.booleanValue()) { // xtext::RuleCall FIXME: check if value is valid for lexer rule type = AssignmentType.LRC; - element = ReferenceGrammarGrammarAccess.INSTANCE.prErwachsener().ele0010LexerRuleCallID(); + element = grammarAccess.prErwachsener().ele0010LexerRuleCallID(); return new Solution(obj); } return null; @@ -992,7 +995,7 @@ protected class Erwachsener_0_1_Assignment_age extends AssignmentToken { } public Assignment getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prErwachsener().ele01AssignmentAge(); + return grammarAccess.prErwachsener().ele01AssignmentAge(); } @Override @@ -1001,7 +1004,7 @@ protected class Erwachsener_0_1_Assignment_age extends AssignmentToken { IInstanceDescription obj = current.cloneAndConsume("age"); if(Boolean.TRUE.booleanValue()) { // xtext::RuleCall FIXME: check if value is valid for lexer rule type = AssignmentType.LRC; - element = ReferenceGrammarGrammarAccess.INSTANCE.prErwachsener().ele010LexerRuleCallINT(); + element = grammarAccess.prErwachsener().ele010LexerRuleCallINT(); return new Solution(obj); } return null; @@ -1017,7 +1020,7 @@ protected class Erwachsener_1_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prErwachsener().ele1KeywordRightParenthesis(); + return grammarAccess.prErwachsener().ele1KeywordRightParenthesis(); } } @@ -1040,7 +1043,7 @@ protected class Spielzeug_Group extends GroupToken { } public Group getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prSpielzeug().eleGroup(); + return grammarAccess.prSpielzeug().eleGroup(); } @Override @@ -1069,7 +1072,7 @@ protected class Spielzeug_0_Group extends GroupToken { } public Group getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prSpielzeug().ele0Group(); + return grammarAccess.prSpielzeug().ele0Group(); } @Override @@ -1098,7 +1101,7 @@ protected class Spielzeug_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prSpielzeug().ele00Group(); + return grammarAccess.prSpielzeug().ele00Group(); } @Override @@ -1127,7 +1130,7 @@ protected class Spielzeug_0_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prSpielzeug().ele000Group(); + return grammarAccess.prSpielzeug().ele000Group(); } @Override @@ -1156,7 +1159,7 @@ protected class Spielzeug_0_0_0_0_Keyword_spielzeug extends KeywordToken { } public Keyword getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prSpielzeug().ele0000KeywordSpielzeug(); + return grammarAccess.prSpielzeug().ele0000KeywordSpielzeug(); } } @@ -1168,7 +1171,7 @@ protected class Spielzeug_0_0_0_1_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prSpielzeug().ele0001KeywordLeftParenthesis(); + return grammarAccess.prSpielzeug().ele0001KeywordLeftParenthesis(); } } @@ -1181,7 +1184,7 @@ protected class Spielzeug_0_0_1_Assignment_name extends AssignmentToken { } public Assignment getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prSpielzeug().ele001AssignmentName(); + return grammarAccess.prSpielzeug().ele001AssignmentName(); } @Override @@ -1190,7 +1193,7 @@ protected class Spielzeug_0_0_1_Assignment_name extends AssignmentToken { IInstanceDescription obj = current.cloneAndConsume("name"); if(Boolean.TRUE.booleanValue()) { // xtext::RuleCall FIXME: check if value is valid for lexer rule type = AssignmentType.LRC; - element = ReferenceGrammarGrammarAccess.INSTANCE.prSpielzeug().ele0010LexerRuleCallID(); + element = grammarAccess.prSpielzeug().ele0010LexerRuleCallID(); return new Solution(obj); } return null; @@ -1206,7 +1209,7 @@ protected class Spielzeug_0_1_Assignment_farbe extends AssignmentToken { } public Assignment getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prSpielzeug().ele01AssignmentFarbe(); + return grammarAccess.prSpielzeug().ele01AssignmentFarbe(); } @Override @@ -1239,7 +1242,7 @@ protected class Spielzeug_1_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prSpielzeug().ele1KeywordRightParenthesis(); + return grammarAccess.prSpielzeug().ele1KeywordRightParenthesis(); } } @@ -1262,7 +1265,7 @@ protected class Familie_Group extends GroupToken { } public Group getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prFamilie().eleGroup(); + return grammarAccess.prFamilie().eleGroup(); } @Override @@ -1291,7 +1294,7 @@ protected class Familie_0_Group extends GroupToken { } public Group getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prFamilie().ele0Group(); + return grammarAccess.prFamilie().ele0Group(); } @Override @@ -1320,7 +1323,7 @@ protected class Familie_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prFamilie().ele00Group(); + return grammarAccess.prFamilie().ele00Group(); } @Override @@ -1349,7 +1352,7 @@ protected class Familie_0_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prFamilie().ele000Group(); + return grammarAccess.prFamilie().ele000Group(); } @Override @@ -1378,7 +1381,7 @@ protected class Familie_0_0_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prFamilie().ele0000Group(); + return grammarAccess.prFamilie().ele0000Group(); } @Override @@ -1407,7 +1410,7 @@ protected class Familie_0_0_0_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prFamilie().ele00000Group(); + return grammarAccess.prFamilie().ele00000Group(); } @Override @@ -1436,7 +1439,7 @@ protected class Familie_0_0_0_0_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prFamilie().ele000000Group(); + return grammarAccess.prFamilie().ele000000Group(); } @Override @@ -1465,7 +1468,7 @@ protected class Familie_0_0_0_0_0_0_0_Keyword_familie extends KeywordToken { } public Keyword getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prFamilie().ele0000000KeywordFamilie(); + return grammarAccess.prFamilie().ele0000000KeywordFamilie(); } } @@ -1477,7 +1480,7 @@ protected class Familie_0_0_0_0_0_0_1_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prFamilie().ele0000001KeywordLeftParenthesis(); + return grammarAccess.prFamilie().ele0000001KeywordLeftParenthesis(); } } @@ -1490,7 +1493,7 @@ protected class Familie_0_0_0_0_0_1_Assignment_name extends AssignmentToken { } public Assignment getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prFamilie().ele000001AssignmentName(); + return grammarAccess.prFamilie().ele000001AssignmentName(); } @Override @@ -1500,18 +1503,18 @@ protected class Familie_0_0_0_0_0_1_Assignment_name extends AssignmentToken { if("keyword".equals(value)) { // xtext::Keyword type = AssignmentType.KW; - element = ReferenceGrammarGrammarAccess.INSTANCE.prFamilie().ele000001000KeywordKeyword(); + element = grammarAccess.prFamilie().ele000001000KeywordKeyword(); return new Solution(obj); } if(Boolean.TRUE.booleanValue()) { // xtext::RuleCall FIXME: check if value is valid for lexer rule type = AssignmentType.LRC; - element = ReferenceGrammarGrammarAccess.INSTANCE.prFamilie().ele000001001LexerRuleCallSTRING(); + element = grammarAccess.prFamilie().ele000001001LexerRuleCallSTRING(); return new Solution(obj); } if(Boolean.TRUE.booleanValue()) { // xtext::RuleCall FIXME: check if value is valid for lexer rule type = AssignmentType.LRC; - element = ReferenceGrammarGrammarAccess.INSTANCE.prFamilie().ele00000101LexerRuleCallID(); + element = grammarAccess.prFamilie().ele00000101LexerRuleCallID(); return new Solution(obj); } return null; @@ -1527,7 +1530,7 @@ protected class Familie_0_0_0_0_1_Assignment_mutter extends AssignmentToken { } public Assignment getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prFamilie().ele00001AssignmentMutter(); + return grammarAccess.prFamilie().ele00001AssignmentMutter(); } @Override @@ -1538,7 +1541,7 @@ protected class Familie_0_0_0_0_1_Assignment_mutter extends AssignmentToken { IInstanceDescription param = getDescr((EObject)value); if(param.isInstanceOf("Erwachsener")) { type = AssignmentType.CR; - element = ReferenceGrammarGrammarAccess.INSTANCE.prFamilie().ele000010CrossReferenceEStringErwachsener(); + element = grammarAccess.prFamilie().ele000010CrossReferenceEStringErwachsener(); return new Solution(obj); } } @@ -1555,7 +1558,7 @@ protected class Familie_0_0_0_1_Assignment_vater extends AssignmentToken { } public Assignment getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prFamilie().ele0001AssignmentVater(); + return grammarAccess.prFamilie().ele0001AssignmentVater(); } @Override @@ -1566,7 +1569,7 @@ protected class Familie_0_0_0_1_Assignment_vater extends AssignmentToken { IInstanceDescription param = getDescr((EObject)value); if(param.isInstanceOf("Erwachsener")) { type = AssignmentType.CR; - element = ReferenceGrammarGrammarAccess.INSTANCE.prFamilie().ele00010CrossReferenceEStringErwachsener(); + element = grammarAccess.prFamilie().ele00010CrossReferenceEStringErwachsener(); return new Solution(obj); } } @@ -1583,7 +1586,7 @@ protected class Familie_0_0_1_Assignment_kinder extends AssignmentToken { } public Assignment getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prFamilie().ele001AssignmentKinder(); + return grammarAccess.prFamilie().ele001AssignmentKinder(); } @Override @@ -1594,7 +1597,7 @@ protected class Familie_0_0_1_Assignment_kinder extends AssignmentToken { IInstanceDescription param = getDescr((EObject)value); if(param.isInstanceOf("Kind")) { type = AssignmentType.CR; - element = ReferenceGrammarGrammarAccess.INSTANCE.prFamilie().ele0010CrossReferenceEStringKind(); + element = grammarAccess.prFamilie().ele0010CrossReferenceEStringKind(); return new Solution(obj); } } @@ -1611,7 +1614,7 @@ protected class Familie_0_1_Group extends GroupToken { } public Group getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prFamilie().ele01Group(); + return grammarAccess.prFamilie().ele01Group(); } @Override @@ -1640,7 +1643,7 @@ protected class Familie_0_1_0_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prFamilie().ele010KeywordComma(); + return grammarAccess.prFamilie().ele010KeywordComma(); } } @@ -1652,7 +1655,7 @@ protected class Familie_0_1_1_Assignment_kinder extends AssignmentToken { } public Assignment getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prFamilie().ele011AssignmentKinder(); + return grammarAccess.prFamilie().ele011AssignmentKinder(); } @Override @@ -1663,7 +1666,7 @@ protected class Familie_0_1_1_Assignment_kinder extends AssignmentToken { IInstanceDescription param = getDescr((EObject)value); if(param.isInstanceOf("Kind")) { type = AssignmentType.CR; - element = ReferenceGrammarGrammarAccess.INSTANCE.prFamilie().ele0110CrossReferenceEStringKind(); + element = grammarAccess.prFamilie().ele0110CrossReferenceEStringKind(); return new Solution(obj); } } @@ -1681,7 +1684,7 @@ protected class Familie_1_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prFamilie().ele1KeywordRightParenthesis(); + return grammarAccess.prFamilie().ele1KeywordRightParenthesis(); } } @@ -1704,7 +1707,7 @@ protected class Farbe_Assignment_wert extends AssignmentToken { } public Assignment getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prFarbe().eleAssignmentWert(); + return grammarAccess.prFarbe().eleAssignmentWert(); } @Override @@ -1714,28 +1717,28 @@ protected class Farbe_Assignment_wert extends AssignmentToken { if("ROT".equals(value)) { // xtext::Keyword type = AssignmentType.KW; - element = ReferenceGrammarGrammarAccess.INSTANCE.prFarbe().ele0000KeywordROT(); + element = grammarAccess.prFarbe().ele0000KeywordROT(); return new Solution(obj); } if("BLAU".equals(value)) { // xtext::Keyword type = AssignmentType.KW; - element = ReferenceGrammarGrammarAccess.INSTANCE.prFarbe().ele0001KeywordBLAU(); + element = grammarAccess.prFarbe().ele0001KeywordBLAU(); return new Solution(obj); } if("GELB".equals(value)) { // xtext::Keyword type = AssignmentType.KW; - element = ReferenceGrammarGrammarAccess.INSTANCE.prFarbe().ele001KeywordGELB(); + element = grammarAccess.prFarbe().ele001KeywordGELB(); return new Solution(obj); } if("GRÜN".equals(value)) { // xtext::Keyword type = AssignmentType.KW; - element = ReferenceGrammarGrammarAccess.INSTANCE.prFarbe().ele01KeywordGRÜN(); + element = grammarAccess.prFarbe().ele01KeywordGRÜN(); return new Solution(obj); } @@ -1761,7 +1764,7 @@ protected class CustomTypeParserRule_Group extends GroupToken { } public Group getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prCustomTypeParserRule().eleGroup(); + return grammarAccess.prCustomTypeParserRule().eleGroup(); } @Override @@ -1790,7 +1793,7 @@ protected class CustomTypeParserRule_0_Keyword_type extends KeywordToken { } public Keyword getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prCustomTypeParserRule().ele0KeywordType(); + return grammarAccess.prCustomTypeParserRule().ele0KeywordType(); } } @@ -1802,7 +1805,7 @@ protected class CustomTypeParserRule_1_Assignment_name extends AssignmentToken } public Assignment getGrammarElement() { - return ReferenceGrammarGrammarAccess.INSTANCE.prCustomTypeParserRule().ele1AssignmentName(); + return grammarAccess.prCustomTypeParserRule().ele1AssignmentName(); } @Override @@ -1811,7 +1814,7 @@ protected class CustomTypeParserRule_1_Assignment_name extends AssignmentToken IInstanceDescription obj = current.cloneAndConsume("name"); if(Boolean.TRUE.booleanValue()) { // xtext::RuleCall FIXME: check if value is valid for lexer rule type = AssignmentType.LRC; - element = ReferenceGrammarGrammarAccess.INSTANCE.prCustomTypeParserRule().ele10LexerRuleCallID(); + element = grammarAccess.prCustomTypeParserRule().ele10LexerRuleCallID(); return new Solution(obj); } return null; diff --git a/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/services/ReferenceGrammarGrammarAccess.java b/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/services/ReferenceGrammarGrammarAccess.java index 0db666e..b44a101 100644 --- a/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/services/ReferenceGrammarGrammarAccess.java +++ b/devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/services/ReferenceGrammarGrammarAccess.java @@ -5,11 +5,17 @@ Generated with Xtext package org.eclipse.xtext.reference.services; import com.google.inject.Singleton; +import com.google.inject.Inject; + import org.eclipse.xtext.*; -import org.eclipse.xtext.parser.BaseEPackageAccess; + +import org.eclipse.xtext.service.GrammarProvider; + +import org.eclipse.xtext.builtin.XtextBuiltinGrammarAccess; @Singleton -public class ReferenceGrammarGrammarAccess extends BaseEPackageAccess implements IGrammarAccess { +public class ReferenceGrammarGrammarAccess implements IGrammarAccess { + public class SpielplatzElements implements IParserRuleAccess { private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "Spielplatz"); @@ -467,34 +473,32 @@ public class ReferenceGrammarGrammarAccess extends BaseEPackageAccess implements public RuleCall ele10LexerRuleCallID() { return c10LexerRuleCallID; } } - public final static ReferenceGrammarGrammarAccess INSTANCE = new ReferenceGrammarGrammarAccess(); - - private static final String REFERENCEGRAMMAR_GRAMMAR_CP_URI = "classpath:/org/eclipse/xtext/reference/ReferenceGrammar.xmi"; - private static Grammar GRAMMAR = null; - private static SpielplatzElements pSpielplatz; - private static PersonElements pPerson; - private static KindElements pKind; - private static ErwachsenerElements pErwachsener; - private static SpielzeugElements pSpielzeug; - private static FamilieElements pFamilie; - private static FarbeElements pFarbe; - private static CustomTypeParserRuleElements pCustomTypeParserRule; - private static LexerRule lID; - private static LexerRule lINT; - private static LexerRule lSTRING; - private static LexerRule lML_COMMENT; - private static LexerRule lSL_COMMENT; - private static LexerRule lWS; - private static LexerRule lANY_OTHER; - - @SuppressWarnings("unused") - public synchronized Grammar getGrammar() { - if (GRAMMAR==null) { - // assert the XtextPackage implementation is loaded - XtextPackage xtextPackage = XtextPackage.eINSTANCE; - GRAMMAR = (Grammar) loadGrammarFile(ReferenceGrammarGrammarAccess.class.getClassLoader(),REFERENCEGRAMMAR_GRAMMAR_CP_URI); - } - return GRAMMAR; + private SpielplatzElements pSpielplatz; + private PersonElements pPerson; + private KindElements pKind; + private ErwachsenerElements pErwachsener; + private SpielzeugElements pSpielzeug; + private FamilieElements pFamilie; + private FarbeElements pFarbe; + private CustomTypeParserRuleElements pCustomTypeParserRule; + + private final GrammarProvider grammarProvider; + + private XtextBuiltinGrammarAccess superGrammarAccess; + + @Inject + public ReferenceGrammarGrammarAccess(GrammarProvider grammarProvider, XtextBuiltinGrammarAccess superGrammarAccess) { + this.grammarProvider = grammarProvider; + this.superGrammarAccess = superGrammarAccess; + } + + public Grammar getGrammar() { + return grammarProvider.getGrammar(this); + } + + + public XtextBuiltinGrammarAccess getSuperGrammarAccess() { + return superGrammarAccess; } @@ -540,36 +544,36 @@ public class ReferenceGrammarGrammarAccess extends BaseEPackageAccess implements // lexer ID: "(\'^\')?(\'a\'..\'z\'|\'A\'..\'Z\'|\'_\') (\'a\'..\'z\'|\'A\'..\'Z\'|\'_\'|\'0\'..\'9\')*"; public LexerRule lrID() { - return (lID != null) ? lID : (lID = (LexerRule) GrammarUtil.findRuleForName(getGrammar(), "ID")); + return superGrammarAccess.lrID(); } // lexer INT returns EInt: "(\'0\'..\'9\')+"; public LexerRule lrINT() { - return (lINT != null) ? lINT : (lINT = (LexerRule) GrammarUtil.findRuleForName(getGrammar(), "INT")); + return superGrammarAccess.lrINT(); } // lexer STRING: "\n\t\t\t \'\"\' ( \'\\\\\' (\'b\'|\'t\'|\'n\'|\'f\'|\'r\'|\'\\\"\'|\'\\\'\'|\'\\\\\') | ~(\'\\\\\'|\'\"\') )* \'\"\' | \n \'\\\'\' ( \'\\\\\' (\'b\'|\'t\'|\'n\'|\'f\'|\'r\'|\'\\\"\'|\'\\\'\'|\'\\\\\') | ~(\'\\\\\'|\'\\\'\') )* \'\\\'\'\n "; public LexerRule lrSTRING() { - return (lSTRING != null) ? lSTRING : (lSTRING = (LexerRule) GrammarUtil.findRuleForName(getGrammar(), "STRING")); + return superGrammarAccess.lrSTRING(); } // lexer ML_COMMENT: "\'/*\' ( options {greedy=false;} : . )* \'*/\'"; public LexerRule lrML_COMMENT() { - return (lML_COMMENT != null) ? lML_COMMENT : (lML_COMMENT = (LexerRule) GrammarUtil.findRuleForName(getGrammar(), "ML_COMMENT")); + return superGrammarAccess.lrML_COMMENT(); } // lexer SL_COMMENT: "\'//\' ~(\'\\n\'|\'\\r\')* (\'\\r\'? \'\\n\')?"; public LexerRule lrSL_COMMENT() { - return (lSL_COMMENT != null) ? lSL_COMMENT : (lSL_COMMENT = (LexerRule) GrammarUtil.findRuleForName(getGrammar(), "SL_COMMENT")); + return superGrammarAccess.lrSL_COMMENT(); } // lexer WS: "(\' \'|\'\\t\'|\'\\r\'|\'\\n\')+"; public LexerRule lrWS() { - return (lWS != null) ? lWS : (lWS = (LexerRule) GrammarUtil.findRuleForName(getGrammar(), "WS")); + return superGrammarAccess.lrWS(); } // lexer ANY_OTHER: "."; public LexerRule lrANY_OTHER() { - return (lANY_OTHER != null) ? lANY_OTHER : (lANY_OTHER = (LexerRule) GrammarUtil.findRuleForName(getGrammar(), "ANY_OTHER")); + return superGrammarAccess.lrANY_OTHER(); } } diff --git a/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/domainmodel.ecore b/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/domainmodel.ecore index 1b4861b..00627f8 100644 --- a/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/domainmodel.ecore +++ b/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/domainmodel.ecore @@ -34,10 +34,10 @@ </eClassifiers> <eClassifiers xsi:type="ecore:EClass" name="Parameter" eSuperTypes="//TypedElement"/> <eClassifiers xsi:type="ecore:EClass" name="TypedElement"> + <eStructuralFeatures xsi:type="ecore:EReference" name="type" eType="//TypeRef" containment="true"/> <eStructuralFeatures xsi:type="ecore:EAttribute" name="name"> <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/> </eStructuralFeatures> - <eStructuralFeatures xsi:type="ecore:EReference" name="type" eType="//TypeRef" containment="true"/> </eClassifiers> <eClassifiers xsi:type="ecore:EClass" name="TypeRef"> <eStructuralFeatures xsi:type="ecore:EReference" name="referenced" eType="//Type"/> diff --git a/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/DomainmodelPackratParser.java b/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/DomainmodelPackratParser.java index 6fde5b1..f4e3bac 100644 --- a/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/DomainmodelPackratParser.java +++ b/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/DomainmodelPackratParser.java @@ -3,14 +3,29 @@ Generated with Xtext */ package org.eclipse.xtext.example.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; -public class DomainmodelPackratParser extends AbstractPackratParser { +import org.eclipse.xtext.example.services.DomainmodelGrammarAccess; +public class DomainmodelPackratParser extends AbstractPackratParser { + + @Inject + public DomainmodelPackratParser(IParseResultFactory parseResultFactory, DomainmodelGrammarAccess grammarAccess) { + super(parseResultFactory, grammarAccess); + } + @Override protected DomainmodelParserConfiguration createParserConfiguration(IInternalParserConfiguration configuration) { - return new DomainmodelParserConfiguration(configuration); + return new DomainmodelParserConfiguration(configuration, getGrammarAccess()); + } + + @Override + protected DomainmodelGrammarAccess getGrammarAccess() { + return (DomainmodelGrammarAccess)super.getGrammarAccess(); } } diff --git a/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/DomainmodelParserConfiguration.java b/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/DomainmodelParserConfiguration.java index 57a950e..37fe41f 100644 --- a/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/DomainmodelParserConfiguration.java +++ b/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/DomainmodelParserConfiguration.java @@ -7,6 +7,8 @@ import org.eclipse.xtext.parser.packrat.AbstractParserConfiguration; import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer; import org.eclipse.xtext.parser.packrat.consumers.INonTerminalConsumer; +import org.eclipse.xtext.example.services.DomainmodelGrammarAccess; + import org.eclipse.xtext.builtin.parser.packrat.XtextBuiltinParserConfiguration; import org.eclipse.xtext.example.parser.packrat.consumers.DomainmodelFileConsumer; @@ -55,9 +57,12 @@ public class DomainmodelParserConfiguration extends AbstractParserConfiguration private DomainmodelTypeRefConsumer typeRefConsumer; private DomainmodelQualifiedNameConsumer qualifiedNameConsumer; - public DomainmodelParserConfiguration(IInternalParserConfiguration configuration) { + private DomainmodelGrammarAccess grammarAccess; + + public DomainmodelParserConfiguration(IInternalParserConfiguration configuration, DomainmodelGrammarAccess grammarAccess) { super(configuration); - this.xtextBuiltinConfiguration = new XtextBuiltinParserConfiguration(configuration); + this.grammarAccess = grammarAccess; + this.xtextBuiltinConfiguration = new XtextBuiltinParserConfiguration(configuration, null); } public DomainmodelFileConsumer getRootConsumer() { @@ -121,6 +126,33 @@ public class DomainmodelParserConfiguration extends AbstractParserConfiguration } public void configureConsumers() { + if (grammarAccess == null) + throw new NullPointerException("grammarAccess may not be null, you call configureConsumers"); + getFileConsumer().setRule(grammarAccess.prFile()); + getImportConsumer().setRule(grammarAccess.prImport()); + getNamedElementConsumer().setRule(grammarAccess.prNamedElement()); + getPackageConsumer().setRule(grammarAccess.prPackage()); + getTypeConsumer().setRule(grammarAccess.prType()); + getDataTypeConsumer().setRule(grammarAccess.prDataType()); + getEntityConsumer().setRule(grammarAccess.prEntity()); + getFeatureConsumer().setRule(grammarAccess.prFeature()); + getStructuralFeatureConsumer().setRule(grammarAccess.prStructuralFeature()); + getAttributeConsumer().setRule(grammarAccess.prAttribute()); + getReferenceConsumer().setRule(grammarAccess.prReference()); + getOperationConsumer().setRule(grammarAccess.prOperation()); + getParameterConsumer().setRule(grammarAccess.prParameter()); + getTypedElementConsumer().setRule(grammarAccess.prTypedElement()); + getTypeRefConsumer().setRule(grammarAccess.prTypeRef()); + getQualifiedNameConsumer().setRule(grammarAccess.prQualifiedName()); + getIdConsumer().setRule(grammarAccess.lrID()); + getIntConsumer().setRule(grammarAccess.lrINT()); + getStringConsumer().setRule(grammarAccess.lrSTRING()); + getMlCommentConsumer().setRule(grammarAccess.lrML_COMMENT()); + getSlCommentConsumer().setRule(grammarAccess.lrSL_COMMENT()); + getWsConsumer().setRule(grammarAccess.lrWS()); + getAnyOtherConsumer().setRule(grammarAccess.lrANY_OTHER()); + + getFileConsumer().setImportConsumer(getImportConsumer()); getFileConsumer().setNamedElementConsumer(getNamedElementConsumer()); diff --git a/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelAttributeConsumer.java b/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelAttributeConsumer.java index b99f852..d09cf7b 100644 --- a/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelAttributeConsumer.java +++ b/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelAttributeConsumer.java @@ -22,6 +22,8 @@ import org.eclipse.xtext.example.parser.packrat.consumers.DomainmodelTypeRefCons @SuppressWarnings("unused") public final class DomainmodelAttributeConsumer extends NonTerminalConsumer { + private AttributeElements rule; + private ITerminalConsumer idConsumer; private INonTerminalConsumer typeRefConsumer; @@ -97,17 +99,11 @@ public final class DomainmodelAttributeConsumer extends NonTerminalConsumer { } protected int consumeAssignment$5(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeTerminal(idConsumer, "name", false, false, getRule().ele0010LexerRuleCallID(), getRuleCall$6$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$6(entryPoint); + } + + protected int consumeRuleCall$6(int entryPoint) throws Exception { + return consumeTerminal(idConsumer, "name", false, false, getRule().ele0010LexerRuleCallID(), getRuleCall$6$Delimiter()); } protected int consumeKeyword$7(int entryPoint) throws Exception { @@ -115,21 +111,20 @@ public final class DomainmodelAttributeConsumer extends NonTerminalConsumer { } protected int consumeAssignment$8(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(typeRefConsumer, "type", false, false, false, getRule().ele10ParserRuleCallTypeRef()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$9(entryPoint); + } + + protected int consumeRuleCall$9(int entryPoint) throws Exception { + return consumeNonTerminal(typeRefConsumer, "type", false, false, false, getRule().ele10ParserRuleCallTypeRef()); } public AttributeElements getRule() { - return DomainmodelGrammarAccess.INSTANCE.prAttribute(); + // DomainmodelGrammarAccess.INSTANCE.prAttribute() + return rule; + } + + public void setRule(AttributeElements rule) { + this.rule = rule; } @Override diff --git a/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelDataTypeConsumer.java b/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelDataTypeConsumer.java index 9c3c1de..695d9b9 100644 --- a/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelDataTypeConsumer.java +++ b/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelDataTypeConsumer.java @@ -21,6 +21,8 @@ import org.eclipse.xtext.builtin.parser.packrat.consumers.XtextBuiltinIDConsumer @SuppressWarnings("unused") public final class DomainmodelDataTypeConsumer extends NonTerminalConsumer { + private DataTypeElements rule; + private ITerminalConsumer idConsumer; private ICharacterClass keyword$2$Delimiter; @@ -74,21 +76,20 @@ public final class DomainmodelDataTypeConsumer extends NonTerminalConsumer { } protected int consumeAssignment$3(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeTerminal(idConsumer, "name", false, false, getRule().ele10LexerRuleCallID(), getRuleCall$4$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$4(entryPoint); + } + + protected int consumeRuleCall$4(int entryPoint) throws Exception { + return consumeTerminal(idConsumer, "name", false, false, getRule().ele10LexerRuleCallID(), getRuleCall$4$Delimiter()); } public DataTypeElements getRule() { - return DomainmodelGrammarAccess.INSTANCE.prDataType(); + // DomainmodelGrammarAccess.INSTANCE.prDataType() + return rule; + } + + public void setRule(DataTypeElements rule) { + this.rule = rule; } @Override diff --git a/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelEntityConsumer.java b/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelEntityConsumer.java index 6d176e7..00954be 100644 --- a/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelEntityConsumer.java +++ b/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelEntityConsumer.java @@ -22,6 +22,8 @@ import org.eclipse.xtext.builtin.parser.packrat.consumers.XtextBuiltinIDConsumer @SuppressWarnings("unused") public final class DomainmodelEntityConsumer extends NonTerminalConsumer { + private EntityElements rule; + private INonTerminalConsumer featureConsumer; private ITerminalConsumer idConsumer; @@ -124,17 +126,11 @@ public final class DomainmodelEntityConsumer extends NonTerminalConsumer { } protected int consumeAssignment$7(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeTerminal(idConsumer, "name", false, false, getRule().ele000010LexerRuleCallID(), getRuleCall$8$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$8(entryPoint); + } + + protected int consumeRuleCall$8(int entryPoint) throws Exception { + return consumeTerminal(idConsumer, "name", false, false, getRule().ele000010LexerRuleCallID(), getRuleCall$8$Delimiter()); } protected int consumeGroup$9(int entryPoint) throws Exception { @@ -183,17 +179,11 @@ public final class DomainmodelEntityConsumer extends NonTerminalConsumer { } protected int consumeAssignment$11(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeTerminal(idConsumer, "superType", false, false, getRule().ele000110CrossReferenceEStringEntity(), getCrossReference$12$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeCrossReference$12(entryPoint); + } + + protected int consumeCrossReference$12(int entryPoint) throws Exception { + return consumeTerminal(idConsumer, "superType", false, false, getRule().ele000110CrossReferenceEStringEntity(), getCrossReference$12$Delimiter()); } protected int consumeKeyword$14(int entryPoint) throws Exception { @@ -210,17 +200,11 @@ public final class DomainmodelEntityConsumer extends NonTerminalConsumer { } protected int doConsumeAssignment$15(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(featureConsumer, "features", true, false, false, getRule().ele010ParserRuleCallFeature()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$16(entryPoint); + } + + protected int consumeRuleCall$16(int entryPoint) throws Exception { + return consumeNonTerminal(featureConsumer, "features", true, false, false, getRule().ele010ParserRuleCallFeature()); } protected int consumeKeyword$17(int entryPoint) throws Exception { @@ -228,7 +212,12 @@ public final class DomainmodelEntityConsumer extends NonTerminalConsumer { } public EntityElements getRule() { - return DomainmodelGrammarAccess.INSTANCE.prEntity(); + // DomainmodelGrammarAccess.INSTANCE.prEntity() + return rule; + } + + public void setRule(EntityElements rule) { + this.rule = rule; } @Override diff --git a/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelFeatureConsumer.java b/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelFeatureConsumer.java index eac91bc..0d5d5f7 100644 --- a/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelFeatureConsumer.java +++ b/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelFeatureConsumer.java @@ -22,6 +22,8 @@ import org.eclipse.xtext.example.parser.packrat.consumers.DomainmodelStructuralF @SuppressWarnings("unused") public final class DomainmodelFeatureConsumer extends NonTerminalConsumer { + private FeatureElements rule; + private INonTerminalConsumer operationConsumer; private INonTerminalConsumer structuralFeatureConsumer; @@ -62,7 +64,12 @@ public final class DomainmodelFeatureConsumer extends NonTerminalConsumer { } public FeatureElements getRule() { - return DomainmodelGrammarAccess.INSTANCE.prFeature(); + // DomainmodelGrammarAccess.INSTANCE.prFeature() + return rule; + } + + public void setRule(FeatureElements rule) { + this.rule = rule; } @Override diff --git a/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelFileConsumer.java b/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelFileConsumer.java index 5e53a87..362e7bf 100644 --- a/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelFileConsumer.java +++ b/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelFileConsumer.java @@ -22,6 +22,8 @@ import org.eclipse.xtext.example.parser.packrat.consumers.DomainmodelNamedElemen @SuppressWarnings("unused") public final class DomainmodelFileConsumer extends NonTerminalConsumer { + private FileElements rule; + private INonTerminalConsumer importConsumer; private INonTerminalConsumer namedElementConsumer; @@ -75,17 +77,11 @@ public final class DomainmodelFileConsumer extends NonTerminalConsumer { } protected int doConsumeAssignment$2(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(importConsumer, "imports", true, false, false, getRule().ele00ParserRuleCallImport()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$3(entryPoint); + } + + protected int consumeRuleCall$3(int entryPoint) throws Exception { + return consumeNonTerminal(importConsumer, "imports", true, false, false, getRule().ele00ParserRuleCallImport()); } protected int consumeAssignment$4(int entryPoint) throws Exception { @@ -98,21 +94,20 @@ public final class DomainmodelFileConsumer extends NonTerminalConsumer { } protected int doConsumeAssignment$4(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(namedElementConsumer, "namedElements", true, false, false, getRule().ele10ParserRuleCallNamedElement()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$5(entryPoint); + } + + protected int consumeRuleCall$5(int entryPoint) throws Exception { + return consumeNonTerminal(namedElementConsumer, "namedElements", true, false, false, getRule().ele10ParserRuleCallNamedElement()); } public FileElements getRule() { - return DomainmodelGrammarAccess.INSTANCE.prFile(); + // DomainmodelGrammarAccess.INSTANCE.prFile() + return rule; + } + + public void setRule(FileElements rule) { + this.rule = rule; } @Override diff --git a/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelImportConsumer.java b/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelImportConsumer.java index 55a9706..980a5d6 100644 --- a/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelImportConsumer.java +++ b/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelImportConsumer.java @@ -21,6 +21,8 @@ import org.eclipse.xtext.builtin.parser.packrat.consumers.XtextBuiltinSTRINGCons @SuppressWarnings("unused") public final class DomainmodelImportConsumer extends NonTerminalConsumer { + private ImportElements rule; + private ITerminalConsumer stringConsumer; private ICharacterClass keyword$2$Delimiter; @@ -74,21 +76,20 @@ public final class DomainmodelImportConsumer extends NonTerminalConsumer { } protected int consumeAssignment$3(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeTerminal(stringConsumer, "importURI", false, false, getRule().ele10LexerRuleCallSTRING(), getRuleCall$4$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$4(entryPoint); + } + + protected int consumeRuleCall$4(int entryPoint) throws Exception { + return consumeTerminal(stringConsumer, "importURI", false, false, getRule().ele10LexerRuleCallSTRING(), getRuleCall$4$Delimiter()); } public ImportElements getRule() { - return DomainmodelGrammarAccess.INSTANCE.prImport(); + // DomainmodelGrammarAccess.INSTANCE.prImport() + return rule; + } + + public void setRule(ImportElements rule) { + this.rule = rule; } @Override diff --git a/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelNamedElementConsumer.java b/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelNamedElementConsumer.java index 1033716..39ab8b9 100644 --- a/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelNamedElementConsumer.java +++ b/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelNamedElementConsumer.java @@ -22,6 +22,8 @@ import org.eclipse.xtext.example.parser.packrat.consumers.DomainmodelTypeConsume @SuppressWarnings("unused") public final class DomainmodelNamedElementConsumer extends NonTerminalConsumer { + private NamedElementElements rule; + private INonTerminalConsumer packageConsumer; private INonTerminalConsumer typeConsumer; @@ -62,7 +64,12 @@ public final class DomainmodelNamedElementConsumer extends NonTerminalConsumer { } public NamedElementElements getRule() { - return DomainmodelGrammarAccess.INSTANCE.prNamedElement(); + // DomainmodelGrammarAccess.INSTANCE.prNamedElement() + return rule; + } + + public void setRule(NamedElementElements rule) { + this.rule = rule; } @Override diff --git a/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelOperationConsumer.java b/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelOperationConsumer.java index fbc6ccb..05bcb2c 100644 --- a/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelOperationConsumer.java +++ b/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelOperationConsumer.java @@ -23,6 +23,8 @@ import org.eclipse.xtext.example.parser.packrat.consumers.DomainmodelTypeRefCons @SuppressWarnings("unused") public final class DomainmodelOperationConsumer extends NonTerminalConsumer { + private OperationElements rule; + private ITerminalConsumer idConsumer; private INonTerminalConsumer parameterConsumer; private INonTerminalConsumer typeRefConsumer; @@ -135,17 +137,11 @@ public final class DomainmodelOperationConsumer extends NonTerminalConsumer { } protected int consumeAssignment$8(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeTerminal(idConsumer, "name", false, false, getRule().ele0000010LexerRuleCallID(), getRuleCall$9$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$9(entryPoint); + } + + protected int consumeRuleCall$9(int entryPoint) throws Exception { + return consumeTerminal(idConsumer, "name", false, false, getRule().ele0000010LexerRuleCallID(), getRuleCall$9$Delimiter()); } protected int consumeKeyword$10(int entryPoint) throws Exception { @@ -194,17 +190,11 @@ public final class DomainmodelOperationConsumer extends NonTerminalConsumer { } protected int consumeAssignment$12(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(parameterConsumer, "params", true, false, false, getRule().ele000100ParserRuleCallParameter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$13(entryPoint); + } + + protected int consumeRuleCall$13(int entryPoint) throws Exception { + return consumeNonTerminal(parameterConsumer, "params", true, false, false, getRule().ele000100ParserRuleCallParameter()); } protected int consumeGroup$14(int entryPoint) throws Exception { @@ -252,17 +242,11 @@ public final class DomainmodelOperationConsumer extends NonTerminalConsumer { } protected int consumeAssignment$16(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(parameterConsumer, "params", true, false, false, getRule().ele0001110ParserRuleCallParameter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$17(entryPoint); + } + + protected int consumeRuleCall$17(int entryPoint) throws Exception { + return consumeNonTerminal(parameterConsumer, "params", true, false, false, getRule().ele0001110ParserRuleCallParameter()); } protected int consumeKeyword$18(int entryPoint) throws Exception { @@ -274,21 +258,20 @@ public final class DomainmodelOperationConsumer extends NonTerminalConsumer { } protected int consumeAssignment$20(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(typeRefConsumer, "type", false, false, false, getRule().ele10ParserRuleCallTypeRef()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$21(entryPoint); + } + + protected int consumeRuleCall$21(int entryPoint) throws Exception { + return consumeNonTerminal(typeRefConsumer, "type", false, false, false, getRule().ele10ParserRuleCallTypeRef()); } public OperationElements getRule() { - return DomainmodelGrammarAccess.INSTANCE.prOperation(); + // DomainmodelGrammarAccess.INSTANCE.prOperation() + return rule; + } + + public void setRule(OperationElements rule) { + this.rule = rule; } @Override diff --git a/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelPackageConsumer.java b/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelPackageConsumer.java index ae339de..b09d7e5 100644 --- a/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelPackageConsumer.java +++ b/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelPackageConsumer.java @@ -22,6 +22,8 @@ import org.eclipse.xtext.example.parser.packrat.consumers.DomainmodelQualifiedNa @SuppressWarnings("unused") public final class DomainmodelPackageConsumer extends NonTerminalConsumer { + private PackageElements rule; + private INonTerminalConsumer namedElementConsumer; private INonTerminalConsumer qualifiedNameConsumer; @@ -106,17 +108,11 @@ public final class DomainmodelPackageConsumer extends NonTerminalConsumer { } protected int consumeAssignment$6(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(qualifiedNameConsumer, "name", false, true, false, getRule().ele00010ParserRuleCallQualifiedName()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$7(entryPoint); + } + + protected int consumeRuleCall$7(int entryPoint) throws Exception { + return consumeNonTerminal(qualifiedNameConsumer, "name", false, true, false, getRule().ele00010ParserRuleCallQualifiedName()); } protected int consumeKeyword$8(int entryPoint) throws Exception { @@ -133,17 +129,11 @@ public final class DomainmodelPackageConsumer extends NonTerminalConsumer { } protected int doConsumeAssignment$9(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(namedElementConsumer, "namedElements", true, false, false, getRule().ele010ParserRuleCallNamedElement()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$10(entryPoint); + } + + protected int consumeRuleCall$10(int entryPoint) throws Exception { + return consumeNonTerminal(namedElementConsumer, "namedElements", true, false, false, getRule().ele010ParserRuleCallNamedElement()); } protected int consumeKeyword$11(int entryPoint) throws Exception { @@ -151,7 +141,12 @@ public final class DomainmodelPackageConsumer extends NonTerminalConsumer { } public PackageElements getRule() { - return DomainmodelGrammarAccess.INSTANCE.prPackage(); + // DomainmodelGrammarAccess.INSTANCE.prPackage() + return rule; + } + + public void setRule(PackageElements rule) { + this.rule = rule; } @Override diff --git a/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelParameterConsumer.java b/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelParameterConsumer.java index 6d1a763..b4c8f24 100644 --- a/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelParameterConsumer.java +++ b/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelParameterConsumer.java @@ -22,6 +22,8 @@ import org.eclipse.xtext.example.parser.packrat.consumers.DomainmodelTypeRefCons @SuppressWarnings("unused") public final class DomainmodelParameterConsumer extends NonTerminalConsumer { + private ParameterElements rule; + private ITerminalConsumer idConsumer; private INonTerminalConsumer typeRefConsumer; @@ -69,35 +71,28 @@ public final class DomainmodelParameterConsumer extends NonTerminalConsumer { } protected int consumeAssignment$2(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeTerminal(idConsumer, "name", false, false, getRule().ele00LexerRuleCallID(), getRuleCall$3$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$3(entryPoint); + } + + protected int consumeRuleCall$3(int entryPoint) throws Exception { + return consumeTerminal(idConsumer, "name", false, false, getRule().ele00LexerRuleCallID(), getRuleCall$3$Delimiter()); } protected int consumeAssignment$4(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(typeRefConsumer, "type", false, false, false, getRule().ele10ParserRuleCallTypeRef()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$5(entryPoint); + } + + protected int consumeRuleCall$5(int entryPoint) throws Exception { + return consumeNonTerminal(typeRefConsumer, "type", false, false, false, getRule().ele10ParserRuleCallTypeRef()); } public ParameterElements getRule() { - return DomainmodelGrammarAccess.INSTANCE.prParameter(); + // DomainmodelGrammarAccess.INSTANCE.prParameter() + return rule; + } + + public void setRule(ParameterElements rule) { + this.rule = rule; } @Override diff --git a/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelQualifiedNameConsumer.java b/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelQualifiedNameConsumer.java index 6e1cf83..c6d60ba 100644 --- a/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelQualifiedNameConsumer.java +++ b/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelQualifiedNameConsumer.java @@ -21,6 +21,8 @@ import org.eclipse.xtext.builtin.parser.packrat.consumers.XtextBuiltinIDConsumer @SuppressWarnings("unused") public final class DomainmodelQualifiedNameConsumer extends NonTerminalConsumer { + private QualifiedNameElements rule; + private ITerminalConsumer idConsumer; private ICharacterClass keyword$4$Delimiter; @@ -125,7 +127,12 @@ public final class DomainmodelQualifiedNameConsumer extends NonTerminalConsumer } public QualifiedNameElements getRule() { - return DomainmodelGrammarAccess.INSTANCE.prQualifiedName(); + // DomainmodelGrammarAccess.INSTANCE.prQualifiedName() + return rule; + } + + public void setRule(QualifiedNameElements rule) { + this.rule = rule; } @Override diff --git a/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelReferenceConsumer.java b/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelReferenceConsumer.java index cdd2e6e..4a316d3 100644 --- a/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelReferenceConsumer.java +++ b/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelReferenceConsumer.java @@ -22,6 +22,8 @@ import org.eclipse.xtext.example.parser.packrat.consumers.DomainmodelTypeRefCons @SuppressWarnings("unused") public final class DomainmodelReferenceConsumer extends NonTerminalConsumer { + private ReferenceElements rule; + private ITerminalConsumer idConsumer; private INonTerminalConsumer typeRefConsumer; @@ -112,17 +114,11 @@ public final class DomainmodelReferenceConsumer extends NonTerminalConsumer { } protected int consumeAssignment$6(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeTerminal(idConsumer, "name", false, false, getRule().ele00010LexerRuleCallID(), getRuleCall$7$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$7(entryPoint); + } + + protected int consumeRuleCall$7(int entryPoint) throws Exception { + return consumeTerminal(idConsumer, "name", false, false, getRule().ele00010LexerRuleCallID(), getRuleCall$7$Delimiter()); } protected int consumeKeyword$8(int entryPoint) throws Exception { @@ -130,17 +126,11 @@ public final class DomainmodelReferenceConsumer extends NonTerminalConsumer { } protected int consumeAssignment$9(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(typeRefConsumer, "type", false, false, false, getRule().ele010ParserRuleCallTypeRef()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$10(entryPoint); + } + + protected int consumeRuleCall$10(int entryPoint) throws Exception { + return consumeNonTerminal(typeRefConsumer, "type", false, false, false, getRule().ele010ParserRuleCallTypeRef()); } protected int consumeGroup$11(int entryPoint) throws Exception { @@ -189,21 +179,20 @@ public final class DomainmodelReferenceConsumer extends NonTerminalConsumer { } protected int consumeAssignment$13(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeTerminal(idConsumer, "opposite", false, false, getRule().ele110CrossReferenceEStringReference(), getCrossReference$14$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeCrossReference$14(entryPoint); + } + + protected int consumeCrossReference$14(int entryPoint) throws Exception { + return consumeTerminal(idConsumer, "opposite", false, false, getRule().ele110CrossReferenceEStringReference(), getCrossReference$14$Delimiter()); } public ReferenceElements getRule() { - return DomainmodelGrammarAccess.INSTANCE.prReference(); + // DomainmodelGrammarAccess.INSTANCE.prReference() + return rule; + } + + public void setRule(ReferenceElements rule) { + this.rule = rule; } @Override diff --git a/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelStructuralFeatureConsumer.java b/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelStructuralFeatureConsumer.java index 86b0502..0d85fd3 100644 --- a/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelStructuralFeatureConsumer.java +++ b/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelStructuralFeatureConsumer.java @@ -22,6 +22,8 @@ import org.eclipse.xtext.example.parser.packrat.consumers.DomainmodelReferenceCo @SuppressWarnings("unused") public final class DomainmodelStructuralFeatureConsumer extends NonTerminalConsumer { + private StructuralFeatureElements rule; + private INonTerminalConsumer attributeConsumer; private INonTerminalConsumer referenceConsumer; @@ -62,7 +64,12 @@ public final class DomainmodelStructuralFeatureConsumer extends NonTerminalConsu } public StructuralFeatureElements getRule() { - return DomainmodelGrammarAccess.INSTANCE.prStructuralFeature(); + // DomainmodelGrammarAccess.INSTANCE.prStructuralFeature() + return rule; + } + + public void setRule(StructuralFeatureElements rule) { + this.rule = rule; } @Override diff --git a/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelTypeConsumer.java b/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelTypeConsumer.java index 0444990..48de045 100644 --- a/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelTypeConsumer.java +++ b/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelTypeConsumer.java @@ -22,6 +22,8 @@ import org.eclipse.xtext.example.parser.packrat.consumers.DomainmodelEntityConsu @SuppressWarnings("unused") public final class DomainmodelTypeConsumer extends NonTerminalConsumer { + private TypeElements rule; + private INonTerminalConsumer dataTypeConsumer; private INonTerminalConsumer entityConsumer; @@ -62,7 +64,12 @@ public final class DomainmodelTypeConsumer extends NonTerminalConsumer { } public TypeElements getRule() { - return DomainmodelGrammarAccess.INSTANCE.prType(); + // DomainmodelGrammarAccess.INSTANCE.prType() + return rule; + } + + public void setRule(TypeElements rule) { + this.rule = rule; } @Override diff --git a/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelTypeRefConsumer.java b/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelTypeRefConsumer.java index 917ce8d..a678565 100644 --- a/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelTypeRefConsumer.java +++ b/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelTypeRefConsumer.java @@ -21,6 +21,8 @@ import org.eclipse.xtext.builtin.parser.packrat.consumers.XtextBuiltinIDConsumer @SuppressWarnings("unused") public final class DomainmodelTypeRefConsumer extends NonTerminalConsumer { + private TypeRefElements rule; + private ITerminalConsumer idConsumer; private ISequenceMatcher crossReference$2$Delimiter; @@ -36,21 +38,20 @@ public final class DomainmodelTypeRefConsumer extends NonTerminalConsumer { } protected int consumeAssignment$1(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeTerminal(idConsumer, "referenced", false, false, getRule().ele0CrossReferenceEStringType(), getCrossReference$2$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeCrossReference$2(entryPoint); + } + + protected int consumeCrossReference$2(int entryPoint) throws Exception { + return consumeTerminal(idConsumer, "referenced", false, false, getRule().ele0CrossReferenceEStringType(), getCrossReference$2$Delimiter()); } public TypeRefElements getRule() { - return DomainmodelGrammarAccess.INSTANCE.prTypeRef(); + // DomainmodelGrammarAccess.INSTANCE.prTypeRef() + return rule; + } + + public void setRule(TypeRefElements rule) { + this.rule = rule; } @Override diff --git a/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelTypedElementConsumer.java b/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelTypedElementConsumer.java index ef80c0b..2b1ea74 100644 --- a/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelTypedElementConsumer.java +++ b/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelTypedElementConsumer.java @@ -22,6 +22,8 @@ import org.eclipse.xtext.example.parser.packrat.consumers.DomainmodelParameterCo @SuppressWarnings("unused") public final class DomainmodelTypedElementConsumer extends NonTerminalConsumer { + private TypedElementElements rule; + private INonTerminalConsumer featureConsumer; private INonTerminalConsumer parameterConsumer; @@ -62,7 +64,12 @@ public final class DomainmodelTypedElementConsumer extends NonTerminalConsumer { } public TypedElementElements getRule() { - return DomainmodelGrammarAccess.INSTANCE.prTypedElement(); + // DomainmodelGrammarAccess.INSTANCE.prTypedElement() + return rule; + } + + public void setRule(TypedElementElements rule) { + this.rule = rule; } @Override diff --git a/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parsetree/reconstr/DomainmodelParseTreeConstructor.java b/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parsetree/reconstr/DomainmodelParseTreeConstructor.java index 337016d..a906ade 100644 --- a/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parsetree/reconstr/DomainmodelParseTreeConstructor.java +++ b/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parsetree/reconstr/DomainmodelParseTreeConstructor.java @@ -9,12 +9,15 @@ import org.eclipse.xtext.*; import org.eclipse.xtext.parsetree.reconstr.*; import org.eclipse.xtext.parsetree.reconstr.impl.*; import org.eclipse.xtext.parsetree.reconstr.impl.AbstractParseTreeConstructor.AbstractToken.Solution; -import org.eclipse.xtext.builtin.XtextBuiltinGrammarAccess; import org.eclipse.xtext.example.services.DomainmodelGrammarAccess; +import com.google.inject.Inject; public class DomainmodelParseTreeConstructor extends AbstractParseTreeConstructor { + @Inject + private DomainmodelGrammarAccess grammarAccess; + protected Solution internalSerialize(EObject obj) { IInstanceDescription inst = getDescr(obj); Solution s; @@ -52,7 +55,7 @@ protected class File_Group extends GroupToken { } public Group getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prFile().eleGroup(); + return grammarAccess.prFile().eleGroup(); } @Override @@ -81,7 +84,7 @@ protected class File_0_Assignment_imports extends AssignmentToken { } public Assignment getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prFile().ele0AssignmentImports(); + return grammarAccess.prFile().ele0AssignmentImports(); } @Override @@ -113,7 +116,7 @@ protected class File_1_Assignment_namedElements extends AssignmentToken { } public Assignment getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prFile().ele1AssignmentNamedElements(); + return grammarAccess.prFile().ele1AssignmentNamedElements(); } @Override @@ -156,7 +159,7 @@ protected class Import_Group extends GroupToken { } public Group getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prImport().eleGroup(); + return grammarAccess.prImport().eleGroup(); } @Override @@ -185,7 +188,7 @@ protected class Import_0_Keyword_import extends KeywordToken { } public Keyword getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prImport().ele0KeywordImport(); + return grammarAccess.prImport().ele0KeywordImport(); } } @@ -197,7 +200,7 @@ protected class Import_1_Assignment_importURI extends AssignmentToken { } public Assignment getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prImport().ele1AssignmentImportURI(); + return grammarAccess.prImport().ele1AssignmentImportURI(); } @Override @@ -206,7 +209,7 @@ protected class Import_1_Assignment_importURI extends AssignmentToken { IInstanceDescription obj = current.cloneAndConsume("importURI"); if(Boolean.TRUE.booleanValue()) { // xtext::RuleCall FIXME: check if value is valid for lexer rule type = AssignmentType.LRC; - element = DomainmodelGrammarAccess.INSTANCE.prImport().ele10LexerRuleCallSTRING(); + element = grammarAccess.prImport().ele10LexerRuleCallSTRING(); return new Solution(obj); } return null; @@ -232,7 +235,7 @@ protected class NamedElement_Alternatives extends AlternativesToken { } public Alternatives getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prNamedElement().eleAlternatives(); + return grammarAccess.prNamedElement().eleAlternatives(); } @Override @@ -254,7 +257,7 @@ protected class NamedElement_0_RuleCall_Package extends RuleCallToken { } public RuleCall getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prNamedElement().ele0ParserRuleCallPackage(); + return grammarAccess.prNamedElement().ele0ParserRuleCallPackage(); } @Override @@ -273,7 +276,7 @@ protected class NamedElement_1_RuleCall_Type extends RuleCallToken { } public RuleCall getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prNamedElement().ele1ParserRuleCallType(); + return grammarAccess.prNamedElement().ele1ParserRuleCallType(); } @Override @@ -303,7 +306,7 @@ protected class Package_Group extends GroupToken { } public Group getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prPackage().eleGroup(); + return grammarAccess.prPackage().eleGroup(); } @Override @@ -332,7 +335,7 @@ protected class Package_0_Group extends GroupToken { } public Group getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prPackage().ele0Group(); + return grammarAccess.prPackage().ele0Group(); } @Override @@ -361,7 +364,7 @@ protected class Package_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prPackage().ele00Group(); + return grammarAccess.prPackage().ele00Group(); } @Override @@ -390,7 +393,7 @@ protected class Package_0_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prPackage().ele000Group(); + return grammarAccess.prPackage().ele000Group(); } @Override @@ -419,7 +422,7 @@ protected class Package_0_0_0_0_Keyword_package extends KeywordToken { } public Keyword getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prPackage().ele0000KeywordPackage(); + return grammarAccess.prPackage().ele0000KeywordPackage(); } } @@ -431,7 +434,7 @@ protected class Package_0_0_0_1_Assignment_name extends AssignmentToken { } public Assignment getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prPackage().ele0001AssignmentName(); + return grammarAccess.prPackage().ele0001AssignmentName(); } @Override @@ -441,7 +444,7 @@ protected class Package_0_0_0_1_Assignment_name extends AssignmentToken { if(Boolean.TRUE.booleanValue()) { // xtext::RuleCall FIXME: check if value is valid for datatype rule type = AssignmentType.PRC; - element = DomainmodelGrammarAccess.INSTANCE.prPackage().ele00010ParserRuleCallQualifiedName(); + element = grammarAccess.prPackage().ele00010ParserRuleCallQualifiedName(); return new Solution(obj); } @@ -458,7 +461,7 @@ protected class Package_0_0_1_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prPackage().ele001KeywordLeftCurlyBracket(); + return grammarAccess.prPackage().ele001KeywordLeftCurlyBracket(); } } @@ -471,7 +474,7 @@ protected class Package_0_1_Assignment_namedElements extends AssignmentToken { } public Assignment getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prPackage().ele01AssignmentNamedElements(); + return grammarAccess.prPackage().ele01AssignmentNamedElements(); } @Override @@ -504,7 +507,7 @@ protected class Package_1_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prPackage().ele1KeywordRightCurlyBracket(); + return grammarAccess.prPackage().ele1KeywordRightCurlyBracket(); } } @@ -527,7 +530,7 @@ protected class Type_Alternatives extends AlternativesToken { } public Alternatives getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prType().eleAlternatives(); + return grammarAccess.prType().eleAlternatives(); } @Override @@ -549,7 +552,7 @@ protected class Type_0_RuleCall_Entity extends RuleCallToken { } public RuleCall getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prType().ele0ParserRuleCallEntity(); + return grammarAccess.prType().ele0ParserRuleCallEntity(); } @Override @@ -568,7 +571,7 @@ protected class Type_1_RuleCall_DataType extends RuleCallToken { } public RuleCall getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prType().ele1ParserRuleCallDataType(); + return grammarAccess.prType().ele1ParserRuleCallDataType(); } @Override @@ -598,7 +601,7 @@ protected class DataType_Group extends GroupToken { } public Group getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prDataType().eleGroup(); + return grammarAccess.prDataType().eleGroup(); } @Override @@ -627,7 +630,7 @@ protected class DataType_0_Keyword_datatype extends KeywordToken { } public Keyword getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prDataType().ele0KeywordDatatype(); + return grammarAccess.prDataType().ele0KeywordDatatype(); } } @@ -639,7 +642,7 @@ protected class DataType_1_Assignment_name extends AssignmentToken { } public Assignment getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prDataType().ele1AssignmentName(); + return grammarAccess.prDataType().ele1AssignmentName(); } @Override @@ -648,7 +651,7 @@ protected class DataType_1_Assignment_name extends AssignmentToken { IInstanceDescription obj = current.cloneAndConsume("name"); if(Boolean.TRUE.booleanValue()) { // xtext::RuleCall FIXME: check if value is valid for lexer rule type = AssignmentType.LRC; - element = DomainmodelGrammarAccess.INSTANCE.prDataType().ele10LexerRuleCallID(); + element = grammarAccess.prDataType().ele10LexerRuleCallID(); return new Solution(obj); } return null; @@ -674,7 +677,7 @@ protected class Entity_Group extends GroupToken { } public Group getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prEntity().eleGroup(); + return grammarAccess.prEntity().eleGroup(); } @Override @@ -703,7 +706,7 @@ protected class Entity_0_Group extends GroupToken { } public Group getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prEntity().ele0Group(); + return grammarAccess.prEntity().ele0Group(); } @Override @@ -732,7 +735,7 @@ protected class Entity_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prEntity().ele00Group(); + return grammarAccess.prEntity().ele00Group(); } @Override @@ -761,7 +764,7 @@ protected class Entity_0_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prEntity().ele000Group(); + return grammarAccess.prEntity().ele000Group(); } @Override @@ -790,7 +793,7 @@ protected class Entity_0_0_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prEntity().ele0000Group(); + return grammarAccess.prEntity().ele0000Group(); } @Override @@ -819,7 +822,7 @@ protected class Entity_0_0_0_0_0_Keyword_entity extends KeywordToken { } public Keyword getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prEntity().ele00000KeywordEntity(); + return grammarAccess.prEntity().ele00000KeywordEntity(); } } @@ -831,7 +834,7 @@ protected class Entity_0_0_0_0_1_Assignment_name extends AssignmentToken { } public Assignment getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prEntity().ele00001AssignmentName(); + return grammarAccess.prEntity().ele00001AssignmentName(); } @Override @@ -840,7 +843,7 @@ protected class Entity_0_0_0_0_1_Assignment_name extends AssignmentToken { IInstanceDescription obj = current.cloneAndConsume("name"); if(Boolean.TRUE.booleanValue()) { // xtext::RuleCall FIXME: check if value is valid for lexer rule type = AssignmentType.LRC; - element = DomainmodelGrammarAccess.INSTANCE.prEntity().ele000010LexerRuleCallID(); + element = grammarAccess.prEntity().ele000010LexerRuleCallID(); return new Solution(obj); } return null; @@ -856,7 +859,7 @@ protected class Entity_0_0_0_1_Group extends GroupToken { } public Group getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prEntity().ele0001Group(); + return grammarAccess.prEntity().ele0001Group(); } @Override @@ -885,7 +888,7 @@ protected class Entity_0_0_0_1_0_Keyword_extends extends KeywordToken { } public Keyword getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prEntity().ele00010KeywordExtends(); + return grammarAccess.prEntity().ele00010KeywordExtends(); } } @@ -897,7 +900,7 @@ protected class Entity_0_0_0_1_1_Assignment_superType extends AssignmentToken { } public Assignment getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prEntity().ele00011AssignmentSuperType(); + return grammarAccess.prEntity().ele00011AssignmentSuperType(); } @Override @@ -908,7 +911,7 @@ protected class Entity_0_0_0_1_1_Assignment_superType extends AssignmentToken { IInstanceDescription param = getDescr((EObject)value); if(param.isInstanceOf("Entity")) { type = AssignmentType.CR; - element = DomainmodelGrammarAccess.INSTANCE.prEntity().ele000110CrossReferenceEStringEntity(); + element = grammarAccess.prEntity().ele000110CrossReferenceEStringEntity(); return new Solution(obj); } } @@ -926,7 +929,7 @@ protected class Entity_0_0_1_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prEntity().ele001KeywordLeftCurlyBracket(); + return grammarAccess.prEntity().ele001KeywordLeftCurlyBracket(); } } @@ -939,7 +942,7 @@ protected class Entity_0_1_Assignment_features extends AssignmentToken { } public Assignment getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prEntity().ele01AssignmentFeatures(); + return grammarAccess.prEntity().ele01AssignmentFeatures(); } @Override @@ -972,7 +975,7 @@ protected class Entity_1_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prEntity().ele1KeywordRightCurlyBracket(); + return grammarAccess.prEntity().ele1KeywordRightCurlyBracket(); } } @@ -995,7 +998,7 @@ protected class Feature_Alternatives extends AlternativesToken { } public Alternatives getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prFeature().eleAlternatives(); + return grammarAccess.prFeature().eleAlternatives(); } @Override @@ -1017,7 +1020,7 @@ protected class Feature_0_RuleCall_StructuralFeature extends RuleCallToken { } public RuleCall getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prFeature().ele0ParserRuleCallStructuralFeature(); + return grammarAccess.prFeature().ele0ParserRuleCallStructuralFeature(); } @Override @@ -1036,7 +1039,7 @@ protected class Feature_1_RuleCall_Operation extends RuleCallToken { } public RuleCall getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prFeature().ele1ParserRuleCallOperation(); + return grammarAccess.prFeature().ele1ParserRuleCallOperation(); } @Override @@ -1066,7 +1069,7 @@ protected class StructuralFeature_Alternatives extends AlternativesToken { } public Alternatives getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prStructuralFeature().eleAlternatives(); + return grammarAccess.prStructuralFeature().eleAlternatives(); } @Override @@ -1088,7 +1091,7 @@ protected class StructuralFeature_0_RuleCall_Attribute extends RuleCallToken { } public RuleCall getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prStructuralFeature().ele0ParserRuleCallAttribute(); + return grammarAccess.prStructuralFeature().ele0ParserRuleCallAttribute(); } @Override @@ -1107,7 +1110,7 @@ protected class StructuralFeature_1_RuleCall_Reference extends RuleCallToken { } public RuleCall getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prStructuralFeature().ele1ParserRuleCallReference(); + return grammarAccess.prStructuralFeature().ele1ParserRuleCallReference(); } @Override @@ -1137,7 +1140,7 @@ protected class Attribute_Group extends GroupToken { } public Group getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prAttribute().eleGroup(); + return grammarAccess.prAttribute().eleGroup(); } @Override @@ -1166,7 +1169,7 @@ protected class Attribute_0_Group extends GroupToken { } public Group getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prAttribute().ele0Group(); + return grammarAccess.prAttribute().ele0Group(); } @Override @@ -1195,7 +1198,7 @@ protected class Attribute_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prAttribute().ele00Group(); + return grammarAccess.prAttribute().ele00Group(); } @Override @@ -1224,7 +1227,7 @@ protected class Attribute_0_0_0_Keyword_attr extends KeywordToken { } public Keyword getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prAttribute().ele000KeywordAttr(); + return grammarAccess.prAttribute().ele000KeywordAttr(); } } @@ -1236,7 +1239,7 @@ protected class Attribute_0_0_1_Assignment_name extends AssignmentToken { } public Assignment getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prAttribute().ele001AssignmentName(); + return grammarAccess.prAttribute().ele001AssignmentName(); } @Override @@ -1245,7 +1248,7 @@ protected class Attribute_0_0_1_Assignment_name extends AssignmentToken { IInstanceDescription obj = current.cloneAndConsume("name"); if(Boolean.TRUE.booleanValue()) { // xtext::RuleCall FIXME: check if value is valid for lexer rule type = AssignmentType.LRC; - element = DomainmodelGrammarAccess.INSTANCE.prAttribute().ele0010LexerRuleCallID(); + element = grammarAccess.prAttribute().ele0010LexerRuleCallID(); return new Solution(obj); } return null; @@ -1261,7 +1264,7 @@ protected class Attribute_0_1_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prAttribute().ele01KeywordColon(); + return grammarAccess.prAttribute().ele01KeywordColon(); } } @@ -1274,7 +1277,7 @@ protected class Attribute_1_Assignment_type extends AssignmentToken { } public Assignment getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prAttribute().ele1AssignmentType(); + return grammarAccess.prAttribute().ele1AssignmentType(); } @Override @@ -1317,7 +1320,7 @@ protected class Reference_Group extends GroupToken { } public Group getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prReference().eleGroup(); + return grammarAccess.prReference().eleGroup(); } @Override @@ -1346,7 +1349,7 @@ protected class Reference_0_Group extends GroupToken { } public Group getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prReference().ele0Group(); + return grammarAccess.prReference().ele0Group(); } @Override @@ -1375,7 +1378,7 @@ protected class Reference_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prReference().ele00Group(); + return grammarAccess.prReference().ele00Group(); } @Override @@ -1404,7 +1407,7 @@ protected class Reference_0_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prReference().ele000Group(); + return grammarAccess.prReference().ele000Group(); } @Override @@ -1433,7 +1436,7 @@ protected class Reference_0_0_0_0_Keyword_ref extends KeywordToken { } public Keyword getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prReference().ele0000KeywordRef(); + return grammarAccess.prReference().ele0000KeywordRef(); } } @@ -1445,7 +1448,7 @@ protected class Reference_0_0_0_1_Assignment_name extends AssignmentToken { } public Assignment getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prReference().ele0001AssignmentName(); + return grammarAccess.prReference().ele0001AssignmentName(); } @Override @@ -1454,7 +1457,7 @@ protected class Reference_0_0_0_1_Assignment_name extends AssignmentToken { IInstanceDescription obj = current.cloneAndConsume("name"); if(Boolean.TRUE.booleanValue()) { // xtext::RuleCall FIXME: check if value is valid for lexer rule type = AssignmentType.LRC; - element = DomainmodelGrammarAccess.INSTANCE.prReference().ele00010LexerRuleCallID(); + element = grammarAccess.prReference().ele00010LexerRuleCallID(); return new Solution(obj); } return null; @@ -1470,7 +1473,7 @@ protected class Reference_0_0_1_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prReference().ele001KeywordColon(); + return grammarAccess.prReference().ele001KeywordColon(); } } @@ -1483,7 +1486,7 @@ protected class Reference_0_1_Assignment_type extends AssignmentToken { } public Assignment getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prReference().ele01AssignmentType(); + return grammarAccess.prReference().ele01AssignmentType(); } @Override @@ -1516,7 +1519,7 @@ protected class Reference_1_Group extends GroupToken { } public Group getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prReference().ele1Group(); + return grammarAccess.prReference().ele1Group(); } @Override @@ -1545,7 +1548,7 @@ protected class Reference_1_0_Keyword_opposite extends KeywordToken { } public Keyword getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prReference().ele10KeywordOpposite(); + return grammarAccess.prReference().ele10KeywordOpposite(); } } @@ -1557,7 +1560,7 @@ protected class Reference_1_1_Assignment_opposite extends AssignmentToken { } public Assignment getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prReference().ele11AssignmentOpposite(); + return grammarAccess.prReference().ele11AssignmentOpposite(); } @Override @@ -1568,7 +1571,7 @@ protected class Reference_1_1_Assignment_opposite extends AssignmentToken { IInstanceDescription param = getDescr((EObject)value); if(param.isInstanceOf("Reference")) { type = AssignmentType.CR; - element = DomainmodelGrammarAccess.INSTANCE.prReference().ele110CrossReferenceEStringReference(); + element = grammarAccess.prReference().ele110CrossReferenceEStringReference(); return new Solution(obj); } } @@ -1596,7 +1599,7 @@ protected class Operation_Group extends GroupToken { } public Group getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prOperation().eleGroup(); + return grammarAccess.prOperation().eleGroup(); } @Override @@ -1625,7 +1628,7 @@ protected class Operation_0_Group extends GroupToken { } public Group getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prOperation().ele0Group(); + return grammarAccess.prOperation().ele0Group(); } @Override @@ -1654,7 +1657,7 @@ protected class Operation_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prOperation().ele00Group(); + return grammarAccess.prOperation().ele00Group(); } @Override @@ -1683,7 +1686,7 @@ protected class Operation_0_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prOperation().ele000Group(); + return grammarAccess.prOperation().ele000Group(); } @Override @@ -1712,7 +1715,7 @@ protected class Operation_0_0_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prOperation().ele0000Group(); + return grammarAccess.prOperation().ele0000Group(); } @Override @@ -1741,7 +1744,7 @@ protected class Operation_0_0_0_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prOperation().ele00000Group(); + return grammarAccess.prOperation().ele00000Group(); } @Override @@ -1770,7 +1773,7 @@ protected class Operation_0_0_0_0_0_0_Keyword_op extends KeywordToken { } public Keyword getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prOperation().ele000000KeywordOp(); + return grammarAccess.prOperation().ele000000KeywordOp(); } } @@ -1782,7 +1785,7 @@ protected class Operation_0_0_0_0_0_1_Assignment_name extends AssignmentToken { } public Assignment getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prOperation().ele000001AssignmentName(); + return grammarAccess.prOperation().ele000001AssignmentName(); } @Override @@ -1791,7 +1794,7 @@ protected class Operation_0_0_0_0_0_1_Assignment_name extends AssignmentToken { IInstanceDescription obj = current.cloneAndConsume("name"); if(Boolean.TRUE.booleanValue()) { // xtext::RuleCall FIXME: check if value is valid for lexer rule type = AssignmentType.LRC; - element = DomainmodelGrammarAccess.INSTANCE.prOperation().ele0000010LexerRuleCallID(); + element = grammarAccess.prOperation().ele0000010LexerRuleCallID(); return new Solution(obj); } return null; @@ -1807,7 +1810,7 @@ protected class Operation_0_0_0_0_1_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prOperation().ele00001KeywordLeftParenthesis(); + return grammarAccess.prOperation().ele00001KeywordLeftParenthesis(); } } @@ -1820,7 +1823,7 @@ protected class Operation_0_0_0_1_Group extends GroupToken { } public Group getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prOperation().ele0001Group(); + return grammarAccess.prOperation().ele0001Group(); } @Override @@ -1849,7 +1852,7 @@ protected class Operation_0_0_0_1_0_Assignment_params extends AssignmentToken { } public Assignment getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prOperation().ele00010AssignmentParams(); + return grammarAccess.prOperation().ele00010AssignmentParams(); } @Override @@ -1881,7 +1884,7 @@ protected class Operation_0_0_0_1_1_Group extends GroupToken { } public Group getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prOperation().ele00011Group(); + return grammarAccess.prOperation().ele00011Group(); } @Override @@ -1910,7 +1913,7 @@ protected class Operation_0_0_0_1_1_0_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prOperation().ele000110KeywordComma(); + return grammarAccess.prOperation().ele000110KeywordComma(); } } @@ -1922,7 +1925,7 @@ protected class Operation_0_0_0_1_1_1_Assignment_params extends AssignmentToken } public Assignment getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prOperation().ele000111AssignmentParams(); + return grammarAccess.prOperation().ele000111AssignmentParams(); } @Override @@ -1957,7 +1960,7 @@ protected class Operation_0_0_1_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prOperation().ele001KeywordRightParenthesis(); + return grammarAccess.prOperation().ele001KeywordRightParenthesis(); } } @@ -1970,7 +1973,7 @@ protected class Operation_0_1_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prOperation().ele01KeywordColon(); + return grammarAccess.prOperation().ele01KeywordColon(); } } @@ -1983,7 +1986,7 @@ protected class Operation_1_Assignment_type extends AssignmentToken { } public Assignment getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prOperation().ele1AssignmentType(); + return grammarAccess.prOperation().ele1AssignmentType(); } @Override @@ -2026,7 +2029,7 @@ protected class Parameter_Group extends GroupToken { } public Group getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prParameter().eleGroup(); + return grammarAccess.prParameter().eleGroup(); } @Override @@ -2055,7 +2058,7 @@ protected class Parameter_0_Assignment_name extends AssignmentToken { } public Assignment getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prParameter().ele0AssignmentName(); + return grammarAccess.prParameter().ele0AssignmentName(); } @Override @@ -2064,7 +2067,7 @@ protected class Parameter_0_Assignment_name extends AssignmentToken { IInstanceDescription obj = current.cloneAndConsume("name"); if(Boolean.TRUE.booleanValue()) { // xtext::RuleCall FIXME: check if value is valid for lexer rule type = AssignmentType.LRC; - element = DomainmodelGrammarAccess.INSTANCE.prParameter().ele00LexerRuleCallID(); + element = grammarAccess.prParameter().ele00LexerRuleCallID(); return new Solution(obj); } return null; @@ -2079,7 +2082,7 @@ protected class Parameter_1_Assignment_type extends AssignmentToken { } public Assignment getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prParameter().ele1AssignmentType(); + return grammarAccess.prParameter().ele1AssignmentType(); } @Override @@ -2122,7 +2125,7 @@ protected class TypedElement_Alternatives extends AlternativesToken { } public Alternatives getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prTypedElement().eleAlternatives(); + return grammarAccess.prTypedElement().eleAlternatives(); } @Override @@ -2144,7 +2147,7 @@ protected class TypedElement_0_RuleCall_Feature extends RuleCallToken { } public RuleCall getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prTypedElement().ele0ParserRuleCallFeature(); + return grammarAccess.prTypedElement().ele0ParserRuleCallFeature(); } @Override @@ -2163,7 +2166,7 @@ protected class TypedElement_1_RuleCall_Parameter extends RuleCallToken { } public RuleCall getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prTypedElement().ele1ParserRuleCallParameter(); + return grammarAccess.prTypedElement().ele1ParserRuleCallParameter(); } @Override @@ -2193,7 +2196,7 @@ protected class TypeRef_Assignment_referenced extends AssignmentToken { } public Assignment getGrammarElement() { - return DomainmodelGrammarAccess.INSTANCE.prTypeRef().eleAssignmentReferenced(); + return grammarAccess.prTypeRef().eleAssignmentReferenced(); } @Override @@ -2204,7 +2207,7 @@ protected class TypeRef_Assignment_referenced extends AssignmentToken { IInstanceDescription param = getDescr((EObject)value); if(param.isInstanceOf("Type")) { type = AssignmentType.CR; - element = DomainmodelGrammarAccess.INSTANCE.prTypeRef().ele0CrossReferenceEStringType(); + element = grammarAccess.prTypeRef().ele0CrossReferenceEStringType(); return new Solution(obj); } } diff --git a/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/services/DomainmodelGrammarAccess.java b/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/services/DomainmodelGrammarAccess.java index ee537f0..ed9923e 100644 --- a/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/services/DomainmodelGrammarAccess.java +++ b/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/services/DomainmodelGrammarAccess.java @@ -5,11 +5,17 @@ Generated with Xtext package org.eclipse.xtext.example.services; import com.google.inject.Singleton; +import com.google.inject.Inject; + import org.eclipse.xtext.*; -import org.eclipse.xtext.parser.BaseEPackageAccess; + +import org.eclipse.xtext.service.GrammarProvider; + +import org.eclipse.xtext.builtin.XtextBuiltinGrammarAccess; @Singleton -public class DomainmodelGrammarAccess extends BaseEPackageAccess implements IGrammarAccess { +public class DomainmodelGrammarAccess implements IGrammarAccess { + public class FileElements implements IParserRuleAccess { private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "File"); @@ -567,42 +573,40 @@ public class DomainmodelGrammarAccess extends BaseEPackageAccess implements IGra public RuleCall ele11LexerRuleCallID() { return c11LexerRuleCallID; } } - public final static DomainmodelGrammarAccess INSTANCE = new DomainmodelGrammarAccess(); - - private static final String DOMAINMODEL_GRAMMAR_CP_URI = "classpath:/org/eclipse/xtext/example/Domainmodel.xmi"; - private static Grammar GRAMMAR = null; - private static FileElements pFile; - private static ImportElements pImport; - private static NamedElementElements pNamedElement; - private static PackageElements pPackage; - private static TypeElements pType; - private static DataTypeElements pDataType; - private static EntityElements pEntity; - private static FeatureElements pFeature; - private static StructuralFeatureElements pStructuralFeature; - private static AttributeElements pAttribute; - private static ReferenceElements pReference; - private static OperationElements pOperation; - private static ParameterElements pParameter; - private static TypedElementElements pTypedElement; - private static TypeRefElements pTypeRef; - private static QualifiedNameElements pQualifiedName; - private static LexerRule lID; - private static LexerRule lINT; - private static LexerRule lSTRING; - private static LexerRule lML_COMMENT; - private static LexerRule lSL_COMMENT; - private static LexerRule lWS; - private static LexerRule lANY_OTHER; - - @SuppressWarnings("unused") - public synchronized Grammar getGrammar() { - if (GRAMMAR==null) { - // assert the XtextPackage implementation is loaded - XtextPackage xtextPackage = XtextPackage.eINSTANCE; - GRAMMAR = (Grammar) loadGrammarFile(DomainmodelGrammarAccess.class.getClassLoader(),DOMAINMODEL_GRAMMAR_CP_URI); - } - return GRAMMAR; + private FileElements pFile; + private ImportElements pImport; + private NamedElementElements pNamedElement; + private PackageElements pPackage; + private TypeElements pType; + private DataTypeElements pDataType; + private EntityElements pEntity; + private FeatureElements pFeature; + private StructuralFeatureElements pStructuralFeature; + private AttributeElements pAttribute; + private ReferenceElements pReference; + private OperationElements pOperation; + private ParameterElements pParameter; + private TypedElementElements pTypedElement; + private TypeRefElements pTypeRef; + private QualifiedNameElements pQualifiedName; + + private final GrammarProvider grammarProvider; + + private XtextBuiltinGrammarAccess superGrammarAccess; + + @Inject + public DomainmodelGrammarAccess(GrammarProvider grammarProvider, XtextBuiltinGrammarAccess superGrammarAccess) { + this.grammarProvider = grammarProvider; + this.superGrammarAccess = superGrammarAccess; + } + + public Grammar getGrammar() { + return grammarProvider.getGrammar(this); + } + + + public XtextBuiltinGrammarAccess getSuperGrammarAccess() { + return superGrammarAccess; } @@ -688,36 +692,36 @@ public class DomainmodelGrammarAccess extends BaseEPackageAccess implements IGra // lexer ID: "(\'^\')?(\'a\'..\'z\'|\'A\'..\'Z\'|\'_\') (\'a\'..\'z\'|\'A\'..\'Z\'|\'_\'|\'0\'..\'9\')*"; public LexerRule lrID() { - return (lID != null) ? lID : (lID = (LexerRule) GrammarUtil.findRuleForName(getGrammar(), "ID")); + return superGrammarAccess.lrID(); } // lexer INT returns EInt: "(\'0\'..\'9\')+"; public LexerRule lrINT() { - return (lINT != null) ? lINT : (lINT = (LexerRule) GrammarUtil.findRuleForName(getGrammar(), "INT")); + return superGrammarAccess.lrINT(); } // lexer STRING: "\n\t\t\t \'\"\' ( \'\\\\\' (\'b\'|\'t\'|\'n\'|\'f\'|\'r\'|\'\\\"\'|\'\\\'\'|\'\\\\\') | ~(\'\\\\\'|\'\"\') )* \'\"\' | \n \'\\\'\' ( \'\\\\\' (\'b\'|\'t\'|\'n\'|\'f\'|\'r\'|\'\\\"\'|\'\\\'\'|\'\\\\\') | ~(\'\\\\\'|\'\\\'\') )* \'\\\'\'\n "; public LexerRule lrSTRING() { - return (lSTRING != null) ? lSTRING : (lSTRING = (LexerRule) GrammarUtil.findRuleForName(getGrammar(), "STRING")); + return superGrammarAccess.lrSTRING(); } // lexer ML_COMMENT: "\'/*\' ( options {greedy=false;} : . )* \'*/\'"; public LexerRule lrML_COMMENT() { - return (lML_COMMENT != null) ? lML_COMMENT : (lML_COMMENT = (LexerRule) GrammarUtil.findRuleForName(getGrammar(), "ML_COMMENT")); + return superGrammarAccess.lrML_COMMENT(); } // lexer SL_COMMENT: "\'//\' ~(\'\\n\'|\'\\r\')* (\'\\r\'? \'\\n\')?"; public LexerRule lrSL_COMMENT() { - return (lSL_COMMENT != null) ? lSL_COMMENT : (lSL_COMMENT = (LexerRule) GrammarUtil.findRuleForName(getGrammar(), "SL_COMMENT")); + return superGrammarAccess.lrSL_COMMENT(); } // lexer WS: "(\' \'|\'\\t\'|\'\\r\'|\'\\n\')+"; public LexerRule lrWS() { - return (lWS != null) ? lWS : (lWS = (LexerRule) GrammarUtil.findRuleForName(getGrammar(), "WS")); + return superGrammarAccess.lrWS(); } // lexer ANY_OTHER: "."; public LexerRule lrANY_OTHER() { - return (lANY_OTHER != null) ? lANY_OTHER : (lANY_OTHER = (LexerRule) GrammarUtil.findRuleForName(getGrammar(), "ANY_OTHER")); + return superGrammarAccess.lrANY_OTHER(); } } diff --git a/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/EcoreDslPackratParser.java b/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/EcoreDslPackratParser.java index c0dcbf6..a0e29b6 100644 --- a/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/EcoreDslPackratParser.java +++ b/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/EcoreDslPackratParser.java @@ -3,14 +3,29 @@ Generated with Xtext */ package org.eclipse.xtext.example.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; -public class EcoreDslPackratParser extends AbstractPackratParser { +import org.eclipse.xtext.example.services.EcoreDslGrammarAccess; +public class EcoreDslPackratParser extends AbstractPackratParser { + + @Inject + public EcoreDslPackratParser(IParseResultFactory parseResultFactory, EcoreDslGrammarAccess grammarAccess) { + super(parseResultFactory, grammarAccess); + } + @Override protected EcoreDslParserConfiguration createParserConfiguration(IInternalParserConfiguration configuration) { - return new EcoreDslParserConfiguration(configuration); + return new EcoreDslParserConfiguration(configuration, getGrammarAccess()); + } + + @Override + protected EcoreDslGrammarAccess getGrammarAccess() { + return (EcoreDslGrammarAccess)super.getGrammarAccess(); } } diff --git a/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/EcoreDslParserConfiguration.java b/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/EcoreDslParserConfiguration.java index b9b2a2f..ce4f75a 100644 --- a/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/EcoreDslParserConfiguration.java +++ b/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/EcoreDslParserConfiguration.java @@ -7,6 +7,8 @@ import org.eclipse.xtext.parser.packrat.AbstractParserConfiguration; import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer; import org.eclipse.xtext.parser.packrat.consumers.INonTerminalConsumer; +import org.eclipse.xtext.example.services.EcoreDslGrammarAccess; + import org.eclipse.xtext.builtin.parser.packrat.XtextBuiltinParserConfiguration; import org.eclipse.xtext.example.parser.packrat.consumers.EcoreDslEcoreDslConsumer; @@ -71,9 +73,12 @@ public class EcoreDslParserConfiguration extends AbstractParserConfiguration { private EcoreDslSTRING_OR_QIDConsumer stringOrQidConsumer; private EcoreDslSINTConsumer sintConsumer; - public EcoreDslParserConfiguration(IInternalParserConfiguration configuration) { + private EcoreDslGrammarAccess grammarAccess; + + public EcoreDslParserConfiguration(IInternalParserConfiguration configuration, EcoreDslGrammarAccess grammarAccess) { super(configuration); - this.xtextBuiltinConfiguration = new XtextBuiltinParserConfiguration(configuration); + this.grammarAccess = grammarAccess; + this.xtextBuiltinConfiguration = new XtextBuiltinParserConfiguration(configuration, null); } public EcoreDslEcoreDslConsumer getRootConsumer() { @@ -161,6 +166,41 @@ public class EcoreDslParserConfiguration extends AbstractParserConfiguration { } public void configureConsumers() { + if (grammarAccess == null) + throw new NullPointerException("grammarAccess may not be null, you call configureConsumers"); + getEcoreDslConsumer().setRule(grammarAccess.prEcoreDsl()); + getImportStatementDeclConsumer().setRule(grammarAccess.prImportStatementDecl()); + getEPackageDeclConsumer().setRule(grammarAccess.prEPackageDecl()); + getSubEPackageDeclConsumer().setRule(grammarAccess.prSubEPackageDecl()); + getEClassifierDeclConsumer().setRule(grammarAccess.prEClassifierDecl()); + getEDataTypeDeclConsumer().setRule(grammarAccess.prEDataTypeDecl()); + getEAnnotationDeclConsumer().setRule(grammarAccess.prEAnnotationDecl()); + getEClassDeclConsumer().setRule(grammarAccess.prEClassDecl()); + getEStructuralFeatureDeclConsumer().setRule(grammarAccess.prEStructuralFeatureDecl()); + getEAttributeDeclConsumer().setRule(grammarAccess.prEAttributeDecl()); + getEReferenceDeclConsumer().setRule(grammarAccess.prEReferenceDecl()); + getEEnumDeclConsumer().setRule(grammarAccess.prEEnumDecl()); + getEEnumLiteralDeclConsumer().setRule(grammarAccess.prEEnumLiteralDecl()); + getETypeParameterDeclConsumer().setRule(grammarAccess.prETypeParameterDecl()); + getEGenericTypeReferenceDeclConsumer().setRule(grammarAccess.prEGenericTypeReferenceDecl()); + getEGenericTypeDeclConsumer().setRule(grammarAccess.prEGenericTypeDecl()); + getEOperationDeclConsumer().setRule(grammarAccess.prEOperationDecl()); + getEParameterDeclConsumer().setRule(grammarAccess.prEParameterDecl()); + getMapEntrySuperConsumer().setRule(grammarAccess.prMapEntrySuper()); + getMapEntryConsumer().setRule(grammarAccess.prMapEntry()); + getMultiplicityExprConsumer().setRule(grammarAccess.prMultiplicityExpr()); + getQidConsumer().setRule(grammarAccess.prQID()); + getStringOrQidConsumer().setRule(grammarAccess.prSTRING_OR_QID()); + getSintConsumer().setRule(grammarAccess.prSINT()); + getIdConsumer().setRule(grammarAccess.lrID()); + getIntConsumer().setRule(grammarAccess.lrINT()); + getStringConsumer().setRule(grammarAccess.lrSTRING()); + getMlCommentConsumer().setRule(grammarAccess.lrML_COMMENT()); + getSlCommentConsumer().setRule(grammarAccess.lrSL_COMMENT()); + getWsConsumer().setRule(grammarAccess.lrWS()); + getAnyOtherConsumer().setRule(grammarAccess.lrANY_OTHER()); + + getEcoreDslConsumer().setEPackageDeclConsumer(getEPackageDeclConsumer()); getEcoreDslConsumer().setImportStatementDeclConsumer(getImportStatementDeclConsumer()); diff --git a/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEAnnotationDeclConsumer.java b/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEAnnotationDeclConsumer.java index 3a380c8..63c91db 100644 --- a/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEAnnotationDeclConsumer.java +++ b/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEAnnotationDeclConsumer.java @@ -23,6 +23,8 @@ import org.eclipse.xtext.builtin.parser.packrat.consumers.XtextBuiltinSTRINGCons @SuppressWarnings("unused") public final class EcoreDslEAnnotationDeclConsumer extends NonTerminalConsumer { + private EAnnotationDeclElements rule; + private ITerminalConsumer idConsumer; private INonTerminalConsumer mapEntrySuperConsumer; private ITerminalConsumer stringConsumer; @@ -135,17 +137,11 @@ public final class EcoreDslEAnnotationDeclConsumer extends NonTerminalConsumer { } protected int consumeAssignment$8(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeTerminal(stringConsumer, "source", false, false, getRule().ele0000010LexerRuleCallSTRING(), getRuleCall$9$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$9(entryPoint); + } + + protected int consumeRuleCall$9(int entryPoint) throws Exception { + return consumeTerminal(stringConsumer, "source", false, false, getRule().ele0000010LexerRuleCallSTRING(), getRuleCall$9$Delimiter()); } protected int consumeAssignment$10(int entryPoint) throws Exception { @@ -159,17 +155,11 @@ public final class EcoreDslEAnnotationDeclConsumer extends NonTerminalConsumer { } protected int doConsumeAssignment$10(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeTerminal(idConsumer, "eModelElement", false, false, getRule().ele000010CrossReferenceEStringEModelElement(), getCrossReference$11$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeCrossReference$11(entryPoint); + } + + protected int consumeCrossReference$11(int entryPoint) throws Exception { + return consumeTerminal(idConsumer, "eModelElement", false, false, getRule().ele000010CrossReferenceEStringEModelElement(), getCrossReference$11$Delimiter()); } protected int consumeKeyword$13(int entryPoint) throws Exception { @@ -177,17 +167,11 @@ public final class EcoreDslEAnnotationDeclConsumer extends NonTerminalConsumer { } protected int consumeAssignment$14(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(mapEntrySuperConsumer, "contents", true, false, false, getRule().ele0010ParserRuleCallMapEntrySuper()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$15(entryPoint); + } + + protected int consumeRuleCall$15(int entryPoint) throws Exception { + return consumeNonTerminal(mapEntrySuperConsumer, "contents", true, false, false, getRule().ele0010ParserRuleCallMapEntrySuper()); } protected int consumeGroup$16(int entryPoint) throws Exception { @@ -235,17 +219,11 @@ public final class EcoreDslEAnnotationDeclConsumer extends NonTerminalConsumer { } protected int consumeAssignment$18(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(mapEntrySuperConsumer, "contents", true, false, false, getRule().ele0110ParserRuleCallMapEntrySuper()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$19(entryPoint); + } + + protected int consumeRuleCall$19(int entryPoint) throws Exception { + return consumeNonTerminal(mapEntrySuperConsumer, "contents", true, false, false, getRule().ele0110ParserRuleCallMapEntrySuper()); } protected int consumeKeyword$20(int entryPoint) throws Exception { @@ -253,7 +231,12 @@ public final class EcoreDslEAnnotationDeclConsumer extends NonTerminalConsumer { } public EAnnotationDeclElements getRule() { - return EcoreDslGrammarAccess.INSTANCE.prEAnnotationDecl(); + // EcoreDslGrammarAccess.INSTANCE.prEAnnotationDecl() + return rule; + } + + public void setRule(EAnnotationDeclElements rule) { + this.rule = rule; } @Override diff --git a/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEAttributeDeclConsumer.java b/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEAttributeDeclConsumer.java index eec2dce..c83e800 100644 --- a/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEAttributeDeclConsumer.java +++ b/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEAttributeDeclConsumer.java @@ -26,6 +26,8 @@ import org.eclipse.xtext.builtin.parser.packrat.consumers.XtextBuiltinSTRINGCons @SuppressWarnings("unused") public final class EcoreDslEAttributeDeclConsumer extends NonTerminalConsumer { + private EAttributeDeclElements rule; + private INonTerminalConsumer eAnnotationDeclConsumer; private INonTerminalConsumer eGenericTypeReferenceDeclConsumer; private ITerminalConsumer idConsumer; @@ -188,17 +190,11 @@ public final class EcoreDslEAttributeDeclConsumer extends NonTerminalConsumer { } protected int doConsumeAssignment$8(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(eAnnotationDeclConsumer, "eAnnotations", true, false, false, getRule().ele00000000ParserRuleCallEAnnotationDecl()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$9(entryPoint); + } + + protected int consumeRuleCall$9(int entryPoint) throws Exception { + return consumeNonTerminal(eAnnotationDeclConsumer, "eAnnotations", true, false, false, getRule().ele00000000ParserRuleCallEAnnotationDecl()); } protected int consumeAlternatives$10(int entryPoint) throws Exception { @@ -260,115 +256,67 @@ public final class EcoreDslEAttributeDeclConsumer extends NonTerminalConsumer { } protected int consumeAssignment$17(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeKeyword(getRule().ele000000100000000KeywordID(), "iD", false, true, getKeyword$18$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeKeyword$18(entryPoint); + } + + protected int consumeKeyword$18(int entryPoint) throws Exception { + return consumeKeyword(getRule().ele000000100000000KeywordID(), "iD", false, true, getKeyword$18$Delimiter()); } protected int consumeAssignment$19(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeKeyword(getRule().ele000000100000010KeywordBag(), "unique", false, true, getKeyword$20$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeKeyword$20(entryPoint); + } + + protected int consumeKeyword$20(int entryPoint) throws Exception { + return consumeKeyword(getRule().ele000000100000010KeywordBag(), "unique", false, true, getKeyword$20$Delimiter()); } protected int consumeAssignment$21(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeKeyword(getRule().ele00000010000010KeywordRandom(), "ordered", false, true, getKeyword$22$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeKeyword$22(entryPoint); + } + + protected int consumeKeyword$22(int entryPoint) throws Exception { + return consumeKeyword(getRule().ele00000010000010KeywordRandom(), "ordered", false, true, getKeyword$22$Delimiter()); } protected int consumeAssignment$23(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeKeyword(getRule().ele0000001000010KeywordReadonly(), "changeable", false, true, getKeyword$24$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeKeyword$24(entryPoint); + } + + protected int consumeKeyword$24(int entryPoint) throws Exception { + return consumeKeyword(getRule().ele0000001000010KeywordReadonly(), "changeable", false, true, getKeyword$24$Delimiter()); } protected int consumeAssignment$25(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeKeyword(getRule().ele000000100010KeywordVolatile(), "volatile", false, true, getKeyword$26$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeKeyword$26(entryPoint); + } + + protected int consumeKeyword$26(int entryPoint) throws Exception { + return consumeKeyword(getRule().ele000000100010KeywordVolatile(), "volatile", false, true, getKeyword$26$Delimiter()); } protected int consumeAssignment$27(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeKeyword(getRule().ele00000010010KeywordTransient(), "transient", false, true, getKeyword$28$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeKeyword$28(entryPoint); + } + + protected int consumeKeyword$28(int entryPoint) throws Exception { + return consumeKeyword(getRule().ele00000010010KeywordTransient(), "transient", false, true, getKeyword$28$Delimiter()); } protected int consumeAssignment$29(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeKeyword(getRule().ele0000001010KeywordUnsettable(), "unsettable", false, true, getKeyword$30$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeKeyword$30(entryPoint); + } + + protected int consumeKeyword$30(int entryPoint) throws Exception { + return consumeKeyword(getRule().ele0000001010KeywordUnsettable(), "unsettable", false, true, getKeyword$30$Delimiter()); } protected int consumeAssignment$31(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeKeyword(getRule().ele000000110KeywordDerived(), "derived", false, true, getKeyword$32$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeKeyword$32(entryPoint); + } + + protected int consumeKeyword$32(int entryPoint) throws Exception { + return consumeKeyword(getRule().ele000000110KeywordDerived(), "derived", false, true, getKeyword$32$Delimiter()); } protected int consumeKeyword$33(int entryPoint) throws Exception { @@ -376,17 +324,11 @@ public final class EcoreDslEAttributeDeclConsumer extends NonTerminalConsumer { } protected int consumeAssignment$34(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(eGenericTypeReferenceDeclConsumer, "eGenericType", false, false, false, getRule().ele000010ParserRuleCallEGenericTypeReferenceDecl()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$35(entryPoint); + } + + protected int consumeRuleCall$35(int entryPoint) throws Exception { + return consumeNonTerminal(eGenericTypeReferenceDeclConsumer, "eGenericType", false, false, false, getRule().ele000010ParserRuleCallEGenericTypeReferenceDecl()); } protected int consumeGroup$36(int entryPoint) throws Exception { @@ -453,17 +395,11 @@ public final class EcoreDslEAttributeDeclConsumer extends NonTerminalConsumer { } protected int consumeAssignment$40(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeTerminal(intConsumer, "lowerBound", false, false, getRule().ele00010010LexerRuleCallINT(), getRuleCall$41$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$41(entryPoint); + } + + protected int consumeRuleCall$41(int entryPoint) throws Exception { + return consumeTerminal(intConsumer, "lowerBound", false, false, getRule().ele00010010LexerRuleCallINT(), getRuleCall$41$Delimiter()); } protected int consumeGroup$42(int entryPoint) throws Exception { @@ -512,17 +448,11 @@ public final class EcoreDslEAttributeDeclConsumer extends NonTerminalConsumer { } protected int consumeAssignment$44(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(sintConsumer, "upperBound", false, true, false, getRule().ele00010110ParserRuleCallSINT()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$45(entryPoint); + } + + protected int consumeRuleCall$45(int entryPoint) throws Exception { + return consumeNonTerminal(sintConsumer, "upperBound", false, true, false, getRule().ele00010110ParserRuleCallSINT()); } protected int consumeKeyword$46(int entryPoint) throws Exception { @@ -530,17 +460,11 @@ public final class EcoreDslEAttributeDeclConsumer extends NonTerminalConsumer { } protected int consumeAssignment$47(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeTerminal(idConsumer, "name", false, false, getRule().ele0010LexerRuleCallID(), getRuleCall$48$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$48(entryPoint); + } + + protected int consumeRuleCall$48(int entryPoint) throws Exception { + return consumeTerminal(idConsumer, "name", false, false, getRule().ele0010LexerRuleCallID(), getRuleCall$48$Delimiter()); } protected int consumeGroup$49(int entryPoint) throws Exception { @@ -589,17 +513,11 @@ public final class EcoreDslEAttributeDeclConsumer extends NonTerminalConsumer { } protected int consumeAssignment$51(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeTerminal(stringConsumer, "defaultValueLiteral", false, false, getRule().ele0110LexerRuleCallSTRING(), getRuleCall$52$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$52(entryPoint); + } + + protected int consumeRuleCall$52(int entryPoint) throws Exception { + return consumeTerminal(stringConsumer, "defaultValueLiteral", false, false, getRule().ele0110LexerRuleCallSTRING(), getRuleCall$52$Delimiter()); } protected int consumeKeyword$53(int entryPoint) throws Exception { @@ -607,7 +525,12 @@ public final class EcoreDslEAttributeDeclConsumer extends NonTerminalConsumer { } public EAttributeDeclElements getRule() { - return EcoreDslGrammarAccess.INSTANCE.prEAttributeDecl(); + // EcoreDslGrammarAccess.INSTANCE.prEAttributeDecl() + return rule; + } + + public void setRule(EAttributeDeclElements rule) { + this.rule = rule; } @Override diff --git a/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEClassDeclConsumer.java b/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEClassDeclConsumer.java index aea10c6..a289364 100644 --- a/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEClassDeclConsumer.java +++ b/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEClassDeclConsumer.java @@ -27,6 +27,8 @@ import org.eclipse.xtext.example.parser.packrat.consumers.EcoreDslSTRING_OR_QIDC @SuppressWarnings("unused") public final class EcoreDslEClassDeclConsumer extends NonTerminalConsumer { + private EClassDeclElements rule; + private INonTerminalConsumer eAnnotationDeclConsumer; private INonTerminalConsumer eGenericTypeReferenceDeclConsumer; private INonTerminalConsumer eOperationDeclConsumer; @@ -193,17 +195,11 @@ public final class EcoreDslEClassDeclConsumer extends NonTerminalConsumer { } protected int doConsumeAssignment$10(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(eAnnotationDeclConsumer, "eAnnotations", true, false, false, getRule().ele0000000000ParserRuleCallEAnnotationDecl()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$11(entryPoint); + } + + protected int consumeRuleCall$11(int entryPoint) throws Exception { + return consumeNonTerminal(eAnnotationDeclConsumer, "eAnnotations", true, false, false, getRule().ele0000000000ParserRuleCallEAnnotationDecl()); } protected int consumeAssignment$12(int entryPoint) throws Exception { @@ -217,17 +213,11 @@ public final class EcoreDslEClassDeclConsumer extends NonTerminalConsumer { } protected int doConsumeAssignment$12(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeKeyword(getRule().ele0000000010KeywordAbstract(), "abstract", false, true, getKeyword$13$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeKeyword$13(entryPoint); + } + + protected int consumeKeyword$13(int entryPoint) throws Exception { + return consumeKeyword(getRule().ele0000000010KeywordAbstract(), "abstract", false, true, getKeyword$13$Delimiter()); } protected int consumeAlternatives$14(int entryPoint) throws Exception { @@ -250,17 +240,11 @@ public final class EcoreDslEClassDeclConsumer extends NonTerminalConsumer { } protected int consumeAssignment$15(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeKeyword(getRule().ele0000000100KeywordInterface(), "interface", false, true, getKeyword$16$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeKeyword$16(entryPoint); + } + + protected int consumeKeyword$16(int entryPoint) throws Exception { + return consumeKeyword(getRule().ele0000000100KeywordInterface(), "interface", false, true, getKeyword$16$Delimiter()); } protected int consumeKeyword$17(int entryPoint) throws Exception { @@ -268,17 +252,11 @@ public final class EcoreDslEClassDeclConsumer extends NonTerminalConsumer { } protected int consumeAssignment$18(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeTerminal(idConsumer, "name", false, false, getRule().ele00000010LexerRuleCallID(), getRuleCall$19$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$19(entryPoint); + } + + protected int consumeRuleCall$19(int entryPoint) throws Exception { + return consumeTerminal(idConsumer, "name", false, false, getRule().ele00000010LexerRuleCallID(), getRuleCall$19$Delimiter()); } protected int consumeGroup$20(int entryPoint) throws Exception { @@ -345,17 +323,11 @@ public final class EcoreDslEClassDeclConsumer extends NonTerminalConsumer { } protected int consumeAssignment$24(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(eTypeParameterDeclConsumer, "eTypeParameters", true, false, false, getRule().ele0000010010ParserRuleCallETypeParameterDecl()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$25(entryPoint); + } + + protected int consumeRuleCall$25(int entryPoint) throws Exception { + return consumeNonTerminal(eTypeParameterDeclConsumer, "eTypeParameters", true, false, false, getRule().ele0000010010ParserRuleCallETypeParameterDecl()); } protected int consumeGroup$26(int entryPoint) throws Exception { @@ -403,17 +375,11 @@ public final class EcoreDslEClassDeclConsumer extends NonTerminalConsumer { } protected int consumeAssignment$28(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(eTypeParameterDeclConsumer, "eTypeParameters", true, false, false, getRule().ele0000010110ParserRuleCallETypeParameterDecl()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$29(entryPoint); + } + + protected int consumeRuleCall$29(int entryPoint) throws Exception { + return consumeNonTerminal(eTypeParameterDeclConsumer, "eTypeParameters", true, false, false, getRule().ele0000010110ParserRuleCallETypeParameterDecl()); } protected int consumeKeyword$30(int entryPoint) throws Exception { @@ -475,17 +441,11 @@ public final class EcoreDslEClassDeclConsumer extends NonTerminalConsumer { } protected int consumeAssignment$34(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(eGenericTypeReferenceDeclConsumer, "eGenericSuperTypes", true, false, false, getRule().ele00001010ParserRuleCallEGenericTypeReferenceDecl()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$35(entryPoint); + } + + protected int consumeRuleCall$35(int entryPoint) throws Exception { + return consumeNonTerminal(eGenericTypeReferenceDeclConsumer, "eGenericSuperTypes", true, false, false, getRule().ele00001010ParserRuleCallEGenericTypeReferenceDecl()); } protected int consumeGroup$36(int entryPoint) throws Exception { @@ -533,17 +493,11 @@ public final class EcoreDslEClassDeclConsumer extends NonTerminalConsumer { } protected int consumeAssignment$38(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(eGenericTypeReferenceDeclConsumer, "eGenericSuperTypes", true, false, false, getRule().ele00001110ParserRuleCallEGenericTypeReferenceDecl()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$39(entryPoint); + } + + protected int consumeRuleCall$39(int entryPoint) throws Exception { + return consumeNonTerminal(eGenericTypeReferenceDeclConsumer, "eGenericSuperTypes", true, false, false, getRule().ele00001110ParserRuleCallEGenericTypeReferenceDecl()); } protected int consumeGroup$40(int entryPoint) throws Exception { @@ -592,17 +546,11 @@ public final class EcoreDslEClassDeclConsumer extends NonTerminalConsumer { } protected int consumeAssignment$42(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(stringOrQidConsumer, "instanceClassName", false, true, false, getRule().ele000110ParserRuleCallSTRING_OR_QID()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$43(entryPoint); + } + + protected int consumeRuleCall$43(int entryPoint) throws Exception { + return consumeNonTerminal(stringOrQidConsumer, "instanceClassName", false, true, false, getRule().ele000110ParserRuleCallSTRING_OR_QID()); } protected int consumeKeyword$44(int entryPoint) throws Exception { @@ -638,31 +586,19 @@ public final class EcoreDslEClassDeclConsumer extends NonTerminalConsumer { } protected int consumeAssignment$46(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(eStructuralFeatureDeclConsumer, "eStructuralFeatures", true, false, false, getRule().ele0100ParserRuleCallEStructuralFeatureDecl()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$47(entryPoint); + } + + protected int consumeRuleCall$47(int entryPoint) throws Exception { + return consumeNonTerminal(eStructuralFeatureDeclConsumer, "eStructuralFeatures", true, false, false, getRule().ele0100ParserRuleCallEStructuralFeatureDecl()); } protected int consumeAssignment$48(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(eOperationDeclConsumer, "eOperations", true, false, false, getRule().ele0110ParserRuleCallEOperationDecl()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$49(entryPoint); + } + + protected int consumeRuleCall$49(int entryPoint) throws Exception { + return consumeNonTerminal(eOperationDeclConsumer, "eOperations", true, false, false, getRule().ele0110ParserRuleCallEOperationDecl()); } protected int consumeKeyword$50(int entryPoint) throws Exception { @@ -670,7 +606,12 @@ public final class EcoreDslEClassDeclConsumer extends NonTerminalConsumer { } public EClassDeclElements getRule() { - return EcoreDslGrammarAccess.INSTANCE.prEClassDecl(); + // EcoreDslGrammarAccess.INSTANCE.prEClassDecl() + return rule; + } + + public void setRule(EClassDeclElements rule) { + this.rule = rule; } @Override diff --git a/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEClassifierDeclConsumer.java b/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEClassifierDeclConsumer.java index 40d6c6f..cf55f18 100644 --- a/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEClassifierDeclConsumer.java +++ b/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEClassifierDeclConsumer.java @@ -22,6 +22,8 @@ import org.eclipse.xtext.example.parser.packrat.consumers.EcoreDslEDataTypeDeclC @SuppressWarnings("unused") public final class EcoreDslEClassifierDeclConsumer extends NonTerminalConsumer { + private EClassifierDeclElements rule; + private INonTerminalConsumer eClassDeclConsumer; private INonTerminalConsumer eDataTypeDeclConsumer; @@ -62,7 +64,12 @@ public final class EcoreDslEClassifierDeclConsumer extends NonTerminalConsumer { } public EClassifierDeclElements getRule() { - return EcoreDslGrammarAccess.INSTANCE.prEClassifierDecl(); + // EcoreDslGrammarAccess.INSTANCE.prEClassifierDecl() + return rule; + } + + public void setRule(EClassifierDeclElements rule) { + this.rule = rule; } @Override diff --git a/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEDataTypeDeclConsumer.java b/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEDataTypeDeclConsumer.java index 1041fab..190a0fc 100644 --- a/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEDataTypeDeclConsumer.java +++ b/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEDataTypeDeclConsumer.java @@ -24,6 +24,8 @@ import org.eclipse.xtext.example.parser.packrat.consumers.EcoreDslSTRING_OR_QIDC @SuppressWarnings("unused") public final class EcoreDslEDataTypeDeclConsumer extends NonTerminalConsumer { + private EDataTypeDeclElements rule; + private INonTerminalConsumer eAnnotationDeclConsumer; private INonTerminalConsumer eEnumDeclConsumer; private ITerminalConsumer idConsumer; @@ -158,17 +160,11 @@ public final class EcoreDslEDataTypeDeclConsumer extends NonTerminalConsumer { } protected int doConsumeAssignment$4(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(eAnnotationDeclConsumer, "eAnnotations", true, false, false, getRule().ele0000ParserRuleCallEAnnotationDecl()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$5(entryPoint); + } + + protected int consumeRuleCall$5(int entryPoint) throws Exception { + return consumeNonTerminal(eAnnotationDeclConsumer, "eAnnotations", true, false, false, getRule().ele0000ParserRuleCallEAnnotationDecl()); } protected int consumeAssignment$6(int entryPoint) throws Exception { @@ -182,17 +178,11 @@ public final class EcoreDslEDataTypeDeclConsumer extends NonTerminalConsumer { } protected int doConsumeAssignment$6(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeKeyword(getRule().ele0010KeywordSerializable(), "serializable", false, true, getKeyword$7$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeKeyword$7(entryPoint); + } + + protected int consumeKeyword$7(int entryPoint) throws Exception { + return consumeKeyword(getRule().ele0010KeywordSerializable(), "serializable", false, true, getKeyword$7$Delimiter()); } protected int consumeKeyword$12(int entryPoint) throws Exception { @@ -200,17 +190,11 @@ public final class EcoreDslEDataTypeDeclConsumer extends NonTerminalConsumer { } protected int consumeAssignment$13(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeTerminal(idConsumer, "name", false, false, getRule().ele0100010LexerRuleCallID(), getRuleCall$14$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$14(entryPoint); + } + + protected int consumeRuleCall$14(int entryPoint) throws Exception { + return consumeTerminal(idConsumer, "name", false, false, getRule().ele0100010LexerRuleCallID(), getRuleCall$14$Delimiter()); } protected int consumeKeyword$15(int entryPoint) throws Exception { @@ -218,17 +202,11 @@ public final class EcoreDslEDataTypeDeclConsumer extends NonTerminalConsumer { } protected int consumeAssignment$16(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(stringOrQidConsumer, "instanceClassName", false, true, false, getRule().ele01010ParserRuleCallSTRING_OR_QID()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$17(entryPoint); + } + + protected int consumeRuleCall$17(int entryPoint) throws Exception { + return consumeNonTerminal(stringOrQidConsumer, "instanceClassName", false, true, false, getRule().ele01010ParserRuleCallSTRING_OR_QID()); } protected int consumeKeyword$18(int entryPoint) throws Exception { @@ -240,7 +218,12 @@ public final class EcoreDslEDataTypeDeclConsumer extends NonTerminalConsumer { } public EDataTypeDeclElements getRule() { - return EcoreDslGrammarAccess.INSTANCE.prEDataTypeDecl(); + // EcoreDslGrammarAccess.INSTANCE.prEDataTypeDecl() + return rule; + } + + public void setRule(EDataTypeDeclElements rule) { + this.rule = rule; } @Override diff --git a/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEEnumDeclConsumer.java b/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEEnumDeclConsumer.java index 3c07f7e..0708bfb 100644 --- a/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEEnumDeclConsumer.java +++ b/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEEnumDeclConsumer.java @@ -23,6 +23,8 @@ import org.eclipse.xtext.builtin.parser.packrat.consumers.XtextBuiltinIDConsumer @SuppressWarnings("unused") public final class EcoreDslEEnumDeclConsumer extends NonTerminalConsumer { + private EEnumDeclElements rule; + private INonTerminalConsumer eAnnotationDeclConsumer; private INonTerminalConsumer eEnumLiteralDeclConsumer; private ITerminalConsumer idConsumer; @@ -125,17 +127,11 @@ public final class EcoreDslEEnumDeclConsumer extends NonTerminalConsumer { } protected int doConsumeAssignment$6(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(eAnnotationDeclConsumer, "eAnnotations", true, false, false, getRule().ele000000ParserRuleCallEAnnotationDecl()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$7(entryPoint); + } + + protected int consumeRuleCall$7(int entryPoint) throws Exception { + return consumeNonTerminal(eAnnotationDeclConsumer, "eAnnotations", true, false, false, getRule().ele000000ParserRuleCallEAnnotationDecl()); } protected int consumeKeyword$8(int entryPoint) throws Exception { @@ -143,17 +139,11 @@ public final class EcoreDslEEnumDeclConsumer extends NonTerminalConsumer { } protected int consumeAssignment$9(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeTerminal(idConsumer, "name", false, false, getRule().ele00010LexerRuleCallID(), getRuleCall$10$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$10(entryPoint); + } + + protected int consumeRuleCall$10(int entryPoint) throws Exception { + return consumeTerminal(idConsumer, "name", false, false, getRule().ele00010LexerRuleCallID(), getRuleCall$10$Delimiter()); } protected int consumeKeyword$11(int entryPoint) throws Exception { @@ -180,9 +170,8 @@ public final class EcoreDslEEnumDeclConsumer extends NonTerminalConsumer { marker.rollback(); announceLevelFinished(); return ConsumeResult.SUCCESS; - } else { - error("Could not find token.", getRule().ele01AssignmentELiterals()); } + error("Could not find token.", getRule().ele01AssignmentELiterals()); } announceLevelFinished(); marker.commit(); @@ -190,17 +179,11 @@ public final class EcoreDslEEnumDeclConsumer extends NonTerminalConsumer { } protected int doConsumeAssignment$12(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(eEnumLiteralDeclConsumer, "eLiterals", true, false, false, getRule().ele010ParserRuleCallEEnumLiteralDecl()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$13(entryPoint); + } + + protected int consumeRuleCall$13(int entryPoint) throws Exception { + return consumeNonTerminal(eEnumLiteralDeclConsumer, "eLiterals", true, false, false, getRule().ele010ParserRuleCallEEnumLiteralDecl()); } protected int consumeKeyword$14(int entryPoint) throws Exception { @@ -208,7 +191,12 @@ public final class EcoreDslEEnumDeclConsumer extends NonTerminalConsumer { } public EEnumDeclElements getRule() { - return EcoreDslGrammarAccess.INSTANCE.prEEnumDecl(); + // EcoreDslGrammarAccess.INSTANCE.prEEnumDecl() + return rule; + } + + public void setRule(EEnumDeclElements rule) { + this.rule = rule; } @Override diff --git a/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEEnumLiteralDeclConsumer.java b/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEEnumLiteralDeclConsumer.java index aab89b2..a2999f4 100644 --- a/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEEnumLiteralDeclConsumer.java +++ b/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEEnumLiteralDeclConsumer.java @@ -24,6 +24,8 @@ import org.eclipse.xtext.builtin.parser.packrat.consumers.XtextBuiltinSTRINGCons @SuppressWarnings("unused") public final class EcoreDslEEnumLiteralDeclConsumer extends NonTerminalConsumer { + private EEnumLiteralDeclElements rule; + private INonTerminalConsumer eAnnotationDeclConsumer; private ITerminalConsumer idConsumer; private ITerminalConsumer intConsumer; @@ -121,31 +123,19 @@ public final class EcoreDslEEnumLiteralDeclConsumer extends NonTerminalConsumer } protected int doConsumeAssignment$5(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(eAnnotationDeclConsumer, "eAnnotations", true, false, false, getRule().ele00000ParserRuleCallEAnnotationDecl()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$6(entryPoint); + } + + protected int consumeRuleCall$6(int entryPoint) throws Exception { + return consumeNonTerminal(eAnnotationDeclConsumer, "eAnnotations", true, false, false, getRule().ele00000ParserRuleCallEAnnotationDecl()); } protected int consumeAssignment$7(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeTerminal(idConsumer, "name", false, false, getRule().ele00010LexerRuleCallID(), getRuleCall$8$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$8(entryPoint); + } + + protected int consumeRuleCall$8(int entryPoint) throws Exception { + return consumeTerminal(idConsumer, "name", false, false, getRule().ele00010LexerRuleCallID(), getRuleCall$8$Delimiter()); } protected int consumeGroup$9(int entryPoint) throws Exception { @@ -194,17 +184,11 @@ public final class EcoreDslEEnumLiteralDeclConsumer extends NonTerminalConsumer } protected int consumeAssignment$11(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeTerminal(intConsumer, "value", false, false, getRule().ele00110LexerRuleCallINT(), getRuleCall$12$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$12(entryPoint); + } + + protected int consumeRuleCall$12(int entryPoint) throws Exception { + return consumeTerminal(intConsumer, "value", false, false, getRule().ele00110LexerRuleCallINT(), getRuleCall$12$Delimiter()); } protected int consumeAssignment$13(int entryPoint) throws Exception { @@ -218,17 +202,11 @@ public final class EcoreDslEEnumLiteralDeclConsumer extends NonTerminalConsumer } protected int doConsumeAssignment$13(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeTerminal(stringConsumer, "literal", false, false, getRule().ele010LexerRuleCallSTRING(), getRuleCall$14$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$14(entryPoint); + } + + protected int consumeRuleCall$14(int entryPoint) throws Exception { + return consumeTerminal(stringConsumer, "literal", false, false, getRule().ele010LexerRuleCallSTRING(), getRuleCall$14$Delimiter()); } protected int consumeKeyword$15(int entryPoint) throws Exception { @@ -236,7 +214,12 @@ public final class EcoreDslEEnumLiteralDeclConsumer extends NonTerminalConsumer } public EEnumLiteralDeclElements getRule() { - return EcoreDslGrammarAccess.INSTANCE.prEEnumLiteralDecl(); + // EcoreDslGrammarAccess.INSTANCE.prEEnumLiteralDecl() + return rule; + } + + public void setRule(EEnumLiteralDeclElements rule) { + this.rule = rule; } @Override diff --git a/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEGenericTypeDeclConsumer.java b/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEGenericTypeDeclConsumer.java index 12666a4..020e245 100644 --- a/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEGenericTypeDeclConsumer.java +++ b/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEGenericTypeDeclConsumer.java @@ -22,6 +22,8 @@ import org.eclipse.xtext.builtin.parser.packrat.consumers.XtextBuiltinIDConsumer @SuppressWarnings("unused") public final class EcoreDslEGenericTypeDeclConsumer extends NonTerminalConsumer { + private EGenericTypeDeclElements rule; + private INonTerminalConsumer eGenericTypeDeclConsumer; private ITerminalConsumer idConsumer; @@ -117,17 +119,11 @@ public final class EcoreDslEGenericTypeDeclConsumer extends NonTerminalConsumer } protected int consumeAssignment$4(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeTerminal(idConsumer, "eClassifier", false, false, getRule().ele0000CrossReferenceEStringEClassifier(), getCrossReference$5$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeCrossReference$5(entryPoint); + } + + protected int consumeCrossReference$5(int entryPoint) throws Exception { + return consumeTerminal(idConsumer, "eClassifier", false, false, getRule().ele0000CrossReferenceEStringEClassifier(), getCrossReference$5$Delimiter()); } protected int consumeGroup$7(int entryPoint) throws Exception { @@ -194,17 +190,11 @@ public final class EcoreDslEGenericTypeDeclConsumer extends NonTerminalConsumer } protected int consumeAssignment$11(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(eGenericTypeDeclConsumer, "eTypeArguments", true, false, false, getRule().ele0010010ParserRuleCallEGenericTypeDecl()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$12(entryPoint); + } + + protected int consumeRuleCall$12(int entryPoint) throws Exception { + return consumeNonTerminal(eGenericTypeDeclConsumer, "eTypeArguments", true, false, false, getRule().ele0010010ParserRuleCallEGenericTypeDecl()); } protected int consumeGroup$13(int entryPoint) throws Exception { @@ -252,17 +242,11 @@ public final class EcoreDslEGenericTypeDeclConsumer extends NonTerminalConsumer } protected int consumeAssignment$15(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(eGenericTypeDeclConsumer, "eTypeArguments", true, false, false, getRule().ele0010110ParserRuleCallEGenericTypeDecl()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$16(entryPoint); + } + + protected int consumeRuleCall$16(int entryPoint) throws Exception { + return consumeNonTerminal(eGenericTypeDeclConsumer, "eTypeArguments", true, false, false, getRule().ele0010110ParserRuleCallEGenericTypeDecl()); } protected int consumeKeyword$17(int entryPoint) throws Exception { @@ -305,17 +289,11 @@ public final class EcoreDslEGenericTypeDeclConsumer extends NonTerminalConsumer } protected int consumeAssignment$20(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeTerminal(idConsumer, "eTypeParameter", false, false, getRule().ele0110CrossReferenceEStringETypeParameter(), getCrossReference$21$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeCrossReference$21(entryPoint); + } + + protected int consumeCrossReference$21(int entryPoint) throws Exception { + return consumeTerminal(idConsumer, "eTypeParameter", false, false, getRule().ele0110CrossReferenceEStringETypeParameter(), getCrossReference$21$Delimiter()); } protected int consumeGroup$23(int entryPoint) throws Exception { @@ -408,17 +386,11 @@ public final class EcoreDslEGenericTypeDeclConsumer extends NonTerminalConsumer } protected int consumeAssignment$28(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(eGenericTypeDeclConsumer, "eUpperBound", false, false, false, getRule().ele11010ParserRuleCallEGenericTypeDecl()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$29(entryPoint); + } + + protected int consumeRuleCall$29(int entryPoint) throws Exception { + return consumeNonTerminal(eGenericTypeDeclConsumer, "eUpperBound", false, false, false, getRule().ele11010ParserRuleCallEGenericTypeDecl()); } protected int consumeGroup$30(int entryPoint) throws Exception { @@ -457,21 +429,20 @@ public final class EcoreDslEGenericTypeDeclConsumer extends NonTerminalConsumer } protected int consumeAssignment$32(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(eGenericTypeDeclConsumer, "eLowerBound", false, false, false, getRule().ele11110ParserRuleCallEGenericTypeDecl()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$33(entryPoint); + } + + protected int consumeRuleCall$33(int entryPoint) throws Exception { + return consumeNonTerminal(eGenericTypeDeclConsumer, "eLowerBound", false, false, false, getRule().ele11110ParserRuleCallEGenericTypeDecl()); } public EGenericTypeDeclElements getRule() { - return EcoreDslGrammarAccess.INSTANCE.prEGenericTypeDecl(); + // EcoreDslGrammarAccess.INSTANCE.prEGenericTypeDecl() + return rule; + } + + public void setRule(EGenericTypeDeclElements rule) { + this.rule = rule; } @Override diff --git a/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEGenericTypeReferenceDeclConsumer.java b/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEGenericTypeReferenceDeclConsumer.java index dd5980e..c47e2c9 100644 --- a/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEGenericTypeReferenceDeclConsumer.java +++ b/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEGenericTypeReferenceDeclConsumer.java @@ -22,6 +22,8 @@ import org.eclipse.xtext.builtin.parser.packrat.consumers.XtextBuiltinIDConsumer @SuppressWarnings("unused") public final class EcoreDslEGenericTypeReferenceDeclConsumer extends NonTerminalConsumer { + private EGenericTypeReferenceDeclElements rule; + private INonTerminalConsumer eGenericTypeDeclConsumer; private ITerminalConsumer idConsumer; @@ -103,17 +105,11 @@ public final class EcoreDslEGenericTypeReferenceDeclConsumer extends NonTerminal } protected int consumeAssignment$3(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeTerminal(idConsumer, "eClassifier", false, false, getRule().ele000CrossReferenceEStringEClassifier(), getCrossReference$4$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeCrossReference$4(entryPoint); + } + + protected int consumeCrossReference$4(int entryPoint) throws Exception { + return consumeTerminal(idConsumer, "eClassifier", false, false, getRule().ele000CrossReferenceEStringEClassifier(), getCrossReference$4$Delimiter()); } protected int consumeGroup$6(int entryPoint) throws Exception { @@ -180,17 +176,11 @@ public final class EcoreDslEGenericTypeReferenceDeclConsumer extends NonTerminal } protected int consumeAssignment$10(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(eGenericTypeDeclConsumer, "eTypeArguments", true, false, false, getRule().ele010010ParserRuleCallEGenericTypeDecl()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$11(entryPoint); + } + + protected int consumeRuleCall$11(int entryPoint) throws Exception { + return consumeNonTerminal(eGenericTypeDeclConsumer, "eTypeArguments", true, false, false, getRule().ele010010ParserRuleCallEGenericTypeDecl()); } protected int consumeGroup$12(int entryPoint) throws Exception { @@ -238,17 +228,11 @@ public final class EcoreDslEGenericTypeReferenceDeclConsumer extends NonTerminal } protected int consumeAssignment$14(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(eGenericTypeDeclConsumer, "eTypeArguments", true, false, false, getRule().ele010110ParserRuleCallEGenericTypeDecl()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$15(entryPoint); + } + + protected int consumeRuleCall$15(int entryPoint) throws Exception { + return consumeNonTerminal(eGenericTypeDeclConsumer, "eTypeArguments", true, false, false, getRule().ele010110ParserRuleCallEGenericTypeDecl()); } protected int consumeKeyword$16(int entryPoint) throws Exception { @@ -291,21 +275,20 @@ public final class EcoreDslEGenericTypeReferenceDeclConsumer extends NonTerminal } protected int consumeAssignment$19(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeTerminal(idConsumer, "eTypeParameter", false, false, getRule().ele110CrossReferenceEStringETypeParameter(), getCrossReference$20$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeCrossReference$20(entryPoint); + } + + protected int consumeCrossReference$20(int entryPoint) throws Exception { + return consumeTerminal(idConsumer, "eTypeParameter", false, false, getRule().ele110CrossReferenceEStringETypeParameter(), getCrossReference$20$Delimiter()); } public EGenericTypeReferenceDeclElements getRule() { - return EcoreDslGrammarAccess.INSTANCE.prEGenericTypeReferenceDecl(); + // EcoreDslGrammarAccess.INSTANCE.prEGenericTypeReferenceDecl() + return rule; + } + + public void setRule(EGenericTypeReferenceDeclElements rule) { + this.rule = rule; } @Override diff --git a/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEOperationDeclConsumer.java b/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEOperationDeclConsumer.java index 604d7ad..59dae88 100644 --- a/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEOperationDeclConsumer.java +++ b/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEOperationDeclConsumer.java @@ -25,6 +25,8 @@ import org.eclipse.xtext.builtin.parser.packrat.consumers.XtextBuiltinIDConsumer @SuppressWarnings("unused") public final class EcoreDslEOperationDeclConsumer extends NonTerminalConsumer { + private EOperationDeclElements rule; + private INonTerminalConsumer eAnnotationDeclConsumer; private INonTerminalConsumer eGenericTypeReferenceDeclConsumer; private INonTerminalConsumer eParameterDeclConsumer; @@ -204,17 +206,11 @@ public final class EcoreDslEOperationDeclConsumer extends NonTerminalConsumer { } protected int doConsumeAssignment$11(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(eAnnotationDeclConsumer, "eAnnotations", true, false, false, getRule().ele00000000000ParserRuleCallEAnnotationDecl()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$12(entryPoint); + } + + protected int consumeRuleCall$12(int entryPoint) throws Exception { + return consumeNonTerminal(eAnnotationDeclConsumer, "eAnnotations", true, false, false, getRule().ele00000000000ParserRuleCallEAnnotationDecl()); } protected int consumeAlternatives$13(int entryPoint) throws Exception { @@ -246,31 +242,19 @@ public final class EcoreDslEOperationDeclConsumer extends NonTerminalConsumer { } protected int consumeAssignment$14(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeKeyword(getRule().ele000000000100KeywordBag(), "unique", false, true, getKeyword$15$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeKeyword$15(entryPoint); + } + + protected int consumeKeyword$15(int entryPoint) throws Exception { + return consumeKeyword(getRule().ele000000000100KeywordBag(), "unique", false, true, getKeyword$15$Delimiter()); } protected int consumeAssignment$16(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeKeyword(getRule().ele000000000110KeywordRandom(), "ordered", false, true, getKeyword$17$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeKeyword$17(entryPoint); + } + + protected int consumeKeyword$17(int entryPoint) throws Exception { + return consumeKeyword(getRule().ele000000000110KeywordRandom(), "ordered", false, true, getKeyword$17$Delimiter()); } protected int consumeKeyword$18(int entryPoint) throws Exception { @@ -297,17 +281,11 @@ public final class EcoreDslEOperationDeclConsumer extends NonTerminalConsumer { } protected int consumeAssignment$20(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(eGenericTypeReferenceDeclConsumer, "eGenericType", false, false, false, getRule().ele0000000100ParserRuleCallEGenericTypeReferenceDecl()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$21(entryPoint); + } + + protected int consumeRuleCall$21(int entryPoint) throws Exception { + return consumeNonTerminal(eGenericTypeReferenceDeclConsumer, "eGenericType", false, false, false, getRule().ele0000000100ParserRuleCallEGenericTypeReferenceDecl()); } protected int consumeKeyword$22(int entryPoint) throws Exception { @@ -315,17 +293,11 @@ public final class EcoreDslEOperationDeclConsumer extends NonTerminalConsumer { } protected int consumeAssignment$23(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeTerminal(idConsumer, "name", false, false, getRule().ele00000010LexerRuleCallID(), getRuleCall$24$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$24(entryPoint); + } + + protected int consumeRuleCall$24(int entryPoint) throws Exception { + return consumeTerminal(idConsumer, "name", false, false, getRule().ele00000010LexerRuleCallID(), getRuleCall$24$Delimiter()); } protected int consumeGroup$25(int entryPoint) throws Exception { @@ -392,17 +364,11 @@ public final class EcoreDslEOperationDeclConsumer extends NonTerminalConsumer { } protected int consumeAssignment$29(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(eTypeParameterDeclConsumer, "eTypeParameters", true, false, false, getRule().ele0000010010ParserRuleCallETypeParameterDecl()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$30(entryPoint); + } + + protected int consumeRuleCall$30(int entryPoint) throws Exception { + return consumeNonTerminal(eTypeParameterDeclConsumer, "eTypeParameters", true, false, false, getRule().ele0000010010ParserRuleCallETypeParameterDecl()); } protected int consumeGroup$31(int entryPoint) throws Exception { @@ -450,17 +416,11 @@ public final class EcoreDslEOperationDeclConsumer extends NonTerminalConsumer { } protected int consumeAssignment$33(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(eTypeParameterDeclConsumer, "eTypeParameters", true, false, false, getRule().ele0000010110ParserRuleCallETypeParameterDecl()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$34(entryPoint); + } + + protected int consumeRuleCall$34(int entryPoint) throws Exception { + return consumeNonTerminal(eTypeParameterDeclConsumer, "eTypeParameters", true, false, false, getRule().ele0000010110ParserRuleCallETypeParameterDecl()); } protected int consumeKeyword$35(int entryPoint) throws Exception { @@ -513,17 +473,11 @@ public final class EcoreDslEOperationDeclConsumer extends NonTerminalConsumer { } protected int consumeAssignment$38(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(eParameterDeclConsumer, "eParameters", true, false, false, getRule().ele000100ParserRuleCallEParameterDecl()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$39(entryPoint); + } + + protected int consumeRuleCall$39(int entryPoint) throws Exception { + return consumeNonTerminal(eParameterDeclConsumer, "eParameters", true, false, false, getRule().ele000100ParserRuleCallEParameterDecl()); } protected int consumeGroup$40(int entryPoint) throws Exception { @@ -571,17 +525,11 @@ public final class EcoreDslEOperationDeclConsumer extends NonTerminalConsumer { } protected int consumeAssignment$42(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(eParameterDeclConsumer, "eParameters", true, false, false, getRule().ele0001110ParserRuleCallEParameterDecl()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$43(entryPoint); + } + + protected int consumeRuleCall$43(int entryPoint) throws Exception { + return consumeNonTerminal(eParameterDeclConsumer, "eParameters", true, false, false, getRule().ele0001110ParserRuleCallEParameterDecl()); } protected int consumeKeyword$44(int entryPoint) throws Exception { @@ -643,17 +591,11 @@ public final class EcoreDslEOperationDeclConsumer extends NonTerminalConsumer { } protected int consumeAssignment$48(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(eGenericTypeReferenceDeclConsumer, "eGenericExceptions", true, false, false, getRule().ele01010ParserRuleCallEGenericTypeReferenceDecl()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$49(entryPoint); + } + + protected int consumeRuleCall$49(int entryPoint) throws Exception { + return consumeNonTerminal(eGenericTypeReferenceDeclConsumer, "eGenericExceptions", true, false, false, getRule().ele01010ParserRuleCallEGenericTypeReferenceDecl()); } protected int consumeGroup$50(int entryPoint) throws Exception { @@ -701,17 +643,11 @@ public final class EcoreDslEOperationDeclConsumer extends NonTerminalConsumer { } protected int consumeAssignment$52(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(eGenericTypeReferenceDeclConsumer, "eGenericExceptions", true, false, false, getRule().ele01110ParserRuleCallEGenericTypeReferenceDecl()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$53(entryPoint); + } + + protected int consumeRuleCall$53(int entryPoint) throws Exception { + return consumeNonTerminal(eGenericTypeReferenceDeclConsumer, "eGenericExceptions", true, false, false, getRule().ele01110ParserRuleCallEGenericTypeReferenceDecl()); } protected int consumeKeyword$54(int entryPoint) throws Exception { @@ -719,7 +655,12 @@ public final class EcoreDslEOperationDeclConsumer extends NonTerminalConsumer { } public EOperationDeclElements getRule() { - return EcoreDslGrammarAccess.INSTANCE.prEOperationDecl(); + // EcoreDslGrammarAccess.INSTANCE.prEOperationDecl() + return rule; + } + + public void setRule(EOperationDeclElements rule) { + this.rule = rule; } @Override diff --git a/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEPackageDeclConsumer.java b/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEPackageDeclConsumer.java index d4645ca..95491d6 100644 --- a/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEPackageDeclConsumer.java +++ b/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEPackageDeclConsumer.java @@ -25,6 +25,8 @@ import org.eclipse.xtext.example.parser.packrat.consumers.EcoreDslSubEPackageDec @SuppressWarnings("unused") public final class EcoreDslEPackageDeclConsumer extends NonTerminalConsumer { + private EPackageDeclElements rule; + private INonTerminalConsumer eAnnotationDeclConsumer; private INonTerminalConsumer eClassifierDeclConsumer; private INonTerminalConsumer qidConsumer; @@ -195,17 +197,11 @@ public final class EcoreDslEPackageDeclConsumer extends NonTerminalConsumer { } protected int doConsumeAssignment$12(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(eAnnotationDeclConsumer, "eAnnotations", true, false, false, getRule().ele000000000000ParserRuleCallEAnnotationDecl()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$13(entryPoint); + } + + protected int consumeRuleCall$13(int entryPoint) throws Exception { + return consumeNonTerminal(eAnnotationDeclConsumer, "eAnnotations", true, false, false, getRule().ele000000000000ParserRuleCallEAnnotationDecl()); } protected int consumeKeyword$14(int entryPoint) throws Exception { @@ -213,17 +209,11 @@ public final class EcoreDslEPackageDeclConsumer extends NonTerminalConsumer { } protected int consumeAssignment$15(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(qidConsumer, "name", false, true, false, getRule().ele00000000010ParserRuleCallQID()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$16(entryPoint); + } + + protected int consumeRuleCall$16(int entryPoint) throws Exception { + return consumeNonTerminal(qidConsumer, "name", false, true, false, getRule().ele00000000010ParserRuleCallQID()); } protected int consumeKeyword$17(int entryPoint) throws Exception { @@ -235,17 +225,11 @@ public final class EcoreDslEPackageDeclConsumer extends NonTerminalConsumer { } protected int consumeAssignment$19(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeTerminal(stringConsumer, "nsURI", false, false, getRule().ele00000010LexerRuleCallSTRING(), getRuleCall$20$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$20(entryPoint); + } + + protected int consumeRuleCall$20(int entryPoint) throws Exception { + return consumeTerminal(stringConsumer, "nsURI", false, false, getRule().ele00000010LexerRuleCallSTRING(), getRuleCall$20$Delimiter()); } protected int consumeKeyword$21(int entryPoint) throws Exception { @@ -257,17 +241,11 @@ public final class EcoreDslEPackageDeclConsumer extends NonTerminalConsumer { } protected int consumeAssignment$23(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(qidConsumer, "nsPrefix", false, true, false, getRule().ele00010ParserRuleCallQID()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$24(entryPoint); + } + + protected int consumeRuleCall$24(int entryPoint) throws Exception { + return consumeNonTerminal(qidConsumer, "nsPrefix", false, true, false, getRule().ele00010ParserRuleCallQID()); } protected int consumeKeyword$25(int entryPoint) throws Exception { @@ -303,31 +281,19 @@ public final class EcoreDslEPackageDeclConsumer extends NonTerminalConsumer { } protected int consumeAssignment$27(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(subEPackageDeclConsumer, "eSubpackages", true, false, false, getRule().ele0100ParserRuleCallSubEPackageDecl()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$28(entryPoint); + } + + protected int consumeRuleCall$28(int entryPoint) throws Exception { + return consumeNonTerminal(subEPackageDeclConsumer, "eSubpackages", true, false, false, getRule().ele0100ParserRuleCallSubEPackageDecl()); } protected int consumeAssignment$29(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(eClassifierDeclConsumer, "eClassifiers", true, false, false, getRule().ele0110ParserRuleCallEClassifierDecl()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$30(entryPoint); + } + + protected int consumeRuleCall$30(int entryPoint) throws Exception { + return consumeNonTerminal(eClassifierDeclConsumer, "eClassifiers", true, false, false, getRule().ele0110ParserRuleCallEClassifierDecl()); } protected int consumeKeyword$31(int entryPoint) throws Exception { @@ -335,7 +301,12 @@ public final class EcoreDslEPackageDeclConsumer extends NonTerminalConsumer { } public EPackageDeclElements getRule() { - return EcoreDslGrammarAccess.INSTANCE.prEPackageDecl(); + // EcoreDslGrammarAccess.INSTANCE.prEPackageDecl() + return rule; + } + + public void setRule(EPackageDeclElements rule) { + this.rule = rule; } @Override diff --git a/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEParameterDeclConsumer.java b/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEParameterDeclConsumer.java index d506a66..09bc4c7 100644 --- a/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEParameterDeclConsumer.java +++ b/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEParameterDeclConsumer.java @@ -23,6 +23,8 @@ import org.eclipse.xtext.builtin.parser.packrat.consumers.XtextBuiltinIDConsumer @SuppressWarnings("unused") public final class EcoreDslEParameterDeclConsumer extends NonTerminalConsumer { + private EParameterDeclElements rule; + private INonTerminalConsumer eAnnotationDeclConsumer; private INonTerminalConsumer eGenericTypeReferenceDeclConsumer; private ITerminalConsumer idConsumer; @@ -89,49 +91,36 @@ public final class EcoreDslEParameterDeclConsumer extends NonTerminalConsumer { } protected int doConsumeAssignment$3(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(eAnnotationDeclConsumer, "eAnnotations", true, false, false, getRule().ele000ParserRuleCallEAnnotationDecl()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$4(entryPoint); + } + + protected int consumeRuleCall$4(int entryPoint) throws Exception { + return consumeNonTerminal(eAnnotationDeclConsumer, "eAnnotations", true, false, false, getRule().ele000ParserRuleCallEAnnotationDecl()); } protected int consumeAssignment$5(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(eGenericTypeReferenceDeclConsumer, "eGenericType", false, false, false, getRule().ele010ParserRuleCallEGenericTypeReferenceDecl()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$6(entryPoint); + } + + protected int consumeRuleCall$6(int entryPoint) throws Exception { + return consumeNonTerminal(eGenericTypeReferenceDeclConsumer, "eGenericType", false, false, false, getRule().ele010ParserRuleCallEGenericTypeReferenceDecl()); } protected int consumeAssignment$7(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeTerminal(idConsumer, "name", false, false, getRule().ele10LexerRuleCallID(), getRuleCall$8$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$8(entryPoint); + } + + protected int consumeRuleCall$8(int entryPoint) throws Exception { + return consumeTerminal(idConsumer, "name", false, false, getRule().ele10LexerRuleCallID(), getRuleCall$8$Delimiter()); } public EParameterDeclElements getRule() { - return EcoreDslGrammarAccess.INSTANCE.prEParameterDecl(); + // EcoreDslGrammarAccess.INSTANCE.prEParameterDecl() + return rule; + } + + public void setRule(EParameterDeclElements rule) { + this.rule = rule; } @Override diff --git a/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEReferenceDeclConsumer.java b/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEReferenceDeclConsumer.java index 2effc2c..a24d91b 100644 --- a/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEReferenceDeclConsumer.java +++ b/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEReferenceDeclConsumer.java @@ -25,6 +25,8 @@ import org.eclipse.xtext.example.parser.packrat.consumers.EcoreDslSINTConsumer; @SuppressWarnings("unused") public final class EcoreDslEReferenceDeclConsumer extends NonTerminalConsumer { + private EReferenceDeclElements rule; + private INonTerminalConsumer eAnnotationDeclConsumer; private INonTerminalConsumer eGenericTypeReferenceDeclConsumer; private ITerminalConsumer idConsumer; @@ -189,17 +191,11 @@ public final class EcoreDslEReferenceDeclConsumer extends NonTerminalConsumer { } protected int doConsumeAssignment$8(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(eAnnotationDeclConsumer, "eAnnotations", true, false, false, getRule().ele00000000ParserRuleCallEAnnotationDecl()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$9(entryPoint); + } + + protected int consumeRuleCall$9(int entryPoint) throws Exception { + return consumeNonTerminal(eAnnotationDeclConsumer, "eAnnotations", true, false, false, getRule().ele00000000ParserRuleCallEAnnotationDecl()); } protected int consumeAlternatives$10(int entryPoint) throws Exception { @@ -261,115 +257,67 @@ public final class EcoreDslEReferenceDeclConsumer extends NonTerminalConsumer { } protected int consumeAssignment$17(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeKeyword(getRule().ele000000100000000KeywordLocal(), "resolveProxies", false, true, getKeyword$18$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeKeyword$18(entryPoint); + } + + protected int consumeKeyword$18(int entryPoint) throws Exception { + return consumeKeyword(getRule().ele000000100000000KeywordLocal(), "resolveProxies", false, true, getKeyword$18$Delimiter()); } protected int consumeAssignment$19(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeKeyword(getRule().ele000000100000010KeywordBag(), "unique", false, true, getKeyword$20$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeKeyword$20(entryPoint); + } + + protected int consumeKeyword$20(int entryPoint) throws Exception { + return consumeKeyword(getRule().ele000000100000010KeywordBag(), "unique", false, true, getKeyword$20$Delimiter()); } protected int consumeAssignment$21(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeKeyword(getRule().ele00000010000010KeywordRandom(), "ordered", false, true, getKeyword$22$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeKeyword$22(entryPoint); + } + + protected int consumeKeyword$22(int entryPoint) throws Exception { + return consumeKeyword(getRule().ele00000010000010KeywordRandom(), "ordered", false, true, getKeyword$22$Delimiter()); } protected int consumeAssignment$23(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeKeyword(getRule().ele0000001000010KeywordReadonly(), "changeable", false, true, getKeyword$24$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeKeyword$24(entryPoint); + } + + protected int consumeKeyword$24(int entryPoint) throws Exception { + return consumeKeyword(getRule().ele0000001000010KeywordReadonly(), "changeable", false, true, getKeyword$24$Delimiter()); } protected int consumeAssignment$25(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeKeyword(getRule().ele000000100010KeywordVolatile(), "volatile", false, true, getKeyword$26$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeKeyword$26(entryPoint); + } + + protected int consumeKeyword$26(int entryPoint) throws Exception { + return consumeKeyword(getRule().ele000000100010KeywordVolatile(), "volatile", false, true, getKeyword$26$Delimiter()); } protected int consumeAssignment$27(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeKeyword(getRule().ele00000010010KeywordTransient(), "transient", false, true, getKeyword$28$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeKeyword$28(entryPoint); + } + + protected int consumeKeyword$28(int entryPoint) throws Exception { + return consumeKeyword(getRule().ele00000010010KeywordTransient(), "transient", false, true, getKeyword$28$Delimiter()); } protected int consumeAssignment$29(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeKeyword(getRule().ele0000001010KeywordUnsettable(), "unsettable", false, true, getKeyword$30$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeKeyword$30(entryPoint); + } + + protected int consumeKeyword$30(int entryPoint) throws Exception { + return consumeKeyword(getRule().ele0000001010KeywordUnsettable(), "unsettable", false, true, getKeyword$30$Delimiter()); } protected int consumeAssignment$31(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeKeyword(getRule().ele000000110KeywordDerived(), "derived", false, true, getKeyword$32$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeKeyword$32(entryPoint); + } + + protected int consumeKeyword$32(int entryPoint) throws Exception { + return consumeKeyword(getRule().ele000000110KeywordDerived(), "derived", false, true, getKeyword$32$Delimiter()); } protected int consumeAlternatives$33(int entryPoint) throws Exception { @@ -392,17 +340,11 @@ public final class EcoreDslEReferenceDeclConsumer extends NonTerminalConsumer { } protected int consumeAssignment$34(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeKeyword(getRule().ele00000100KeywordVal(), "containment", false, true, getKeyword$35$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeKeyword$35(entryPoint); + } + + protected int consumeKeyword$35(int entryPoint) throws Exception { + return consumeKeyword(getRule().ele00000100KeywordVal(), "containment", false, true, getKeyword$35$Delimiter()); } protected int consumeKeyword$36(int entryPoint) throws Exception { @@ -410,17 +352,11 @@ public final class EcoreDslEReferenceDeclConsumer extends NonTerminalConsumer { } protected int consumeAssignment$37(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(eGenericTypeReferenceDeclConsumer, "eGenericType", false, false, false, getRule().ele000010ParserRuleCallEGenericTypeReferenceDecl()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$38(entryPoint); + } + + protected int consumeRuleCall$38(int entryPoint) throws Exception { + return consumeNonTerminal(eGenericTypeReferenceDeclConsumer, "eGenericType", false, false, false, getRule().ele000010ParserRuleCallEGenericTypeReferenceDecl()); } protected int consumeGroup$39(int entryPoint) throws Exception { @@ -487,17 +423,11 @@ public final class EcoreDslEReferenceDeclConsumer extends NonTerminalConsumer { } protected int consumeAssignment$43(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeTerminal(intConsumer, "lowerBound", false, false, getRule().ele00010010LexerRuleCallINT(), getRuleCall$44$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$44(entryPoint); + } + + protected int consumeRuleCall$44(int entryPoint) throws Exception { + return consumeTerminal(intConsumer, "lowerBound", false, false, getRule().ele00010010LexerRuleCallINT(), getRuleCall$44$Delimiter()); } protected int consumeGroup$45(int entryPoint) throws Exception { @@ -546,17 +476,11 @@ public final class EcoreDslEReferenceDeclConsumer extends NonTerminalConsumer { } protected int consumeAssignment$47(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(sintConsumer, "upperBound", false, true, false, getRule().ele00010110ParserRuleCallSINT()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$48(entryPoint); + } + + protected int consumeRuleCall$48(int entryPoint) throws Exception { + return consumeNonTerminal(sintConsumer, "upperBound", false, true, false, getRule().ele00010110ParserRuleCallSINT()); } protected int consumeKeyword$49(int entryPoint) throws Exception { @@ -609,31 +533,19 @@ public final class EcoreDslEReferenceDeclConsumer extends NonTerminalConsumer { } protected int consumeAssignment$52(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeTerminal(idConsumer, "eOpposite", false, false, getRule().ele00110CrossReferenceEStringEReference(), getCrossReference$53$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeCrossReference$53(entryPoint); + } + + protected int consumeCrossReference$53(int entryPoint) throws Exception { + return consumeTerminal(idConsumer, "eOpposite", false, false, getRule().ele00110CrossReferenceEStringEReference(), getCrossReference$53$Delimiter()); } protected int consumeAssignment$55(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeTerminal(idConsumer, "name", false, false, getRule().ele010LexerRuleCallID(), getRuleCall$56$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$56(entryPoint); + } + + protected int consumeRuleCall$56(int entryPoint) throws Exception { + return consumeTerminal(idConsumer, "name", false, false, getRule().ele010LexerRuleCallID(), getRuleCall$56$Delimiter()); } protected int consumeKeyword$57(int entryPoint) throws Exception { @@ -641,7 +553,12 @@ public final class EcoreDslEReferenceDeclConsumer extends NonTerminalConsumer { } public EReferenceDeclElements getRule() { - return EcoreDslGrammarAccess.INSTANCE.prEReferenceDecl(); + // EcoreDslGrammarAccess.INSTANCE.prEReferenceDecl() + return rule; + } + + public void setRule(EReferenceDeclElements rule) { + this.rule = rule; } @Override diff --git a/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEStructuralFeatureDeclConsumer.java b/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEStructuralFeatureDeclConsumer.java index db07881..2ca6f99 100644 --- a/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEStructuralFeatureDeclConsumer.java +++ b/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEStructuralFeatureDeclConsumer.java @@ -22,6 +22,8 @@ import org.eclipse.xtext.example.parser.packrat.consumers.EcoreDslEReferenceDecl @SuppressWarnings("unused") public final class EcoreDslEStructuralFeatureDeclConsumer extends NonTerminalConsumer { + private EStructuralFeatureDeclElements rule; + private INonTerminalConsumer eAttributeDeclConsumer; private INonTerminalConsumer eReferenceDeclConsumer; @@ -62,7 +64,12 @@ public final class EcoreDslEStructuralFeatureDeclConsumer extends NonTerminalCon } public EStructuralFeatureDeclElements getRule() { - return EcoreDslGrammarAccess.INSTANCE.prEStructuralFeatureDecl(); + // EcoreDslGrammarAccess.INSTANCE.prEStructuralFeatureDecl() + return rule; + } + + public void setRule(EStructuralFeatureDeclElements rule) { + this.rule = rule; } @Override diff --git a/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslETypeParameterDeclConsumer.java b/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslETypeParameterDeclConsumer.java index fe29830..3c533b8 100644 --- a/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslETypeParameterDeclConsumer.java +++ b/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslETypeParameterDeclConsumer.java @@ -22,6 +22,8 @@ import org.eclipse.xtext.builtin.parser.packrat.consumers.XtextBuiltinIDConsumer @SuppressWarnings("unused") public final class EcoreDslETypeParameterDeclConsumer extends NonTerminalConsumer { + private ETypeParameterDeclElements rule; + private INonTerminalConsumer eGenericTypeDeclConsumer; private ITerminalConsumer idConsumer; @@ -72,17 +74,11 @@ public final class EcoreDslETypeParameterDeclConsumer extends NonTerminalConsume } protected int consumeAssignment$2(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeTerminal(idConsumer, "name", false, false, getRule().ele00LexerRuleCallID(), getRuleCall$3$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$3(entryPoint); + } + + protected int consumeRuleCall$3(int entryPoint) throws Exception { + return consumeTerminal(idConsumer, "name", false, false, getRule().ele00LexerRuleCallID(), getRuleCall$3$Delimiter()); } protected int consumeGroup$4(int entryPoint) throws Exception { @@ -131,21 +127,20 @@ public final class EcoreDslETypeParameterDeclConsumer extends NonTerminalConsume } protected int consumeAssignment$6(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(eGenericTypeDeclConsumer, "eBounds", true, false, false, getRule().ele110ParserRuleCallEGenericTypeDecl()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$7(entryPoint); + } + + protected int consumeRuleCall$7(int entryPoint) throws Exception { + return consumeNonTerminal(eGenericTypeDeclConsumer, "eBounds", true, false, false, getRule().ele110ParserRuleCallEGenericTypeDecl()); } public ETypeParameterDeclElements getRule() { - return EcoreDslGrammarAccess.INSTANCE.prETypeParameterDecl(); + // EcoreDslGrammarAccess.INSTANCE.prETypeParameterDecl() + return rule; + } + + public void setRule(ETypeParameterDeclElements rule) { + this.rule = rule; } @Override diff --git a/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEcoreDslConsumer.java b/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEcoreDslConsumer.java index ed02e54..f03c9df 100644 --- a/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEcoreDslConsumer.java +++ b/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslEcoreDslConsumer.java @@ -22,6 +22,8 @@ import org.eclipse.xtext.example.parser.packrat.consumers.EcoreDslImportStatemen @SuppressWarnings("unused") public final class EcoreDslEcoreDslConsumer extends NonTerminalConsumer { + private EcoreDslElements rule; + private INonTerminalConsumer ePackageDeclConsumer; private INonTerminalConsumer importStatementDeclConsumer; @@ -75,35 +77,28 @@ public final class EcoreDslEcoreDslConsumer extends NonTerminalConsumer { } protected int doConsumeAssignment$2(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(importStatementDeclConsumer, "imports", true, false, false, getRule().ele00ParserRuleCallImportStatementDecl()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$3(entryPoint); + } + + protected int consumeRuleCall$3(int entryPoint) throws Exception { + return consumeNonTerminal(importStatementDeclConsumer, "imports", true, false, false, getRule().ele00ParserRuleCallImportStatementDecl()); } protected int consumeAssignment$4(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(ePackageDeclConsumer, "package", false, false, false, getRule().ele10ParserRuleCallEPackageDecl()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$5(entryPoint); + } + + protected int consumeRuleCall$5(int entryPoint) throws Exception { + return consumeNonTerminal(ePackageDeclConsumer, "package", false, false, false, getRule().ele10ParserRuleCallEPackageDecl()); } public EcoreDslElements getRule() { - return EcoreDslGrammarAccess.INSTANCE.prEcoreDsl(); + // EcoreDslGrammarAccess.INSTANCE.prEcoreDsl() + return rule; + } + + public void setRule(EcoreDslElements rule) { + this.rule = rule; } @Override diff --git a/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslImportStatementDeclConsumer.java b/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslImportStatementDeclConsumer.java index 475e9de..667fe80 100644 --- a/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslImportStatementDeclConsumer.java +++ b/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslImportStatementDeclConsumer.java @@ -22,6 +22,8 @@ import org.eclipse.xtext.builtin.parser.packrat.consumers.XtextBuiltinSTRINGCons @SuppressWarnings("unused") public final class EcoreDslImportStatementDeclConsumer extends NonTerminalConsumer { + private ImportStatementDeclElements rule; + private ITerminalConsumer idConsumer; private ITerminalConsumer stringConsumer; @@ -144,17 +146,11 @@ public final class EcoreDslImportStatementDeclConsumer extends NonTerminalConsum } protected int consumeAssignment$6(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeTerminal(idConsumer, "alias", false, false, getRule().ele00100LexerRuleCallID(), getRuleCall$7$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$7(entryPoint); + } + + protected int consumeRuleCall$7(int entryPoint) throws Exception { + return consumeTerminal(idConsumer, "alias", false, false, getRule().ele00100LexerRuleCallID(), getRuleCall$7$Delimiter()); } protected int consumeKeyword$8(int entryPoint) throws Exception { @@ -162,17 +158,11 @@ public final class EcoreDslImportStatementDeclConsumer extends NonTerminalConsum } protected int consumeAssignment$9(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeTerminal(stringConsumer, "importURI", false, false, getRule().ele010LexerRuleCallSTRING(), getRuleCall$10$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$10(entryPoint); + } + + protected int consumeRuleCall$10(int entryPoint) throws Exception { + return consumeTerminal(stringConsumer, "importURI", false, false, getRule().ele010LexerRuleCallSTRING(), getRuleCall$10$Delimiter()); } protected int consumeKeyword$11(int entryPoint) throws Exception { @@ -180,7 +170,12 @@ public final class EcoreDslImportStatementDeclConsumer extends NonTerminalConsum } public ImportStatementDeclElements getRule() { - return EcoreDslGrammarAccess.INSTANCE.prImportStatementDecl(); + // EcoreDslGrammarAccess.INSTANCE.prImportStatementDecl() + return rule; + } + + public void setRule(ImportStatementDeclElements rule) { + this.rule = rule; } @Override diff --git a/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslMapEntryConsumer.java b/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslMapEntryConsumer.java index a2b6075..114e177 100644 --- a/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslMapEntryConsumer.java +++ b/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslMapEntryConsumer.java @@ -22,6 +22,8 @@ import org.eclipse.xtext.builtin.parser.packrat.consumers.XtextBuiltinSTRINGCons @SuppressWarnings("unused") public final class EcoreDslMapEntryConsumer extends NonTerminalConsumer { + private MapEntryElements rule; + private ITerminalConsumer idConsumer; private ITerminalConsumer stringConsumer; @@ -84,17 +86,11 @@ public final class EcoreDslMapEntryConsumer extends NonTerminalConsumer { } protected int consumeAssignment$3(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeTerminal(idConsumer, "detailKey", false, false, getRule().ele000LexerRuleCallID(), getRuleCall$4$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$4(entryPoint); + } + + protected int consumeRuleCall$4(int entryPoint) throws Exception { + return consumeTerminal(idConsumer, "detailKey", false, false, getRule().ele000LexerRuleCallID(), getRuleCall$4$Delimiter()); } protected int consumeKeyword$5(int entryPoint) throws Exception { @@ -102,21 +98,20 @@ public final class EcoreDslMapEntryConsumer extends NonTerminalConsumer { } protected int consumeAssignment$6(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeTerminal(stringConsumer, "detailValue", false, false, getRule().ele10LexerRuleCallSTRING(), getRuleCall$7$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$7(entryPoint); + } + + protected int consumeRuleCall$7(int entryPoint) throws Exception { + return consumeTerminal(stringConsumer, "detailValue", false, false, getRule().ele10LexerRuleCallSTRING(), getRuleCall$7$Delimiter()); } public MapEntryElements getRule() { - return EcoreDslGrammarAccess.INSTANCE.prMapEntry(); + // EcoreDslGrammarAccess.INSTANCE.prMapEntry() + return rule; + } + + public void setRule(MapEntryElements rule) { + this.rule = rule; } @Override diff --git a/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslMapEntrySuperConsumer.java b/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslMapEntrySuperConsumer.java index 0418c39..85a04e1 100644 --- a/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslMapEntrySuperConsumer.java +++ b/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslMapEntrySuperConsumer.java @@ -21,6 +21,8 @@ import org.eclipse.xtext.example.parser.packrat.consumers.EcoreDslMapEntryConsum @SuppressWarnings("unused") public final class EcoreDslMapEntrySuperConsumer extends NonTerminalConsumer { + private MapEntrySuperElements rule; + private INonTerminalConsumer mapEntryConsumer; public EcoreDslMapEntrySuperConsumer(INonTerminalConsumerConfiguration configuration, ITerminalConsumer[] hiddenTokens) { @@ -37,7 +39,12 @@ public final class EcoreDslMapEntrySuperConsumer extends NonTerminalConsumer { } public MapEntrySuperElements getRule() { - return EcoreDslGrammarAccess.INSTANCE.prMapEntrySuper(); + // EcoreDslGrammarAccess.INSTANCE.prMapEntrySuper() + return rule; + } + + public void setRule(MapEntrySuperElements rule) { + this.rule = rule; } @Override diff --git a/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslMultiplicityExprConsumer.java b/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslMultiplicityExprConsumer.java index c61781c..9c3ff9a 100644 --- a/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslMultiplicityExprConsumer.java +++ b/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslMultiplicityExprConsumer.java @@ -20,6 +20,8 @@ import org.eclipse.xtext.example.services.EcoreDslGrammarAccess.MultiplicityExpr @SuppressWarnings("unused") public final class EcoreDslMultiplicityExprConsumer extends NonTerminalConsumer { + private MultiplicityExprElements rule; + private ICharacterClass keyword$3$Delimiter; @@ -76,7 +78,12 @@ public final class EcoreDslMultiplicityExprConsumer extends NonTerminalConsumer } public MultiplicityExprElements getRule() { - return EcoreDslGrammarAccess.INSTANCE.prMultiplicityExpr(); + // EcoreDslGrammarAccess.INSTANCE.prMultiplicityExpr() + return rule; + } + + public void setRule(MultiplicityExprElements rule) { + this.rule = rule; } @Override diff --git a/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslQIDConsumer.java b/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslQIDConsumer.java index 295dd3e..4714c36 100644 --- a/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslQIDConsumer.java +++ b/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslQIDConsumer.java @@ -21,6 +21,8 @@ import org.eclipse.xtext.builtin.parser.packrat.consumers.XtextBuiltinIDConsumer @SuppressWarnings("unused") public final class EcoreDslQIDConsumer extends NonTerminalConsumer { + private QIDElements rule; + private ITerminalConsumer idConsumer; private ICharacterClass keyword$5$Delimiter; @@ -151,7 +153,12 @@ public final class EcoreDslQIDConsumer extends NonTerminalConsumer { } public QIDElements getRule() { - return EcoreDslGrammarAccess.INSTANCE.prQID(); + // EcoreDslGrammarAccess.INSTANCE.prQID() + return rule; + } + + public void setRule(QIDElements rule) { + this.rule = rule; } @Override diff --git a/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslSINTConsumer.java b/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslSINTConsumer.java index 964fc3d..49585ec 100644 --- a/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslSINTConsumer.java +++ b/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslSINTConsumer.java @@ -21,6 +21,8 @@ import org.eclipse.xtext.builtin.parser.packrat.consumers.XtextBuiltinINTConsume @SuppressWarnings("unused") public final class EcoreDslSINTConsumer extends NonTerminalConsumer { + private SINTElements rule; + private ITerminalConsumer intConsumer; private ICharacterClass keyword$2$Delimiter; @@ -88,7 +90,12 @@ public final class EcoreDslSINTConsumer extends NonTerminalConsumer { } public SINTElements getRule() { - return EcoreDslGrammarAccess.INSTANCE.prSINT(); + // EcoreDslGrammarAccess.INSTANCE.prSINT() + return rule; + } + + public void setRule(SINTElements rule) { + this.rule = rule; } @Override diff --git a/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslSTRING_OR_QIDConsumer.java b/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslSTRING_OR_QIDConsumer.java index e3a2f66..cc3fde1 100644 --- a/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslSTRING_OR_QIDConsumer.java +++ b/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslSTRING_OR_QIDConsumer.java @@ -22,6 +22,8 @@ import org.eclipse.xtext.builtin.parser.packrat.consumers.XtextBuiltinSTRINGCons @SuppressWarnings("unused") public final class EcoreDslSTRING_OR_QIDConsumer extends NonTerminalConsumer { + private STRING_OR_QIDElements rule; + private INonTerminalConsumer qidConsumer; private ITerminalConsumer stringConsumer; @@ -65,7 +67,12 @@ public final class EcoreDslSTRING_OR_QIDConsumer extends NonTerminalConsumer { } public STRING_OR_QIDElements getRule() { - return EcoreDslGrammarAccess.INSTANCE.prSTRING_OR_QID(); + // EcoreDslGrammarAccess.INSTANCE.prSTRING_OR_QID() + return rule; + } + + public void setRule(STRING_OR_QIDElements rule) { + this.rule = rule; } @Override diff --git a/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslSubEPackageDeclConsumer.java b/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslSubEPackageDeclConsumer.java index 11b7a6e..fcc7950 100644 --- a/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslSubEPackageDeclConsumer.java +++ b/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/EcoreDslSubEPackageDeclConsumer.java @@ -24,6 +24,8 @@ import org.eclipse.xtext.example.parser.packrat.consumers.EcoreDslSubEPackageDec @SuppressWarnings("unused") public final class EcoreDslSubEPackageDeclConsumer extends NonTerminalConsumer { + private SubEPackageDeclElements rule; + private INonTerminalConsumer eAnnotationDeclConsumer; private INonTerminalConsumer eClassifierDeclConsumer; private ITerminalConsumer idConsumer; @@ -127,17 +129,11 @@ public final class EcoreDslSubEPackageDeclConsumer extends NonTerminalConsumer { } protected int doConsumeAssignment$6(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(eAnnotationDeclConsumer, "eAnnotations", true, false, false, getRule().ele000000ParserRuleCallEAnnotationDecl()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$7(entryPoint); + } + + protected int consumeRuleCall$7(int entryPoint) throws Exception { + return consumeNonTerminal(eAnnotationDeclConsumer, "eAnnotations", true, false, false, getRule().ele000000ParserRuleCallEAnnotationDecl()); } protected int consumeKeyword$8(int entryPoint) throws Exception { @@ -145,17 +141,11 @@ public final class EcoreDslSubEPackageDeclConsumer extends NonTerminalConsumer { } protected int consumeAssignment$9(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeTerminal(idConsumer, "name", false, false, getRule().ele00010LexerRuleCallID(), getRuleCall$10$Delimiter()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$10(entryPoint); + } + + protected int consumeRuleCall$10(int entryPoint) throws Exception { + return consumeTerminal(idConsumer, "name", false, false, getRule().ele00010LexerRuleCallID(), getRuleCall$10$Delimiter()); } protected int consumeKeyword$11(int entryPoint) throws Exception { @@ -191,31 +181,19 @@ public final class EcoreDslSubEPackageDeclConsumer extends NonTerminalConsumer { } protected int consumeAssignment$13(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(subEPackageDeclConsumer, "eSubpackages", true, false, false, getRule().ele0100ParserRuleCallSubEPackageDecl()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$14(entryPoint); + } + + protected int consumeRuleCall$14(int entryPoint) throws Exception { + return consumeNonTerminal(subEPackageDeclConsumer, "eSubpackages", true, false, false, getRule().ele0100ParserRuleCallSubEPackageDecl()); } protected int consumeAssignment$15(int entryPoint) throws Exception { - int result = ConsumeResult.EMPTY_MATCH; - int tempResult; - announceNextLevel(); - tempResult = consumeNonTerminal(eClassifierDeclConsumer, "eClassifiers", true, false, false, getRule().ele0110ParserRuleCallEClassifierDecl()); - if (tempResult == ConsumeResult.SUCCESS) { - announceLevelFinished(); - return tempResult; - } - result = tempResult >= result ? tempResult : result; - announceLevelFinished(); - return result; + return consumeRuleCall$16(entryPoint); + } + + protected int consumeRuleCall$16(int entryPoint) throws Exception { + return consumeNonTerminal(eClassifierDeclConsumer, "eClassifiers", true, false, false, getRule().ele0110ParserRuleCallEClassifierDecl()); } protected int consumeKeyword$17(int entryPoint) throws Exception { @@ -223,7 +201,12 @@ public final class EcoreDslSubEPackageDeclConsumer extends NonTerminalConsumer { } public SubEPackageDeclElements getRule() { - return EcoreDslGrammarAccess.INSTANCE.prSubEPackageDecl(); + // EcoreDslGrammarAccess.INSTANCE.prSubEPackageDecl() + return rule; + } + + public void setRule(SubEPackageDeclElements rule) { + this.rule = rule; } @Override diff --git a/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parsetree/reconstr/EcoreDslParseTreeConstructor.java b/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parsetree/reconstr/EcoreDslParseTreeConstructor.java index e8972fe..2b7086e 100644 --- a/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parsetree/reconstr/EcoreDslParseTreeConstructor.java +++ b/examples/org.eclipse.xtext.example.ecoredsl/src-gen/org/eclipse/xtext/example/parsetree/reconstr/EcoreDslParseTreeConstructor.java @@ -9,12 +9,15 @@ import org.eclipse.xtext.*; import org.eclipse.xtext.parsetree.reconstr.*; import org.eclipse.xtext.parsetree.reconstr.impl.*; import org.eclipse.xtext.parsetree.reconstr.impl.AbstractParseTreeConstructor.AbstractToken.Solution; -import org.eclipse.xtext.builtin.XtextBuiltinGrammarAccess; import org.eclipse.xtext.example.services.EcoreDslGrammarAccess; +import com.google.inject.Inject; public class EcoreDslParseTreeConstructor extends AbstractParseTreeConstructor { + @Inject + private EcoreDslGrammarAccess grammarAccess; + protected Solution internalSerialize(EObject obj) { IInstanceDescription inst = getDescr(obj); Solution s; @@ -58,7 +61,7 @@ protected class EcoreDsl_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEcoreDsl().eleGroup(); + return grammarAccess.prEcoreDsl().eleGroup(); } @Override @@ -87,7 +90,7 @@ protected class EcoreDsl_0_Assignment_imports extends AssignmentToken { } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEcoreDsl().ele0AssignmentImports(); + return grammarAccess.prEcoreDsl().ele0AssignmentImports(); } @Override @@ -119,7 +122,7 @@ protected class EcoreDsl_1_Assignment_package extends AssignmentToken { } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEcoreDsl().ele1AssignmentPackage(); + return grammarAccess.prEcoreDsl().ele1AssignmentPackage(); } @Override @@ -162,7 +165,7 @@ protected class ImportStatementDecl_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prImportStatementDecl().eleGroup(); + return grammarAccess.prImportStatementDecl().eleGroup(); } @Override @@ -191,7 +194,7 @@ protected class ImportStatementDecl_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prImportStatementDecl().ele0Group(); + return grammarAccess.prImportStatementDecl().ele0Group(); } @Override @@ -220,7 +223,7 @@ protected class ImportStatementDecl_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prImportStatementDecl().ele00Group(); + return grammarAccess.prImportStatementDecl().ele00Group(); } @Override @@ -249,7 +252,7 @@ protected class ImportStatementDecl_0_0_0_Keyword_import extends KeywordToken { } public Keyword getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prImportStatementDecl().ele000KeywordImport(); + return grammarAccess.prImportStatementDecl().ele000KeywordImport(); } } @@ -261,7 +264,7 @@ protected class ImportStatementDecl_0_0_1_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prImportStatementDecl().ele001Group(); + return grammarAccess.prImportStatementDecl().ele001Group(); } @Override @@ -290,7 +293,7 @@ protected class ImportStatementDecl_0_0_1_0_Assignment_alias extends AssignmentT } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prImportStatementDecl().ele0010AssignmentAlias(); + return grammarAccess.prImportStatementDecl().ele0010AssignmentAlias(); } @Override @@ -299,7 +302,7 @@ protected class ImportStatementDecl_0_0_1_0_Assignment_alias extends AssignmentT IInstanceDescription obj = current.cloneAndConsume("alias"); if(Boolean.TRUE.booleanValue()) { // xtext::RuleCall FIXME: check if value is valid for lexer rule type = AssignmentType.LRC; - element = EcoreDslGrammarAccess.INSTANCE.prImportStatementDecl().ele00100LexerRuleCallID(); + element = grammarAccess.prImportStatementDecl().ele00100LexerRuleCallID(); return new Solution(obj); } return null; @@ -314,7 +317,7 @@ protected class ImportStatementDecl_0_0_1_1_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prImportStatementDecl().ele0011KeywordEqualsSign(); + return grammarAccess.prImportStatementDecl().ele0011KeywordEqualsSign(); } } @@ -328,7 +331,7 @@ protected class ImportStatementDecl_0_1_Assignment_importURI extends AssignmentT } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prImportStatementDecl().ele01AssignmentImportURI(); + return grammarAccess.prImportStatementDecl().ele01AssignmentImportURI(); } @Override @@ -337,7 +340,7 @@ protected class ImportStatementDecl_0_1_Assignment_importURI extends AssignmentT IInstanceDescription obj = current.cloneAndConsume("importURI"); if(Boolean.TRUE.booleanValue()) { // xtext::RuleCall FIXME: check if value is valid for lexer rule type = AssignmentType.LRC; - element = EcoreDslGrammarAccess.INSTANCE.prImportStatementDecl().ele010LexerRuleCallSTRING(); + element = grammarAccess.prImportStatementDecl().ele010LexerRuleCallSTRING(); return new Solution(obj); } return null; @@ -353,7 +356,7 @@ protected class ImportStatementDecl_1_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prImportStatementDecl().ele1KeywordSemicolon(); + return grammarAccess.prImportStatementDecl().ele1KeywordSemicolon(); } } @@ -376,7 +379,7 @@ protected class EPackageDecl_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEPackageDecl().eleGroup(); + return grammarAccess.prEPackageDecl().eleGroup(); } @Override @@ -405,7 +408,7 @@ protected class EPackageDecl_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEPackageDecl().ele0Group(); + return grammarAccess.prEPackageDecl().ele0Group(); } @Override @@ -434,7 +437,7 @@ protected class EPackageDecl_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEPackageDecl().ele00Group(); + return grammarAccess.prEPackageDecl().ele00Group(); } @Override @@ -463,7 +466,7 @@ protected class EPackageDecl_0_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEPackageDecl().ele000Group(); + return grammarAccess.prEPackageDecl().ele000Group(); } @Override @@ -492,7 +495,7 @@ protected class EPackageDecl_0_0_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEPackageDecl().ele0000Group(); + return grammarAccess.prEPackageDecl().ele0000Group(); } @Override @@ -521,7 +524,7 @@ protected class EPackageDecl_0_0_0_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEPackageDecl().ele00000Group(); + return grammarAccess.prEPackageDecl().ele00000Group(); } @Override @@ -550,7 +553,7 @@ protected class EPackageDecl_0_0_0_0_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEPackageDecl().ele000000Group(); + return grammarAccess.prEPackageDecl().ele000000Group(); } @Override @@ -579,7 +582,7 @@ protected class EPackageDecl_0_0_0_0_0_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEPackageDecl().ele0000000Group(); + return grammarAccess.prEPackageDecl().ele0000000Group(); } @Override @@ -608,7 +611,7 @@ protected class EPackageDecl_0_0_0_0_0_0_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEPackageDecl().ele00000000Group(); + return grammarAccess.prEPackageDecl().ele00000000Group(); } @Override @@ -637,7 +640,7 @@ protected class EPackageDecl_0_0_0_0_0_0_0_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEPackageDecl().ele000000000Group(); + return grammarAccess.prEPackageDecl().ele000000000Group(); } @Override @@ -666,7 +669,7 @@ protected class EPackageDecl_0_0_0_0_0_0_0_0_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEPackageDecl().ele0000000000Group(); + return grammarAccess.prEPackageDecl().ele0000000000Group(); } @Override @@ -695,7 +698,7 @@ protected class EPackageDecl_0_0_0_0_0_0_0_0_0_0_0_Assignment_eAnnotations exten } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEPackageDecl().ele00000000000AssignmentEAnnotations(); + return grammarAccess.prEPackageDecl().ele00000000000AssignmentEAnnotations(); } @Override @@ -727,7 +730,7 @@ protected class EPackageDecl_0_0_0_0_0_0_0_0_0_0_1_Keyword_package extends Keywo } public Keyword getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEPackageDecl().ele00000000001KeywordPackage(); + return grammarAccess.prEPackageDecl().ele00000000001KeywordPackage(); } } @@ -740,7 +743,7 @@ protected class EPackageDecl_0_0_0_0_0_0_0_0_0_1_Assignment_name extends Assignm } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEPackageDecl().ele0000000001AssignmentName(); + return grammarAccess.prEPackageDecl().ele0000000001AssignmentName(); } @Override @@ -750,7 +753,7 @@ protected class EPackageDecl_0_0_0_0_0_0_0_0_0_1_Assignment_name extends Assignm if(Boolean.TRUE.booleanValue()) { // xtext::RuleCall FIXME: check if value is valid for datatype rule type = AssignmentType.PRC; - element = EcoreDslGrammarAccess.INSTANCE.prEPackageDecl().ele00000000010ParserRuleCallQID(); + element = grammarAccess.prEPackageDecl().ele00000000010ParserRuleCallQID(); return new Solution(obj); } @@ -767,7 +770,7 @@ protected class EPackageDecl_0_0_0_0_0_0_0_0_1_Keyword_nsURI extends KeywordToke } public Keyword getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEPackageDecl().ele000000001KeywordNsURI(); + return grammarAccess.prEPackageDecl().ele000000001KeywordNsURI(); } } @@ -780,7 +783,7 @@ protected class EPackageDecl_0_0_0_0_0_0_0_1_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEPackageDecl().ele00000001KeywordEqualsSign(); + return grammarAccess.prEPackageDecl().ele00000001KeywordEqualsSign(); } } @@ -793,7 +796,7 @@ protected class EPackageDecl_0_0_0_0_0_0_1_Assignment_nsURI extends AssignmentTo } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEPackageDecl().ele0000001AssignmentNsURI(); + return grammarAccess.prEPackageDecl().ele0000001AssignmentNsURI(); } @Override @@ -802,7 +805,7 @@ protected class EPackageDecl_0_0_0_0_0_0_1_Assignment_nsURI extends AssignmentTo IInstanceDescription obj = current.cloneAndConsume("nsURI"); if(Boolean.TRUE.booleanValue()) { // xtext::RuleCall FIXME: check if value is valid for lexer rule type = AssignmentType.LRC; - element = EcoreDslGrammarAccess.INSTANCE.prEPackageDecl().ele00000010LexerRuleCallSTRING(); + element = grammarAccess.prEPackageDecl().ele00000010LexerRuleCallSTRING(); return new Solution(obj); } return null; @@ -818,7 +821,7 @@ protected class EPackageDecl_0_0_0_0_0_1_Keyword_nsPrefix extends KeywordToken } public Keyword getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEPackageDecl().ele000001KeywordNsPrefix(); + return grammarAccess.prEPackageDecl().ele000001KeywordNsPrefix(); } } @@ -831,7 +834,7 @@ protected class EPackageDecl_0_0_0_0_1_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEPackageDecl().ele00001KeywordEqualsSign(); + return grammarAccess.prEPackageDecl().ele00001KeywordEqualsSign(); } } @@ -844,7 +847,7 @@ protected class EPackageDecl_0_0_0_1_Assignment_nsPrefix extends AssignmentToken } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEPackageDecl().ele0001AssignmentNsPrefix(); + return grammarAccess.prEPackageDecl().ele0001AssignmentNsPrefix(); } @Override @@ -854,7 +857,7 @@ protected class EPackageDecl_0_0_0_1_Assignment_nsPrefix extends AssignmentToken if(Boolean.TRUE.booleanValue()) { // xtext::RuleCall FIXME: check if value is valid for datatype rule type = AssignmentType.PRC; - element = EcoreDslGrammarAccess.INSTANCE.prEPackageDecl().ele00010ParserRuleCallQID(); + element = grammarAccess.prEPackageDecl().ele00010ParserRuleCallQID(); return new Solution(obj); } @@ -871,7 +874,7 @@ protected class EPackageDecl_0_0_1_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEPackageDecl().ele001KeywordLeftCurlyBracket(); + return grammarAccess.prEPackageDecl().ele001KeywordLeftCurlyBracket(); } } @@ -884,7 +887,7 @@ protected class EPackageDecl_0_1_Alternatives extends AlternativesToken { } public Alternatives getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEPackageDecl().ele01Alternatives(); + return grammarAccess.prEPackageDecl().ele01Alternatives(); } @Override @@ -906,7 +909,7 @@ protected class EPackageDecl_0_1_0_Assignment_eSubpackages extends AssignmentTok } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEPackageDecl().ele010AssignmentESubpackages(); + return grammarAccess.prEPackageDecl().ele010AssignmentESubpackages(); } @Override @@ -938,7 +941,7 @@ protected class EPackageDecl_0_1_1_Assignment_eClassifiers extends AssignmentTok } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEPackageDecl().ele011AssignmentEClassifiers(); + return grammarAccess.prEPackageDecl().ele011AssignmentEClassifiers(); } @Override @@ -972,7 +975,7 @@ protected class EPackageDecl_1_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEPackageDecl().ele1KeywordRightCurlyBracket(); + return grammarAccess.prEPackageDecl().ele1KeywordRightCurlyBracket(); } } @@ -995,7 +998,7 @@ protected class SubEPackageDecl_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prSubEPackageDecl().eleGroup(); + return grammarAccess.prSubEPackageDecl().eleGroup(); } @Override @@ -1024,7 +1027,7 @@ protected class SubEPackageDecl_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prSubEPackageDecl().ele0Group(); + return grammarAccess.prSubEPackageDecl().ele0Group(); } @Override @@ -1053,7 +1056,7 @@ protected class SubEPackageDecl_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prSubEPackageDecl().ele00Group(); + return grammarAccess.prSubEPackageDecl().ele00Group(); } @Override @@ -1082,7 +1085,7 @@ protected class SubEPackageDecl_0_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prSubEPackageDecl().ele000Group(); + return grammarAccess.prSubEPackageDecl().ele000Group(); } @Override @@ -1111,7 +1114,7 @@ protected class SubEPackageDecl_0_0_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prSubEPackageDecl().ele0000Group(); + return grammarAccess.prSubEPackageDecl().ele0000Group(); } @Override @@ -1140,7 +1143,7 @@ protected class SubEPackageDecl_0_0_0_0_0_Assignment_eAnnotations extends Assign } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prSubEPackageDecl().ele00000AssignmentEAnnotations(); + return grammarAccess.prSubEPackageDecl().ele00000AssignmentEAnnotations(); } @Override @@ -1172,7 +1175,7 @@ protected class SubEPackageDecl_0_0_0_0_1_Keyword_package extends KeywordToken } public Keyword getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prSubEPackageDecl().ele00001KeywordPackage(); + return grammarAccess.prSubEPackageDecl().ele00001KeywordPackage(); } } @@ -1185,7 +1188,7 @@ protected class SubEPackageDecl_0_0_0_1_Assignment_name extends AssignmentToken } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prSubEPackageDecl().ele0001AssignmentName(); + return grammarAccess.prSubEPackageDecl().ele0001AssignmentName(); } @Override @@ -1194,7 +1197,7 @@ protected class SubEPackageDecl_0_0_0_1_Assignment_name extends AssignmentToken IInstanceDescription obj = current.cloneAndConsume("name"); if(Boolean.TRUE.booleanValue()) { // xtext::RuleCall FIXME: check if value is valid for lexer rule type = AssignmentType.LRC; - element = EcoreDslGrammarAccess.INSTANCE.prSubEPackageDecl().ele00010LexerRuleCallID(); + element = grammarAccess.prSubEPackageDecl().ele00010LexerRuleCallID(); return new Solution(obj); } return null; @@ -1210,7 +1213,7 @@ protected class SubEPackageDecl_0_0_1_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prSubEPackageDecl().ele001KeywordLeftCurlyBracket(); + return grammarAccess.prSubEPackageDecl().ele001KeywordLeftCurlyBracket(); } } @@ -1223,7 +1226,7 @@ protected class SubEPackageDecl_0_1_Alternatives extends AlternativesToken { } public Alternatives getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prSubEPackageDecl().ele01Alternatives(); + return grammarAccess.prSubEPackageDecl().ele01Alternatives(); } @Override @@ -1245,7 +1248,7 @@ protected class SubEPackageDecl_0_1_0_Assignment_eSubpackages extends Assignment } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prSubEPackageDecl().ele010AssignmentESubpackages(); + return grammarAccess.prSubEPackageDecl().ele010AssignmentESubpackages(); } @Override @@ -1277,7 +1280,7 @@ protected class SubEPackageDecl_0_1_1_Assignment_eClassifiers extends Assignment } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prSubEPackageDecl().ele011AssignmentEClassifiers(); + return grammarAccess.prSubEPackageDecl().ele011AssignmentEClassifiers(); } @Override @@ -1311,7 +1314,7 @@ protected class SubEPackageDecl_1_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prSubEPackageDecl().ele1KeywordRightCurlyBracket(); + return grammarAccess.prSubEPackageDecl().ele1KeywordRightCurlyBracket(); } } @@ -1334,7 +1337,7 @@ protected class EClassifierDecl_Alternatives extends AlternativesToken { } public Alternatives getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEClassifierDecl().eleAlternatives(); + return grammarAccess.prEClassifierDecl().eleAlternatives(); } @Override @@ -1356,7 +1359,7 @@ protected class EClassifierDecl_0_RuleCall_EClassDecl extends RuleCallToken { } public RuleCall getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEClassifierDecl().ele0ParserRuleCallEClassDecl(); + return grammarAccess.prEClassifierDecl().ele0ParserRuleCallEClassDecl(); } @Override @@ -1375,7 +1378,7 @@ protected class EClassifierDecl_1_RuleCall_EDataTypeDecl extends RuleCallToken { } public RuleCall getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEClassifierDecl().ele1ParserRuleCallEDataTypeDecl(); + return grammarAccess.prEClassifierDecl().ele1ParserRuleCallEDataTypeDecl(); } @Override @@ -1405,7 +1408,7 @@ protected class EDataTypeDecl_Alternatives extends AlternativesToken { } public Alternatives getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEDataTypeDecl().eleAlternatives(); + return grammarAccess.prEDataTypeDecl().eleAlternatives(); } @Override @@ -1427,7 +1430,7 @@ protected class EDataTypeDecl_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEDataTypeDecl().ele0Group(); + return grammarAccess.prEDataTypeDecl().ele0Group(); } @Override @@ -1456,7 +1459,7 @@ protected class EDataTypeDecl_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEDataTypeDecl().ele00Group(); + return grammarAccess.prEDataTypeDecl().ele00Group(); } @Override @@ -1485,7 +1488,7 @@ protected class EDataTypeDecl_0_0_0_Assignment_eAnnotations extends AssignmentTo } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEDataTypeDecl().ele000AssignmentEAnnotations(); + return grammarAccess.prEDataTypeDecl().ele000AssignmentEAnnotations(); } @Override @@ -1517,7 +1520,7 @@ protected class EDataTypeDecl_0_0_1_Assignment_serializable extends AssignmentTo } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEDataTypeDecl().ele001AssignmentSerializable(); + return grammarAccess.prEDataTypeDecl().ele001AssignmentSerializable(); } @Override @@ -1527,7 +1530,7 @@ protected class EDataTypeDecl_0_0_1_Assignment_serializable extends AssignmentTo if(Boolean.TRUE.equals(value)) { // xtext::Keyword type = AssignmentType.KW; - element = EcoreDslGrammarAccess.INSTANCE.prEDataTypeDecl().ele0010KeywordSerializable(); + element = grammarAccess.prEDataTypeDecl().ele0010KeywordSerializable(); return new Solution(obj); } @@ -1544,7 +1547,7 @@ protected class EDataTypeDecl_0_1_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEDataTypeDecl().ele01Group(); + return grammarAccess.prEDataTypeDecl().ele01Group(); } @Override @@ -1573,7 +1576,7 @@ protected class EDataTypeDecl_0_1_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEDataTypeDecl().ele010Group(); + return grammarAccess.prEDataTypeDecl().ele010Group(); } @Override @@ -1602,7 +1605,7 @@ protected class EDataTypeDecl_0_1_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEDataTypeDecl().ele0100Group(); + return grammarAccess.prEDataTypeDecl().ele0100Group(); } @Override @@ -1631,7 +1634,7 @@ protected class EDataTypeDecl_0_1_0_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEDataTypeDecl().ele01000Group(); + return grammarAccess.prEDataTypeDecl().ele01000Group(); } @Override @@ -1660,7 +1663,7 @@ protected class EDataTypeDecl_0_1_0_0_0_0_Keyword_datatype extends KeywordToken } public Keyword getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEDataTypeDecl().ele010000KeywordDatatype(); + return grammarAccess.prEDataTypeDecl().ele010000KeywordDatatype(); } } @@ -1672,7 +1675,7 @@ protected class EDataTypeDecl_0_1_0_0_0_1_Assignment_name extends AssignmentToke } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEDataTypeDecl().ele010001AssignmentName(); + return grammarAccess.prEDataTypeDecl().ele010001AssignmentName(); } @Override @@ -1681,7 +1684,7 @@ protected class EDataTypeDecl_0_1_0_0_0_1_Assignment_name extends AssignmentToke IInstanceDescription obj = current.cloneAndConsume("name"); if(Boolean.TRUE.booleanValue()) { // xtext::RuleCall FIXME: check if value is valid for lexer rule type = AssignmentType.LRC; - element = EcoreDslGrammarAccess.INSTANCE.prEDataTypeDecl().ele0100010LexerRuleCallID(); + element = grammarAccess.prEDataTypeDecl().ele0100010LexerRuleCallID(); return new Solution(obj); } return null; @@ -1697,7 +1700,7 @@ protected class EDataTypeDecl_0_1_0_0_1_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEDataTypeDecl().ele01001KeywordColon(); + return grammarAccess.prEDataTypeDecl().ele01001KeywordColon(); } } @@ -1710,7 +1713,7 @@ protected class EDataTypeDecl_0_1_0_1_Assignment_instanceClassName extends Assig } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEDataTypeDecl().ele0101AssignmentInstanceClassName(); + return grammarAccess.prEDataTypeDecl().ele0101AssignmentInstanceClassName(); } @Override @@ -1720,7 +1723,7 @@ protected class EDataTypeDecl_0_1_0_1_Assignment_instanceClassName extends Assig if(Boolean.TRUE.booleanValue()) { // xtext::RuleCall FIXME: check if value is valid for datatype rule type = AssignmentType.PRC; - element = EcoreDslGrammarAccess.INSTANCE.prEDataTypeDecl().ele01010ParserRuleCallSTRING_OR_QID(); + element = grammarAccess.prEDataTypeDecl().ele01010ParserRuleCallSTRING_OR_QID(); return new Solution(obj); } @@ -1737,7 +1740,7 @@ protected class EDataTypeDecl_0_1_1_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEDataTypeDecl().ele011KeywordSemicolon(); + return grammarAccess.prEDataTypeDecl().ele011KeywordSemicolon(); } } @@ -1751,7 +1754,7 @@ protected class EDataTypeDecl_1_RuleCall_EEnumDecl extends RuleCallToken { } public RuleCall getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEDataTypeDecl().ele1ParserRuleCallEEnumDecl(); + return grammarAccess.prEDataTypeDecl().ele1ParserRuleCallEEnumDecl(); } @Override @@ -1781,7 +1784,7 @@ protected class EAnnotationDecl_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEAnnotationDecl().eleGroup(); + return grammarAccess.prEAnnotationDecl().eleGroup(); } @Override @@ -1810,7 +1813,7 @@ protected class EAnnotationDecl_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEAnnotationDecl().ele0Group(); + return grammarAccess.prEAnnotationDecl().ele0Group(); } @Override @@ -1839,7 +1842,7 @@ protected class EAnnotationDecl_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEAnnotationDecl().ele00Group(); + return grammarAccess.prEAnnotationDecl().ele00Group(); } @Override @@ -1868,7 +1871,7 @@ protected class EAnnotationDecl_0_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEAnnotationDecl().ele000Group(); + return grammarAccess.prEAnnotationDecl().ele000Group(); } @Override @@ -1897,7 +1900,7 @@ protected class EAnnotationDecl_0_0_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEAnnotationDecl().ele0000Group(); + return grammarAccess.prEAnnotationDecl().ele0000Group(); } @Override @@ -1926,7 +1929,7 @@ protected class EAnnotationDecl_0_0_0_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEAnnotationDecl().ele00000Group(); + return grammarAccess.prEAnnotationDecl().ele00000Group(); } @Override @@ -1955,7 +1958,7 @@ protected class EAnnotationDecl_0_0_0_0_0_0_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEAnnotationDecl().ele000000KeywordCommercialAt(); + return grammarAccess.prEAnnotationDecl().ele000000KeywordCommercialAt(); } } @@ -1967,7 +1970,7 @@ protected class EAnnotationDecl_0_0_0_0_0_1_Assignment_source extends Assignment } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEAnnotationDecl().ele000001AssignmentSource(); + return grammarAccess.prEAnnotationDecl().ele000001AssignmentSource(); } @Override @@ -1976,7 +1979,7 @@ protected class EAnnotationDecl_0_0_0_0_0_1_Assignment_source extends Assignment IInstanceDescription obj = current.cloneAndConsume("source"); if(Boolean.TRUE.booleanValue()) { // xtext::RuleCall FIXME: check if value is valid for lexer rule type = AssignmentType.LRC; - element = EcoreDslGrammarAccess.INSTANCE.prEAnnotationDecl().ele0000010LexerRuleCallSTRING(); + element = grammarAccess.prEAnnotationDecl().ele0000010LexerRuleCallSTRING(); return new Solution(obj); } return null; @@ -1992,7 +1995,7 @@ protected class EAnnotationDecl_0_0_0_0_1_Assignment_eModelElement extends Assig } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEAnnotationDecl().ele00001AssignmentEModelElement(); + return grammarAccess.prEAnnotationDecl().ele00001AssignmentEModelElement(); } @Override @@ -2003,7 +2006,7 @@ protected class EAnnotationDecl_0_0_0_0_1_Assignment_eModelElement extends Assig IInstanceDescription param = getDescr((EObject)value); if(param.isInstanceOf("EModelElement")) { type = AssignmentType.CR; - element = EcoreDslGrammarAccess.INSTANCE.prEAnnotationDecl().ele000010CrossReferenceEStringEModelElement(); + element = grammarAccess.prEAnnotationDecl().ele000010CrossReferenceEStringEModelElement(); return new Solution(obj); } } @@ -2020,7 +2023,7 @@ protected class EAnnotationDecl_0_0_0_1_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEAnnotationDecl().ele0001KeywordLeftParenthesis(); + return grammarAccess.prEAnnotationDecl().ele0001KeywordLeftParenthesis(); } } @@ -2033,7 +2036,7 @@ protected class EAnnotationDecl_0_0_1_Assignment_contents extends AssignmentToke } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEAnnotationDecl().ele001AssignmentContents(); + return grammarAccess.prEAnnotationDecl().ele001AssignmentContents(); } @Override @@ -2066,7 +2069,7 @@ protected class EAnnotationDecl_0_1_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEAnnotationDecl().ele01Group(); + return grammarAccess.prEAnnotationDecl().ele01Group(); } @Override @@ -2095,7 +2098,7 @@ protected class EAnnotationDecl_0_1_0_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEAnnotationDecl().ele010KeywordComma(); + return grammarAccess.prEAnnotationDecl().ele010KeywordComma(); } } @@ -2107,7 +2110,7 @@ protected class EAnnotationDecl_0_1_1_Assignment_contents extends AssignmentToke } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEAnnotationDecl().ele011AssignmentContents(); + return grammarAccess.prEAnnotationDecl().ele011AssignmentContents(); } @Override @@ -2141,7 +2144,7 @@ protected class EAnnotationDecl_1_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEAnnotationDecl().ele1KeywordRightParenthesis(); + return grammarAccess.prEAnnotationDecl().ele1KeywordRightParenthesis(); } } @@ -2164,7 +2167,7 @@ protected class EClassDecl_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEClassDecl().eleGroup(); + return grammarAccess.prEClassDecl().eleGroup(); } @Override @@ -2193,7 +2196,7 @@ protected class EClassDecl_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEClassDecl().ele0Group(); + return grammarAccess.prEClassDecl().ele0Group(); } @Override @@ -2222,7 +2225,7 @@ protected class EClassDecl_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEClassDecl().ele00Group(); + return grammarAccess.prEClassDecl().ele00Group(); } @Override @@ -2251,7 +2254,7 @@ protected class EClassDecl_0_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEClassDecl().ele000Group(); + return grammarAccess.prEClassDecl().ele000Group(); } @Override @@ -2280,7 +2283,7 @@ protected class EClassDecl_0_0_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEClassDecl().ele0000Group(); + return grammarAccess.prEClassDecl().ele0000Group(); } @Override @@ -2309,7 +2312,7 @@ protected class EClassDecl_0_0_0_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEClassDecl().ele00000Group(); + return grammarAccess.prEClassDecl().ele00000Group(); } @Override @@ -2338,7 +2341,7 @@ protected class EClassDecl_0_0_0_0_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEClassDecl().ele000000Group(); + return grammarAccess.prEClassDecl().ele000000Group(); } @Override @@ -2367,7 +2370,7 @@ protected class EClassDecl_0_0_0_0_0_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEClassDecl().ele0000000Group(); + return grammarAccess.prEClassDecl().ele0000000Group(); } @Override @@ -2396,7 +2399,7 @@ protected class EClassDecl_0_0_0_0_0_0_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEClassDecl().ele00000000Group(); + return grammarAccess.prEClassDecl().ele00000000Group(); } @Override @@ -2425,7 +2428,7 @@ protected class EClassDecl_0_0_0_0_0_0_0_0_0_Assignment_eAnnotations extends Ass } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEClassDecl().ele000000000AssignmentEAnnotations(); + return grammarAccess.prEClassDecl().ele000000000AssignmentEAnnotations(); } @Override @@ -2457,7 +2460,7 @@ protected class EClassDecl_0_0_0_0_0_0_0_0_1_Assignment_abstract extends Assignm } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEClassDecl().ele000000001AssignmentAbstract(); + return grammarAccess.prEClassDecl().ele000000001AssignmentAbstract(); } @Override @@ -2467,7 +2470,7 @@ protected class EClassDecl_0_0_0_0_0_0_0_0_1_Assignment_abstract extends Assignm if(Boolean.TRUE.equals(value)) { // xtext::Keyword type = AssignmentType.KW; - element = EcoreDslGrammarAccess.INSTANCE.prEClassDecl().ele0000000010KeywordAbstract(); + element = grammarAccess.prEClassDecl().ele0000000010KeywordAbstract(); return new Solution(obj); } @@ -2484,7 +2487,7 @@ protected class EClassDecl_0_0_0_0_0_0_0_1_Alternatives extends AlternativesToke } public Alternatives getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEClassDecl().ele00000001Alternatives(); + return grammarAccess.prEClassDecl().ele00000001Alternatives(); } @Override @@ -2506,7 +2509,7 @@ protected class EClassDecl_0_0_0_0_0_0_0_1_0_Assignment_interface extends Assign } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEClassDecl().ele000000010AssignmentInterface(); + return grammarAccess.prEClassDecl().ele000000010AssignmentInterface(); } @Override @@ -2516,7 +2519,7 @@ protected class EClassDecl_0_0_0_0_0_0_0_1_0_Assignment_interface extends Assign if(Boolean.TRUE.equals(value)) { // xtext::Keyword type = AssignmentType.KW; - element = EcoreDslGrammarAccess.INSTANCE.prEClassDecl().ele0000000100KeywordInterface(); + element = grammarAccess.prEClassDecl().ele0000000100KeywordInterface(); return new Solution(obj); } @@ -2532,7 +2535,7 @@ protected class EClassDecl_0_0_0_0_0_0_0_1_1_Keyword_class extends KeywordToken } public Keyword getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEClassDecl().ele000000011KeywordClass(); + return grammarAccess.prEClassDecl().ele000000011KeywordClass(); } } @@ -2546,7 +2549,7 @@ protected class EClassDecl_0_0_0_0_0_0_1_Assignment_name extends AssignmentToken } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEClassDecl().ele0000001AssignmentName(); + return grammarAccess.prEClassDecl().ele0000001AssignmentName(); } @Override @@ -2555,7 +2558,7 @@ protected class EClassDecl_0_0_0_0_0_0_1_Assignment_name extends AssignmentToken IInstanceDescription obj = current.cloneAndConsume("name"); if(Boolean.TRUE.booleanValue()) { // xtext::RuleCall FIXME: check if value is valid for lexer rule type = AssignmentType.LRC; - element = EcoreDslGrammarAccess.INSTANCE.prEClassDecl().ele00000010LexerRuleCallID(); + element = grammarAccess.prEClassDecl().ele00000010LexerRuleCallID(); return new Solution(obj); } return null; @@ -2571,7 +2574,7 @@ protected class EClassDecl_0_0_0_0_0_1_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEClassDecl().ele000001Group(); + return grammarAccess.prEClassDecl().ele000001Group(); } @Override @@ -2600,7 +2603,7 @@ protected class EClassDecl_0_0_0_0_0_1_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEClassDecl().ele0000010Group(); + return grammarAccess.prEClassDecl().ele0000010Group(); } @Override @@ -2629,7 +2632,7 @@ protected class EClassDecl_0_0_0_0_0_1_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEClassDecl().ele00000100Group(); + return grammarAccess.prEClassDecl().ele00000100Group(); } @Override @@ -2658,7 +2661,7 @@ protected class EClassDecl_0_0_0_0_0_1_0_0_0_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEClassDecl().ele000001000KeywordLessThanSign(); + return grammarAccess.prEClassDecl().ele000001000KeywordLessThanSign(); } } @@ -2670,7 +2673,7 @@ protected class EClassDecl_0_0_0_0_0_1_0_0_1_Assignment_eTypeParameters extends } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEClassDecl().ele000001001AssignmentETypeParameters(); + return grammarAccess.prEClassDecl().ele000001001AssignmentETypeParameters(); } @Override @@ -2703,7 +2706,7 @@ protected class EClassDecl_0_0_0_0_0_1_0_1_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEClassDecl().ele00000101Group(); + return grammarAccess.prEClassDecl().ele00000101Group(); } @Override @@ -2732,7 +2735,7 @@ protected class EClassDecl_0_0_0_0_0_1_0_1_0_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEClassDecl().ele000001010KeywordComma(); + return grammarAccess.prEClassDecl().ele000001010KeywordComma(); } } @@ -2744,7 +2747,7 @@ protected class EClassDecl_0_0_0_0_0_1_0_1_1_Assignment_eTypeParameters extends } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEClassDecl().ele000001011AssignmentETypeParameters(); + return grammarAccess.prEClassDecl().ele000001011AssignmentETypeParameters(); } @Override @@ -2778,7 +2781,7 @@ protected class EClassDecl_0_0_0_0_0_1_1_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEClassDecl().ele0000011KeywordGreaterThanSign(); + return grammarAccess.prEClassDecl().ele0000011KeywordGreaterThanSign(); } } @@ -2792,7 +2795,7 @@ protected class EClassDecl_0_0_0_0_1_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEClassDecl().ele00001Group(); + return grammarAccess.prEClassDecl().ele00001Group(); } @Override @@ -2821,7 +2824,7 @@ protected class EClassDecl_0_0_0_0_1_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEClassDecl().ele000010Group(); + return grammarAccess.prEClassDecl().ele000010Group(); } @Override @@ -2850,7 +2853,7 @@ protected class EClassDecl_0_0_0_0_1_0_0_Keyword_extends extends KeywordToken { } public Keyword getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEClassDecl().ele0000100KeywordExtends(); + return grammarAccess.prEClassDecl().ele0000100KeywordExtends(); } } @@ -2862,7 +2865,7 @@ protected class EClassDecl_0_0_0_0_1_0_1_Assignment_eGenericSuperTypes extends A } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEClassDecl().ele0000101AssignmentEGenericSuperTypes(); + return grammarAccess.prEClassDecl().ele0000101AssignmentEGenericSuperTypes(); } @Override @@ -2895,7 +2898,7 @@ protected class EClassDecl_0_0_0_0_1_1_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEClassDecl().ele000011Group(); + return grammarAccess.prEClassDecl().ele000011Group(); } @Override @@ -2924,7 +2927,7 @@ protected class EClassDecl_0_0_0_0_1_1_0_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEClassDecl().ele0000110KeywordComma(); + return grammarAccess.prEClassDecl().ele0000110KeywordComma(); } } @@ -2936,7 +2939,7 @@ protected class EClassDecl_0_0_0_0_1_1_1_Assignment_eGenericSuperTypes extends A } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEClassDecl().ele0000111AssignmentEGenericSuperTypes(); + return grammarAccess.prEClassDecl().ele0000111AssignmentEGenericSuperTypes(); } @Override @@ -2971,7 +2974,7 @@ protected class EClassDecl_0_0_0_1_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEClassDecl().ele0001Group(); + return grammarAccess.prEClassDecl().ele0001Group(); } @Override @@ -3000,7 +3003,7 @@ protected class EClassDecl_0_0_0_1_0_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEClassDecl().ele00010KeywordColon(); + return grammarAccess.prEClassDecl().ele00010KeywordColon(); } } @@ -3012,7 +3015,7 @@ protected class EClassDecl_0_0_0_1_1_Assignment_instanceClassName extends Assign } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEClassDecl().ele00011AssignmentInstanceClassName(); + return grammarAccess.prEClassDecl().ele00011AssignmentInstanceClassName(); } @Override @@ -3022,7 +3025,7 @@ protected class EClassDecl_0_0_0_1_1_Assignment_instanceClassName extends Assign if(Boolean.TRUE.booleanValue()) { // xtext::RuleCall FIXME: check if value is valid for datatype rule type = AssignmentType.PRC; - element = EcoreDslGrammarAccess.INSTANCE.prEClassDecl().ele000110ParserRuleCallSTRING_OR_QID(); + element = grammarAccess.prEClassDecl().ele000110ParserRuleCallSTRING_OR_QID(); return new Solution(obj); } @@ -3040,7 +3043,7 @@ protected class EClassDecl_0_0_1_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEClassDecl().ele001KeywordLeftCurlyBracket(); + return grammarAccess.prEClassDecl().ele001KeywordLeftCurlyBracket(); } } @@ -3053,7 +3056,7 @@ protected class EClassDecl_0_1_Alternatives extends AlternativesToken { } public Alternatives getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEClassDecl().ele01Alternatives(); + return grammarAccess.prEClassDecl().ele01Alternatives(); } @Override @@ -3075,7 +3078,7 @@ protected class EClassDecl_0_1_0_Assignment_eStructuralFeatures extends Assignme } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEClassDecl().ele010AssignmentEStructuralFeatures(); + return grammarAccess.prEClassDecl().ele010AssignmentEStructuralFeatures(); } @Override @@ -3107,7 +3110,7 @@ protected class EClassDecl_0_1_1_Assignment_eOperations extends AssignmentToken } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEClassDecl().ele011AssignmentEOperations(); + return grammarAccess.prEClassDecl().ele011AssignmentEOperations(); } @Override @@ -3141,7 +3144,7 @@ protected class EClassDecl_1_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEClassDecl().ele1KeywordRightCurlyBracket(); + return grammarAccess.prEClassDecl().ele1KeywordRightCurlyBracket(); } } @@ -3164,7 +3167,7 @@ protected class EStructuralFeatureDecl_Alternatives extends AlternativesToken { } public Alternatives getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEStructuralFeatureDecl().eleAlternatives(); + return grammarAccess.prEStructuralFeatureDecl().eleAlternatives(); } @Override @@ -3186,7 +3189,7 @@ protected class EStructuralFeatureDecl_0_RuleCall_EAttributeDecl extends RuleCal } public RuleCall getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEStructuralFeatureDecl().ele0ParserRuleCallEAttributeDecl(); + return grammarAccess.prEStructuralFeatureDecl().ele0ParserRuleCallEAttributeDecl(); } @Override @@ -3205,7 +3208,7 @@ protected class EStructuralFeatureDecl_1_RuleCall_EReferenceDecl extends RuleCal } public RuleCall getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEStructuralFeatureDecl().ele1ParserRuleCallEReferenceDecl(); + return grammarAccess.prEStructuralFeatureDecl().ele1ParserRuleCallEReferenceDecl(); } @Override @@ -3235,7 +3238,7 @@ protected class EAttributeDecl_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEAttributeDecl().eleGroup(); + return grammarAccess.prEAttributeDecl().eleGroup(); } @Override @@ -3264,7 +3267,7 @@ protected class EAttributeDecl_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEAttributeDecl().ele0Group(); + return grammarAccess.prEAttributeDecl().ele0Group(); } @Override @@ -3293,7 +3296,7 @@ protected class EAttributeDecl_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEAttributeDecl().ele00Group(); + return grammarAccess.prEAttributeDecl().ele00Group(); } @Override @@ -3322,7 +3325,7 @@ protected class EAttributeDecl_0_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEAttributeDecl().ele000Group(); + return grammarAccess.prEAttributeDecl().ele000Group(); } @Override @@ -3351,7 +3354,7 @@ protected class EAttributeDecl_0_0_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEAttributeDecl().ele0000Group(); + return grammarAccess.prEAttributeDecl().ele0000Group(); } @Override @@ -3380,7 +3383,7 @@ protected class EAttributeDecl_0_0_0_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEAttributeDecl().ele00000Group(); + return grammarAccess.prEAttributeDecl().ele00000Group(); } @Override @@ -3409,7 +3412,7 @@ protected class EAttributeDecl_0_0_0_0_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEAttributeDecl().ele000000Group(); + return grammarAccess.prEAttributeDecl().ele000000Group(); } @Override @@ -3438,7 +3441,7 @@ protected class EAttributeDecl_0_0_0_0_0_0_0_Assignment_eAnnotations extends Ass } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEAttributeDecl().ele0000000AssignmentEAnnotations(); + return grammarAccess.prEAttributeDecl().ele0000000AssignmentEAnnotations(); } @Override @@ -3470,7 +3473,7 @@ protected class EAttributeDecl_0_0_0_0_0_0_1_Alternatives extends AlternativesTo } public Alternatives getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEAttributeDecl().ele0000001Alternatives(); + return grammarAccess.prEAttributeDecl().ele0000001Alternatives(); } @Override @@ -3492,7 +3495,7 @@ protected class EAttributeDecl_0_0_0_0_0_0_1_0_Alternatives extends Alternatives } public Alternatives getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEAttributeDecl().ele00000010Alternatives(); + return grammarAccess.prEAttributeDecl().ele00000010Alternatives(); } @Override @@ -3514,7 +3517,7 @@ protected class EAttributeDecl_0_0_0_0_0_0_1_0_0_Alternatives extends Alternativ } public Alternatives getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEAttributeDecl().ele000000100Alternatives(); + return grammarAccess.prEAttributeDecl().ele000000100Alternatives(); } @Override @@ -3536,7 +3539,7 @@ protected class EAttributeDecl_0_0_0_0_0_0_1_0_0_0_Alternatives extends Alternat } public Alternatives getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEAttributeDecl().ele0000001000Alternatives(); + return grammarAccess.prEAttributeDecl().ele0000001000Alternatives(); } @Override @@ -3558,7 +3561,7 @@ protected class EAttributeDecl_0_0_0_0_0_0_1_0_0_0_0_Alternatives extends Altern } public Alternatives getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEAttributeDecl().ele00000010000Alternatives(); + return grammarAccess.prEAttributeDecl().ele00000010000Alternatives(); } @Override @@ -3580,7 +3583,7 @@ protected class EAttributeDecl_0_0_0_0_0_0_1_0_0_0_0_0_Alternatives extends Alte } public Alternatives getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEAttributeDecl().ele000000100000Alternatives(); + return grammarAccess.prEAttributeDecl().ele000000100000Alternatives(); } @Override @@ -3602,7 +3605,7 @@ protected class EAttributeDecl_0_0_0_0_0_0_1_0_0_0_0_0_0_Alternatives extends Al } public Alternatives getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEAttributeDecl().ele0000001000000Alternatives(); + return grammarAccess.prEAttributeDecl().ele0000001000000Alternatives(); } @Override @@ -3624,7 +3627,7 @@ protected class EAttributeDecl_0_0_0_0_0_0_1_0_0_0_0_0_0_0_Assignment_iD extends } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEAttributeDecl().ele00000010000000AssignmentID(); + return grammarAccess.prEAttributeDecl().ele00000010000000AssignmentID(); } @Override @@ -3634,7 +3637,7 @@ protected class EAttributeDecl_0_0_0_0_0_0_1_0_0_0_0_0_0_0_Assignment_iD extends if(Boolean.TRUE.equals(value)) { // xtext::Keyword type = AssignmentType.KW; - element = EcoreDslGrammarAccess.INSTANCE.prEAttributeDecl().ele000000100000000KeywordID(); + element = grammarAccess.prEAttributeDecl().ele000000100000000KeywordID(); return new Solution(obj); } @@ -3650,7 +3653,7 @@ protected class EAttributeDecl_0_0_0_0_0_0_1_0_0_0_0_0_0_1_Assignment_unique ext } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEAttributeDecl().ele00000010000001AssignmentUnique(); + return grammarAccess.prEAttributeDecl().ele00000010000001AssignmentUnique(); } @Override @@ -3660,7 +3663,7 @@ protected class EAttributeDecl_0_0_0_0_0_0_1_0_0_0_0_0_0_1_Assignment_unique ext if(Boolean.TRUE.equals(value)) { // xtext::Keyword type = AssignmentType.KW; - element = EcoreDslGrammarAccess.INSTANCE.prEAttributeDecl().ele000000100000010KeywordBag(); + element = grammarAccess.prEAttributeDecl().ele000000100000010KeywordBag(); return new Solution(obj); } @@ -3677,7 +3680,7 @@ protected class EAttributeDecl_0_0_0_0_0_0_1_0_0_0_0_0_1_Assignment_ordered exte } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEAttributeDecl().ele0000001000001AssignmentOrdered(); + return grammarAccess.prEAttributeDecl().ele0000001000001AssignmentOrdered(); } @Override @@ -3687,7 +3690,7 @@ protected class EAttributeDecl_0_0_0_0_0_0_1_0_0_0_0_0_1_Assignment_ordered exte if(Boolean.TRUE.equals(value)) { // xtext::Keyword type = AssignmentType.KW; - element = EcoreDslGrammarAccess.INSTANCE.prEAttributeDecl().ele00000010000010KeywordRandom(); + element = grammarAccess.prEAttributeDecl().ele00000010000010KeywordRandom(); return new Solution(obj); } @@ -3704,7 +3707,7 @@ protected class EAttributeDecl_0_0_0_0_0_0_1_0_0_0_0_1_Assignment_changeable ext } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEAttributeDecl().ele000000100001AssignmentChangeable(); + return grammarAccess.prEAttributeDecl().ele000000100001AssignmentChangeable(); } @Override @@ -3714,7 +3717,7 @@ protected class EAttributeDecl_0_0_0_0_0_0_1_0_0_0_0_1_Assignment_changeable ext if(Boolean.TRUE.equals(value)) { // xtext::Keyword type = AssignmentType.KW; - element = EcoreDslGrammarAccess.INSTANCE.prEAttributeDecl().ele0000001000010KeywordReadonly(); + element = grammarAccess.prEAttributeDecl().ele0000001000010KeywordReadonly(); return new Solution(obj); } @@ -3731,7 +3734,7 @@ protected class EAttributeDecl_0_0_0_0_0_0_1_0_0_0_1_Assignment_volatile extends } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEAttributeDecl().ele00000010001AssignmentVolatile(); + return grammarAccess.prEAttributeDecl().ele00000010001AssignmentVolatile(); } @Override @@ -3741,7 +3744,7 @@ protected class EAttributeDecl_0_0_0_0_0_0_1_0_0_0_1_Assignment_volatile extends if(Boolean.TRUE.equals(value)) { // xtext::Keyword type = AssignmentType.KW; - element = EcoreDslGrammarAccess.INSTANCE.prEAttributeDecl().ele000000100010KeywordVolatile(); + element = grammarAccess.prEAttributeDecl().ele000000100010KeywordVolatile(); return new Solution(obj); } @@ -3758,7 +3761,7 @@ protected class EAttributeDecl_0_0_0_0_0_0_1_0_0_1_Assignment_transient extends } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEAttributeDecl().ele0000001001AssignmentTransient(); + return grammarAccess.prEAttributeDecl().ele0000001001AssignmentTransient(); } @Override @@ -3768,7 +3771,7 @@ protected class EAttributeDecl_0_0_0_0_0_0_1_0_0_1_Assignment_transient extends if(Boolean.TRUE.equals(value)) { // xtext::Keyword type = AssignmentType.KW; - element = EcoreDslGrammarAccess.INSTANCE.prEAttributeDecl().ele00000010010KeywordTransient(); + element = grammarAccess.prEAttributeDecl().ele00000010010KeywordTransient(); return new Solution(obj); } @@ -3785,7 +3788,7 @@ protected class EAttributeDecl_0_0_0_0_0_0_1_0_1_Assignment_unsettable extends A } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEAttributeDecl().ele000000101AssignmentUnsettable(); + return grammarAccess.prEAttributeDecl().ele000000101AssignmentUnsettable(); } @Override @@ -3795,7 +3798,7 @@ protected class EAttributeDecl_0_0_0_0_0_0_1_0_1_Assignment_unsettable extends A if(Boolean.TRUE.equals(value)) { // xtext::Keyword type = AssignmentType.KW; - element = EcoreDslGrammarAccess.INSTANCE.prEAttributeDecl().ele0000001010KeywordUnsettable(); + element = grammarAccess.prEAttributeDecl().ele0000001010KeywordUnsettable(); return new Solution(obj); } @@ -3812,7 +3815,7 @@ protected class EAttributeDecl_0_0_0_0_0_0_1_1_Assignment_derived extends Assign } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEAttributeDecl().ele00000011AssignmentDerived(); + return grammarAccess.prEAttributeDecl().ele00000011AssignmentDerived(); } @Override @@ -3822,7 +3825,7 @@ protected class EAttributeDecl_0_0_0_0_0_0_1_1_Assignment_derived extends Assign if(Boolean.TRUE.equals(value)) { // xtext::Keyword type = AssignmentType.KW; - element = EcoreDslGrammarAccess.INSTANCE.prEAttributeDecl().ele000000110KeywordDerived(); + element = grammarAccess.prEAttributeDecl().ele000000110KeywordDerived(); return new Solution(obj); } @@ -3840,7 +3843,7 @@ protected class EAttributeDecl_0_0_0_0_0_1_Keyword_attr extends KeywordToken { } public Keyword getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEAttributeDecl().ele000001KeywordAttr(); + return grammarAccess.prEAttributeDecl().ele000001KeywordAttr(); } } @@ -3853,7 +3856,7 @@ protected class EAttributeDecl_0_0_0_0_1_Assignment_eGenericType extends Assignm } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEAttributeDecl().ele00001AssignmentEGenericType(); + return grammarAccess.prEAttributeDecl().ele00001AssignmentEGenericType(); } @Override @@ -3886,7 +3889,7 @@ protected class EAttributeDecl_0_0_0_1_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEAttributeDecl().ele0001Group(); + return grammarAccess.prEAttributeDecl().ele0001Group(); } @Override @@ -3915,7 +3918,7 @@ protected class EAttributeDecl_0_0_0_1_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEAttributeDecl().ele00010Group(); + return grammarAccess.prEAttributeDecl().ele00010Group(); } @Override @@ -3944,7 +3947,7 @@ protected class EAttributeDecl_0_0_0_1_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEAttributeDecl().ele000100Group(); + return grammarAccess.prEAttributeDecl().ele000100Group(); } @Override @@ -3973,7 +3976,7 @@ protected class EAttributeDecl_0_0_0_1_0_0_0_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEAttributeDecl().ele0001000KeywordLeftSquareBracket(); + return grammarAccess.prEAttributeDecl().ele0001000KeywordLeftSquareBracket(); } } @@ -3985,7 +3988,7 @@ protected class EAttributeDecl_0_0_0_1_0_0_1_Assignment_lowerBound extends Assig } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEAttributeDecl().ele0001001AssignmentLowerBound(); + return grammarAccess.prEAttributeDecl().ele0001001AssignmentLowerBound(); } @Override @@ -3994,7 +3997,7 @@ protected class EAttributeDecl_0_0_0_1_0_0_1_Assignment_lowerBound extends Assig IInstanceDescription obj = current.cloneAndConsume("lowerBound"); if(Boolean.TRUE.booleanValue()) { // xtext::RuleCall FIXME: check if value is valid for lexer rule type = AssignmentType.LRC; - element = EcoreDslGrammarAccess.INSTANCE.prEAttributeDecl().ele00010010LexerRuleCallINT(); + element = grammarAccess.prEAttributeDecl().ele00010010LexerRuleCallINT(); return new Solution(obj); } return null; @@ -4010,7 +4013,7 @@ protected class EAttributeDecl_0_0_0_1_0_1_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEAttributeDecl().ele000101Group(); + return grammarAccess.prEAttributeDecl().ele000101Group(); } @Override @@ -4039,7 +4042,7 @@ protected class EAttributeDecl_0_0_0_1_0_1_0_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEAttributeDecl().ele0001010KeywordFullStopFullStop(); + return grammarAccess.prEAttributeDecl().ele0001010KeywordFullStopFullStop(); } } @@ -4051,7 +4054,7 @@ protected class EAttributeDecl_0_0_0_1_0_1_1_Assignment_upperBound extends Assig } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEAttributeDecl().ele0001011AssignmentUpperBound(); + return grammarAccess.prEAttributeDecl().ele0001011AssignmentUpperBound(); } @Override @@ -4061,7 +4064,7 @@ protected class EAttributeDecl_0_0_0_1_0_1_1_Assignment_upperBound extends Assig if(Boolean.TRUE.booleanValue()) { // xtext::RuleCall FIXME: check if value is valid for datatype rule type = AssignmentType.PRC; - element = EcoreDslGrammarAccess.INSTANCE.prEAttributeDecl().ele00010110ParserRuleCallSINT(); + element = grammarAccess.prEAttributeDecl().ele00010110ParserRuleCallSINT(); return new Solution(obj); } @@ -4079,7 +4082,7 @@ protected class EAttributeDecl_0_0_0_1_1_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEAttributeDecl().ele00011KeywordRightSquareBracket(); + return grammarAccess.prEAttributeDecl().ele00011KeywordRightSquareBracket(); } } @@ -4093,7 +4096,7 @@ protected class EAttributeDecl_0_0_1_Assignment_name extends AssignmentToken { } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEAttributeDecl().ele001AssignmentName(); + return grammarAccess.prEAttributeDecl().ele001AssignmentName(); } @Override @@ -4102,7 +4105,7 @@ protected class EAttributeDecl_0_0_1_Assignment_name extends AssignmentToken { IInstanceDescription obj = current.cloneAndConsume("name"); if(Boolean.TRUE.booleanValue()) { // xtext::RuleCall FIXME: check if value is valid for lexer rule type = AssignmentType.LRC; - element = EcoreDslGrammarAccess.INSTANCE.prEAttributeDecl().ele0010LexerRuleCallID(); + element = grammarAccess.prEAttributeDecl().ele0010LexerRuleCallID(); return new Solution(obj); } return null; @@ -4118,7 +4121,7 @@ protected class EAttributeDecl_0_1_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEAttributeDecl().ele01Group(); + return grammarAccess.prEAttributeDecl().ele01Group(); } @Override @@ -4147,7 +4150,7 @@ protected class EAttributeDecl_0_1_0_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEAttributeDecl().ele010KeywordEqualsSign(); + return grammarAccess.prEAttributeDecl().ele010KeywordEqualsSign(); } } @@ -4159,7 +4162,7 @@ protected class EAttributeDecl_0_1_1_Assignment_defaultValueLiteral extends Assi } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEAttributeDecl().ele011AssignmentDefaultValueLiteral(); + return grammarAccess.prEAttributeDecl().ele011AssignmentDefaultValueLiteral(); } @Override @@ -4168,7 +4171,7 @@ protected class EAttributeDecl_0_1_1_Assignment_defaultValueLiteral extends Assi IInstanceDescription obj = current.cloneAndConsume("defaultValueLiteral"); if(Boolean.TRUE.booleanValue()) { // xtext::RuleCall FIXME: check if value is valid for lexer rule type = AssignmentType.LRC; - element = EcoreDslGrammarAccess.INSTANCE.prEAttributeDecl().ele0110LexerRuleCallSTRING(); + element = grammarAccess.prEAttributeDecl().ele0110LexerRuleCallSTRING(); return new Solution(obj); } return null; @@ -4185,7 +4188,7 @@ protected class EAttributeDecl_1_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEAttributeDecl().ele1KeywordSemicolon(); + return grammarAccess.prEAttributeDecl().ele1KeywordSemicolon(); } } @@ -4208,7 +4211,7 @@ protected class EReferenceDecl_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEReferenceDecl().eleGroup(); + return grammarAccess.prEReferenceDecl().eleGroup(); } @Override @@ -4237,7 +4240,7 @@ protected class EReferenceDecl_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEReferenceDecl().ele0Group(); + return grammarAccess.prEReferenceDecl().ele0Group(); } @Override @@ -4266,7 +4269,7 @@ protected class EReferenceDecl_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEReferenceDecl().ele00Group(); + return grammarAccess.prEReferenceDecl().ele00Group(); } @Override @@ -4295,7 +4298,7 @@ protected class EReferenceDecl_0_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEReferenceDecl().ele000Group(); + return grammarAccess.prEReferenceDecl().ele000Group(); } @Override @@ -4324,7 +4327,7 @@ protected class EReferenceDecl_0_0_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEReferenceDecl().ele0000Group(); + return grammarAccess.prEReferenceDecl().ele0000Group(); } @Override @@ -4353,7 +4356,7 @@ protected class EReferenceDecl_0_0_0_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEReferenceDecl().ele00000Group(); + return grammarAccess.prEReferenceDecl().ele00000Group(); } @Override @@ -4382,7 +4385,7 @@ protected class EReferenceDecl_0_0_0_0_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEReferenceDecl().ele000000Group(); + return grammarAccess.prEReferenceDecl().ele000000Group(); } @Override @@ -4411,7 +4414,7 @@ protected class EReferenceDecl_0_0_0_0_0_0_0_Assignment_eAnnotations extends Ass } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEReferenceDecl().ele0000000AssignmentEAnnotations(); + return grammarAccess.prEReferenceDecl().ele0000000AssignmentEAnnotations(); } @Override @@ -4443,7 +4446,7 @@ protected class EReferenceDecl_0_0_0_0_0_0_1_Alternatives extends AlternativesTo } public Alternatives getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEReferenceDecl().ele0000001Alternatives(); + return grammarAccess.prEReferenceDecl().ele0000001Alternatives(); } @Override @@ -4465,7 +4468,7 @@ protected class EReferenceDecl_0_0_0_0_0_0_1_0_Alternatives extends Alternatives } public Alternatives getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEReferenceDecl().ele00000010Alternatives(); + return grammarAccess.prEReferenceDecl().ele00000010Alternatives(); } @Override @@ -4487,7 +4490,7 @@ protected class EReferenceDecl_0_0_0_0_0_0_1_0_0_Alternatives extends Alternativ } public Alternatives getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEReferenceDecl().ele000000100Alternatives(); + return grammarAccess.prEReferenceDecl().ele000000100Alternatives(); } @Override @@ -4509,7 +4512,7 @@ protected class EReferenceDecl_0_0_0_0_0_0_1_0_0_0_Alternatives extends Alternat } public Alternatives getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEReferenceDecl().ele0000001000Alternatives(); + return grammarAccess.prEReferenceDecl().ele0000001000Alternatives(); } @Override @@ -4531,7 +4534,7 @@ protected class EReferenceDecl_0_0_0_0_0_0_1_0_0_0_0_Alternatives extends Altern } public Alternatives getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEReferenceDecl().ele00000010000Alternatives(); + return grammarAccess.prEReferenceDecl().ele00000010000Alternatives(); } @Override @@ -4553,7 +4556,7 @@ protected class EReferenceDecl_0_0_0_0_0_0_1_0_0_0_0_0_Alternatives extends Alte } public Alternatives getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEReferenceDecl().ele000000100000Alternatives(); + return grammarAccess.prEReferenceDecl().ele000000100000Alternatives(); } @Override @@ -4575,7 +4578,7 @@ protected class EReferenceDecl_0_0_0_0_0_0_1_0_0_0_0_0_0_Alternatives extends Al } public Alternatives getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEReferenceDecl().ele0000001000000Alternatives(); + return grammarAccess.prEReferenceDecl().ele0000001000000Alternatives(); } @Override @@ -4597,7 +4600,7 @@ protected class EReferenceDecl_0_0_0_0_0_0_1_0_0_0_0_0_0_0_Assignment_resolvePro } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEReferenceDecl().ele00000010000000AssignmentResolveProxies(); + return grammarAccess.prEReferenceDecl().ele00000010000000AssignmentResolveProxies(); } @Override @@ -4607,7 +4610,7 @@ protected class EReferenceDecl_0_0_0_0_0_0_1_0_0_0_0_0_0_0_Assignment_resolvePro if(Boolean.TRUE.equals(value)) { // xtext::Keyword type = AssignmentType.KW; - element = EcoreDslGrammarAccess.INSTANCE.prEReferenceDecl().ele000000100000000KeywordLocal(); + element = grammarAccess.prEReferenceDecl().ele000000100000000KeywordLocal(); return new Solution(obj); } @@ -4623,7 +4626,7 @@ protected class EReferenceDecl_0_0_0_0_0_0_1_0_0_0_0_0_0_1_Assignment_unique ext } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEReferenceDecl().ele00000010000001AssignmentUnique(); + return grammarAccess.prEReferenceDecl().ele00000010000001AssignmentUnique(); } @Override @@ -4633,7 +4636,7 @@ protected class EReferenceDecl_0_0_0_0_0_0_1_0_0_0_0_0_0_1_Assignment_unique ext if(Boolean.TRUE.equals(value)) { // xtext::Keyword type = AssignmentType.KW; - element = EcoreDslGrammarAccess.INSTANCE.prEReferenceDecl().ele000000100000010KeywordBag(); + element = grammarAccess.prEReferenceDecl().ele000000100000010KeywordBag(); return new Solution(obj); } @@ -4650,7 +4653,7 @@ protected class EReferenceDecl_0_0_0_0_0_0_1_0_0_0_0_0_1_Assignment_ordered exte } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEReferenceDecl().ele0000001000001AssignmentOrdered(); + return grammarAccess.prEReferenceDecl().ele0000001000001AssignmentOrdered(); } @Override @@ -4660,7 +4663,7 @@ protected class EReferenceDecl_0_0_0_0_0_0_1_0_0_0_0_0_1_Assignment_ordered exte if(Boolean.TRUE.equals(value)) { // xtext::Keyword type = AssignmentType.KW; - element = EcoreDslGrammarAccess.INSTANCE.prEReferenceDecl().ele00000010000010KeywordRandom(); + element = grammarAccess.prEReferenceDecl().ele00000010000010KeywordRandom(); return new Solution(obj); } @@ -4677,7 +4680,7 @@ protected class EReferenceDecl_0_0_0_0_0_0_1_0_0_0_0_1_Assignment_changeable ext } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEReferenceDecl().ele000000100001AssignmentChangeable(); + return grammarAccess.prEReferenceDecl().ele000000100001AssignmentChangeable(); } @Override @@ -4687,7 +4690,7 @@ protected class EReferenceDecl_0_0_0_0_0_0_1_0_0_0_0_1_Assignment_changeable ext if(Boolean.TRUE.equals(value)) { // xtext::Keyword type = AssignmentType.KW; - element = EcoreDslGrammarAccess.INSTANCE.prEReferenceDecl().ele0000001000010KeywordReadonly(); + element = grammarAccess.prEReferenceDecl().ele0000001000010KeywordReadonly(); return new Solution(obj); } @@ -4704,7 +4707,7 @@ protected class EReferenceDecl_0_0_0_0_0_0_1_0_0_0_1_Assignment_volatile extends } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEReferenceDecl().ele00000010001AssignmentVolatile(); + return grammarAccess.prEReferenceDecl().ele00000010001AssignmentVolatile(); } @Override @@ -4714,7 +4717,7 @@ protected class EReferenceDecl_0_0_0_0_0_0_1_0_0_0_1_Assignment_volatile extends if(Boolean.TRUE.equals(value)) { // xtext::Keyword type = AssignmentType.KW; - element = EcoreDslGrammarAccess.INSTANCE.prEReferenceDecl().ele000000100010KeywordVolatile(); + element = grammarAccess.prEReferenceDecl().ele000000100010KeywordVolatile(); return new Solution(obj); } @@ -4731,7 +4734,7 @@ protected class EReferenceDecl_0_0_0_0_0_0_1_0_0_1_Assignment_transient extends } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEReferenceDecl().ele0000001001AssignmentTransient(); + return grammarAccess.prEReferenceDecl().ele0000001001AssignmentTransient(); } @Override @@ -4741,7 +4744,7 @@ protected class EReferenceDecl_0_0_0_0_0_0_1_0_0_1_Assignment_transient extends if(Boolean.TRUE.equals(value)) { // xtext::Keyword type = AssignmentType.KW; - element = EcoreDslGrammarAccess.INSTANCE.prEReferenceDecl().ele00000010010KeywordTransient(); + element = grammarAccess.prEReferenceDecl().ele00000010010KeywordTransient(); return new Solution(obj); } @@ -4758,7 +4761,7 @@ protected class EReferenceDecl_0_0_0_0_0_0_1_0_1_Assignment_unsettable extends A } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEReferenceDecl().ele000000101AssignmentUnsettable(); + return grammarAccess.prEReferenceDecl().ele000000101AssignmentUnsettable(); } @Override @@ -4768,7 +4771,7 @@ protected class EReferenceDecl_0_0_0_0_0_0_1_0_1_Assignment_unsettable extends A if(Boolean.TRUE.equals(value)) { // xtext::Keyword type = AssignmentType.KW; - element = EcoreDslGrammarAccess.INSTANCE.prEReferenceDecl().ele0000001010KeywordUnsettable(); + element = grammarAccess.prEReferenceDecl().ele0000001010KeywordUnsettable(); return new Solution(obj); } @@ -4785,7 +4788,7 @@ protected class EReferenceDecl_0_0_0_0_0_0_1_1_Assignment_derived extends Assign } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEReferenceDecl().ele00000011AssignmentDerived(); + return grammarAccess.prEReferenceDecl().ele00000011AssignmentDerived(); } @Override @@ -4795,7 +4798,7 @@ protected class EReferenceDecl_0_0_0_0_0_0_1_1_Assignment_derived extends Assign if(Boolean.TRUE.equals(value)) { // xtext::Keyword type = AssignmentType.KW; - element = EcoreDslGrammarAccess.INSTANCE.prEReferenceDecl().ele000000110KeywordDerived(); + element = grammarAccess.prEReferenceDecl().ele000000110KeywordDerived(); return new Solution(obj); } @@ -4813,7 +4816,7 @@ protected class EReferenceDecl_0_0_0_0_0_1_Alternatives extends AlternativesToke } public Alternatives getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEReferenceDecl().ele000001Alternatives(); + return grammarAccess.prEReferenceDecl().ele000001Alternatives(); } @Override @@ -4835,7 +4838,7 @@ protected class EReferenceDecl_0_0_0_0_0_1_0_Assignment_containment extends Assi } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEReferenceDecl().ele0000010AssignmentContainment(); + return grammarAccess.prEReferenceDecl().ele0000010AssignmentContainment(); } @Override @@ -4845,7 +4848,7 @@ protected class EReferenceDecl_0_0_0_0_0_1_0_Assignment_containment extends Assi if(Boolean.TRUE.equals(value)) { // xtext::Keyword type = AssignmentType.KW; - element = EcoreDslGrammarAccess.INSTANCE.prEReferenceDecl().ele00000100KeywordVal(); + element = grammarAccess.prEReferenceDecl().ele00000100KeywordVal(); return new Solution(obj); } @@ -4861,7 +4864,7 @@ protected class EReferenceDecl_0_0_0_0_0_1_1_Keyword_ref extends KeywordToken { } public Keyword getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEReferenceDecl().ele0000011KeywordRef(); + return grammarAccess.prEReferenceDecl().ele0000011KeywordRef(); } } @@ -4875,7 +4878,7 @@ protected class EReferenceDecl_0_0_0_0_1_Assignment_eGenericType extends Assignm } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEReferenceDecl().ele00001AssignmentEGenericType(); + return grammarAccess.prEReferenceDecl().ele00001AssignmentEGenericType(); } @Override @@ -4908,7 +4911,7 @@ protected class EReferenceDecl_0_0_0_1_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEReferenceDecl().ele0001Group(); + return grammarAccess.prEReferenceDecl().ele0001Group(); } @Override @@ -4937,7 +4940,7 @@ protected class EReferenceDecl_0_0_0_1_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEReferenceDecl().ele00010Group(); + return grammarAccess.prEReferenceDecl().ele00010Group(); } @Override @@ -4966,7 +4969,7 @@ protected class EReferenceDecl_0_0_0_1_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEReferenceDecl().ele000100Group(); + return grammarAccess.prEReferenceDecl().ele000100Group(); } @Override @@ -4995,7 +4998,7 @@ protected class EReferenceDecl_0_0_0_1_0_0_0_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEReferenceDecl().ele0001000KeywordLeftSquareBracket(); + return grammarAccess.prEReferenceDecl().ele0001000KeywordLeftSquareBracket(); } } @@ -5007,7 +5010,7 @@ protected class EReferenceDecl_0_0_0_1_0_0_1_Assignment_lowerBound extends Assig } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEReferenceDecl().ele0001001AssignmentLowerBound(); + return grammarAccess.prEReferenceDecl().ele0001001AssignmentLowerBound(); } @Override @@ -5016,7 +5019,7 @@ protected class EReferenceDecl_0_0_0_1_0_0_1_Assignment_lowerBound extends Assig IInstanceDescription obj = current.cloneAndConsume("lowerBound"); if(Boolean.TRUE.booleanValue()) { // xtext::RuleCall FIXME: check if value is valid for lexer rule type = AssignmentType.LRC; - element = EcoreDslGrammarAccess.INSTANCE.prEReferenceDecl().ele00010010LexerRuleCallINT(); + element = grammarAccess.prEReferenceDecl().ele00010010LexerRuleCallINT(); return new Solution(obj); } return null; @@ -5032,7 +5035,7 @@ protected class EReferenceDecl_0_0_0_1_0_1_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEReferenceDecl().ele000101Group(); + return grammarAccess.prEReferenceDecl().ele000101Group(); } @Override @@ -5061,7 +5064,7 @@ protected class EReferenceDecl_0_0_0_1_0_1_0_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEReferenceDecl().ele0001010KeywordFullStopFullStop(); + return grammarAccess.prEReferenceDecl().ele0001010KeywordFullStopFullStop(); } } @@ -5073,7 +5076,7 @@ protected class EReferenceDecl_0_0_0_1_0_1_1_Assignment_upperBound extends Assig } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEReferenceDecl().ele0001011AssignmentUpperBound(); + return grammarAccess.prEReferenceDecl().ele0001011AssignmentUpperBound(); } @Override @@ -5083,7 +5086,7 @@ protected class EReferenceDecl_0_0_0_1_0_1_1_Assignment_upperBound extends Assig if(Boolean.TRUE.booleanValue()) { // xtext::RuleCall FIXME: check if value is valid for datatype rule type = AssignmentType.PRC; - element = EcoreDslGrammarAccess.INSTANCE.prEReferenceDecl().ele00010110ParserRuleCallSINT(); + element = grammarAccess.prEReferenceDecl().ele00010110ParserRuleCallSINT(); return new Solution(obj); } @@ -5101,7 +5104,7 @@ protected class EReferenceDecl_0_0_0_1_1_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEReferenceDecl().ele00011KeywordRightSquareBracket(); + return grammarAccess.prEReferenceDecl().ele00011KeywordRightSquareBracket(); } } @@ -5115,7 +5118,7 @@ protected class EReferenceDecl_0_0_1_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEReferenceDecl().ele001Group(); + return grammarAccess.prEReferenceDecl().ele001Group(); } @Override @@ -5144,7 +5147,7 @@ protected class EReferenceDecl_0_0_1_0_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEReferenceDecl().ele0010KeywordNumberSign(); + return grammarAccess.prEReferenceDecl().ele0010KeywordNumberSign(); } } @@ -5156,7 +5159,7 @@ protected class EReferenceDecl_0_0_1_1_Assignment_eOpposite extends AssignmentTo } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEReferenceDecl().ele0011AssignmentEOpposite(); + return grammarAccess.prEReferenceDecl().ele0011AssignmentEOpposite(); } @Override @@ -5167,7 +5170,7 @@ protected class EReferenceDecl_0_0_1_1_Assignment_eOpposite extends AssignmentTo IInstanceDescription param = getDescr((EObject)value); if(param.isInstanceOf("EReference")) { type = AssignmentType.CR; - element = EcoreDslGrammarAccess.INSTANCE.prEReferenceDecl().ele00110CrossReferenceEStringEReference(); + element = grammarAccess.prEReferenceDecl().ele00110CrossReferenceEStringEReference(); return new Solution(obj); } } @@ -5185,7 +5188,7 @@ protected class EReferenceDecl_0_1_Assignment_name extends AssignmentToken { } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEReferenceDecl().ele01AssignmentName(); + return grammarAccess.prEReferenceDecl().ele01AssignmentName(); } @Override @@ -5194,7 +5197,7 @@ protected class EReferenceDecl_0_1_Assignment_name extends AssignmentToken { IInstanceDescription obj = current.cloneAndConsume("name"); if(Boolean.TRUE.booleanValue()) { // xtext::RuleCall FIXME: check if value is valid for lexer rule type = AssignmentType.LRC; - element = EcoreDslGrammarAccess.INSTANCE.prEReferenceDecl().ele010LexerRuleCallID(); + element = grammarAccess.prEReferenceDecl().ele010LexerRuleCallID(); return new Solution(obj); } return null; @@ -5210,7 +5213,7 @@ protected class EReferenceDecl_1_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEReferenceDecl().ele1KeywordSemicolon(); + return grammarAccess.prEReferenceDecl().ele1KeywordSemicolon(); } } @@ -5233,7 +5236,7 @@ protected class EEnumDecl_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEEnumDecl().eleGroup(); + return grammarAccess.prEEnumDecl().eleGroup(); } @Override @@ -5262,7 +5265,7 @@ protected class EEnumDecl_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEEnumDecl().ele0Group(); + return grammarAccess.prEEnumDecl().ele0Group(); } @Override @@ -5291,7 +5294,7 @@ protected class EEnumDecl_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEEnumDecl().ele00Group(); + return grammarAccess.prEEnumDecl().ele00Group(); } @Override @@ -5320,7 +5323,7 @@ protected class EEnumDecl_0_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEEnumDecl().ele000Group(); + return grammarAccess.prEEnumDecl().ele000Group(); } @Override @@ -5349,7 +5352,7 @@ protected class EEnumDecl_0_0_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEEnumDecl().ele0000Group(); + return grammarAccess.prEEnumDecl().ele0000Group(); } @Override @@ -5378,7 +5381,7 @@ protected class EEnumDecl_0_0_0_0_0_Assignment_eAnnotations extends AssignmentTo } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEEnumDecl().ele00000AssignmentEAnnotations(); + return grammarAccess.prEEnumDecl().ele00000AssignmentEAnnotations(); } @Override @@ -5410,7 +5413,7 @@ protected class EEnumDecl_0_0_0_0_1_Keyword_enum extends KeywordToken { } public Keyword getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEEnumDecl().ele00001KeywordEnum(); + return grammarAccess.prEEnumDecl().ele00001KeywordEnum(); } } @@ -5423,7 +5426,7 @@ protected class EEnumDecl_0_0_0_1_Assignment_name extends AssignmentToken { } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEEnumDecl().ele0001AssignmentName(); + return grammarAccess.prEEnumDecl().ele0001AssignmentName(); } @Override @@ -5432,7 +5435,7 @@ protected class EEnumDecl_0_0_0_1_Assignment_name extends AssignmentToken { IInstanceDescription obj = current.cloneAndConsume("name"); if(Boolean.TRUE.booleanValue()) { // xtext::RuleCall FIXME: check if value is valid for lexer rule type = AssignmentType.LRC; - element = EcoreDslGrammarAccess.INSTANCE.prEEnumDecl().ele00010LexerRuleCallID(); + element = grammarAccess.prEEnumDecl().ele00010LexerRuleCallID(); return new Solution(obj); } return null; @@ -5448,7 +5451,7 @@ protected class EEnumDecl_0_0_1_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEEnumDecl().ele001KeywordLeftCurlyBracket(); + return grammarAccess.prEEnumDecl().ele001KeywordLeftCurlyBracket(); } } @@ -5461,7 +5464,7 @@ protected class EEnumDecl_0_1_Assignment_eLiterals extends AssignmentToken { } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEEnumDecl().ele01AssignmentELiterals(); + return grammarAccess.prEEnumDecl().ele01AssignmentELiterals(); } @Override @@ -5494,7 +5497,7 @@ protected class EEnumDecl_1_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEEnumDecl().ele1KeywordRightCurlyBracket(); + return grammarAccess.prEEnumDecl().ele1KeywordRightCurlyBracket(); } } @@ -5517,7 +5520,7 @@ protected class EEnumLiteralDecl_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEEnumLiteralDecl().eleGroup(); + return grammarAccess.prEEnumLiteralDecl().eleGroup(); } @Override @@ -5546,7 +5549,7 @@ protected class EEnumLiteralDecl_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEEnumLiteralDecl().ele0Group(); + return grammarAccess.prEEnumLiteralDecl().ele0Group(); } @Override @@ -5575,7 +5578,7 @@ protected class EEnumLiteralDecl_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEEnumLiteralDecl().ele00Group(); + return grammarAccess.prEEnumLiteralDecl().ele00Group(); } @Override @@ -5604,7 +5607,7 @@ protected class EEnumLiteralDecl_0_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEEnumLiteralDecl().ele000Group(); + return grammarAccess.prEEnumLiteralDecl().ele000Group(); } @Override @@ -5633,7 +5636,7 @@ protected class EEnumLiteralDecl_0_0_0_0_Assignment_eAnnotations extends Assignm } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEEnumLiteralDecl().ele0000AssignmentEAnnotations(); + return grammarAccess.prEEnumLiteralDecl().ele0000AssignmentEAnnotations(); } @Override @@ -5665,7 +5668,7 @@ protected class EEnumLiteralDecl_0_0_0_1_Assignment_name extends AssignmentToken } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEEnumLiteralDecl().ele0001AssignmentName(); + return grammarAccess.prEEnumLiteralDecl().ele0001AssignmentName(); } @Override @@ -5674,7 +5677,7 @@ protected class EEnumLiteralDecl_0_0_0_1_Assignment_name extends AssignmentToken IInstanceDescription obj = current.cloneAndConsume("name"); if(Boolean.TRUE.booleanValue()) { // xtext::RuleCall FIXME: check if value is valid for lexer rule type = AssignmentType.LRC; - element = EcoreDslGrammarAccess.INSTANCE.prEEnumLiteralDecl().ele00010LexerRuleCallID(); + element = grammarAccess.prEEnumLiteralDecl().ele00010LexerRuleCallID(); return new Solution(obj); } return null; @@ -5690,7 +5693,7 @@ protected class EEnumLiteralDecl_0_0_1_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEEnumLiteralDecl().ele001Group(); + return grammarAccess.prEEnumLiteralDecl().ele001Group(); } @Override @@ -5719,7 +5722,7 @@ protected class EEnumLiteralDecl_0_0_1_0_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEEnumLiteralDecl().ele0010KeywordEqualsSign(); + return grammarAccess.prEEnumLiteralDecl().ele0010KeywordEqualsSign(); } } @@ -5731,7 +5734,7 @@ protected class EEnumLiteralDecl_0_0_1_1_Assignment_value extends AssignmentToke } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEEnumLiteralDecl().ele0011AssignmentValue(); + return grammarAccess.prEEnumLiteralDecl().ele0011AssignmentValue(); } @Override @@ -5740,7 +5743,7 @@ protected class EEnumLiteralDecl_0_0_1_1_Assignment_value extends AssignmentToke IInstanceDescription obj = current.cloneAndConsume("value"); if(Boolean.TRUE.booleanValue()) { // xtext::RuleCall FIXME: check if value is valid for lexer rule type = AssignmentType.LRC; - element = EcoreDslGrammarAccess.INSTANCE.prEEnumLiteralDecl().ele00110LexerRuleCallINT(); + element = grammarAccess.prEEnumLiteralDecl().ele00110LexerRuleCallINT(); return new Solution(obj); } return null; @@ -5757,7 +5760,7 @@ protected class EEnumLiteralDecl_0_1_Assignment_literal extends AssignmentToken } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEEnumLiteralDecl().ele01AssignmentLiteral(); + return grammarAccess.prEEnumLiteralDecl().ele01AssignmentLiteral(); } @Override @@ -5766,7 +5769,7 @@ protected class EEnumLiteralDecl_0_1_Assignment_literal extends AssignmentToken IInstanceDescription obj = current.cloneAndConsume("literal"); if(Boolean.TRUE.booleanValue()) { // xtext::RuleCall FIXME: check if value is valid for lexer rule type = AssignmentType.LRC; - element = EcoreDslGrammarAccess.INSTANCE.prEEnumLiteralDecl().ele010LexerRuleCallSTRING(); + element = grammarAccess.prEEnumLiteralDecl().ele010LexerRuleCallSTRING(); return new Solution(obj); } return null; @@ -5782,7 +5785,7 @@ protected class EEnumLiteralDecl_1_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEEnumLiteralDecl().ele1KeywordSemicolon(); + return grammarAccess.prEEnumLiteralDecl().ele1KeywordSemicolon(); } } @@ -5805,7 +5808,7 @@ protected class ETypeParameterDecl_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prETypeParameterDecl().eleGroup(); + return grammarAccess.prETypeParameterDecl().eleGroup(); } @Override @@ -5834,7 +5837,7 @@ protected class ETypeParameterDecl_0_Assignment_name extends AssignmentToken { } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prETypeParameterDecl().ele0AssignmentName(); + return grammarAccess.prETypeParameterDecl().ele0AssignmentName(); } @Override @@ -5843,7 +5846,7 @@ protected class ETypeParameterDecl_0_Assignment_name extends AssignmentToken { IInstanceDescription obj = current.cloneAndConsume("name"); if(Boolean.TRUE.booleanValue()) { // xtext::RuleCall FIXME: check if value is valid for lexer rule type = AssignmentType.LRC; - element = EcoreDslGrammarAccess.INSTANCE.prETypeParameterDecl().ele00LexerRuleCallID(); + element = grammarAccess.prETypeParameterDecl().ele00LexerRuleCallID(); return new Solution(obj); } return null; @@ -5858,7 +5861,7 @@ protected class ETypeParameterDecl_1_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prETypeParameterDecl().ele1Group(); + return grammarAccess.prETypeParameterDecl().ele1Group(); } @Override @@ -5887,7 +5890,7 @@ protected class ETypeParameterDecl_1_0_Keyword_extends extends KeywordToken { } public Keyword getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prETypeParameterDecl().ele10KeywordExtends(); + return grammarAccess.prETypeParameterDecl().ele10KeywordExtends(); } } @@ -5899,7 +5902,7 @@ protected class ETypeParameterDecl_1_1_Assignment_eBounds extends AssignmentToke } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prETypeParameterDecl().ele11AssignmentEBounds(); + return grammarAccess.prETypeParameterDecl().ele11AssignmentEBounds(); } @Override @@ -5943,7 +5946,7 @@ protected class EGenericTypeReferenceDecl_Alternatives extends AlternativesToken } public Alternatives getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEGenericTypeReferenceDecl().eleAlternatives(); + return grammarAccess.prEGenericTypeReferenceDecl().eleAlternatives(); } @Override @@ -5965,7 +5968,7 @@ protected class EGenericTypeReferenceDecl_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEGenericTypeReferenceDecl().ele0Group(); + return grammarAccess.prEGenericTypeReferenceDecl().ele0Group(); } @Override @@ -5994,7 +5997,7 @@ protected class EGenericTypeReferenceDecl_0_0_Assignment_eClassifier extends Ass } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEGenericTypeReferenceDecl().ele00AssignmentEClassifier(); + return grammarAccess.prEGenericTypeReferenceDecl().ele00AssignmentEClassifier(); } @Override @@ -6005,7 +6008,7 @@ protected class EGenericTypeReferenceDecl_0_0_Assignment_eClassifier extends Ass IInstanceDescription param = getDescr((EObject)value); if(param.isInstanceOf("EClassifier")) { type = AssignmentType.CR; - element = EcoreDslGrammarAccess.INSTANCE.prEGenericTypeReferenceDecl().ele000CrossReferenceEStringEClassifier(); + element = grammarAccess.prEGenericTypeReferenceDecl().ele000CrossReferenceEStringEClassifier(); return new Solution(obj); } } @@ -6021,7 +6024,7 @@ protected class EGenericTypeReferenceDecl_0_1_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEGenericTypeReferenceDecl().ele01Group(); + return grammarAccess.prEGenericTypeReferenceDecl().ele01Group(); } @Override @@ -6050,7 +6053,7 @@ protected class EGenericTypeReferenceDecl_0_1_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEGenericTypeReferenceDecl().ele010Group(); + return grammarAccess.prEGenericTypeReferenceDecl().ele010Group(); } @Override @@ -6079,7 +6082,7 @@ protected class EGenericTypeReferenceDecl_0_1_0_0_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEGenericTypeReferenceDecl().ele0100Group(); + return grammarAccess.prEGenericTypeReferenceDecl().ele0100Group(); } @Override @@ -6108,7 +6111,7 @@ protected class EGenericTypeReferenceDecl_0_1_0_0_0_Keyword extends KeywordToken } public Keyword getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEGenericTypeReferenceDecl().ele01000KeywordLessThanSign(); + return grammarAccess.prEGenericTypeReferenceDecl().ele01000KeywordLessThanSign(); } } @@ -6120,7 +6123,7 @@ protected class EGenericTypeReferenceDecl_0_1_0_0_1_Assignment_eTypeArguments ex } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEGenericTypeReferenceDecl().ele01001AssignmentETypeArguments(); + return grammarAccess.prEGenericTypeReferenceDecl().ele01001AssignmentETypeArguments(); } @Override @@ -6153,7 +6156,7 @@ protected class EGenericTypeReferenceDecl_0_1_0_1_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEGenericTypeReferenceDecl().ele0101Group(); + return grammarAccess.prEGenericTypeReferenceDecl().ele0101Group(); } @Override @@ -6182,7 +6185,7 @@ protected class EGenericTypeReferenceDecl_0_1_0_1_0_Keyword extends KeywordToken } public Keyword getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEGenericTypeReferenceDecl().ele01010KeywordComma(); + return grammarAccess.prEGenericTypeReferenceDecl().ele01010KeywordComma(); } } @@ -6194,7 +6197,7 @@ protected class EGenericTypeReferenceDecl_0_1_0_1_1_Assignment_eTypeArguments ex } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEGenericTypeReferenceDecl().ele01011AssignmentETypeArguments(); + return grammarAccess.prEGenericTypeReferenceDecl().ele01011AssignmentETypeArguments(); } @Override @@ -6228,7 +6231,7 @@ protected class EGenericTypeReferenceDecl_0_1_1_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEGenericTypeReferenceDecl().ele011KeywordGreaterThanSign(); + return grammarAccess.prEGenericTypeReferenceDecl().ele011KeywordGreaterThanSign(); } } @@ -6242,7 +6245,7 @@ protected class EGenericTypeReferenceDecl_1_Group extends GroupToken { } public Group getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEGenericTypeReferenceDecl().ele1Group(); + return grammarAccess.prEGenericTypeReferenceDecl().ele1Group(); } @Override @@ -6271,7 +6274,7 @@ protected class EGenericTypeReferenceDecl_1_0_Keyword extends KeywordToken { } public Keyword getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEGenericTypeReferenceDecl().ele10KeywordNumberSign(); + return grammarAccess.prEGenericTypeReferenceDecl().ele10KeywordNumberSign(); } } @@ -6283,7 +6286,7 @@ protected class EGenericTypeReferenceDecl_1_1_Assignment_eTypeParameter extends } public Assignment getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEGenericTypeReferenceDecl().ele11AssignmentETypeParameter(); + return grammarAccess.prEGenericTypeReferenceDecl().ele11AssignmentETypeParameter(); } @Override @@ -6294,7 +6297,7 @@ protected class EGenericTypeReferenceDecl_1_1_Assignment_eTypeParameter extends IInstanceDescription param = getDescr((EObject)value); if(param.isInstanceOf("ETypeParameter")) { type = AssignmentType.CR; - element = EcoreDslGrammarAccess.INSTANCE.prEGenericTypeReferenceDecl().ele110CrossReferenceEStringETypeParameter(); + element = grammarAccess.prEGenericTypeReferenceDecl().ele110CrossReferenceEStringETypeParameter(); return new Solution(obj); } } @@ -6322,7 +6325,7 @@ protected class EGenericTypeDecl_Alternatives extends AlternativesToken { } public Alternatives getGrammarElement() { - return EcoreDslGrammarAccess.INSTANCE.prEGenericTypeDecl().eleAlternatives(); + return grammarAccess.prEGenericTypeDecl().eleAlternatives(); } @Override |

