aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorszarnekow2009-01-23 05:04:15 (EST)
committersefftinge2009-01-23 05:04:15 (EST)
commit7e3ca04a5608c740a5147aa8ff30042424901814 (patch)
treebd282865b661c21621c464453afe9f0028d14bec
parent5efe88a9fc6067611851943c9050fb35cf3137b5 (diff)
downloadorg.eclipse.xtext-7e3ca04a5608c740a5147aa8ff30042424901814.zip
org.eclipse.xtext-7e3ca04a5608c740a5147aa8ff30042424901814.tar.gz
org.eclipse.xtext-7e3ca04a5608c740a5147aa8ff30042424901814.tar.bz2
parser error messages: first shot
-rw-r--r--devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/packrat/consumers/ReferenceGrammarCustomTypeParserRuleConsumer.java36
-rw-r--r--devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/packrat/consumers/ReferenceGrammarErwachsenerConsumer.java73
-rw-r--r--devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/packrat/consumers/ReferenceGrammarFamilieConsumer.java175
-rw-r--r--devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/packrat/consumers/ReferenceGrammarFarbeConsumer.java33
-rw-r--r--devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/packrat/consumers/ReferenceGrammarKindConsumer.java73
-rw-r--r--devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/packrat/consumers/ReferenceGrammarPersonConsumer.java56
-rw-r--r--devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/packrat/consumers/ReferenceGrammarSpielplatzConsumer.java281
-rw-r--r--devtools/org.eclipse.xtext.reference/src-gen/org/eclipse/xtext/reference/parser/packrat/consumers/ReferenceGrammarSpielzeugConsumer.java73
-rw-r--r--examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/domainmodel.ecore2
-rw-r--r--examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelAttributeConsumer.java64
-rw-r--r--examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelDataTypeConsumer.java36
-rw-r--r--examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelEntityConsumer.java135
-rw-r--r--examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelFeatureConsumer.java56
-rw-r--r--examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelFileConsumer.java70
-rw-r--r--examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelImportConsumer.java36
-rw-r--r--examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelNamedElementConsumer.java56
-rw-r--r--examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelOperationConsumer.java175
-rw-r--r--examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelPackageConsumer.java85
-rw-r--r--examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelParameterConsumer.java46
-rw-r--r--examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelQualifiedNameConsumer.java59
-rw-r--r--examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelReferenceConsumer.java114
-rw-r--r--examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelStructuralFeatureConsumer.java56
-rw-r--r--examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelTypeConsumer.java56
-rw-r--r--examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelTypeRefConsumer.java15
-rw-r--r--examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelTypedElementConsumer.java56
-rw-r--r--examples/org.eclipse.xtext.example.fowlerdsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/FowlerDslCommandConsumer.java46
-rw-r--r--examples/org.eclipse.xtext.example.fowlerdsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/FowlerDslEventConsumer.java75
-rw-r--r--examples/org.eclipse.xtext.example.fowlerdsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/FowlerDslStateConsumer.java166
-rw-r--r--examples/org.eclipse.xtext.example.fowlerdsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/FowlerDslStatemachineConsumer.java137
-rw-r--r--examples/org.eclipse.xtext.example.fowlerdsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/FowlerDslTransitionConsumer.java55
-rw-r--r--plugins/org.eclipse.xtext.ui.common.xtend/META-INF/MANIFEST.MF2
-rw-r--r--tests/org.eclipse.xtext.generator.tests/META-INF/MANIFEST.MF3
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/XtextTest.ecore6
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/crossrefs/parser/packrat/consumers/ImportUriTestLanguageImportConsumer.java36
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/crossrefs/parser/packrat/consumers/ImportUriTestLanguageMainConsumer.java70
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/crossrefs/parser/packrat/consumers/ImportUriTestLanguageTypeConsumer.java64
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/crossrefs/parser/packrat/consumers/LangATestLanguageImportConsumer.java36
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/crossrefs/parser/packrat/consumers/LangATestLanguageMainConsumer.java70
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/crossrefs/parser/packrat/consumers/LangATestLanguageTypeConsumer.java64
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/dummy/parser/packrat/consumers/DummyTestLanguageElementConsumer.java105
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/dummy/parser/packrat/consumers/DummyTestLanguageModelConsumer.java27
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/grammarinheritance/parser/packrat/consumers/AbstractTestLanguageInheritedParserRuleConsumer.java36
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/grammarinheritance/parser/packrat/consumers/ConcreteTestLanguageConcreteParserRuleConsumer.java76
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/metamodelreferencing/tests/parser/packrat/consumers/MetamodelRefTestLanguageFooConsumer.java58
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/metamodelreferencing/tests/parser/packrat/consumers/MetamodelRefTestLanguageMyRuleConsumer.java15
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/metamodelreferencing/tests/parser/packrat/consumers/MetamodelRefTestLanguageNameRefConsumer.java15
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/metamodelreferencing/tests/parser/packrat/consumers/MultiGenMMTestLanguageFooConsumer.java58
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/metamodelreferencing/tests/parser/packrat/consumers/MultiGenMMTestLanguageNameRefConsumer.java15
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/datatyperules/parser/packrat/consumers/DatatypeRulesTestLanguageCompositeModelConsumer.java37
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/datatyperules/parser/packrat/consumers/DatatypeRulesTestLanguageDotsConsumer.java77
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/datatyperules/parser/packrat/consumers/DatatypeRulesTestLanguageFractionConsumer.java57
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/datatyperules/parser/packrat/consumers/DatatypeRulesTestLanguageModelConsumer.java186
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/datatyperules/parser/packrat/consumers/DatatypeRulesTestLanguageModelIdConsumer.java35
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/datatyperules/parser/packrat/consumers/DatatypeRulesTestLanguageNestedModelIdConsumer.java35
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/datatyperules/parser/packrat/consumers/DatatypeRulesTestLanguageVectorConsumer.java44
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageAbstractMetamodelDeclarationConsumer.java56
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageAbstractNegatedTokenConsumer.java56
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageAbstractRuleConsumer.java78
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageAbstractTerminalConsumer.java100
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageAbstractTokenConsumer.java131
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageActionConsumer.java147
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageAlternativesConsumer.java80
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageAssignmentConsumer.java77
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageCharacterRangeConsumer.java78
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageCrossReferenceConsumer.java95
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageGeneratedMetamodelConsumer.java105
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageGrammarConsumer.java323
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageGroupConsumer.java71
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageKeywordConsumer.java15
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageLexerRuleConsumer.java174
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageNegatedTokenConsumer.java36
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageParenthesizedElementConsumer.java35
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageParenthesizedTerminalElementConsumer.java35
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageParserRuleConsumer.java220
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageReferencedMetamodelConsumer.java86
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageRuleCallConsumer.java15
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageTerminalAlternativesConsumer.java80
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageTerminalGroupConsumer.java71
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageTerminalRuleConsumer.java133
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageTerminalTokenConsumer.java58
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageTerminalTokenElementConsumer.java122
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageTypeRefConsumer.java77
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageUpToTokenConsumer.java36
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageWildcardConsumer.java15
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/XtextTerminalsTestLanguage.ecore2
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/TerminalRulesTestLanguageANY_OTHERConsumer.java5
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/TerminalRulesTestLanguageIDConsumer.java5
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/TerminalRulesTestLanguageINTConsumer.java5
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/TerminalRulesTestLanguageML_COMMENTConsumer.java5
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/TerminalRulesTestLanguageModelConsumer.java236
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/TerminalRulesTestLanguageSL_COMMENTConsumer.java5
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/TerminalRulesTestLanguageSTRINGConsumer.java5
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/TerminalRulesTestLanguageWSConsumer.java5
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageANY_OTHERConsumer.java5
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageAbstractMetamodelDeclarationConsumer.java56
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageAbstractNegatedTokenConsumer.java56
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageAbstractRuleConsumer.java78
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageAbstractTerminalConsumer.java100
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageAbstractTokenConsumer.java131
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageActionConsumer.java147
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageAlternativesConsumer.java80
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageAssignmentConsumer.java77
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageCharacterRangeConsumer.java78
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageCrossReferenceConsumer.java95
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageGeneratedMetamodelConsumer.java105
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageGrammarConsumer.java323
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageGroupConsumer.java71
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageIDConsumer.java5
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageINTConsumer.java5
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageKeywordConsumer.java15
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageLexerRuleConsumer.java174
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageML_COMMENTConsumer.java5
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageNegatedTokenConsumer.java36
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageParenthesizedElementConsumer.java35
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageParenthesizedTerminalElementConsumer.java35
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageParserRuleConsumer.java244
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageReferencedMetamodelConsumer.java86
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageRuleCallConsumer.java15
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageSL_COMMENTConsumer.java5
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageSTRINGConsumer.java5
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageTerminalAlternativesConsumer.java80
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageTerminalGroupConsumer.java71
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageTerminalRuleConsumer.java133
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageTerminalTokenConsumer.java58
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageTerminalTokenElementConsumer.java122
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageTypeRefConsumer.java77
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageUpToTokenConsumer.java36
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageWSConsumer.java5
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageWildcardConsumer.java15
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/formatter/parser/packrat/consumers/FormatterTestLanguageLineConsumer.java55
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/formatter/parser/packrat/consumers/FormatterTestLanguageRootConsumer.java77
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/formatter/parser/packrat/consumers/FormatterTestLanguageTestIndentationConsumer.java131
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/formatter/parser/packrat/consumers/FormatterTestLanguageTestLinewrapConsumer.java48
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/packrat/consumers/ComplexReconstrTestLanguageAtomConsumer.java15
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/packrat/consumers/ComplexReconstrTestLanguageOpConsumer.java177
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/packrat/consumers/ComplexReconstrTestLanguageParensConsumer.java64
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/packrat/consumers/ComplexReconstrTestLanguageRootConsumer.java56
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/packrat/consumers/ComplexReconstrTestLanguageTermConsumer.java56
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/packrat/consumers/ComplexReconstrTestLanguageTrickyA1Consumer.java15
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/packrat/consumers/ComplexReconstrTestLanguageTrickyAConsumer.java192
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/packrat/consumers/ComplexReconstrTestLanguageTrickyBConsumer.java108
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/packrat/consumers/ComplexReconstrTestLanguageTrickyCConsumer.java162
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/packrat/consumers/ComplexReconstrTestLanguageTrickyDConsumer.java187
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/packrat/consumers/ComplexReconstrTestLanguageTrickyEConsumer.java169
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/packrat/consumers/ComplexReconstrTestLanguageTrickyFConsumer.java159
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/packrat/consumers/ComplexReconstrTestLanguageTrickyG1Consumer.java119
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/packrat/consumers/ComplexReconstrTestLanguageTrickyG2Consumer.java66
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/packrat/consumers/ComplexReconstrTestLanguageTrickyGConsumer.java36
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/packrat/consumers/SimpleReconstrTestLanguageAtomConsumer.java15
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/packrat/consumers/SimpleReconstrTestLanguageBooleanConsumer.java74
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/packrat/consumers/SimpleReconstrTestLanguageManyStringsConsumer.java67
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/packrat/consumers/SimpleReconstrTestLanguageOpConsumer.java71
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/packrat/consumers/SimpleReconstrTestLanguageParensConsumer.java64
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/packrat/consumers/SimpleReconstrTestLanguageRef2Consumer.java48
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/packrat/consumers/SimpleReconstrTestLanguageSpareConsumer.java88
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/packrat/consumers/SimpleReconstrTestLanguageTermConsumer.java192
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/packrat/consumers/SimpleReconstrTestLanguageTwoNumbersConsumer.java98
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/parser/packrat/consumers/SimpleReconstrTestLanguageTypeConsumer.java64
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/transientvalues/parser/packrat/consumers/TransientValuesTestRootConsumer.java99
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/transientvalues/parser/packrat/consumers/TransientValuesTestTestListConsumer.java48
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/transientvalues/parser/packrat/consumers/TransientValuesTestTestOptionalConsumer.java96
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parsetree/transientvalues/parser/packrat/consumers/TransientValuesTestTestRequiredConsumer.java55
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/resource/metamodel/parser/packrat/consumers/MultiValueFeatureTestLanguageStartConsumer.java37
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/ReferenceGrammar.ecore6
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/packrat/consumers/ActionTestLanguageElementConsumer.java47
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/packrat/consumers/ActionTestLanguageItemConsumer.java38
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/packrat/consumers/ActionTestLanguageModelConsumer.java27
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/packrat/consumers/ContentAssistTestLanguageAbstractRuleCallConsumer.java15
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/packrat/consumers/ContentAssistTestLanguageAbstractRuleConsumer.java56
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/packrat/consumers/ContentAssistTestLanguageFirstAbstractRuleChildConsumer.java95
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/packrat/consumers/ContentAssistTestLanguageSecondAbstractRuleChildConsumer.java73
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/packrat/consumers/ContentAssistTestLanguageStartConsumer.java67
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/packrat/consumers/FowlerDslTestLanguageCommandConsumer.java46
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/packrat/consumers/FowlerDslTestLanguageEventConsumer.java75
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/packrat/consumers/FowlerDslTestLanguageStateConsumer.java166
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/packrat/consumers/FowlerDslTestLanguageStatemachineConsumer.java137
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/packrat/consumers/FowlerDslTestLanguageTransitionConsumer.java55
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/packrat/consumers/LexerTestLanguageElementConsumer.java46
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/packrat/consumers/LexerTestLanguageModelConsumer.java27
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/packrat/consumers/LookaheadTestLanguageAltsConsumer.java78
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/packrat/consumers/LookaheadTestLanguageEntryConsumer.java27
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/packrat/consumers/LookaheadTestLanguageLookAhead0Consumer.java36
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/packrat/consumers/LookaheadTestLanguageLookAhead1Consumer.java74
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/packrat/consumers/LookaheadTestLanguageLookAhead2Consumer.java97
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/packrat/consumers/LookaheadTestLanguageLookAhead3Consumer.java64
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/packrat/consumers/LookaheadTestLanguageLookAhead4Consumer.java76
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/packrat/consumers/OptionalEmptyTestLanguageGreetingConsumer.java36
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/packrat/consumers/OptionalEmptyTestLanguageModelConsumer.java25
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/packrat/consumers/PartialParserTestLanguageAbstractChildConsumer.java56
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/packrat/consumers/PartialParserTestLanguageAbstractChildrenConsumer.java76
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/packrat/consumers/PartialParserTestLanguageChildConsumer.java63
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/packrat/consumers/PartialParserTestLanguageChildrenConsumer.java106
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/packrat/consumers/PartialParserTestLanguageContainerConsumer.java150
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/packrat/consumers/PartialParserTestLanguageContentConsumer.java56
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/packrat/consumers/PartialParserTestLanguageFirstConcreteConsumer.java92
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/packrat/consumers/PartialParserTestLanguageNamedConsumer.java15
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/packrat/consumers/PartialParserTestLanguageNestedConsumer.java76
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/packrat/consumers/PartialParserTestLanguageSecondConcreteConsumer.java101
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/packrat/consumers/ReferenceGrammarTestLanguageErwachsenerConsumer.java73
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/packrat/consumers/ReferenceGrammarTestLanguageFamilieConsumer.java175
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/packrat/consumers/ReferenceGrammarTestLanguageFarbeConsumer.java100
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/packrat/consumers/ReferenceGrammarTestLanguageKindConsumer.java73
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/packrat/consumers/ReferenceGrammarTestLanguagePersonConsumer.java56
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/packrat/consumers/ReferenceGrammarTestLanguageSpielplatzConsumer.java249
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/packrat/consumers/ReferenceGrammarTestLanguageSpielzeugConsumer.java73
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/packrat/consumers/SimpleExpressionsTestLanguageAdditionConsumer.java96
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/packrat/consumers/SimpleExpressionsTestLanguageAtomConsumer.java15
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/packrat/consumers/SimpleExpressionsTestLanguageMultiplicationConsumer.java96
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/packrat/consumers/SimpleExpressionsTestLanguageParensConsumer.java35
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/packrat/consumers/SimpleExpressionsTestLanguageSequenceConsumer.java71
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/packrat/consumers/SimpleExpressionsTestLanguageTermConsumer.java56
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/packrat/consumers/TestLanguageAbstractRuleConsumer.java56
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/packrat/consumers/TestLanguageChoiceRuleConsumer.java65
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/packrat/consumers/TestLanguageEntryRuleConsumer.java27
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/packrat/consumers/TestLanguageReducibleRuleConsumer.java78
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/packrat/consumers/TestLanguageTerminalRuleConsumer.java15
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/packrat/consumers/TreeTestLanguageModelConsumer.java27
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/packrat/consumers/TreeTestLanguageNodeConsumer.java113
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/valueconverter/parser/packrat/consumers/Bug250313Ref2Consumer.java48
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/grammarinheritance/parser/packrat/consumers/AbstractTestLanguageIDConsumer.java5
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/grammarinheritance/parser/packrat/consumers/AbstractTestLanguageREALConsumer.java11
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parser/packrat/PerformanceTest.java40
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parser/packrat/PerformanceTestXtextGrammar.java2
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/testlanguages/parser/packrat/consumers/LexerTestLanguageSTRINGConsumer.java9
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/xtext/parser/handwritten/HandwrittenDelimiters.java32
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/xtext/parser/handwritten/HandwrittenParser.java29
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/xtext/parser/handwritten/HandwrittenParserConfiguration.java192
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/xtext/parser/handwritten/HandwrittenParserWithMethodCalls.java29
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/xtext/parser/handwritten/HandwrittenParserWithMethodCallsConfiguration.java192
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/xtext/parser/handwritten/consumers/AbstractMetamodelDeclarationConsumer.java72
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/xtext/parser/handwritten/consumers/AbstractRuleConsumer.java66
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/xtext/parser/handwritten/consumers/GeneratedMetamodelConsumer.java82
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/xtext/parser/handwritten/consumers/GrammarConsumer.java143
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/xtext/parser/handwritten/consumers/LexerRuleConsumer.java102
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/xtext/parser/handwritten/consumers/ParserRuleConsumer.java47
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/xtext/parser/handwritten/consumers/ReferencedMetamodelConsumer.java87
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/xtext/parser/handwritten/consumers/TypeRefConsumer.java77
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/xtext/parser/handwritten/consumers/methodCalls/AbstractMetamodelDeclarationConsumer.java69
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/xtext/parser/handwritten/consumers/methodCalls/AbstractRuleConsumer.java63
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/xtext/parser/handwritten/consumers/methodCalls/GeneratedMetamodelConsumer.java84
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/xtext/parser/handwritten/consumers/methodCalls/GrammarConsumer.java204
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/xtext/parser/handwritten/consumers/methodCalls/LexerRuleConsumer.java113
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/xtext/parser/handwritten/consumers/methodCalls/ParserRuleConsumer.java47
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/xtext/parser/handwritten/consumers/methodCalls/ReferencedMetamodelConsumer.java97
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/xtext/parser/handwritten/consumers/methodCalls/TypeRefConsumer.java92
-rw-r--r--tests/org.eclipse.xtext.ui.core.tests/src-gen/org/eclipse/xtext/ui/core/parser/packrat/consumers/TestLanguageFileConsumer.java27
-rw-r--r--tests/org.eclipse.xtext.ui.core.tests/src-gen/org/eclipse/xtext/ui/core/parser/packrat/consumers/TestLanguageStuffConsumer.java36
247 files changed, 10833 insertions, 7266 deletions
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 9fe584c..1f24cb4 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
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -37,34 +38,41 @@ public final class ReferenceGrammarCustomTypeParserRuleConsumer extends NonTermi
ruleCall$4$Delimiter = ISequenceMatcher.Factory.nullMatcher();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$2()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$2();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0KeywordType());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$3()) {
- marker.rollback();
+ result = consumeAssignment$3();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1AssignmentName());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$2() throws Exception {
+ protected int consumeKeyword$2() throws Exception {
return consumeKeyword(getRule().ele0KeywordType(), null, false, false, getKeyword$2$Delimiter());
}
- protected boolean consumeAssignment$3() throws Exception {
- if (consumeTerminal(idConsumer, "name", false, false, getRule().ele10LexerRuleCallID(), getRuleCall$4$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$3() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, "name", false, false, getRule().ele10LexerRuleCallID(), getRuleCall$4$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
public CustomTypeParserRuleElements getRule() {
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 d999120..03423db 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
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -48,62 +49,76 @@ public final class ReferenceGrammarErwachsenerConsumer extends NonTerminalConsum
ruleCall$10$Delimiter = ISequenceMatcher.Factory.nullMatcher();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$5()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$5();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0000KeywordErwachsener());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$6()) {
- marker.rollback();
+ result = consumeKeyword$6();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0001KeywordLeftParenthesis());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$7()) {
- marker.rollback();
+ result = consumeAssignment$7();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele001AssignmentName());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$9()) {
- marker.rollback();
+ result = consumeAssignment$9();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele01AssignmentAge());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$11()) {
- marker.rollback();
+ result = consumeKeyword$11();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1KeywordRightParenthesis());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$5() throws Exception {
+ protected int consumeKeyword$5() throws Exception {
return consumeKeyword(getRule().ele0000KeywordErwachsener(), null, false, false, getKeyword$5$Delimiter());
}
- protected boolean consumeKeyword$6() throws Exception {
+ protected int consumeKeyword$6() throws Exception {
return consumeKeyword(getRule().ele0001KeywordLeftParenthesis(), null, false, false, getKeyword$6$Delimiter());
}
- protected boolean consumeAssignment$7() throws Exception {
- if (consumeTerminal(idConsumer, "name", false, false, getRule().ele0010LexerRuleCallID(), getRuleCall$8$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$7() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, "name", false, false, getRule().ele0010LexerRuleCallID(), getRuleCall$8$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeAssignment$9() throws Exception {
- if (consumeTerminal(intConsumer, "age", false, false, getRule().ele010LexerRuleCallINT(), getRuleCall$10$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$9() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(intConsumer, "age", false, false, getRule().ele010LexerRuleCallINT(), getRuleCall$10$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeKeyword$11() throws Exception {
+ protected int consumeKeyword$11() throws Exception {
return consumeKeyword(getRule().ele1KeywordRightParenthesis(), null, false, false, getKeyword$11$Delimiter());
}
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 af8d58a..21de35f 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
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -66,124 +67,166 @@ public final class ReferenceGrammarFamilieConsumer extends NonTerminalConsumer {
ruleCall$15$Delimiter = ISequenceMatcher.Factory.nullMatcher();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$8()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$8();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0000000KeywordFamilie());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$9()) {
- marker.rollback();
+ result = consumeKeyword$9();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0000001KeywordLeftParenthesis());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$10()) {
- marker.rollback();
+ result = consumeAssignment$10();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele000001AssignmentName());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$16()) {
- marker.rollback();
+ result = consumeAssignment$16();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00001AssignmentMutter());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$19()) {
- marker.rollback();
+ result = consumeAssignment$19();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0001AssignmentVater());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$22()) {
- marker.rollback();
+ result = consumeAssignment$22();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele001AssignmentKinder());
marker.release();
- return false;
+ return result;
}
- if (!consumeGroup$25()) {
- marker.rollback();
+ result = consumeGroup$25();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele01Group());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$30()) {
- marker.rollback();
+ result = consumeKeyword$30();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1KeywordRightParenthesis());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$8() throws Exception {
+ protected int consumeKeyword$8() throws Exception {
return consumeKeyword(getRule().ele0000000KeywordFamilie(), null, false, false, getKeyword$8$Delimiter());
}
- protected boolean consumeKeyword$9() throws Exception {
+ protected int consumeKeyword$9() throws Exception {
return consumeKeyword(getRule().ele0000001KeywordLeftParenthesis(), null, false, false, getKeyword$9$Delimiter());
}
- protected boolean consumeAssignment$10() throws Exception {
- if (consumeKeyword(getRule().ele000001000KeywordKeyword(), "name", false, false, getKeyword$13$Delimiter()))
- return true;
- if (consumeTerminal(stringConsumer, "name", false, false, getRule().ele000001001LexerRuleCallSTRING(), getRuleCall$14$Delimiter()))
- return true;
- if (consumeTerminal(idConsumer, "name", false, false, getRule().ele00000101LexerRuleCallID(), getRuleCall$15$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$10() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeKeyword(getRule().ele000001000KeywordKeyword(), "name", false, false, getKeyword$13$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ tempResult = consumeTerminal(stringConsumer, "name", false, false, getRule().ele000001001LexerRuleCallSTRING(), getRuleCall$14$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ tempResult = consumeTerminal(idConsumer, "name", false, false, getRule().ele00000101LexerRuleCallID(), getRuleCall$15$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeAssignment$16() throws Exception {
- if (consumeTerminal(idConsumer, null, false, false, getRule().ele000010CrossReferenceEStringErwachsener(), getCrossReference$17$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$16() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, null, false, false, getRule().ele000010CrossReferenceEStringErwachsener(), getCrossReference$17$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeAssignment$19() throws Exception {
- if (consumeTerminal(idConsumer, null, false, false, getRule().ele00010CrossReferenceEStringErwachsener(), getCrossReference$20$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$19() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, null, false, false, getRule().ele00010CrossReferenceEStringErwachsener(), getCrossReference$20$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeAssignment$22() throws Exception {
- if (consumeTerminal(idConsumer, null, true, false, getRule().ele0010CrossReferenceEStringKind(), getCrossReference$23$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$22() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, null, true, false, getRule().ele0010CrossReferenceEStringKind(), getCrossReference$23$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeGroup$25() throws Exception {
- while(doConsumeGroup$25()) {}
- return true;
+ protected int consumeGroup$25() throws Exception {
+ IMarker marker = mark();
+ while(doConsumeGroup$25() == ConsumeResult.SUCCESS) {
+ marker.release();
+ marker = mark();
+ }
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeGroup$25() throws Exception {
+ protected int doConsumeGroup$25() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$26()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$26();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele010KeywordComma());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$27()) {
- marker.rollback();
+ result = consumeAssignment$27();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele011AssignmentKinder());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$26() throws Exception {
+ protected int consumeKeyword$26() throws Exception {
return consumeKeyword(getRule().ele010KeywordComma(), null, false, false, getKeyword$26$Delimiter());
}
- protected boolean consumeAssignment$27() throws Exception {
- if (consumeTerminal(idConsumer, null, true, false, getRule().ele0110CrossReferenceEStringKind(), getCrossReference$28$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$27() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, null, true, false, getRule().ele0110CrossReferenceEStringKind(), getCrossReference$28$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeKeyword$30() throws Exception {
+ protected int consumeKeyword$30() throws Exception {
return consumeKeyword(getRule().ele1KeywordRightParenthesis(), null, false, false, getKeyword$30$Delimiter());
}
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 f1062fa..c765ce1 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
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -41,20 +42,30 @@ public final class ReferenceGrammarFarbeConsumer extends NonTerminalConsumer {
keyword$8$Delimiter = ICharacterClass.Factory.nullClass();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeAssignment$1();
}
- protected boolean consumeAssignment$1() throws Exception {
- if (consumeKeyword(getRule().ele0000KeywordROT(), "wert", false, false, getKeyword$5$Delimiter()))
- return true;
- if (consumeKeyword(getRule().ele0001KeywordBLAU(), "wert", false, false, getKeyword$6$Delimiter()))
- return true;
- if (consumeKeyword(getRule().ele001KeywordGELB(), "wert", false, false, getKeyword$7$Delimiter()))
- return true;
- if (consumeKeyword(getRule().ele01KeywordGRÜN(), "wert", false, false, getKeyword$8$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$1() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeKeyword(getRule().ele0000KeywordROT(), "wert", false, false, getKeyword$5$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ tempResult = consumeKeyword(getRule().ele0001KeywordBLAU(), "wert", false, false, getKeyword$6$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ tempResult = consumeKeyword(getRule().ele001KeywordGELB(), "wert", false, false, getKeyword$7$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ tempResult = consumeKeyword(getRule().ele01KeywordGRÜN(), "wert", false, false, getKeyword$8$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
public FarbeElements getRule() {
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 fe95548..3828353 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
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -48,62 +49,76 @@ public final class ReferenceGrammarKindConsumer extends NonTerminalConsumer {
ruleCall$10$Delimiter = ISequenceMatcher.Factory.nullMatcher();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$5()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$5();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0000KeywordKind());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$6()) {
- marker.rollback();
+ result = consumeKeyword$6();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0001KeywordLeftParenthesis());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$7()) {
- marker.rollback();
+ result = consumeAssignment$7();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele001AssignmentName());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$9()) {
- marker.rollback();
+ result = consumeAssignment$9();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele01AssignmentAge());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$11()) {
- marker.rollback();
+ result = consumeKeyword$11();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1KeywordRightParenthesis());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$5() throws Exception {
+ protected int consumeKeyword$5() throws Exception {
return consumeKeyword(getRule().ele0000KeywordKind(), null, false, false, getKeyword$5$Delimiter());
}
- protected boolean consumeKeyword$6() throws Exception {
+ protected int consumeKeyword$6() throws Exception {
return consumeKeyword(getRule().ele0001KeywordLeftParenthesis(), null, false, false, getKeyword$6$Delimiter());
}
- protected boolean consumeAssignment$7() throws Exception {
- if (consumeTerminal(idConsumer, "name", false, false, getRule().ele0010LexerRuleCallID(), getRuleCall$8$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$7() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, "name", false, false, getRule().ele0010LexerRuleCallID(), getRuleCall$8$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeAssignment$9() throws Exception {
- if (consumeTerminal(intConsumer, "age", false, false, getRule().ele010LexerRuleCallINT(), getRuleCall$10$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$9() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(intConsumer, "age", false, false, getRule().ele010LexerRuleCallINT(), getRuleCall$10$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeKeyword$11() throws Exception {
+ protected int consumeKeyword$11() throws Exception {
return consumeKeyword(getRule().ele1KeywordRightParenthesis(), null, false, false, getKeyword$11$Delimiter());
}
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 c18dc01..5cf86f4 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
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -33,23 +34,60 @@ public final class ReferenceGrammarPersonConsumer extends NonTerminalConsumer {
super(input, markerFactory, tokenAcceptor, hiddenTokenHandler, consumerUtil, hiddenTokens);
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeAlternatives$1();
}
- protected boolean consumeAlternatives$1() throws Exception {
- if (consumeRuleCall$2())
- return true;
- if (consumeRuleCall$3())
- return true;
- return false;
+ protected int consumeAlternatives$1() throws Exception {
+ int result = ConsumeResult.SUCCESS;
+ IMarker bestMarker = mark();
+ IMarker currentMarker;
+ int tempResult;
+ currentMarker = bestMarker.copy();
+ tempResult = consumeRuleCall$2();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ currentMarker = bestMarker.copy();
+ tempResult = consumeRuleCall$3();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ bestMarker.release();
+ return result;
}
- protected boolean consumeRuleCall$2() throws Exception {
+ protected int consumeRuleCall$2() throws Exception {
return consumeNonTerminal(kindConsumer, null, false, false, getRule().ele0ParserRuleCallKind());
}
- protected boolean consumeRuleCall$3() throws Exception {
+ protected int consumeRuleCall$3() throws Exception {
return consumeNonTerminal(erwachsenerConsumer, null, false, false, getRule().ele1ParserRuleCallErwachsener());
}
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 8d2e2bb..cae9137 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
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -58,126 +59,260 @@ public final class ReferenceGrammarSpielplatzConsumer extends NonTerminalConsume
ruleCall$10$Delimiter = ISequenceMatcher.Factory.nullMatcher();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
- doConsumeGroup$1();
- return true;
+ protected int consumeGroup$1() throws Exception {
+ IMarker marker = mark();
+ int result = doConsumeGroup$1();
+ if (result != ConsumeResult.SUCCESS)
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeGroup$1() throws Exception {
+ protected int doConsumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$6()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$6();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00000KeywordSpielplatz());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$7()) {
- marker.rollback();
+ result = consumeAssignment$7();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00001AssignmentGroesse());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$9()) {
- marker.rollback();
+ result = consumeAssignment$9();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0001AssignmentBeschreibung());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$11()) {
- marker.rollback();
+ result = consumeKeyword$11();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele001KeywordLeftCurlyBracket());
marker.release();
- return false;
+ return result;
}
- if (!consumeAlternatives$12()) {
- marker.rollback();
+ result = consumeAlternatives$12();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele01Alternatives());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$26()) {
- marker.rollback();
+ result = consumeKeyword$26();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1KeywordRightCurlyBracket());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$6() throws Exception {
+ protected int consumeKeyword$6() throws Exception {
return consumeKeyword(getRule().ele00000KeywordSpielplatz(), null, false, false, getKeyword$6$Delimiter());
}
- protected boolean consumeAssignment$7() throws Exception {
- if (consumeTerminal(intConsumer, "groesse", false, false, getRule().ele000010LexerRuleCallINT(), getRuleCall$8$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$7() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(intConsumer, "groesse", false, false, getRule().ele000010LexerRuleCallINT(), getRuleCall$8$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeAssignment$9() throws Exception {
- doConsumeAssignment$9();
- return true;
+ protected int consumeAssignment$9() throws Exception {
+ IMarker marker = mark();
+ int result = doConsumeAssignment$9();
+ if (result != ConsumeResult.SUCCESS)
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeAssignment$9() throws Exception {
- if (consumeTerminal(stringConsumer, "beschreibung", false, false, getRule().ele00010LexerRuleCallSTRING(), getRuleCall$10$Delimiter()))
- return true;
- return false;
+ protected int doConsumeAssignment$9() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(stringConsumer, "beschreibung", false, false, getRule().ele00010LexerRuleCallSTRING(), getRuleCall$10$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeKeyword$11() throws Exception {
+ protected int consumeKeyword$11() throws Exception {
return consumeKeyword(getRule().ele001KeywordLeftCurlyBracket(), null, false, false, getKeyword$11$Delimiter());
}
- protected boolean consumeAlternatives$12() throws Exception {
- while(doConsumeAlternatives$12()) {}
- return true;
+ protected int consumeAlternatives$12() throws Exception {
+ IMarker marker = mark();
+ while(doConsumeAlternatives$12() == ConsumeResult.SUCCESS) {
+ marker.release();
+ marker = mark();
+ }
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeAlternatives$12() throws Exception {
- if (consumeAssignment$16())
- return true;
- if (consumeAssignment$18())
- return true;
- if (consumeAssignment$20())
- return true;
- if (consumeAssignment$22())
- return true;
- if (consumeAssignment$24())
- return true;
- return false;
+ protected int doConsumeAlternatives$12() throws Exception {
+ int result = ConsumeResult.SUCCESS;
+ IMarker bestMarker = mark();
+ IMarker currentMarker;
+ int tempResult;
+ currentMarker = bestMarker.copy();
+ tempResult = consumeAssignment$16();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ currentMarker = bestMarker.copy();
+ tempResult = consumeAssignment$18();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ currentMarker = bestMarker.copy();
+ tempResult = consumeAssignment$20();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ currentMarker = bestMarker.copy();
+ tempResult = consumeAssignment$22();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ currentMarker = bestMarker.copy();
+ tempResult = consumeAssignment$24();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ bestMarker.release();
+ return result;
}
- protected boolean consumeAssignment$16() throws Exception {
- if (consumeNonTerminal(kindConsumer, "kinder", true, false, getRule().ele0100000ParserRuleCallKind()))
- return true;
- return false;
+ protected int consumeAssignment$16() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(kindConsumer, "kinder", true, false, getRule().ele0100000ParserRuleCallKind());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeAssignment$18() throws Exception {
- if (consumeNonTerminal(erwachsenerConsumer, "erzieher", true, false, getRule().ele0100010ParserRuleCallErwachsener()))
- return true;
- return false;
+ protected int consumeAssignment$18() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(erwachsenerConsumer, "erzieher", true, false, getRule().ele0100010ParserRuleCallErwachsener());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeAssignment$20() throws Exception {
- if (consumeNonTerminal(spielzeugConsumer, "spielzeuge", true, false, getRule().ele010010ParserRuleCallSpielzeug()))
- return true;
- return false;
+ protected int consumeAssignment$20() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(spielzeugConsumer, "spielzeuge", true, false, getRule().ele010010ParserRuleCallSpielzeug());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeAssignment$22() throws Exception {
- if (consumeNonTerminal(familieConsumer, "familie", true, false, getRule().ele01010ParserRuleCallFamilie()))
- return true;
- return false;
+ protected int consumeAssignment$22() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(familieConsumer, "familie", true, false, getRule().ele01010ParserRuleCallFamilie());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeAssignment$24() throws Exception {
- if (consumeNonTerminal(customTypeParserRuleConsumer, "types", true, false, getRule().ele0110ParserRuleCallCustomTypeParserRule()))
- return true;
- return false;
+ protected int consumeAssignment$24() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(customTypeParserRuleConsumer, "types", true, false, getRule().ele0110ParserRuleCallCustomTypeParserRule());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeKeyword$26() throws Exception {
+ protected int consumeKeyword$26() throws Exception {
return consumeKeyword(getRule().ele1KeywordRightCurlyBracket(), null, false, false, getKeyword$26$Delimiter());
}
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 d29dc71..0fbf107 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
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -45,62 +46,76 @@ public final class ReferenceGrammarSpielzeugConsumer extends NonTerminalConsumer
ruleCall$8$Delimiter = ISequenceMatcher.Factory.nullMatcher();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$5()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$5();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0000KeywordSpielzeug());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$6()) {
- marker.rollback();
+ result = consumeKeyword$6();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0001KeywordLeftParenthesis());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$7()) {
- marker.rollback();
+ result = consumeAssignment$7();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele001AssignmentName());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$9()) {
- marker.rollback();
+ result = consumeAssignment$9();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele01AssignmentFarbe());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$11()) {
- marker.rollback();
+ result = consumeKeyword$11();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1KeywordRightParenthesis());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$5() throws Exception {
+ protected int consumeKeyword$5() throws Exception {
return consumeKeyword(getRule().ele0000KeywordSpielzeug(), null, false, false, getKeyword$5$Delimiter());
}
- protected boolean consumeKeyword$6() throws Exception {
+ protected int consumeKeyword$6() throws Exception {
return consumeKeyword(getRule().ele0001KeywordLeftParenthesis(), null, false, false, getKeyword$6$Delimiter());
}
- protected boolean consumeAssignment$7() throws Exception {
- if (consumeTerminal(idConsumer, "name", false, false, getRule().ele0010LexerRuleCallID(), getRuleCall$8$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$7() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, "name", false, false, getRule().ele0010LexerRuleCallID(), getRuleCall$8$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeAssignment$9() throws Exception {
- if (consumeNonTerminal(farbeConsumer, "farbe", false, false, getRule().ele010ParserRuleCallFarbe()))
- return true;
- return false;
+ protected int consumeAssignment$9() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(farbeConsumer, "farbe", false, false, getRule().ele010ParserRuleCallFarbe());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeKeyword$11() throws Exception {
+ protected int consumeKeyword$11() throws Exception {
return consumeKeyword(getRule().ele1KeywordRightParenthesis(), null, false, false, getKeyword$11$Delimiter());
}
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 6d74b1d..9f2974c 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/consumers/DomainmodelAttributeConsumer.java b/examples/org.eclipse.xtext.example.domainmodel/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/DomainmodelAttributeConsumer.java
index e6af455..7414330 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
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -42,54 +43,67 @@ public final class DomainmodelAttributeConsumer extends NonTerminalConsumer {
ruleCall$6$Delimiter = ISequenceMatcher.Factory.nullMatcher();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$4()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$4();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele000KeywordAttr());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$5()) {
- marker.rollback();
+ result = consumeAssignment$5();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele001AssignmentName());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$7()) {
- marker.rollback();
+ result = consumeKeyword$7();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele01KeywordColon());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$8()) {
- marker.rollback();
+ result = consumeAssignment$8();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1AssignmentType());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$4() throws Exception {
+ protected int consumeKeyword$4() throws Exception {
return consumeKeyword(getRule().ele000KeywordAttr(), null, false, false, getKeyword$4$Delimiter());
}
- protected boolean consumeAssignment$5() throws Exception {
- if (consumeTerminal(idConsumer, "name", false, false, getRule().ele0010LexerRuleCallID(), getRuleCall$6$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$5() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, "name", false, false, getRule().ele0010LexerRuleCallID(), getRuleCall$6$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeKeyword$7() throws Exception {
+ protected int consumeKeyword$7() throws Exception {
return consumeKeyword(getRule().ele01KeywordColon(), null, false, false, getKeyword$7$Delimiter());
}
- protected boolean consumeAssignment$8() throws Exception {
- if (consumeNonTerminal(typeRefConsumer, "type", false, false, getRule().ele10ParserRuleCallTypeRef()))
- return true;
- return false;
+ protected int consumeAssignment$8() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(typeRefConsumer, "type", false, false, getRule().ele10ParserRuleCallTypeRef());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
public AttributeElements getRule() {
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 8576696..d4e087c 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
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -37,34 +38,41 @@ public final class DomainmodelDataTypeConsumer extends NonTerminalConsumer {
ruleCall$4$Delimiter = ISequenceMatcher.Factory.nullMatcher();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$2()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$2();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0KeywordDatatype());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$3()) {
- marker.rollback();
+ result = consumeAssignment$3();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1AssignmentName());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$2() throws Exception {
+ protected int consumeKeyword$2() throws Exception {
return consumeKeyword(getRule().ele0KeywordDatatype(), null, false, false, getKeyword$2$Delimiter());
}
- protected boolean consumeAssignment$3() throws Exception {
- if (consumeTerminal(idConsumer, "name", false, false, getRule().ele10LexerRuleCallID(), getRuleCall$4$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$3() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, "name", false, false, getRule().ele10LexerRuleCallID(), getRuleCall$4$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
public DataTypeElements getRule() {
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 0ec7dac..dd455cb 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
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -51,103 +52,135 @@ public final class DomainmodelEntityConsumer extends NonTerminalConsumer {
ruleCall$8$Delimiter = ISequenceMatcher.Factory.nullMatcher();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$6()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$6();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00000KeywordEntity());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$7()) {
- marker.rollback();
+ result = consumeAssignment$7();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00001AssignmentName());
marker.release();
- return false;
+ return result;
}
- if (!consumeGroup$9()) {
- marker.rollback();
+ result = consumeGroup$9();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0001Group());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$14()) {
- marker.rollback();
+ result = consumeKeyword$14();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele001KeywordLeftCurlyBracket());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$15()) {
- marker.rollback();
+ result = consumeAssignment$15();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele01AssignmentFeatures());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$17()) {
- marker.rollback();
+ result = consumeKeyword$17();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1KeywordRightCurlyBracket());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$6() throws Exception {
+ protected int consumeKeyword$6() throws Exception {
return consumeKeyword(getRule().ele00000KeywordEntity(), null, false, false, getKeyword$6$Delimiter());
}
- protected boolean consumeAssignment$7() throws Exception {
- if (consumeTerminal(idConsumer, "name", false, false, getRule().ele000010LexerRuleCallID(), getRuleCall$8$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$7() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, "name", false, false, getRule().ele000010LexerRuleCallID(), getRuleCall$8$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeGroup$9() throws Exception {
- doConsumeGroup$9();
- return true;
+ protected int consumeGroup$9() throws Exception {
+ IMarker marker = mark();
+ int result = doConsumeGroup$9();
+ if (result != ConsumeResult.SUCCESS)
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeGroup$9() throws Exception {
+ protected int doConsumeGroup$9() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$10()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$10();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00010KeywordExtends());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$11()) {
- marker.rollback();
+ result = consumeAssignment$11();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00011AssignmentSuperType());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$10() throws Exception {
+ protected int consumeKeyword$10() throws Exception {
return consumeKeyword(getRule().ele00010KeywordExtends(), null, false, false, getKeyword$10$Delimiter());
}
- protected boolean consumeAssignment$11() throws Exception {
- if (consumeTerminal(idConsumer, null, false, false, getRule().ele000110CrossReferenceEStringEntity(), getCrossReference$12$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$11() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, null, false, false, getRule().ele000110CrossReferenceEStringEntity(), getCrossReference$12$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeKeyword$14() throws Exception {
+ protected int consumeKeyword$14() throws Exception {
return consumeKeyword(getRule().ele001KeywordLeftCurlyBracket(), null, false, false, getKeyword$14$Delimiter());
}
- protected boolean consumeAssignment$15() throws Exception {
- while(doConsumeAssignment$15()) {}
- return true;
+ protected int consumeAssignment$15() throws Exception {
+ IMarker marker = mark();
+ while(doConsumeAssignment$15() == ConsumeResult.SUCCESS) {
+ marker.release();
+ marker = mark();
+ }
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeAssignment$15() throws Exception {
- if (consumeNonTerminal(featureConsumer, "features", true, false, getRule().ele010ParserRuleCallFeature()))
- return true;
- return false;
+ protected int doConsumeAssignment$15() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(featureConsumer, "features", true, false, getRule().ele010ParserRuleCallFeature());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeKeyword$17() throws Exception {
+ protected int consumeKeyword$17() throws Exception {
return consumeKeyword(getRule().ele1KeywordRightCurlyBracket(), null, false, false, getKeyword$17$Delimiter());
}
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 05ac59e..ebcda64 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
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -33,23 +34,60 @@ public final class DomainmodelFeatureConsumer extends NonTerminalConsumer {
super(input, markerFactory, tokenAcceptor, hiddenTokenHandler, consumerUtil, hiddenTokens);
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeAlternatives$1();
}
- protected boolean consumeAlternatives$1() throws Exception {
- if (consumeRuleCall$2())
- return true;
- if (consumeRuleCall$3())
- return true;
- return false;
+ protected int consumeAlternatives$1() throws Exception {
+ int result = ConsumeResult.SUCCESS;
+ IMarker bestMarker = mark();
+ IMarker currentMarker;
+ int tempResult;
+ currentMarker = bestMarker.copy();
+ tempResult = consumeRuleCall$2();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ currentMarker = bestMarker.copy();
+ tempResult = consumeRuleCall$3();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ bestMarker.release();
+ return result;
}
- protected boolean consumeRuleCall$2() throws Exception {
+ protected int consumeRuleCall$2() throws Exception {
return consumeNonTerminal(structuralFeatureConsumer, null, false, false, getRule().ele0ParserRuleCallStructuralFeature());
}
- protected boolean consumeRuleCall$3() throws Exception {
+ protected int consumeRuleCall$3() throws Exception {
return consumeNonTerminal(operationConsumer, null, false, false, getRule().ele1ParserRuleCallOperation());
}
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 c2ecafe..243ae81 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
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -33,46 +34,69 @@ public final class DomainmodelFileConsumer extends NonTerminalConsumer {
super(input, markerFactory, tokenAcceptor, hiddenTokenHandler, consumerUtil, hiddenTokens);
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeAssignment$2()) {
- marker.rollback();
+ int result;
+ result = consumeAssignment$2();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0AssignmentImports());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$4()) {
- marker.rollback();
+ result = consumeAssignment$4();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1AssignmentNamedElements());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeAssignment$2() throws Exception {
- while(doConsumeAssignment$2()) {}
- return true;
+ protected int consumeAssignment$2() throws Exception {
+ IMarker marker = mark();
+ while(doConsumeAssignment$2() == ConsumeResult.SUCCESS) {
+ marker.release();
+ marker = mark();
+ }
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeAssignment$2() throws Exception {
- if (consumeNonTerminal(importConsumer, "imports", true, false, getRule().ele00ParserRuleCallImport()))
- return true;
- return false;
+ protected int doConsumeAssignment$2() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(importConsumer, "imports", true, false, getRule().ele00ParserRuleCallImport());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeAssignment$4() throws Exception {
- while(doConsumeAssignment$4()) {}
- return true;
+ protected int consumeAssignment$4() throws Exception {
+ IMarker marker = mark();
+ while(doConsumeAssignment$4() == ConsumeResult.SUCCESS) {
+ marker.release();
+ marker = mark();
+ }
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeAssignment$4() throws Exception {
- if (consumeNonTerminal(namedElementConsumer, "namedElements", true, false, getRule().ele10ParserRuleCallNamedElement()))
- return true;
- return false;
+ protected int doConsumeAssignment$4() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(namedElementConsumer, "namedElements", true, false, getRule().ele10ParserRuleCallNamedElement());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
public FileElements getRule() {
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 8f7ec03..aaaa3a9 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
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -37,34 +38,41 @@ public final class DomainmodelImportConsumer extends NonTerminalConsumer {
ruleCall$4$Delimiter = ISequenceMatcher.Factory.nullMatcher();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$2()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$2();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0KeywordImport());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$3()) {
- marker.rollback();
+ result = consumeAssignment$3();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1AssignmentImportURI());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$2() throws Exception {
+ protected int consumeKeyword$2() throws Exception {
return consumeKeyword(getRule().ele0KeywordImport(), null, false, false, getKeyword$2$Delimiter());
}
- protected boolean consumeAssignment$3() throws Exception {
- if (consumeTerminal(stringConsumer, "importURI", false, false, getRule().ele10LexerRuleCallSTRING(), getRuleCall$4$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$3() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(stringConsumer, "importURI", false, false, getRule().ele10LexerRuleCallSTRING(), getRuleCall$4$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
public ImportElements getRule() {
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 e84b271..0b59118 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
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -33,23 +34,60 @@ public final class DomainmodelNamedElementConsumer extends NonTerminalConsumer {
super(input, markerFactory, tokenAcceptor, hiddenTokenHandler, consumerUtil, hiddenTokens);
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeAlternatives$1();
}
- protected boolean consumeAlternatives$1() throws Exception {
- if (consumeRuleCall$2())
- return true;
- if (consumeRuleCall$3())
- return true;
- return false;
+ protected int consumeAlternatives$1() throws Exception {
+ int result = ConsumeResult.SUCCESS;
+ IMarker bestMarker = mark();
+ IMarker currentMarker;
+ int tempResult;
+ currentMarker = bestMarker.copy();
+ tempResult = consumeRuleCall$2();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ currentMarker = bestMarker.copy();
+ tempResult = consumeRuleCall$3();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ bestMarker.release();
+ return result;
}
- protected boolean consumeRuleCall$2() throws Exception {
+ protected int consumeRuleCall$2() throws Exception {
return consumeNonTerminal(packageConsumer, null, false, false, getRule().ele0ParserRuleCallPackage());
}
- protected boolean consumeRuleCall$3() throws Exception {
+ protected int consumeRuleCall$3() throws Exception {
return consumeNonTerminal(typeConsumer, null, false, false, getRule().ele1ParserRuleCallType());
}
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 c65589e..c6a6f2e 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
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -53,135 +54,175 @@ public final class DomainmodelOperationConsumer extends NonTerminalConsumer {
ruleCall$9$Delimiter = ISequenceMatcher.Factory.nullMatcher();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$7()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$7();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele000000KeywordOp());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$8()) {
- marker.rollback();
+ result = consumeAssignment$8();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele000001AssignmentName());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$10()) {
- marker.rollback();
+ result = consumeKeyword$10();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00001KeywordLeftParenthesis());
marker.release();
- return false;
+ return result;
}
- if (!consumeGroup$11()) {
- marker.rollback();
+ result = consumeGroup$11();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0001Group());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$18()) {
- marker.rollback();
+ result = consumeKeyword$18();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele001KeywordRightParenthesis());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$19()) {
- marker.rollback();
+ result = consumeKeyword$19();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele01KeywordColon());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$20()) {
- marker.rollback();
+ result = consumeAssignment$20();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1AssignmentType());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$7() throws Exception {
+ protected int consumeKeyword$7() throws Exception {
return consumeKeyword(getRule().ele000000KeywordOp(), null, false, false, getKeyword$7$Delimiter());
}
- protected boolean consumeAssignment$8() throws Exception {
- if (consumeTerminal(idConsumer, "name", false, false, getRule().ele0000010LexerRuleCallID(), getRuleCall$9$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$8() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, "name", false, false, getRule().ele0000010LexerRuleCallID(), getRuleCall$9$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeKeyword$10() throws Exception {
+ protected int consumeKeyword$10() throws Exception {
return consumeKeyword(getRule().ele00001KeywordLeftParenthesis(), null, false, false, getKeyword$10$Delimiter());
}
- protected boolean consumeGroup$11() throws Exception {
- doConsumeGroup$11();
- return true;
+ protected int consumeGroup$11() throws Exception {
+ IMarker marker = mark();
+ int result = doConsumeGroup$11();
+ if (result != ConsumeResult.SUCCESS)
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeGroup$11() throws Exception {
+ protected int doConsumeGroup$11() throws Exception {
final IMarker marker = mark();
- if (!consumeAssignment$12()) {
- marker.rollback();
+ int result;
+ result = consumeAssignment$12();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00010AssignmentParams());
marker.release();
- return false;
+ return result;
}
- if (!consumeGroup$14()) {
- marker.rollback();
+ result = consumeGroup$14();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00011Group());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeAssignment$12() throws Exception {
- if (consumeNonTerminal(parameterConsumer, "params", true, false, getRule().ele000100ParserRuleCallParameter()))
- return true;
- return false;
+ protected int consumeAssignment$12() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(parameterConsumer, "params", true, false, getRule().ele000100ParserRuleCallParameter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeGroup$14() throws Exception {
- while(doConsumeGroup$14()) {}
- return true;
+ protected int consumeGroup$14() throws Exception {
+ IMarker marker = mark();
+ while(doConsumeGroup$14() == ConsumeResult.SUCCESS) {
+ marker.release();
+ marker = mark();
+ }
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeGroup$14() throws Exception {
+ protected int doConsumeGroup$14() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$15()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$15();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele000110KeywordComma());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$16()) {
- marker.rollback();
+ result = consumeAssignment$16();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele000111AssignmentParams());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$15() throws Exception {
+ protected int consumeKeyword$15() throws Exception {
return consumeKeyword(getRule().ele000110KeywordComma(), null, false, false, getKeyword$15$Delimiter());
}
- protected boolean consumeAssignment$16() throws Exception {
- if (consumeNonTerminal(parameterConsumer, "params", true, false, getRule().ele0001110ParserRuleCallParameter()))
- return true;
- return false;
+ protected int consumeAssignment$16() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(parameterConsumer, "params", true, false, getRule().ele0001110ParserRuleCallParameter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeKeyword$18() throws Exception {
+ protected int consumeKeyword$18() throws Exception {
return consumeKeyword(getRule().ele001KeywordRightParenthesis(), null, false, false, getKeyword$18$Delimiter());
}
- protected boolean consumeKeyword$19() throws Exception {
+ protected int consumeKeyword$19() throws Exception {
return consumeKeyword(getRule().ele01KeywordColon(), null, false, false, getKeyword$19$Delimiter());
}
- protected boolean consumeAssignment$20() throws Exception {
- if (consumeNonTerminal(typeRefConsumer, "type", false, false, getRule().ele10ParserRuleCallTypeRef()))
- return true;
- return false;
+ protected int consumeAssignment$20() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(typeRefConsumer, "type", false, false, getRule().ele10ParserRuleCallTypeRef());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
public OperationElements getRule() {
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 05c1456..7a73853 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
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -42,67 +43,87 @@ public final class DomainmodelPackageConsumer extends NonTerminalConsumer {
keyword$11$Delimiter = ICharacterClass.Factory.nullClass();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$5()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$5();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0000KeywordPackage());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$6()) {
- marker.rollback();
+ result = consumeAssignment$6();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0001AssignmentName());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$8()) {
- marker.rollback();
+ result = consumeKeyword$8();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele001KeywordLeftCurlyBracket());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$9()) {
- marker.rollback();
+ result = consumeAssignment$9();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele01AssignmentNamedElements());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$11()) {
- marker.rollback();
+ result = consumeKeyword$11();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1KeywordRightCurlyBracket());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$5() throws Exception {
+ protected int consumeKeyword$5() throws Exception {
return consumeKeyword(getRule().ele0000KeywordPackage(), null, false, false, getKeyword$5$Delimiter());
}
- protected boolean consumeAssignment$6() throws Exception {
- if (consumeNonTerminal(qualifiedNameConsumer, "name", false, true, getRule().ele00010ParserRuleCallQualifiedName()))
- return true;
- return false;
+ protected int consumeAssignment$6() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(qualifiedNameConsumer, "name", false, true, getRule().ele00010ParserRuleCallQualifiedName());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeKeyword$8() throws Exception {
+ protected int consumeKeyword$8() throws Exception {
return consumeKeyword(getRule().ele001KeywordLeftCurlyBracket(), null, false, false, getKeyword$8$Delimiter());
}
- protected boolean consumeAssignment$9() throws Exception {
- while(doConsumeAssignment$9()) {}
- return true;
+ protected int consumeAssignment$9() throws Exception {
+ IMarker marker = mark();
+ while(doConsumeAssignment$9() == ConsumeResult.SUCCESS) {
+ marker.release();
+ marker = mark();
+ }
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeAssignment$9() throws Exception {
- if (consumeNonTerminal(namedElementConsumer, "namedElements", true, false, getRule().ele010ParserRuleCallNamedElement()))
- return true;
- return false;
+ protected int doConsumeAssignment$9() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(namedElementConsumer, "namedElements", true, false, getRule().ele010ParserRuleCallNamedElement());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeKeyword$11() throws Exception {
+ protected int consumeKeyword$11() throws Exception {
return consumeKeyword(getRule().ele1KeywordRightCurlyBracket(), null, false, false, getKeyword$11$Delimiter());
}
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 ff551ee..8cc5246 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
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -36,36 +37,47 @@ public final class DomainmodelParameterConsumer extends NonTerminalConsumer {
ruleCall$3$Delimiter = ISequenceMatcher.Factory.nullMatcher();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeAssignment$2()) {
- marker.rollback();
+ int result;
+ result = consumeAssignment$2();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0AssignmentName());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$4()) {
- marker.rollback();
+ result = consumeAssignment$4();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1AssignmentType());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeAssignment$2() throws Exception {
- if (consumeTerminal(idConsumer, "name", false, false, getRule().ele00LexerRuleCallID(), getRuleCall$3$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$2() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, "name", false, false, getRule().ele00LexerRuleCallID(), getRuleCall$3$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeAssignment$4() throws Exception {
- if (consumeNonTerminal(typeRefConsumer, "type", false, false, getRule().ele10ParserRuleCallTypeRef()))
- return true;
- return false;
+ protected int consumeAssignment$4() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(typeRefConsumer, "type", false, false, getRule().ele10ParserRuleCallTypeRef());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
public ParameterElements getRule() {
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 44aba5c..f76bdb0 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
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -40,56 +41,68 @@ public final class DomainmodelQualifiedNameConsumer extends NonTerminalConsumer
ruleCall$5$Delimiter = ISequenceMatcher.Factory.nullMatcher();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeRuleCall$2()) {
- marker.rollback();
+ int result;
+ result = consumeRuleCall$2();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0LexerRuleCallID());
marker.release();
- return false;
+ return result;
}
- if (!consumeGroup$3()) {
- marker.rollback();
+ result = consumeGroup$3();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1Group());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeRuleCall$2() throws Exception {
+ protected int consumeRuleCall$2() throws Exception {
return consumeTerminal(idConsumer, null, false, false, getRule().ele0LexerRuleCallID(), getRuleCall$2$Delimiter());
}
- protected boolean consumeGroup$3() throws Exception {
- while(doConsumeGroup$3()) {}
- return true;
+ protected int consumeGroup$3() throws Exception {
+ IMarker marker = mark();
+ while(doConsumeGroup$3() == ConsumeResult.SUCCESS) {
+ marker.release();
+ marker = mark();
+ }
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeGroup$3() throws Exception {
+ protected int doConsumeGroup$3() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$4()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$4();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele10KeywordFullStop());
marker.release();
- return false;
+ return result;
}
- if (!consumeRuleCall$5()) {
- marker.rollback();
+ result = consumeRuleCall$5();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele11LexerRuleCallID());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$4() throws Exception {
+ protected int consumeKeyword$4() throws Exception {
return consumeKeyword(getRule().ele10KeywordFullStop(), null, false, false, getKeyword$4$Delimiter());
}
- protected boolean consumeRuleCall$5() throws Exception {
+ protected int consumeRuleCall$5() throws Exception {
return consumeTerminal(idConsumer, null, false, false, getRule().ele11LexerRuleCallID(), getRuleCall$5$Delimiter());
}
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 2cb3eb3..72cf20e 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
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -48,90 +49,115 @@ public final class DomainmodelReferenceConsumer extends NonTerminalConsumer {
ruleCall$7$Delimiter = ISequenceMatcher.Factory.nullMatcher();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$5()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$5();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0000KeywordRef());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$6()) {
- marker.rollback();
+ result = consumeAssignment$6();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0001AssignmentName());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$8()) {
- marker.rollback();
+ result = consumeKeyword$8();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele001KeywordColon());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$9()) {
- marker.rollback();
+ result = consumeAssignment$9();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele01AssignmentType());
marker.release();
- return false;
+ return result;
}
- if (!consumeGroup$11()) {
- marker.rollback();
+ result = consumeGroup$11();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1Group());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$5() throws Exception {
+ protected int consumeKeyword$5() throws Exception {
return consumeKeyword(getRule().ele0000KeywordRef(), null, false, false, getKeyword$5$Delimiter());
}
- protected boolean consumeAssignment$6() throws Exception {
- if (consumeTerminal(idConsumer, "name", false, false, getRule().ele00010LexerRuleCallID(), getRuleCall$7$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$6() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, "name", false, false, getRule().ele00010LexerRuleCallID(), getRuleCall$7$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeKeyword$8() throws Exception {
+ protected int consumeKeyword$8() throws Exception {
return consumeKeyword(getRule().ele001KeywordColon(), null, false, false, getKeyword$8$Delimiter());
}
- protected boolean consumeAssignment$9() throws Exception {
- if (consumeNonTerminal(typeRefConsumer, "type", false, false, getRule().ele010ParserRuleCallTypeRef()))
- return true;
- return false;
+ protected int consumeAssignment$9() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(typeRefConsumer, "type", false, false, getRule().ele010ParserRuleCallTypeRef());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeGroup$11() throws Exception {
- doConsumeGroup$11();
- return true;
+ protected int consumeGroup$11() throws Exception {
+ IMarker marker = mark();
+ int result = doConsumeGroup$11();
+ if (result != ConsumeResult.SUCCESS)
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeGroup$11() throws Exception {
+ protected int doConsumeGroup$11() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$12()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$12();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele10KeywordOpposite());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$13()) {
- marker.rollback();
+ result = consumeAssignment$13();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele11AssignmentOpposite());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$12() throws Exception {
+ protected int consumeKeyword$12() throws Exception {
return consumeKeyword(getRule().ele10KeywordOpposite(), null, false, false, getKeyword$12$Delimiter());
}
- protected boolean consumeAssignment$13() throws Exception {
- if (consumeTerminal(idConsumer, null, false, false, getRule().ele110CrossReferenceEStringReference(), getCrossReference$14$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$13() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, null, false, false, getRule().ele110CrossReferenceEStringReference(), getCrossReference$14$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
public ReferenceElements getRule() {
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 0324f02..045d261 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
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -33,23 +34,60 @@ public final class DomainmodelStructuralFeatureConsumer extends NonTerminalConsu
super(input, markerFactory, tokenAcceptor, hiddenTokenHandler, consumerUtil, hiddenTokens);
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeAlternatives$1();
}
- protected boolean consumeAlternatives$1() throws Exception {
- if (consumeRuleCall$2())
- return true;
- if (consumeRuleCall$3())
- return true;
- return false;
+ protected int consumeAlternatives$1() throws Exception {
+ int result = ConsumeResult.SUCCESS;
+ IMarker bestMarker = mark();
+ IMarker currentMarker;
+ int tempResult;
+ currentMarker = bestMarker.copy();
+ tempResult = consumeRuleCall$2();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ currentMarker = bestMarker.copy();
+ tempResult = consumeRuleCall$3();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ bestMarker.release();
+ return result;
}
- protected boolean consumeRuleCall$2() throws Exception {
+ protected int consumeRuleCall$2() throws Exception {
return consumeNonTerminal(attributeConsumer, null, false, false, getRule().ele0ParserRuleCallAttribute());
}
- protected boolean consumeRuleCall$3() throws Exception {
+ protected int consumeRuleCall$3() throws Exception {
return consumeNonTerminal(referenceConsumer, null, false, false, getRule().ele1ParserRuleCallReference());
}
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 d6f9793..e55d4ef 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
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -33,23 +34,60 @@ public final class DomainmodelTypeConsumer extends NonTerminalConsumer {
super(input, markerFactory, tokenAcceptor, hiddenTokenHandler, consumerUtil, hiddenTokens);
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeAlternatives$1();
}
- protected boolean consumeAlternatives$1() throws Exception {
- if (consumeRuleCall$2())
- return true;
- if (consumeRuleCall$3())
- return true;
- return false;
+ protected int consumeAlternatives$1() throws Exception {
+ int result = ConsumeResult.SUCCESS;
+ IMarker bestMarker = mark();
+ IMarker currentMarker;
+ int tempResult;
+ currentMarker = bestMarker.copy();
+ tempResult = consumeRuleCall$2();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ currentMarker = bestMarker.copy();
+ tempResult = consumeRuleCall$3();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ bestMarker.release();
+ return result;
}
- protected boolean consumeRuleCall$2() throws Exception {
+ protected int consumeRuleCall$2() throws Exception {
return consumeNonTerminal(entityConsumer, null, false, false, getRule().ele0ParserRuleCallEntity());
}
- protected boolean consumeRuleCall$3() throws Exception {
+ protected int consumeRuleCall$3() throws Exception {
return consumeNonTerminal(dataTypeConsumer, null, false, false, getRule().ele1ParserRuleCallDataType());
}
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 4b59f8f..76b5b6d 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
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -34,14 +35,18 @@ public final class DomainmodelTypeRefConsumer extends NonTerminalConsumer {
crossReference$2$Delimiter = ISequenceMatcher.Factory.nullMatcher();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeAssignment$1();
}
- protected boolean consumeAssignment$1() throws Exception {
- if (consumeTerminal(idConsumer, null, false, false, getRule().ele0CrossReferenceEStringType(), getCrossReference$2$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$1() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, null, false, false, getRule().ele0CrossReferenceEStringType(), getCrossReference$2$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
public TypeRefElements getRule() {
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 7ecb244..7f920fd 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
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -33,23 +34,60 @@ public final class DomainmodelTypedElementConsumer extends NonTerminalConsumer {
super(input, markerFactory, tokenAcceptor, hiddenTokenHandler, consumerUtil, hiddenTokens);
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeAlternatives$1();
}
- protected boolean consumeAlternatives$1() throws Exception {
- if (consumeRuleCall$2())
- return true;
- if (consumeRuleCall$3())
- return true;
- return false;
+ protected int consumeAlternatives$1() throws Exception {
+ int result = ConsumeResult.SUCCESS;
+ IMarker bestMarker = mark();
+ IMarker currentMarker;
+ int tempResult;
+ currentMarker = bestMarker.copy();
+ tempResult = consumeRuleCall$2();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ currentMarker = bestMarker.copy();
+ tempResult = consumeRuleCall$3();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ bestMarker.release();
+ return result;
}
- protected boolean consumeRuleCall$2() throws Exception {
+ protected int consumeRuleCall$2() throws Exception {
return consumeNonTerminal(featureConsumer, null, false, false, getRule().ele0ParserRuleCallFeature());
}
- protected boolean consumeRuleCall$3() throws Exception {
+ protected int consumeRuleCall$3() throws Exception {
return consumeNonTerminal(parameterConsumer, null, false, false, getRule().ele1ParserRuleCallParameter());
}
diff --git a/examples/org.eclipse.xtext.example.fowlerdsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/FowlerDslCommandConsumer.java b/examples/org.eclipse.xtext.example.fowlerdsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/FowlerDslCommandConsumer.java
index 727326c..c91fb94 100644
--- a/examples/org.eclipse.xtext.example.fowlerdsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/FowlerDslCommandConsumer.java
+++ b/examples/org.eclipse.xtext.example.fowlerdsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/FowlerDslCommandConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -37,36 +38,47 @@ public final class FowlerDslCommandConsumer extends NonTerminalConsumer {
ruleCall$5$Delimiter = ISequenceMatcher.Factory.nullMatcher();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeAssignment$2()) {
- marker.rollback();
+ int result;
+ result = consumeAssignment$2();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0AssignmentName());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$4()) {
- marker.rollback();
+ result = consumeAssignment$4();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1AssignmentCode());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeAssignment$2() throws Exception {
- if (consumeTerminal(idConsumer, "name", false, false, getRule().ele00LexerRuleCallID(), getRuleCall$3$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$2() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, "name", false, false, getRule().ele00LexerRuleCallID(), getRuleCall$3$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeAssignment$4() throws Exception {
- if (consumeTerminal(idConsumer, "code", false, false, getRule().ele10LexerRuleCallID(), getRuleCall$5$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$4() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, "code", false, false, getRule().ele10LexerRuleCallID(), getRuleCall$5$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
public CommandElements getRule() {
diff --git a/examples/org.eclipse.xtext.example.fowlerdsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/FowlerDslEventConsumer.java b/examples/org.eclipse.xtext.example.fowlerdsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/FowlerDslEventConsumer.java
index 0ce95fa..417da68 100644
--- a/examples/org.eclipse.xtext.example.fowlerdsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/FowlerDslEventConsumer.java
+++ b/examples/org.eclipse.xtext.example.fowlerdsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/FowlerDslEventConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -40,52 +41,72 @@ public final class FowlerDslEventConsumer extends NonTerminalConsumer {
ruleCall$8$Delimiter = ISequenceMatcher.Factory.nullMatcher();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeAssignment$3()) {
- marker.rollback();
+ int result;
+ result = consumeAssignment$3();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00AssignmentResetting());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$5()) {
- marker.rollback();
+ result = consumeAssignment$5();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele01AssignmentName());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$7()) {
- marker.rollback();
+ result = consumeAssignment$7();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1AssignmentCode());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeAssignment$3() throws Exception {
- doConsumeAssignment$3();
- return true;
+ protected int consumeAssignment$3() throws Exception {
+ IMarker marker = mark();
+ int result = doConsumeAssignment$3();
+ if (result != ConsumeResult.SUCCESS)
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeAssignment$3() throws Exception {
- if (consumeKeyword(getRule().ele000KeywordResetting(), "resetting", false, true, getKeyword$4$Delimiter()))
- return true;
- return false;
+ protected int doConsumeAssignment$3() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeKeyword(getRule().ele000KeywordResetting(), "resetting", false, true, getKeyword$4$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeAssignment$5() throws Exception {
- if (consumeTerminal(idConsumer, "name", false, false, getRule().ele010LexerRuleCallID(), getRuleCall$6$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$5() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, "name", false, false, getRule().ele010LexerRuleCallID(), getRuleCall$6$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeAssignment$7() throws Exception {
- if (consumeTerminal(idConsumer, "code", false, false, getRule().ele10LexerRuleCallID(), getRuleCall$8$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$7() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, "code", false, false, getRule().ele10LexerRuleCallID(), getRuleCall$8$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
public EventElements getRule() {
diff --git a/examples/org.eclipse.xtext.example.fowlerdsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/FowlerDslStateConsumer.java b/examples/org.eclipse.xtext.example.fowlerdsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/FowlerDslStateConsumer.java
index 7c24dfe..4f1b100 100644
--- a/examples/org.eclipse.xtext.example.fowlerdsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/FowlerDslStateConsumer.java
+++ b/examples/org.eclipse.xtext.example.fowlerdsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/FowlerDslStateConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -54,120 +55,165 @@ public final class FowlerDslStateConsumer extends NonTerminalConsumer {
ruleCall$7$Delimiter = ISequenceMatcher.Factory.nullMatcher();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$5()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$5();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0000KeywordState());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$6()) {
- marker.rollback();
+ result = consumeAssignment$6();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0001AssignmentName());
marker.release();
- return false;
+ return result;
}
- if (!consumeGroup$8()) {
- marker.rollback();
+ result = consumeGroup$8();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele001Group());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$17()) {
- marker.rollback();
+ result = consumeAssignment$17();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele01AssignmentTransitions());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$19()) {
- marker.rollback();
+ result = consumeKeyword$19();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1KeywordEnd());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$5() throws Exception {
+ protected int consumeKeyword$5() throws Exception {
return consumeKeyword(getRule().ele0000KeywordState(), null, false, false, getKeyword$5$Delimiter());
}
- protected boolean consumeAssignment$6() throws Exception {
- if (consumeTerminal(idConsumer, "name", false, false, getRule().ele00010LexerRuleCallID(), getRuleCall$7$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$6() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, "name", false, false, getRule().ele00010LexerRuleCallID(), getRuleCall$7$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeGroup$8() throws Exception {
- doConsumeGroup$8();
- return true;
+ protected int consumeGroup$8() throws Exception {
+ IMarker marker = mark();
+ int result = doConsumeGroup$8();
+ if (result != ConsumeResult.SUCCESS)
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeGroup$8() throws Exception {
+ protected int doConsumeGroup$8() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$11()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$11();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele001000KeywordActions());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$12()) {
- marker.rollback();
+ result = consumeKeyword$12();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele001001KeywordLeftCurlyBracket());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$13()) {
- marker.rollback();
+ result = consumeAssignment$13();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00101AssignmentActions());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$16()) {
- marker.rollback();
+ result = consumeKeyword$16();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0011KeywordRightCurlyBracket());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$11() throws Exception {
+ protected int consumeKeyword$11() throws Exception {
return consumeKeyword(getRule().ele001000KeywordActions(), null, false, false, getKeyword$11$Delimiter());
}
- protected boolean consumeKeyword$12() throws Exception {
+ protected int consumeKeyword$12() throws Exception {
return consumeKeyword(getRule().ele001001KeywordLeftCurlyBracket(), null, false, false, getKeyword$12$Delimiter());
}
- protected boolean consumeAssignment$13() throws Exception {
- if (doConsumeAssignment$13()) {
- while(doConsumeAssignment$13()) {}
- return true;
+ protected int consumeAssignment$13() throws Exception {
+ IMarker marker = mark();
+ int result = doConsumeAssignment$13();
+ if (result == ConsumeResult.SUCCESS) {
+ marker.release();
+ marker = mark();
+ while(doConsumeAssignment$13()==ConsumeResult.SUCCESS) {
+ marker.release();
+ marker = mark();
+ }
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
+ } else {
+ error("Could not find token.", getRule().ele00101AssignmentActions());
}
- return false;
+ marker.release();
+ return result;
}
- protected boolean doConsumeAssignment$13() throws Exception {
- if (consumeTerminal(idConsumer, null, true, false, getRule().ele001010CrossReferenceEStringCommand(), getCrossReference$14$Delimiter()))
- return true;
- return false;
+ protected int doConsumeAssignment$13() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, null, true, false, getRule().ele001010CrossReferenceEStringCommand(), getCrossReference$14$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeKeyword$16() throws Exception {
+ protected int consumeKeyword$16() throws Exception {
return consumeKeyword(getRule().ele0011KeywordRightCurlyBracket(), null, false, false, getKeyword$16$Delimiter());
}
- protected boolean consumeAssignment$17() throws Exception {
- while(doConsumeAssignment$17()) {}
- return true;
+ protected int consumeAssignment$17() throws Exception {
+ IMarker marker = mark();
+ while(doConsumeAssignment$17() == ConsumeResult.SUCCESS) {
+ marker.release();
+ marker = mark();
+ }
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeAssignment$17() throws Exception {
- if (consumeNonTerminal(transitionConsumer, "transitions", true, false, getRule().ele010ParserRuleCallTransition()))
- return true;
- return false;
+ protected int doConsumeAssignment$17() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(transitionConsumer, "transitions", true, false, getRule().ele010ParserRuleCallTransition());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeKeyword$19() throws Exception {
+ protected int consumeKeyword$19() throws Exception {
return consumeKeyword(getRule().ele1KeywordEnd(), null, false, false, getKeyword$19$Delimiter());
}
diff --git a/examples/org.eclipse.xtext.example.fowlerdsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/FowlerDslStatemachineConsumer.java b/examples/org.eclipse.xtext.example.fowlerdsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/FowlerDslStatemachineConsumer.java
index e8a64cd..ca5b62a 100644
--- a/examples/org.eclipse.xtext.example.fowlerdsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/FowlerDslStatemachineConsumer.java
+++ b/examples/org.eclipse.xtext.example.fowlerdsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/FowlerDslStatemachineConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -47,98 +48,136 @@ public final class FowlerDslStatemachineConsumer extends NonTerminalConsumer {
keyword$7$Delimiter = ICharacterClass.Factory.nullClass();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$7()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$7();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele000000KeywordEvents());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$8()) {
- marker.rollback();
+ result = consumeAssignment$8();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele000001AssignmentEvents());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$10()) {
- marker.rollback();
+ result = consumeKeyword$10();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00001KeywordEnd());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$11()) {
- marker.rollback();
+ result = consumeKeyword$11();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0001KeywordCommands());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$12()) {
- marker.rollback();
+ result = consumeAssignment$12();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele001AssignmentCommands());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$14()) {
- marker.rollback();
+ result = consumeKeyword$14();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele01KeywordEnd());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$15()) {
- marker.rollback();
+ result = consumeAssignment$15();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1AssignmentStates());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$7() throws Exception {
+ protected int consumeKeyword$7() throws Exception {
return consumeKeyword(getRule().ele000000KeywordEvents(), null, false, false, getKeyword$7$Delimiter());
}
- protected boolean consumeAssignment$8() throws Exception {
- while(doConsumeAssignment$8()) {}
- return true;
+ protected int consumeAssignment$8() throws Exception {
+ IMarker marker = mark();
+ while(doConsumeAssignment$8() == ConsumeResult.SUCCESS) {
+ marker.release();
+ marker = mark();
+ }
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeAssignment$8() throws Exception {
- if (consumeNonTerminal(eventConsumer, "events", true, false, getRule().ele0000010ParserRuleCallEvent()))
- return true;
- return false;
+ protected int doConsumeAssignment$8() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(eventConsumer, "events", true, false, getRule().ele0000010ParserRuleCallEvent());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeKeyword$10() throws Exception {
+ protected int consumeKeyword$10() throws Exception {
return consumeKeyword(getRule().ele00001KeywordEnd(), null, false, false, getKeyword$10$Delimiter());
}
- protected boolean consumeKeyword$11() throws Exception {
+ protected int consumeKeyword$11() throws Exception {
return consumeKeyword(getRule().ele0001KeywordCommands(), null, false, false, getKeyword$11$Delimiter());
}
- protected boolean consumeAssignment$12() throws Exception {
- while(doConsumeAssignment$12()) {}
- return true;
+ protected int consumeAssignment$12() throws Exception {
+ IMarker marker = mark();
+ while(doConsumeAssignment$12() == ConsumeResult.SUCCESS) {
+ marker.release();
+ marker = mark();
+ }
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeAssignment$12() throws Exception {
- if (consumeNonTerminal(commandConsumer, "commands", true, false, getRule().ele0010ParserRuleCallCommand()))
- return true;
- return false;
+ protected int doConsumeAssignment$12() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(commandConsumer, "commands", true, false, getRule().ele0010ParserRuleCallCommand());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeKeyword$14() throws Exception {
+ protected int consumeKeyword$14() throws Exception {
return consumeKeyword(getRule().ele01KeywordEnd(), null, false, false, getKeyword$14$Delimiter());
}
- protected boolean consumeAssignment$15() throws Exception {
- while(doConsumeAssignment$15()) {}
- return true;
+ protected int consumeAssignment$15() throws Exception {
+ IMarker marker = mark();
+ while(doConsumeAssignment$15() == ConsumeResult.SUCCESS) {
+ marker.release();
+ marker = mark();
+ }
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeAssignment$15() throws Exception {
- if (consumeNonTerminal(stateConsumer, "states", true, false, getRule().ele10ParserRuleCallState()))
- return true;
- return false;
+ protected int doConsumeAssignment$15() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(stateConsumer, "states", true, false, getRule().ele10ParserRuleCallState());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
public StatemachineElements getRule() {
diff --git a/examples/org.eclipse.xtext.example.fowlerdsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/FowlerDslTransitionConsumer.java b/examples/org.eclipse.xtext.example.fowlerdsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/FowlerDslTransitionConsumer.java
index dc765c3..7f39715 100644
--- a/examples/org.eclipse.xtext.example.fowlerdsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/FowlerDslTransitionConsumer.java
+++ b/examples/org.eclipse.xtext.example.fowlerdsl/src-gen/org/eclipse/xtext/example/parser/packrat/consumers/FowlerDslTransitionConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -40,45 +41,57 @@ public final class FowlerDslTransitionConsumer extends NonTerminalConsumer {
keyword$6$Delimiter = ICharacterClass.Factory.nullClass();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeAssignment$3()) {
- marker.rollback();
+ int result;
+ result = consumeAssignment$3();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00AssignmentEvent());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$6()) {
- marker.rollback();
+ result = consumeKeyword$6();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele01KeywordEqualsSignGreaterThanSign());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$7()) {
- marker.rollback();
+ result = consumeAssignment$7();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1AssignmentState());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeAssignment$3() throws Exception {
- if (consumeTerminal(idConsumer, null, false, false, getRule().ele000CrossReferenceEStringEvent(), getCrossReference$4$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$3() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, null, false, false, getRule().ele000CrossReferenceEStringEvent(), getCrossReference$4$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeKeyword$6() throws Exception {
+ protected int consumeKeyword$6() throws Exception {
return consumeKeyword(getRule().ele01KeywordEqualsSignGreaterThanSign(), null, false, false, getKeyword$6$Delimiter());
}
- protected boolean consumeAssignment$7() throws Exception {
- if (consumeTerminal(idConsumer, null, false, false, getRule().ele10CrossReferenceEStringState(), getCrossReference$8$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$7() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, null, false, false, getRule().ele10CrossReferenceEStringState(), getCrossReference$8$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
public TransitionElements getRule() {
diff --git a/plugins/org.eclipse.xtext.ui.common.xtend/META-INF/MANIFEST.MF b/plugins/org.eclipse.xtext.ui.common.xtend/META-INF/MANIFEST.MF
index 011b516..3a6680d 100644
--- a/plugins/org.eclipse.xtext.ui.common.xtend/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.xtext.ui.common.xtend/META-INF/MANIFEST.MF
@@ -9,7 +9,7 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.xtext.ui.common;bundle-version="0.7.0",
org.eclipse.xtend;bundle-version="0.7.0",
org.eclipse.xtext;bundle-version="0.7.0",
- org.eclipse.jface.text;bundle-version="3.4.1",
+ org.eclipse.jface.text,
org.eclipse.xtend.typesystem.emf;bundle-version="0.7.0",
org.eclipse.xtext.log4j;bundle-version="1.2.15",
org.eclipse.xtend.util.stdlib;bundle-version="0.7.0";visibility:=reexport
diff --git a/tests/org.eclipse.xtext.generator.tests/META-INF/MANIFEST.MF b/tests/org.eclipse.xtext.generator.tests/META-INF/MANIFEST.MF
index a3afa27..c2edd9e 100644
--- a/tests/org.eclipse.xtext.generator.tests/META-INF/MANIFEST.MF
+++ b/tests/org.eclipse.xtext.generator.tests/META-INF/MANIFEST.MF
@@ -22,5 +22,4 @@ Export-Package: org.eclipse.xtext,
org.eclipse.xtext.testlanguages.parser.antlr.internal,
org.eclipse.xtext.testlanguages.parsetree.reconstr,
org.eclipse.xtext.testlanguages.services,
- org.eclipse.xtext.tests,
- org.eclipse.xtext.xtext.parser.handwritten
+ org.eclipse.xtext.tests
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/XtextTest.ecore b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/XtextTest.ecore
index 30c6432..8d076d0 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/XtextTest.ecore
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/XtextTest.ecore
@@ -20,12 +20,12 @@
<eStructuralFeatures xsi:type="ecore:EReference" name="type" eType="//TypeRef" containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="AbstractMetamodelDeclaration">
- <eStructuralFeatures xsi:type="ecore:EReference" name="ePackage">
- <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//EPackage"/>
- </eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="alias">
<eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="ePackage">
+ <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//EPackage"/>
+ </eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="GeneratedMetamodel" eSuperTypes="//AbstractMetamodelDeclaration">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name">
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/crossrefs/parser/packrat/consumers/ImportUriTestLanguageImportConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/crossrefs/parser/packrat/consumers/ImportUriTestLanguageImportConsumer.java
index 3e54ab7..e8594b5 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/crossrefs/parser/packrat/consumers/ImportUriTestLanguageImportConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/crossrefs/parser/packrat/consumers/ImportUriTestLanguageImportConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -37,34 +38,41 @@ public final class ImportUriTestLanguageImportConsumer extends NonTerminalConsum
ruleCall$4$Delimiter = ISequenceMatcher.Factory.nullMatcher();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$2()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$2();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0KeywordImport());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$3()) {
- marker.rollback();
+ result = consumeAssignment$3();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1AssignmentImportURI());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$2() throws Exception {
+ protected int consumeKeyword$2() throws Exception {
return consumeKeyword(getRule().ele0KeywordImport(), null, false, false, getKeyword$2$Delimiter());
}
- protected boolean consumeAssignment$3() throws Exception {
- if (consumeTerminal(stringConsumer, "importURI", false, false, getRule().ele10LexerRuleCallSTRING(), getRuleCall$4$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$3() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(stringConsumer, "importURI", false, false, getRule().ele10LexerRuleCallSTRING(), getRuleCall$4$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
public ImportElements getRule() {
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/crossrefs/parser/packrat/consumers/ImportUriTestLanguageMainConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/crossrefs/parser/packrat/consumers/ImportUriTestLanguageMainConsumer.java
index 6253353..308dc72 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/crossrefs/parser/packrat/consumers/ImportUriTestLanguageMainConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/crossrefs/parser/packrat/consumers/ImportUriTestLanguageMainConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -33,46 +34,69 @@ public final class ImportUriTestLanguageMainConsumer extends NonTerminalConsumer
super(input, markerFactory, tokenAcceptor, hiddenTokenHandler, consumerUtil, hiddenTokens);
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeAssignment$2()) {
- marker.rollback();
+ int result;
+ result = consumeAssignment$2();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0AssignmentImports());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$4()) {
- marker.rollback();
+ result = consumeAssignment$4();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1AssignmentTypes());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeAssignment$2() throws Exception {
- while(doConsumeAssignment$2()) {}
- return true;
+ protected int consumeAssignment$2() throws Exception {
+ IMarker marker = mark();
+ while(doConsumeAssignment$2() == ConsumeResult.SUCCESS) {
+ marker.release();
+ marker = mark();
+ }
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeAssignment$2() throws Exception {
- if (consumeNonTerminal(importConsumer, "imports", true, false, getRule().ele00ParserRuleCallImport()))
- return true;
- return false;
+ protected int doConsumeAssignment$2() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(importConsumer, "imports", true, false, getRule().ele00ParserRuleCallImport());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeAssignment$4() throws Exception {
- while(doConsumeAssignment$4()) {}
- return true;
+ protected int consumeAssignment$4() throws Exception {
+ IMarker marker = mark();
+ while(doConsumeAssignment$4() == ConsumeResult.SUCCESS) {
+ marker.release();
+ marker = mark();
+ }
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeAssignment$4() throws Exception {
- if (consumeNonTerminal(typeConsumer, "types", true, false, getRule().ele10ParserRuleCallType()))
- return true;
- return false;
+ protected int doConsumeAssignment$4() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(typeConsumer, "types", true, false, getRule().ele10ParserRuleCallType());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
public MainElements getRule() {
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/crossrefs/parser/packrat/consumers/ImportUriTestLanguageTypeConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/crossrefs/parser/packrat/consumers/ImportUriTestLanguageTypeConsumer.java
index 1e691e5..48db752 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/crossrefs/parser/packrat/consumers/ImportUriTestLanguageTypeConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/crossrefs/parser/packrat/consumers/ImportUriTestLanguageTypeConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -43,54 +44,67 @@ public final class ImportUriTestLanguageTypeConsumer extends NonTerminalConsumer
ruleCall$6$Delimiter = ISequenceMatcher.Factory.nullMatcher();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$4()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$4();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele000KeywordType());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$5()) {
- marker.rollback();
+ result = consumeAssignment$5();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele001AssignmentName());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$7()) {
- marker.rollback();
+ result = consumeKeyword$7();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele01KeywordExtends());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$8()) {
- marker.rollback();
+ result = consumeAssignment$8();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1AssignmentExtends());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$4() throws Exception {
+ protected int consumeKeyword$4() throws Exception {
return consumeKeyword(getRule().ele000KeywordType(), null, false, false, getKeyword$4$Delimiter());
}
- protected boolean consumeAssignment$5() throws Exception {
- if (consumeTerminal(idConsumer, "name", false, false, getRule().ele0010LexerRuleCallID(), getRuleCall$6$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$5() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, "name", false, false, getRule().ele0010LexerRuleCallID(), getRuleCall$6$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeKeyword$7() throws Exception {
+ protected int consumeKeyword$7() throws Exception {
return consumeKeyword(getRule().ele01KeywordExtends(), null, false, false, getKeyword$7$Delimiter());
}
- protected boolean consumeAssignment$8() throws Exception {
- if (consumeTerminal(idConsumer, null, false, false, getRule().ele10CrossReferenceEStringType(), getCrossReference$9$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$8() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, null, false, false, getRule().ele10CrossReferenceEStringType(), getCrossReference$9$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
public TypeElements getRule() {
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/crossrefs/parser/packrat/consumers/LangATestLanguageImportConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/crossrefs/parser/packrat/consumers/LangATestLanguageImportConsumer.java
index 65446bf..34c0085 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/crossrefs/parser/packrat/consumers/LangATestLanguageImportConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/crossrefs/parser/packrat/consumers/LangATestLanguageImportConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -37,34 +38,41 @@ public final class LangATestLanguageImportConsumer extends NonTerminalConsumer {
ruleCall$4$Delimiter = ISequenceMatcher.Factory.nullMatcher();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$2()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$2();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0KeywordImport());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$3()) {
- marker.rollback();
+ result = consumeAssignment$3();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1AssignmentUri());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$2() throws Exception {
+ protected int consumeKeyword$2() throws Exception {
return consumeKeyword(getRule().ele0KeywordImport(), null, false, false, getKeyword$2$Delimiter());
}
- protected boolean consumeAssignment$3() throws Exception {
- if (consumeTerminal(stringConsumer, "uri", false, false, getRule().ele10LexerRuleCallSTRING(), getRuleCall$4$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$3() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(stringConsumer, "uri", false, false, getRule().ele10LexerRuleCallSTRING(), getRuleCall$4$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
public ImportElements getRule() {
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/crossrefs/parser/packrat/consumers/LangATestLanguageMainConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/crossrefs/parser/packrat/consumers/LangATestLanguageMainConsumer.java
index f7496f4..b858ba8 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/crossrefs/parser/packrat/consumers/LangATestLanguageMainConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/crossrefs/parser/packrat/consumers/LangATestLanguageMainConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -33,46 +34,69 @@ public final class LangATestLanguageMainConsumer extends NonTerminalConsumer {
super(input, markerFactory, tokenAcceptor, hiddenTokenHandler, consumerUtil, hiddenTokens);
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeAssignment$2()) {
- marker.rollback();
+ int result;
+ result = consumeAssignment$2();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0AssignmentImports());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$4()) {
- marker.rollback();
+ result = consumeAssignment$4();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1AssignmentTypes());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeAssignment$2() throws Exception {
- while(doConsumeAssignment$2()) {}
- return true;
+ protected int consumeAssignment$2() throws Exception {
+ IMarker marker = mark();
+ while(doConsumeAssignment$2() == ConsumeResult.SUCCESS) {
+ marker.release();
+ marker = mark();
+ }
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeAssignment$2() throws Exception {
- if (consumeNonTerminal(importConsumer, "imports", true, false, getRule().ele00ParserRuleCallImport()))
- return true;
- return false;
+ protected int doConsumeAssignment$2() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(importConsumer, "imports", true, false, getRule().ele00ParserRuleCallImport());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeAssignment$4() throws Exception {
- while(doConsumeAssignment$4()) {}
- return true;
+ protected int consumeAssignment$4() throws Exception {
+ IMarker marker = mark();
+ while(doConsumeAssignment$4() == ConsumeResult.SUCCESS) {
+ marker.release();
+ marker = mark();
+ }
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeAssignment$4() throws Exception {
- if (consumeNonTerminal(typeConsumer, "types", true, false, getRule().ele10ParserRuleCallType()))
- return true;
- return false;
+ protected int doConsumeAssignment$4() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(typeConsumer, "types", true, false, getRule().ele10ParserRuleCallType());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
public MainElements getRule() {
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/crossrefs/parser/packrat/consumers/LangATestLanguageTypeConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/crossrefs/parser/packrat/consumers/LangATestLanguageTypeConsumer.java
index 7ff53de..502ad92 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/crossrefs/parser/packrat/consumers/LangATestLanguageTypeConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/crossrefs/parser/packrat/consumers/LangATestLanguageTypeConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -43,54 +44,67 @@ public final class LangATestLanguageTypeConsumer extends NonTerminalConsumer {
ruleCall$6$Delimiter = ISequenceMatcher.Factory.nullMatcher();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$4()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$4();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele000KeywordType());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$5()) {
- marker.rollback();
+ result = consumeAssignment$5();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele001AssignmentName());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$7()) {
- marker.rollback();
+ result = consumeKeyword$7();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele01KeywordExtends());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$8()) {
- marker.rollback();
+ result = consumeAssignment$8();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1AssignmentExtends());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$4() throws Exception {
+ protected int consumeKeyword$4() throws Exception {
return consumeKeyword(getRule().ele000KeywordType(), null, false, false, getKeyword$4$Delimiter());
}
- protected boolean consumeAssignment$5() throws Exception {
- if (consumeTerminal(idConsumer, "name", false, false, getRule().ele0010LexerRuleCallID(), getRuleCall$6$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$5() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, "name", false, false, getRule().ele0010LexerRuleCallID(), getRuleCall$6$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeKeyword$7() throws Exception {
+ protected int consumeKeyword$7() throws Exception {
return consumeKeyword(getRule().ele01KeywordExtends(), null, false, false, getKeyword$7$Delimiter());
}
- protected boolean consumeAssignment$8() throws Exception {
- if (consumeTerminal(idConsumer, null, false, false, getRule().ele10CrossReferenceEStringType(), getCrossReference$9$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$8() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, null, false, false, getRule().ele10CrossReferenceEStringType(), getCrossReference$9$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
public TypeElements getRule() {
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/dummy/parser/packrat/consumers/DummyTestLanguageElementConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/dummy/parser/packrat/consumers/DummyTestLanguageElementConsumer.java
index 7950503..72d3f4f 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/dummy/parser/packrat/consumers/DummyTestLanguageElementConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/dummy/parser/packrat/consumers/DummyTestLanguageElementConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -48,74 +49,102 @@ public final class DummyTestLanguageElementConsumer extends NonTerminalConsumer
ruleCall$11$Delimiter = ISequenceMatcher.Factory.nullMatcher();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeAssignment$5()) {
- marker.rollback();
+ int result;
+ result = consumeAssignment$5();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0000AssignmentOptional());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$7()) {
- marker.rollback();
+ result = consumeKeyword$7();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0001KeywordElement());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$8()) {
- marker.rollback();
+ result = consumeAssignment$8();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele001AssignmentName());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$10()) {
- marker.rollback();
+ result = consumeAssignment$10();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele01AssignmentDescriptions());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$12()) {
- marker.rollback();
+ result = consumeKeyword$12();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1KeywordSemicolon());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeAssignment$5() throws Exception {
- doConsumeAssignment$5();
- return true;
+ protected int consumeAssignment$5() throws Exception {
+ IMarker marker = mark();
+ int result = doConsumeAssignment$5();
+ if (result != ConsumeResult.SUCCESS)
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeAssignment$5() throws Exception {
- if (consumeKeyword(getRule().ele00000KeywordOptional(), "optional", false, true, getKeyword$6$Delimiter()))
- return true;
- return false;
+ protected int doConsumeAssignment$5() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeKeyword(getRule().ele00000KeywordOptional(), "optional", false, true, getKeyword$6$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeKeyword$7() throws Exception {
+ protected int consumeKeyword$7() throws Exception {
return consumeKeyword(getRule().ele0001KeywordElement(), null, false, false, getKeyword$7$Delimiter());
}
- protected boolean consumeAssignment$8() throws Exception {
- if (consumeTerminal(idConsumer, "name", false, false, getRule().ele0010LexerRuleCallID(), getRuleCall$9$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$8() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, "name", false, false, getRule().ele0010LexerRuleCallID(), getRuleCall$9$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeAssignment$10() throws Exception {
- while(doConsumeAssignment$10()) {}
- return true;
+ protected int consumeAssignment$10() throws Exception {
+ IMarker marker = mark();
+ while(doConsumeAssignment$10() == ConsumeResult.SUCCESS) {
+ marker.release();
+ marker = mark();
+ }
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeAssignment$10() throws Exception {
- if (consumeTerminal(stringConsumer, "descriptions", true, false, getRule().ele010LexerRuleCallSTRING(), getRuleCall$11$Delimiter()))
- return true;
- return false;
+ protected int doConsumeAssignment$10() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(stringConsumer, "descriptions", true, false, getRule().ele010LexerRuleCallSTRING(), getRuleCall$11$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeKeyword$12() throws Exception {
+ protected int consumeKeyword$12() throws Exception {
return consumeKeyword(getRule().ele1KeywordSemicolon(), null, false, false, getKeyword$12$Delimiter());
}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/dummy/parser/packrat/consumers/DummyTestLanguageModelConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/dummy/parser/packrat/consumers/DummyTestLanguageModelConsumer.java
index 9539558..f300374 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/dummy/parser/packrat/consumers/DummyTestLanguageModelConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/dummy/parser/packrat/consumers/DummyTestLanguageModelConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -31,19 +32,29 @@ public final class DummyTestLanguageModelConsumer extends NonTerminalConsumer {
super(input, markerFactory, tokenAcceptor, hiddenTokenHandler, consumerUtil, hiddenTokens);
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeAssignment$1();
}
- protected boolean consumeAssignment$1() throws Exception {
- while(doConsumeAssignment$1()) {}
- return true;
+ protected int consumeAssignment$1() throws Exception {
+ IMarker marker = mark();
+ while(doConsumeAssignment$1() == ConsumeResult.SUCCESS) {
+ marker.release();
+ marker = mark();
+ }
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeAssignment$1() throws Exception {
- if (consumeNonTerminal(elementConsumer, "elements", true, false, getRule().ele0ParserRuleCallElement()))
- return true;
- return false;
+ protected int doConsumeAssignment$1() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(elementConsumer, "elements", true, false, getRule().ele0ParserRuleCallElement());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
public ModelElements getRule() {
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/grammarinheritance/parser/packrat/consumers/AbstractTestLanguageInheritedParserRuleConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/grammarinheritance/parser/packrat/consumers/AbstractTestLanguageInheritedParserRuleConsumer.java
index 2ebdc6d..ea869f5 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/grammarinheritance/parser/packrat/consumers/AbstractTestLanguageInheritedParserRuleConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/grammarinheritance/parser/packrat/consumers/AbstractTestLanguageInheritedParserRuleConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -37,34 +38,41 @@ public final class AbstractTestLanguageInheritedParserRuleConsumer extends NonTe
ruleCall$4$Delimiter = ISequenceMatcher.Factory.nullMatcher();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$2()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$2();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0KeywordElement());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$3()) {
- marker.rollback();
+ result = consumeAssignment$3();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1AssignmentName());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$2() throws Exception {
+ protected int consumeKeyword$2() throws Exception {
return consumeKeyword(getRule().ele0KeywordElement(), null, false, false, getKeyword$2$Delimiter());
}
- protected boolean consumeAssignment$3() throws Exception {
- if (consumeTerminal(idConsumer, "name", false, false, getRule().ele10LexerRuleCallID(), getRuleCall$4$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$3() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, "name", false, false, getRule().ele10LexerRuleCallID(), getRuleCall$4$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
public InheritedParserRuleElements getRule() {
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/grammarinheritance/parser/packrat/consumers/ConcreteTestLanguageConcreteParserRuleConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/grammarinheritance/parser/packrat/consumers/ConcreteTestLanguageConcreteParserRuleConsumer.java
index f8657f7..af03e8c 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/grammarinheritance/parser/packrat/consumers/ConcreteTestLanguageConcreteParserRuleConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/grammarinheritance/parser/packrat/consumers/ConcreteTestLanguageConcreteParserRuleConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -42,59 +43,78 @@ public final class ConcreteTestLanguageConcreteParserRuleConsumer extends NonTer
ruleCall$6$Delimiter = ISequenceMatcher.Factory.nullMatcher();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$4()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$4();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele000KeywordModel());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$5()) {
- marker.rollback();
+ result = consumeAssignment$5();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele001AssignmentMagicNumber());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$7()) {
- marker.rollback();
+ result = consumeKeyword$7();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele01KeywordColon());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$8()) {
- marker.rollback();
+ result = consumeAssignment$8();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1AssignmentElements());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$4() throws Exception {
+ protected int consumeKeyword$4() throws Exception {
return consumeKeyword(getRule().ele000KeywordModel(), null, false, false, getKeyword$4$Delimiter());
}
- protected boolean consumeAssignment$5() throws Exception {
- if (consumeTerminal(realConsumer, "magicNumber", false, false, getRule().ele0010LexerRuleCallREAL(), getRuleCall$6$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$5() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(realConsumer, "magicNumber", false, false, getRule().ele0010LexerRuleCallREAL(), getRuleCall$6$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeKeyword$7() throws Exception {
+ protected int consumeKeyword$7() throws Exception {
return consumeKeyword(getRule().ele01KeywordColon(), null, false, false, getKeyword$7$Delimiter());
}
- protected boolean consumeAssignment$8() throws Exception {
- while(doConsumeAssignment$8()) {}
- return true;
+ protected int consumeAssignment$8() throws Exception {
+ IMarker marker = mark();
+ while(doConsumeAssignment$8() == ConsumeResult.SUCCESS) {
+ marker.release();
+ marker = mark();
+ }
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeAssignment$8() throws Exception {
- if (consumeNonTerminal(inheritedParserRuleConsumer, "elements", true, false, getRule().ele10ParserRuleCallInheritedParserRule()))
- return true;
- return false;
+ protected int doConsumeAssignment$8() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(inheritedParserRuleConsumer, "elements", true, false, getRule().ele10ParserRuleCallInheritedParserRule());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
public ConcreteParserRuleElements getRule() {
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/metamodelreferencing/tests/parser/packrat/consumers/MetamodelRefTestLanguageFooConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/metamodelreferencing/tests/parser/packrat/consumers/MetamodelRefTestLanguageFooConsumer.java
index d775328..b7a9da2 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/metamodelreferencing/tests/parser/packrat/consumers/MetamodelRefTestLanguageFooConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/metamodelreferencing/tests/parser/packrat/consumers/MetamodelRefTestLanguageFooConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -36,41 +37,58 @@ public final class MetamodelRefTestLanguageFooConsumer extends NonTerminalConsum
ruleCall$3$Delimiter = ISequenceMatcher.Factory.nullMatcher();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeAssignment$2()) {
- marker.rollback();
+ int result;
+ result = consumeAssignment$2();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0AssignmentName());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$4()) {
- marker.rollback();
+ result = consumeAssignment$4();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1AssignmentNameRefs());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeAssignment$2() throws Exception {
- if (consumeTerminal(idConsumer, "name", false, false, getRule().ele00LexerRuleCallID(), getRuleCall$3$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$2() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, "name", false, false, getRule().ele00LexerRuleCallID(), getRuleCall$3$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeAssignment$4() throws Exception {
- while(doConsumeAssignment$4()) {}
- return true;
+ protected int consumeAssignment$4() throws Exception {
+ IMarker marker = mark();
+ while(doConsumeAssignment$4() == ConsumeResult.SUCCESS) {
+ marker.release();
+ marker = mark();
+ }
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeAssignment$4() throws Exception {
- if (consumeNonTerminal(nameRefConsumer, "nameRefs", true, false, getRule().ele10ParserRuleCallNameRef()))
- return true;
- return false;
+ protected int doConsumeAssignment$4() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(nameRefConsumer, "nameRefs", true, false, getRule().ele10ParserRuleCallNameRef());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
public FooElements getRule() {
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/metamodelreferencing/tests/parser/packrat/consumers/MetamodelRefTestLanguageMyRuleConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/metamodelreferencing/tests/parser/packrat/consumers/MetamodelRefTestLanguageMyRuleConsumer.java
index 9b6207f..7de9741 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/metamodelreferencing/tests/parser/packrat/consumers/MetamodelRefTestLanguageMyRuleConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/metamodelreferencing/tests/parser/packrat/consumers/MetamodelRefTestLanguageMyRuleConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -34,14 +35,18 @@ public final class MetamodelRefTestLanguageMyRuleConsumer extends NonTerminalCon
ruleCall$2$Delimiter = ISequenceMatcher.Factory.nullMatcher();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeAssignment$1();
}
- protected boolean consumeAssignment$1() throws Exception {
- if (consumeTerminal(idConsumer, "name", false, false, getRule().ele0LexerRuleCallID(), getRuleCall$2$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$1() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, "name", false, false, getRule().ele0LexerRuleCallID(), getRuleCall$2$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
public MyRuleElements getRule() {
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/metamodelreferencing/tests/parser/packrat/consumers/MetamodelRefTestLanguageNameRefConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/metamodelreferencing/tests/parser/packrat/consumers/MetamodelRefTestLanguageNameRefConsumer.java
index 6889e45..10aab4c 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/metamodelreferencing/tests/parser/packrat/consumers/MetamodelRefTestLanguageNameRefConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/metamodelreferencing/tests/parser/packrat/consumers/MetamodelRefTestLanguageNameRefConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -34,14 +35,18 @@ public final class MetamodelRefTestLanguageNameRefConsumer extends NonTerminalCo
crossReference$2$Delimiter = ISequenceMatcher.Factory.nullMatcher();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeAssignment$1();
}
- protected boolean consumeAssignment$1() throws Exception {
- if (consumeTerminal(idConsumer, null, false, false, getRule().ele0CrossReferenceEStringParserRule(), getCrossReference$2$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$1() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, null, false, false, getRule().ele0CrossReferenceEStringParserRule(), getCrossReference$2$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
public NameRefElements getRule() {
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/metamodelreferencing/tests/parser/packrat/consumers/MultiGenMMTestLanguageFooConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/metamodelreferencing/tests/parser/packrat/consumers/MultiGenMMTestLanguageFooConsumer.java
index 2abc98d..2bed178 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/metamodelreferencing/tests/parser/packrat/consumers/MultiGenMMTestLanguageFooConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/metamodelreferencing/tests/parser/packrat/consumers/MultiGenMMTestLanguageFooConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -36,41 +37,58 @@ public final class MultiGenMMTestLanguageFooConsumer extends NonTerminalConsumer
ruleCall$3$Delimiter = ISequenceMatcher.Factory.nullMatcher();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeAssignment$2()) {
- marker.rollback();
+ int result;
+ result = consumeAssignment$2();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0AssignmentName());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$4()) {
- marker.rollback();
+ result = consumeAssignment$4();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1AssignmentNameRefs());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeAssignment$2() throws Exception {
- if (consumeTerminal(idConsumer, "name", false, false, getRule().ele00LexerRuleCallID(), getRuleCall$3$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$2() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, "name", false, false, getRule().ele00LexerRuleCallID(), getRuleCall$3$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeAssignment$4() throws Exception {
- while(doConsumeAssignment$4()) {}
- return true;
+ protected int consumeAssignment$4() throws Exception {
+ IMarker marker = mark();
+ while(doConsumeAssignment$4() == ConsumeResult.SUCCESS) {
+ marker.release();
+ marker = mark();
+ }
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeAssignment$4() throws Exception {
- if (consumeNonTerminal(nameRefConsumer, "nameRefs", true, false, getRule().ele10ParserRuleCallNameRef()))
- return true;
- return false;
+ protected int doConsumeAssignment$4() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(nameRefConsumer, "nameRefs", true, false, getRule().ele10ParserRuleCallNameRef());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
public FooElements getRule() {
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/metamodelreferencing/tests/parser/packrat/consumers/MultiGenMMTestLanguageNameRefConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/metamodelreferencing/tests/parser/packrat/consumers/MultiGenMMTestLanguageNameRefConsumer.java
index 2e37556..0cbfa29 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/metamodelreferencing/tests/parser/packrat/consumers/MultiGenMMTestLanguageNameRefConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/metamodelreferencing/tests/parser/packrat/consumers/MultiGenMMTestLanguageNameRefConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -34,14 +35,18 @@ public final class MultiGenMMTestLanguageNameRefConsumer extends NonTerminalCons
ruleCall$2$Delimiter = ISequenceMatcher.Factory.nullMatcher();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeAssignment$1();
}
- protected boolean consumeAssignment$1() throws Exception {
- if (consumeTerminal(stringConsumer, "name", false, false, getRule().ele0LexerRuleCallSTRING(), getRuleCall$2$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$1() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(stringConsumer, "name", false, false, getRule().ele0LexerRuleCallSTRING(), getRuleCall$2$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
public NameRefElements getRule() {
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/datatyperules/parser/packrat/consumers/DatatypeRulesTestLanguageCompositeModelConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/datatyperules/parser/packrat/consumers/DatatypeRulesTestLanguageCompositeModelConsumer.java
index 3e66f6b..94614d7 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/datatyperules/parser/packrat/consumers/DatatypeRulesTestLanguageCompositeModelConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/datatyperules/parser/packrat/consumers/DatatypeRulesTestLanguageCompositeModelConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -31,22 +32,38 @@ public final class DatatypeRulesTestLanguageCompositeModelConsumer extends NonTe
super(input, markerFactory, tokenAcceptor, hiddenTokenHandler, consumerUtil, hiddenTokens);
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeAssignment$1();
}
- protected boolean consumeAssignment$1() throws Exception {
- if (doConsumeAssignment$1()) {
- while(doConsumeAssignment$1()) {}
- return true;
+ protected int consumeAssignment$1() throws Exception {
+ IMarker marker = mark();
+ int result = doConsumeAssignment$1();
+ if (result == ConsumeResult.SUCCESS) {
+ marker.release();
+ marker = mark();
+ while(doConsumeAssignment$1()==ConsumeResult.SUCCESS) {
+ marker.release();
+ marker = mark();
+ }
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
+ } else {
+ error("Could not find token.", getRule().eleAssignmentModel());
}
- return false;
+ marker.release();
+ return result;
}
- protected boolean doConsumeAssignment$1() throws Exception {
- if (consumeNonTerminal(modelConsumer, "model", true, false, getRule().ele0ParserRuleCallModel()))
- return true;
- return false;
+ protected int doConsumeAssignment$1() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(modelConsumer, "model", true, false, getRule().ele0ParserRuleCallModel());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
public CompositeModelElements getRule() {
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/datatyperules/parser/packrat/consumers/DatatypeRulesTestLanguageDotsConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/datatyperules/parser/packrat/consumers/DatatypeRulesTestLanguageDotsConsumer.java
index ce493d8..6d57897 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/datatyperules/parser/packrat/consumers/DatatypeRulesTestLanguageDotsConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/datatyperules/parser/packrat/consumers/DatatypeRulesTestLanguageDotsConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -38,43 +39,83 @@ public final class DatatypeRulesTestLanguageDotsConsumer extends NonTerminalCons
keyword$5$Delimiter = ICharacterClass.Factory.nullClass();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeAlternatives$1();
}
- protected boolean consumeAlternatives$1() throws Exception {
- if (consumeGroup$2())
- return true;
- if (consumeKeyword$5())
- return true;
- return false;
+ protected int consumeAlternatives$1() throws Exception {
+ int result = ConsumeResult.SUCCESS;
+ IMarker bestMarker = mark();
+ IMarker currentMarker;
+ int tempResult;
+ currentMarker = bestMarker.copy();
+ tempResult = consumeGroup$2();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ currentMarker = bestMarker.copy();
+ tempResult = consumeKeyword$5();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ bestMarker.release();
+ return result;
}
- protected boolean consumeGroup$2() throws Exception {
+ protected int consumeGroup$2() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$3()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$3();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00KeywordFullStop());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$4()) {
- marker.rollback();
+ result = consumeKeyword$4();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele01KeywordFullStop());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$3() throws Exception {
+ protected int consumeKeyword$3() throws Exception {
return consumeKeyword(getRule().ele00KeywordFullStop(), null, false, false, getKeyword$3$Delimiter());
}
- protected boolean consumeKeyword$4() throws Exception {
+ protected int consumeKeyword$4() throws Exception {
return consumeKeyword(getRule().ele01KeywordFullStop(), null, false, false, getKeyword$4$Delimiter());
}
- protected boolean consumeKeyword$5() throws Exception {
+ protected int consumeKeyword$5() throws Exception {
return consumeKeyword(getRule().ele1KeywordFullStopFullStop(), null, false, false, getKeyword$5$Delimiter());
}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/datatyperules/parser/packrat/consumers/DatatypeRulesTestLanguageFractionConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/datatyperules/parser/packrat/consumers/DatatypeRulesTestLanguageFractionConsumer.java
index dcc4950..53afa94 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/datatyperules/parser/packrat/consumers/DatatypeRulesTestLanguageFractionConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/datatyperules/parser/packrat/consumers/DatatypeRulesTestLanguageFractionConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -40,56 +41,66 @@ public final class DatatypeRulesTestLanguageFractionConsumer extends NonTerminal
ruleCall$5$Delimiter = ISequenceMatcher.Factory.nullMatcher();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeRuleCall$2()) {
- marker.rollback();
+ int result;
+ result = consumeRuleCall$2();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0LexerRuleCallINT());
marker.release();
- return false;
+ return result;
}
- if (!consumeGroup$3()) {
- marker.rollback();
+ result = consumeGroup$3();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1Group());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeRuleCall$2() throws Exception {
+ protected int consumeRuleCall$2() throws Exception {
return consumeTerminal(intConsumer, null, false, false, getRule().ele0LexerRuleCallINT(), getRuleCall$2$Delimiter());
}
- protected boolean consumeGroup$3() throws Exception {
- doConsumeGroup$3();
- return true;
+ protected int consumeGroup$3() throws Exception {
+ IMarker marker = mark();
+ int result = doConsumeGroup$3();
+ if (result != ConsumeResult.SUCCESS)
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeGroup$3() throws Exception {
+ protected int doConsumeGroup$3() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$4()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$4();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele10KeywordSolidus());
marker.release();
- return false;
+ return result;
}
- if (!consumeRuleCall$5()) {
- marker.rollback();
+ result = consumeRuleCall$5();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele11LexerRuleCallINT());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$4() throws Exception {
+ protected int consumeKeyword$4() throws Exception {
return consumeKeyword(getRule().ele10KeywordSolidus(), null, false, false, getKeyword$4$Delimiter());
}
- protected boolean consumeRuleCall$5() throws Exception {
+ protected int consumeRuleCall$5() throws Exception {
return consumeTerminal(intConsumer, null, false, false, getRule().ele11LexerRuleCallINT(), getRuleCall$5$Delimiter());
}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/datatyperules/parser/packrat/consumers/DatatypeRulesTestLanguageModelConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/datatyperules/parser/packrat/consumers/DatatypeRulesTestLanguageModelConsumer.java
index 0e6b875..f912704 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/datatyperules/parser/packrat/consumers/DatatypeRulesTestLanguageModelConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/datatyperules/parser/packrat/consumers/DatatypeRulesTestLanguageModelConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -49,141 +50,184 @@ public final class DatatypeRulesTestLanguageModelConsumer extends NonTerminalCon
keyword$19$Delimiter = ICharacterClass.Factory.nullClass();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeAssignment$5()) {
- marker.rollback();
+ int result;
+ result = consumeAssignment$5();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0000AssignmentId());
marker.release();
- return false;
+ return result;
}
- if (!consumeGroup$7()) {
- marker.rollback();
+ result = consumeGroup$7();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0001Group());
marker.release();
- return false;
+ return result;
}
- if (!consumeGroup$11()) {
- marker.rollback();
+ result = consumeGroup$11();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele001Group());
marker.release();
- return false;
+ return result;
}
- if (!consumeGroup$15()) {
- marker.rollback();
+ result = consumeGroup$15();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele01Group());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$19()) {
- marker.rollback();
+ result = consumeKeyword$19();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1KeywordSemicolon());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeAssignment$5() throws Exception {
- if (consumeNonTerminal(nestedModelIdConsumer, "id", false, true, getRule().ele00000ParserRuleCallNestedModelId()))
- return true;
- return false;
+ protected int consumeAssignment$5() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(nestedModelIdConsumer, "id", false, true, getRule().ele00000ParserRuleCallNestedModelId());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeGroup$7() throws Exception {
- doConsumeGroup$7();
- return true;
+ protected int consumeGroup$7() throws Exception {
+ IMarker marker = mark();
+ int result = doConsumeGroup$7();
+ if (result != ConsumeResult.SUCCESS)
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeGroup$7() throws Exception {
+ protected int doConsumeGroup$7() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$8()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$8();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00010KeywordColon());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$9()) {
- marker.rollback();
+ result = consumeAssignment$9();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00011AssignmentValue());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$8() throws Exception {
+ protected int consumeKeyword$8() throws Exception {
return consumeKeyword(getRule().ele00010KeywordColon(), null, false, false, getKeyword$8$Delimiter());
}
- protected boolean consumeAssignment$9() throws Exception {
- if (consumeNonTerminal(fractionConsumer, "value", false, true, getRule().ele000110ParserRuleCallFraction()))
- return true;
- return false;
+ protected int consumeAssignment$9() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(fractionConsumer, "value", false, true, getRule().ele000110ParserRuleCallFraction());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeGroup$11() throws Exception {
- doConsumeGroup$11();
- return true;
+ protected int consumeGroup$11() throws Exception {
+ IMarker marker = mark();
+ int result = doConsumeGroup$11();
+ if (result != ConsumeResult.SUCCESS)
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeGroup$11() throws Exception {
+ protected int doConsumeGroup$11() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$12()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$12();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0010KeywordNumberSign());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$13()) {
- marker.rollback();
+ result = consumeAssignment$13();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0011AssignmentVector());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$12() throws Exception {
+ protected int consumeKeyword$12() throws Exception {
return consumeKeyword(getRule().ele0010KeywordNumberSign(), null, false, false, getKeyword$12$Delimiter());
}
- protected boolean consumeAssignment$13() throws Exception {
- if (consumeNonTerminal(vectorConsumer, "vector", false, true, getRule().ele00110ParserRuleCallVector()))
- return true;
- return false;
+ protected int consumeAssignment$13() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(vectorConsumer, "vector", false, true, getRule().ele00110ParserRuleCallVector());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeGroup$15() throws Exception {
- doConsumeGroup$15();
- return true;
+ protected int consumeGroup$15() throws Exception {
+ IMarker marker = mark();
+ int result = doConsumeGroup$15();
+ if (result != ConsumeResult.SUCCESS)
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeGroup$15() throws Exception {
+ protected int doConsumeGroup$15() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$16()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$16();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele010KeywordPlusSign());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$17()) {
- marker.rollback();
+ result = consumeAssignment$17();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele011AssignmentDots());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$16() throws Exception {
+ protected int consumeKeyword$16() throws Exception {
return consumeKeyword(getRule().ele010KeywordPlusSign(), null, false, false, getKeyword$16$Delimiter());
}
- protected boolean consumeAssignment$17() throws Exception {
- if (consumeNonTerminal(dotsConsumer, "dots", false, true, getRule().ele0110ParserRuleCallDots()))
- return true;
- return false;
+ protected int consumeAssignment$17() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(dotsConsumer, "dots", false, true, getRule().ele0110ParserRuleCallDots());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeKeyword$19() throws Exception {
+ protected int consumeKeyword$19() throws Exception {
return consumeKeyword(getRule().ele1KeywordSemicolon(), null, false, false, getKeyword$19$Delimiter());
}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/datatyperules/parser/packrat/consumers/DatatypeRulesTestLanguageModelIdConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/datatyperules/parser/packrat/consumers/DatatypeRulesTestLanguageModelIdConsumer.java
index 5307708..35d8ca9 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/datatyperules/parser/packrat/consumers/DatatypeRulesTestLanguageModelIdConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/datatyperules/parser/packrat/consumers/DatatypeRulesTestLanguageModelIdConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -40,40 +41,44 @@ public final class DatatypeRulesTestLanguageModelIdConsumer extends NonTerminalC
ruleCall$5$Delimiter = ISequenceMatcher.Factory.nullMatcher();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeRuleCall$3()) {
- marker.rollback();
+ int result;
+ result = consumeRuleCall$3();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00LexerRuleCallID());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$4()) {
- marker.rollback();
+ result = consumeKeyword$4();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele01KeywordFullStop());
marker.release();
- return false;
+ return result;
}
- if (!consumeRuleCall$5()) {
- marker.rollback();
+ result = consumeRuleCall$5();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1LexerRuleCallID());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeRuleCall$3() throws Exception {
+ protected int consumeRuleCall$3() throws Exception {
return consumeTerminal(idConsumer, null, false, false, getRule().ele00LexerRuleCallID(), getRuleCall$3$Delimiter());
}
- protected boolean consumeKeyword$4() throws Exception {
+ protected int consumeKeyword$4() throws Exception {
return consumeKeyword(getRule().ele01KeywordFullStop(), null, false, false, getKeyword$4$Delimiter());
}
- protected boolean consumeRuleCall$5() throws Exception {
+ protected int consumeRuleCall$5() throws Exception {
return consumeTerminal(idConsumer, null, false, false, getRule().ele1LexerRuleCallID(), getRuleCall$5$Delimiter());
}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/datatyperules/parser/packrat/consumers/DatatypeRulesTestLanguageNestedModelIdConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/datatyperules/parser/packrat/consumers/DatatypeRulesTestLanguageNestedModelIdConsumer.java
index fe412b7..63d63e5 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/datatyperules/parser/packrat/consumers/DatatypeRulesTestLanguageNestedModelIdConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/datatyperules/parser/packrat/consumers/DatatypeRulesTestLanguageNestedModelIdConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -34,40 +35,44 @@ public final class DatatypeRulesTestLanguageNestedModelIdConsumer extends NonTer
keyword$4$Delimiter = ICharacterClass.Factory.nullClass();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeRuleCall$3()) {
- marker.rollback();
+ int result;
+ result = consumeRuleCall$3();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00ParserRuleCallModelId());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$4()) {
- marker.rollback();
+ result = consumeKeyword$4();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele01KeywordFullStop());
marker.release();
- return false;
+ return result;
}
- if (!consumeRuleCall$5()) {
- marker.rollback();
+ result = consumeRuleCall$5();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1ParserRuleCallModelId());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeRuleCall$3() throws Exception {
+ protected int consumeRuleCall$3() throws Exception {
return consumeNonTerminal(modelIdConsumer, null, false, true, getRule().ele00ParserRuleCallModelId());
}
- protected boolean consumeKeyword$4() throws Exception {
+ protected int consumeKeyword$4() throws Exception {
return consumeKeyword(getRule().ele01KeywordFullStop(), null, false, false, getKeyword$4$Delimiter());
}
- protected boolean consumeRuleCall$5() throws Exception {
+ protected int consumeRuleCall$5() throws Exception {
return consumeNonTerminal(modelIdConsumer, null, false, true, getRule().ele1ParserRuleCallModelId());
}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/datatyperules/parser/packrat/consumers/DatatypeRulesTestLanguageVectorConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/datatyperules/parser/packrat/consumers/DatatypeRulesTestLanguageVectorConsumer.java
index ac34033..df7b419 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/datatyperules/parser/packrat/consumers/DatatypeRulesTestLanguageVectorConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/datatyperules/parser/packrat/consumers/DatatypeRulesTestLanguageVectorConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -43,49 +44,54 @@ public final class DatatypeRulesTestLanguageVectorConsumer extends NonTerminalCo
ruleCall$6$Delimiter = ISequenceMatcher.Factory.nullMatcher();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$4()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$4();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele000KeywordLeftParenthesis());
marker.release();
- return false;
+ return result;
}
- if (!consumeRuleCall$5()) {
- marker.rollback();
+ result = consumeRuleCall$5();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele001LexerRuleCallINT());
marker.release();
- return false;
+ return result;
}
- if (!consumeRuleCall$6()) {
- marker.rollback();
+ result = consumeRuleCall$6();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele01LexerRuleCallINT());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$7()) {
- marker.rollback();
+ result = consumeKeyword$7();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1KeywordRightParenthesis());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$4() throws Exception {
+ protected int consumeKeyword$4() throws Exception {
return consumeKeyword(getRule().ele000KeywordLeftParenthesis(), null, false, false, getKeyword$4$Delimiter());
}
- protected boolean consumeRuleCall$5() throws Exception {
+ protected int consumeRuleCall$5() throws Exception {
return consumeTerminal(intConsumer, null, false, false, getRule().ele001LexerRuleCallINT(), getRuleCall$5$Delimiter());
}
- protected boolean consumeRuleCall$6() throws Exception {
+ protected int consumeRuleCall$6() throws Exception {
return consumeTerminal(intConsumer, null, false, false, getRule().ele01LexerRuleCallINT(), getRuleCall$6$Delimiter());
}
- protected boolean consumeKeyword$7() throws Exception {
+ protected int consumeKeyword$7() throws Exception {
return consumeKeyword(getRule().ele1KeywordRightParenthesis(), null, false, false, getKeyword$7$Delimiter());
}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageAbstractMetamodelDeclarationConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageAbstractMetamodelDeclarationConsumer.java
index 65808a7..c65daa6 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageAbstractMetamodelDeclarationConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageAbstractMetamodelDeclarationConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -33,23 +34,60 @@ public final class XtextGrammarTestLanguageAbstractMetamodelDeclarationConsumer
super(input, markerFactory, tokenAcceptor, hiddenTokenHandler, consumerUtil, hiddenTokens);
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeAlternatives$1();
}
- protected boolean consumeAlternatives$1() throws Exception {
- if (consumeRuleCall$2())
- return true;
- if (consumeRuleCall$3())
- return true;
- return false;
+ protected int consumeAlternatives$1() throws Exception {
+ int result = ConsumeResult.SUCCESS;
+ IMarker bestMarker = mark();
+ IMarker currentMarker;
+ int tempResult;
+ currentMarker = bestMarker.copy();
+ tempResult = consumeRuleCall$2();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ currentMarker = bestMarker.copy();
+ tempResult = consumeRuleCall$3();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ bestMarker.release();
+ return result;
}
- protected boolean consumeRuleCall$2() throws Exception {
+ protected int consumeRuleCall$2() throws Exception {
return consumeNonTerminal(generatedMetamodelConsumer, null, false, false, getRule().ele0ParserRuleCallGeneratedMetamodel());
}
- protected boolean consumeRuleCall$3() throws Exception {
+ protected int consumeRuleCall$3() throws Exception {
return consumeNonTerminal(referencedMetamodelConsumer, null, false, false, getRule().ele1ParserRuleCallReferencedMetamodel());
}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageAbstractNegatedTokenConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageAbstractNegatedTokenConsumer.java
index e7ce5f9..bf08131 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageAbstractNegatedTokenConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageAbstractNegatedTokenConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -33,23 +34,60 @@ public final class XtextGrammarTestLanguageAbstractNegatedTokenConsumer extends
super(input, markerFactory, tokenAcceptor, hiddenTokenHandler, consumerUtil, hiddenTokens);
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeAlternatives$1();
}
- protected boolean consumeAlternatives$1() throws Exception {
- if (consumeRuleCall$2())
- return true;
- if (consumeRuleCall$3())
- return true;
- return false;
+ protected int consumeAlternatives$1() throws Exception {
+ int result = ConsumeResult.SUCCESS;
+ IMarker bestMarker = mark();
+ IMarker currentMarker;
+ int tempResult;
+ currentMarker = bestMarker.copy();
+ tempResult = consumeRuleCall$2();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ currentMarker = bestMarker.copy();
+ tempResult = consumeRuleCall$3();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ bestMarker.release();
+ return result;
}
- protected boolean consumeRuleCall$2() throws Exception {
+ protected int consumeRuleCall$2() throws Exception {
return consumeNonTerminal(negatedTokenConsumer, null, false, false, getRule().ele0ParserRuleCallNegatedToken());
}
- protected boolean consumeRuleCall$3() throws Exception {
+ protected int consumeRuleCall$3() throws Exception {
return consumeNonTerminal(upToTokenConsumer, null, false, false, getRule().ele1ParserRuleCallUpToToken());
}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageAbstractRuleConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageAbstractRuleConsumer.java
index f2df0ba..afb5ffe 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageAbstractRuleConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageAbstractRuleConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -35,29 +36,82 @@ public final class XtextGrammarTestLanguageAbstractRuleConsumer extends NonTermi
super(input, markerFactory, tokenAcceptor, hiddenTokenHandler, consumerUtil, hiddenTokens);
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeAlternatives$1();
}
- protected boolean consumeAlternatives$1() throws Exception {
- if (consumeRuleCall$3())
- return true;
- if (consumeRuleCall$4())
- return true;
- if (consumeRuleCall$5())
- return true;
- return false;
+ protected int consumeAlternatives$1() throws Exception {
+ int result = ConsumeResult.SUCCESS;
+ IMarker bestMarker = mark();
+ IMarker currentMarker;
+ int tempResult;
+ currentMarker = bestMarker.copy();
+ tempResult = consumeRuleCall$3();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ currentMarker = bestMarker.copy();
+ tempResult = consumeRuleCall$4();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ currentMarker = bestMarker.copy();
+ tempResult = consumeRuleCall$5();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ bestMarker.release();
+ return result;
}
- protected boolean consumeRuleCall$3() throws Exception {
+ protected int consumeRuleCall$3() throws Exception {
return consumeNonTerminal(lexerRuleConsumer, null, false, false, getRule().ele00ParserRuleCallLexerRule());
}
- protected boolean consumeRuleCall$4() throws Exception {
+ protected int consumeRuleCall$4() throws Exception {
return consumeNonTerminal(parserRuleConsumer, null, false, false, getRule().ele01ParserRuleCallParserRule());
}
- protected boolean consumeRuleCall$5() throws Exception {
+ protected int consumeRuleCall$5() throws Exception {
return consumeNonTerminal(terminalRuleConsumer, null, false, false, getRule().ele1ParserRuleCallTerminalRule());
}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageAbstractTerminalConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageAbstractTerminalConsumer.java
index 14b0549..20d4422 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageAbstractTerminalConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageAbstractTerminalConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -37,35 +38,104 @@ public final class XtextGrammarTestLanguageAbstractTerminalConsumer extends NonT
super(input, markerFactory, tokenAcceptor, hiddenTokenHandler, consumerUtil, hiddenTokens);
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeAlternatives$1();
}
- protected boolean consumeAlternatives$1() throws Exception {
- if (consumeRuleCall$4())
- return true;
- if (consumeRuleCall$5())
- return true;
- if (consumeRuleCall$6())
- return true;
- if (consumeRuleCall$7())
- return true;
- return false;
+ protected int consumeAlternatives$1() throws Exception {
+ int result = ConsumeResult.SUCCESS;
+ IMarker bestMarker = mark();
+ IMarker currentMarker;
+ int tempResult;
+ currentMarker = bestMarker.copy();
+ tempResult = consumeRuleCall$4();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ currentMarker = bestMarker.copy();
+ tempResult = consumeRuleCall$5();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ currentMarker = bestMarker.copy();
+ tempResult = consumeRuleCall$6();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ currentMarker = bestMarker.copy();
+ tempResult = consumeRuleCall$7();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ bestMarker.release();
+ return result;
}
- protected boolean consumeRuleCall$4() throws Exception {
+ protected int consumeRuleCall$4() throws Exception {
return consumeNonTerminal(keywordConsumer, null, false, false, getRule().ele000ParserRuleCallKeyword());
}
- protected boolean consumeRuleCall$5() throws Exception {
+ protected int consumeRuleCall$5() throws Exception {
return consumeNonTerminal(ruleCallConsumer, null, false, false, getRule().ele001ParserRuleCallRuleCall());
}
- protected boolean consumeRuleCall$6() throws Exception {
+ protected int consumeRuleCall$6() throws Exception {
return consumeNonTerminal(parenthesizedElementConsumer, null, false, false, getRule().ele01ParserRuleCallParenthesizedElement());
}
- protected boolean consumeRuleCall$7() throws Exception {
+ protected int consumeRuleCall$7() throws Exception {
return consumeNonTerminal(crossReferenceConsumer, null, false, false, getRule().ele1ParserRuleCallCrossReference());
}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageAbstractTokenConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageAbstractTokenConsumer.java
index e426c8a..c256919 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageAbstractTokenConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageAbstractTokenConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -44,61 +45,129 @@ public final class XtextGrammarTestLanguageAbstractTokenConsumer extends NonTerm
keyword$12$Delimiter = ICharacterClass.Factory.nullClass();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeAlternatives$2()) {
- marker.rollback();
+ int result;
+ result = consumeAlternatives$2();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0Alternatives());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$7()) {
- marker.rollback();
+ result = consumeAssignment$7();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1AssignmentCardinality());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeAlternatives$2() throws Exception {
- if (consumeRuleCall$4())
- return true;
- if (consumeRuleCall$5())
- return true;
- if (consumeRuleCall$6())
- return true;
- return false;
+ protected int consumeAlternatives$2() throws Exception {
+ int result = ConsumeResult.SUCCESS;
+ IMarker bestMarker = mark();
+ IMarker currentMarker;
+ int tempResult;
+ currentMarker = bestMarker.copy();
+ tempResult = consumeRuleCall$4();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ currentMarker = bestMarker.copy();
+ tempResult = consumeRuleCall$5();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ currentMarker = bestMarker.copy();
+ tempResult = consumeRuleCall$6();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ bestMarker.release();
+ return result;
}
- protected boolean consumeRuleCall$4() throws Exception {
+ protected int consumeRuleCall$4() throws Exception {
return consumeNonTerminal(assignmentConsumer, null, false, false, getRule().ele000ParserRuleCallAssignment());
}
- protected boolean consumeRuleCall$5() throws Exception {
+ protected int consumeRuleCall$5() throws Exception {
return consumeNonTerminal(actionConsumer, null, false, false, getRule().ele001ParserRuleCallAction());
}
- protected boolean consumeRuleCall$6() throws Exception {
+ protected int consumeRuleCall$6() throws Exception {
return consumeNonTerminal(abstractTerminalConsumer, null, false, false, getRule().ele01ParserRuleCallAbstractTerminal());
}
- protected boolean consumeAssignment$7() throws Exception {
- doConsumeAssignment$7();
- return true;
+ protected int consumeAssignment$7() throws Exception {
+ IMarker marker = mark();
+ int result = doConsumeAssignment$7();
+ if (result != ConsumeResult.SUCCESS)
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeAssignment$7() throws Exception {
- if (consumeKeyword(getRule().ele1000KeywordQuestionMark(), "cardinality", false, false, getKeyword$10$Delimiter()))
- return true;
- if (consumeKeyword(getRule().ele1001KeywordAsterisk(), "cardinality", false, false, getKeyword$11$Delimiter()))
- return true;
- if (consumeKeyword(getRule().ele101KeywordPlusSign(), "cardinality", false, false, getKeyword$12$Delimiter()))
- return true;
- return false;
+ protected int doConsumeAssignment$7() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeKeyword(getRule().ele1000KeywordQuestionMark(), "cardinality", false, false, getKeyword$10$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ tempResult = consumeKeyword(getRule().ele1001KeywordAsterisk(), "cardinality", false, false, getKeyword$11$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ tempResult = consumeKeyword(getRule().ele101KeywordPlusSign(), "cardinality", false, false, getKeyword$12$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
public AbstractTokenElements getRule() {
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageActionConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageActionConsumer.java
index 31c7219..63ace85 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageActionConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageActionConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -60,118 +61,148 @@ public final class XtextGrammarTestLanguageActionConsumer extends NonTerminalCon
ruleCall$16$Delimiter = ISequenceMatcher.Factory.nullMatcher();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$8()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$8();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0000000KeywordLeftCurlyBracket());
marker.release();
- return false;
+ return result;
}
- if (!consumeGroup$9()) {
- marker.rollback();
+ result = consumeGroup$9();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0000001Group());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$12()) {
- marker.rollback();
+ result = consumeAssignment$12();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele000001AssignmentTypeName());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$14()) {
- marker.rollback();
+ result = consumeKeyword$14();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00001KeywordFullStop());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$15()) {
- marker.rollback();
+ result = consumeAssignment$15();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0001AssignmentFeature());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$17()) {
- marker.rollback();
+ result = consumeAssignment$17();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele001AssignmentOperator());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$21()) {
- marker.rollback();
+ result = consumeKeyword$21();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele01KeywordCurrent());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$22()) {
- marker.rollback();
+ result = consumeKeyword$22();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1KeywordRightCurlyBracket());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$8() throws Exception {
+ protected int consumeKeyword$8() throws Exception {
return consumeKeyword(getRule().ele0000000KeywordLeftCurlyBracket(), null, false, false, getKeyword$8$Delimiter());
}
- protected boolean consumeGroup$9() throws Exception {
- doConsumeGroup$9();
- return true;
+ protected int consumeGroup$9() throws Exception {
+ IMarker marker = mark();
+ int result = doConsumeGroup$9();
+ if (result != ConsumeResult.SUCCESS)
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeGroup$9() throws Exception {
+ protected int doConsumeGroup$9() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$10()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$10();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00000010KeywordCurrent());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$11()) {
- marker.rollback();
+ result = consumeKeyword$11();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00000011KeywordEqualsSign());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$10() throws Exception {
+ protected int consumeKeyword$10() throws Exception {
return consumeKeyword(getRule().ele00000010KeywordCurrent(), null, false, false, getKeyword$10$Delimiter());
}
- protected boolean consumeKeyword$11() throws Exception {
+ protected int consumeKeyword$11() throws Exception {
return consumeKeyword(getRule().ele00000011KeywordEqualsSign(), null, false, false, getKeyword$11$Delimiter());
}
- protected boolean consumeAssignment$12() throws Exception {
- if (consumeNonTerminal(typeRefConsumer, "typeName", false, false, getRule().ele0000010ParserRuleCallTypeRef()))
- return true;
- return false;
+ protected int consumeAssignment$12() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(typeRefConsumer, "typeName", false, false, getRule().ele0000010ParserRuleCallTypeRef());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeKeyword$14() throws Exception {
+ protected int consumeKeyword$14() throws Exception {
return consumeKeyword(getRule().ele00001KeywordFullStop(), null, false, false, getKeyword$14$Delimiter());
}
- protected boolean consumeAssignment$15() throws Exception {
- if (consumeTerminal(idConsumer, "feature", false, false, getRule().ele00010LexerRuleCallID(), getRuleCall$16$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$15() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, "feature", false, false, getRule().ele00010LexerRuleCallID(), getRuleCall$16$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeAssignment$17() throws Exception {
- if (consumeKeyword(getRule().ele00100KeywordEqualsSign(), "operator", false, false, getKeyword$19$Delimiter()))
- return true;
- if (consumeKeyword(getRule().ele00101KeywordPlusSignEqualsSign(), "operator", false, false, getKeyword$20$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$17() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeKeyword(getRule().ele00100KeywordEqualsSign(), "operator", false, false, getKeyword$19$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ tempResult = consumeKeyword(getRule().ele00101KeywordPlusSignEqualsSign(), "operator", false, false, getKeyword$20$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeKeyword$21() throws Exception {
+ protected int consumeKeyword$21() throws Exception {
return consumeKeyword(getRule().ele01KeywordCurrent(), null, false, false, getKeyword$21$Delimiter());
}
- protected boolean consumeKeyword$22() throws Exception {
+ protected int consumeKeyword$22() throws Exception {
return consumeKeyword(getRule().ele1KeywordRightCurlyBracket(), null, false, false, getKeyword$22$Delimiter());
}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageAlternativesConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageAlternativesConsumer.java
index 319b2ca..2fb50b3 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageAlternativesConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageAlternativesConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -34,68 +35,85 @@ public final class XtextGrammarTestLanguageAlternativesConsumer extends NonTermi
keyword$7$Delimiter = ICharacterClass.Factory.nullClass();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeRuleCall$2()) {
- marker.rollback();
+ int result;
+ result = consumeRuleCall$2();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0ParserRuleCallGroup());
marker.release();
- return false;
+ return result;
}
- if (!consumeGroup$3()) {
- marker.rollback();
+ result = consumeGroup$3();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1Group());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeRuleCall$2() throws Exception {
+ protected int consumeRuleCall$2() throws Exception {
return consumeNonTerminal(groupConsumer, null, false, false, getRule().ele0ParserRuleCallGroup());
}
- protected boolean consumeGroup$3() throws Exception {
- while(doConsumeGroup$3()) {}
- return true;
+ protected int consumeGroup$3() throws Exception {
+ IMarker marker = mark();
+ while(doConsumeGroup$3() == ConsumeResult.SUCCESS) {
+ marker.release();
+ marker = mark();
+ }
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeGroup$3() throws Exception {
+ protected int doConsumeGroup$3() throws Exception {
final IMarker marker = mark();
- if (!consumeAction$5()) {
- marker.rollback();
+ int result;
+ result = consumeAction$5();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele100ActionAlternativesgroups());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$7()) {
- marker.rollback();
+ result = consumeKeyword$7();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele101KeywordVerticalLine());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$8()) {
- marker.rollback();
+ result = consumeAssignment$8();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele11AssignmentGroups());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeAction$5() {
+ protected int consumeAction$5() {
consumeAction("Alternatives", "groups", true);
- return true;
+ return ConsumeResult.SUCCESS;
}
- protected boolean consumeKeyword$7() throws Exception {
+ protected int consumeKeyword$7() throws Exception {
return consumeKeyword(getRule().ele101KeywordVerticalLine(), null, false, false, getKeyword$7$Delimiter());
}
- protected boolean consumeAssignment$8() throws Exception {
- if (consumeNonTerminal(groupConsumer, "groups", true, false, getRule().ele110ParserRuleCallGroup()))
- return true;
- return false;
+ protected int consumeAssignment$8() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(groupConsumer, "groups", true, false, getRule().ele110ParserRuleCallGroup());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
public AlternativesElements getRule() {
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageAssignmentConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageAssignmentConsumer.java
index 2874b7c..03d3071 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageAssignmentConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageAssignmentConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -45,51 +46,71 @@ public final class XtextGrammarTestLanguageAssignmentConsumer extends NonTermina
ruleCall$4$Delimiter = ISequenceMatcher.Factory.nullMatcher();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeAssignment$3()) {
- marker.rollback();
+ int result;
+ result = consumeAssignment$3();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00AssignmentFeature());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$5()) {
- marker.rollback();
+ result = consumeAssignment$5();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele01AssignmentOperator());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$11()) {
- marker.rollback();
+ result = consumeAssignment$11();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1AssignmentTerminal());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeAssignment$3() throws Exception {
- if (consumeTerminal(idConsumer, "feature", false, false, getRule().ele000LexerRuleCallID(), getRuleCall$4$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$3() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, "feature", false, false, getRule().ele000LexerRuleCallID(), getRuleCall$4$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeAssignment$5() throws Exception {
- if (consumeKeyword(getRule().ele01000KeywordPlusSignEqualsSign(), "operator", false, false, getKeyword$8$Delimiter()))
- return true;
- if (consumeKeyword(getRule().ele01001KeywordEqualsSign(), "operator", false, false, getKeyword$9$Delimiter()))
- return true;
- if (consumeKeyword(getRule().ele0101KeywordQuestionMarkEqualsSign(), "operator", false, false, getKeyword$10$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$5() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeKeyword(getRule().ele01000KeywordPlusSignEqualsSign(), "operator", false, false, getKeyword$8$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ tempResult = consumeKeyword(getRule().ele01001KeywordEqualsSign(), "operator", false, false, getKeyword$9$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ tempResult = consumeKeyword(getRule().ele0101KeywordQuestionMarkEqualsSign(), "operator", false, false, getKeyword$10$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeAssignment$11() throws Exception {
- if (consumeNonTerminal(abstractTerminalConsumer, "terminal", false, false, getRule().ele10ParserRuleCallAbstractTerminal()))
- return true;
- return false;
+ protected int consumeAssignment$11() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(abstractTerminalConsumer, "terminal", false, false, getRule().ele10ParserRuleCallAbstractTerminal());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
public AssignmentElements getRule() {
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageCharacterRangeConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageCharacterRangeConsumer.java
index 62ee1a4..a587353 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageCharacterRangeConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageCharacterRangeConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -34,68 +35,83 @@ public final class XtextGrammarTestLanguageCharacterRangeConsumer extends NonTer
keyword$7$Delimiter = ICharacterClass.Factory.nullClass();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeRuleCall$2()) {
- marker.rollback();
+ int result;
+ result = consumeRuleCall$2();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0ParserRuleCallKeyword());
marker.release();
- return false;
+ return result;
}
- if (!consumeGroup$3()) {
- marker.rollback();
+ result = consumeGroup$3();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1Group());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeRuleCall$2() throws Exception {
+ protected int consumeRuleCall$2() throws Exception {
return consumeNonTerminal(keywordConsumer, null, false, false, getRule().ele0ParserRuleCallKeyword());
}
- protected boolean consumeGroup$3() throws Exception {
- doConsumeGroup$3();
- return true;
+ protected int consumeGroup$3() throws Exception {
+ IMarker marker = mark();
+ int result = doConsumeGroup$3();
+ if (result != ConsumeResult.SUCCESS)
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeGroup$3() throws Exception {
+ protected int doConsumeGroup$3() throws Exception {
final IMarker marker = mark();
- if (!consumeAction$5()) {
- marker.rollback();
+ int result;
+ result = consumeAction$5();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele100ActionCharacterRangeleft());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$7()) {
- marker.rollback();
+ result = consumeKeyword$7();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele101KeywordFullStopFullStop());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$8()) {
- marker.rollback();
+ result = consumeAssignment$8();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele11AssignmentRight());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeAction$5() {
+ protected int consumeAction$5() {
consumeAction("CharacterRange", "left", false);
- return true;
+ return ConsumeResult.SUCCESS;
}
- protected boolean consumeKeyword$7() throws Exception {
+ protected int consumeKeyword$7() throws Exception {
return consumeKeyword(getRule().ele101KeywordFullStopFullStop(), null, false, false, getKeyword$7$Delimiter());
}
- protected boolean consumeAssignment$8() throws Exception {
- if (consumeNonTerminal(keywordConsumer, "right", false, false, getRule().ele110ParserRuleCallKeyword()))
- return true;
- return false;
+ protected int consumeAssignment$8() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(keywordConsumer, "right", false, false, getRule().ele110ParserRuleCallKeyword());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
public CharacterRangeElements getRule() {
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageCrossReferenceConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageCrossReferenceConsumer.java
index 36b93b4..138ebb8 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageCrossReferenceConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageCrossReferenceConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -45,78 +46,98 @@ public final class XtextGrammarTestLanguageCrossReferenceConsumer extends NonTer
keyword$12$Delimiter = ICharacterClass.Factory.nullClass();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$4()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$4();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele000KeywordLeftSquareBracket());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$5()) {
- marker.rollback();
+ result = consumeAssignment$5();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele001AssignmentType());
marker.release();
- return false;
+ return result;
}
- if (!consumeGroup$7()) {
- marker.rollback();
+ result = consumeGroup$7();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele01Group());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$12()) {
- marker.rollback();
+ result = consumeKeyword$12();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1KeywordRightSquareBracket());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$4() throws Exception {
+ protected int consumeKeyword$4() throws Exception {
return consumeKeyword(getRule().ele000KeywordLeftSquareBracket(), null, false, false, getKeyword$4$Delimiter());
}
- protected boolean consumeAssignment$5() throws Exception {
- if (consumeNonTerminal(typeRefConsumer, "type", false, false, getRule().ele0010ParserRuleCallTypeRef()))
- return true;
- return false;
+ protected int consumeAssignment$5() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(typeRefConsumer, "type", false, false, getRule().ele0010ParserRuleCallTypeRef());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeGroup$7() throws Exception {
- doConsumeGroup$7();
- return true;
+ protected int consumeGroup$7() throws Exception {
+ IMarker marker = mark();
+ int result = doConsumeGroup$7();
+ if (result != ConsumeResult.SUCCESS)
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeGroup$7() throws Exception {
+ protected int doConsumeGroup$7() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$8()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$8();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele010KeywordVerticalLine());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$9()) {
- marker.rollback();
+ result = consumeAssignment$9();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele011AssignmentRule());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$8() throws Exception {
+ protected int consumeKeyword$8() throws Exception {
return consumeKeyword(getRule().ele010KeywordVerticalLine(), null, false, false, getKeyword$8$Delimiter());
}
- protected boolean consumeAssignment$9() throws Exception {
- if (consumeTerminal(idConsumer, null, false, false, getRule().ele0110CrossReferenceEStringAbstractRule(), getCrossReference$10$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$9() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, null, false, false, getRule().ele0110CrossReferenceEStringAbstractRule(), getCrossReference$10$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeKeyword$12() throws Exception {
+ protected int consumeKeyword$12() throws Exception {
return consumeKeyword(getRule().ele1KeywordRightSquareBracket(), null, false, false, getKeyword$12$Delimiter());
}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageGeneratedMetamodelConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageGeneratedMetamodelConsumer.java
index 1bd3e8a..e2d69e2 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageGeneratedMetamodelConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageGeneratedMetamodelConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -48,81 +49,105 @@ public final class XtextGrammarTestLanguageGeneratedMetamodelConsumer extends No
ruleCall$13$Delimiter = ISequenceMatcher.Factory.nullMatcher();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$4()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$4();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele000KeywordGenerate());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$5()) {
- marker.rollback();
+ result = consumeAssignment$5();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele001AssignmentName());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$7()) {
- marker.rollback();
+ result = consumeAssignment$7();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele01AssignmentEPackage());
marker.release();
- return false;
+ return result;
}
- if (!consumeGroup$10()) {
- marker.rollback();
+ result = consumeGroup$10();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1Group());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$4() throws Exception {
+ protected int consumeKeyword$4() throws Exception {
return consumeKeyword(getRule().ele000KeywordGenerate(), null, false, false, getKeyword$4$Delimiter());
}
- protected boolean consumeAssignment$5() throws Exception {
- if (consumeTerminal(idConsumer, "name", false, false, getRule().ele0010LexerRuleCallID(), getRuleCall$6$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$5() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, "name", false, false, getRule().ele0010LexerRuleCallID(), getRuleCall$6$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeAssignment$7() throws Exception {
- if (consumeTerminal(stringConsumer, null, false, false, getRule().ele010CrossReferenceEStringEPackage(), getCrossReference$8$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$7() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(stringConsumer, null, false, false, getRule().ele010CrossReferenceEStringEPackage(), getCrossReference$8$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeGroup$10() throws Exception {
- doConsumeGroup$10();
- return true;
+ protected int consumeGroup$10() throws Exception {
+ IMarker marker = mark();
+ int result = doConsumeGroup$10();
+ if (result != ConsumeResult.SUCCESS)
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeGroup$10() throws Exception {
+ protected int doConsumeGroup$10() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$11()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$11();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele10KeywordAs());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$12()) {
- marker.rollback();
+ result = consumeAssignment$12();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele11AssignmentAlias());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$11() throws Exception {
+ protected int consumeKeyword$11() throws Exception {
return consumeKeyword(getRule().ele10KeywordAs(), null, false, false, getKeyword$11$Delimiter());
}
- protected boolean consumeAssignment$12() throws Exception {
- if (consumeTerminal(idConsumer, "alias", false, false, getRule().ele110LexerRuleCallID(), getRuleCall$13$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$12() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, "alias", false, false, getRule().ele110LexerRuleCallID(), getRuleCall$13$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
public GeneratedMetamodelElements getRule() {
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageGrammarConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageGrammarConsumer.java
index 8bcc768..d06f7a8 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageGrammarConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageGrammarConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -62,191 +63,307 @@ public final class XtextGrammarTestLanguageGrammarConsumer extends NonTerminalCo
ruleCall$24$Delimiter = ISequenceMatcher.Factory.nullMatcher();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeAlternatives$6()) {
- marker.rollback();
+ int result;
+ result = consumeAlternatives$6();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00000Alternatives());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$10()) {
- marker.rollback();
+ result = consumeAssignment$10();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00001AssignmentIdElements());
marker.release();
- return false;
+ return result;
}
- if (!consumeGroup$12()) {
- marker.rollback();
+ result = consumeGroup$12();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0001Group());
marker.release();
- return false;
+ return result;
}
- if (!consumeGroup$16()) {
- marker.rollback();
+ result = consumeGroup$16();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele001Group());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$25()) {
- marker.rollback();
+ result = consumeAssignment$25();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele01AssignmentMetamodelDeclarations());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$27()) {
- marker.rollback();
+ result = consumeAssignment$27();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1AssignmentRules());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeAlternatives$6() throws Exception {
- if (consumeAssignment$7())
- return true;
- if (consumeKeyword$9())
- return true;
- return false;
+ protected int consumeAlternatives$6() throws Exception {
+ int result = ConsumeResult.SUCCESS;
+ IMarker bestMarker = mark();
+ IMarker currentMarker;
+ int tempResult;
+ currentMarker = bestMarker.copy();
+ tempResult = consumeAssignment$7();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ currentMarker = bestMarker.copy();
+ tempResult = consumeKeyword$9();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ bestMarker.release();
+ return result;
}
- protected boolean consumeAssignment$7() throws Exception {
- if (consumeKeyword(getRule().ele0000000KeywordAbstractLanguage(), "abstract", false, true, getKeyword$8$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$7() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeKeyword(getRule().ele0000000KeywordAbstractLanguage(), "abstract", false, true, getKeyword$8$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeKeyword$9() throws Exception {
+ protected int consumeKeyword$9() throws Exception {
return consumeKeyword(getRule().ele000001KeywordLanguage(), null, false, false, getKeyword$9$Delimiter());
}
- protected boolean consumeAssignment$10() throws Exception {
- if (consumeTerminal(idConsumer, "idElements", true, false, getRule().ele000010LexerRuleCallID(), getRuleCall$11$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$10() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, "idElements", true, false, getRule().ele000010LexerRuleCallID(), getRuleCall$11$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeGroup$12() throws Exception {
- while(doConsumeGroup$12()) {}
- return true;
+ protected int consumeGroup$12() throws Exception {
+ IMarker marker = mark();
+ while(doConsumeGroup$12() == ConsumeResult.SUCCESS) {
+ marker.release();
+ marker = mark();
+ }
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeGroup$12() throws Exception {
+ protected int doConsumeGroup$12() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$13()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$13();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00010KeywordFullStop());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$14()) {
- marker.rollback();
+ result = consumeAssignment$14();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00011AssignmentIdElements());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$13() throws Exception {
+ protected int consumeKeyword$13() throws Exception {
return consumeKeyword(getRule().ele00010KeywordFullStop(), null, false, false, getKeyword$13$Delimiter());
}
- protected boolean consumeAssignment$14() throws Exception {
- if (consumeTerminal(idConsumer, "idElements", true, false, getRule().ele000110LexerRuleCallID(), getRuleCall$15$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$14() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, "idElements", true, false, getRule().ele000110LexerRuleCallID(), getRuleCall$15$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeGroup$16() throws Exception {
- doConsumeGroup$16();
- return true;
+ protected int consumeGroup$16() throws Exception {
+ IMarker marker = mark();
+ int result = doConsumeGroup$16();
+ if (result != ConsumeResult.SUCCESS)
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeGroup$16() throws Exception {
+ protected int doConsumeGroup$16() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$18()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$18();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00100KeywordExtends());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$19()) {
- marker.rollback();
+ result = consumeAssignment$19();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00101AssignmentSuperGrammarIdElements());
marker.release();
- return false;
+ return result;
}
- if (!consumeGroup$21()) {
- marker.rollback();
+ result = consumeGroup$21();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0011Group());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$18() throws Exception {
+ protected int consumeKeyword$18() throws Exception {
return consumeKeyword(getRule().ele00100KeywordExtends(), null, false, false, getKeyword$18$Delimiter());
}
- protected boolean consumeAssignment$19() throws Exception {
- if (consumeTerminal(idConsumer, "superGrammarIdElements", true, false, getRule().ele001010LexerRuleCallID(), getRuleCall$20$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$19() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, "superGrammarIdElements", true, false, getRule().ele001010LexerRuleCallID(), getRuleCall$20$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeGroup$21() throws Exception {
- while(doConsumeGroup$21()) {}
- return true;
+ protected int consumeGroup$21() throws Exception {
+ IMarker marker = mark();
+ while(doConsumeGroup$21() == ConsumeResult.SUCCESS) {
+ marker.release();
+ marker = mark();
+ }
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeGroup$21() throws Exception {
+ protected int doConsumeGroup$21() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$22()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$22();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00110KeywordFullStop());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$23()) {
- marker.rollback();
+ result = consumeAssignment$23();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00111AssignmentSuperGrammarIdElements());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$22() throws Exception {
+ protected int consumeKeyword$22() throws Exception {
return consumeKeyword(getRule().ele00110KeywordFullStop(), null, false, false, getKeyword$22$Delimiter());
}
- protected boolean consumeAssignment$23() throws Exception {
- if (consumeTerminal(idConsumer, "superGrammarIdElements", true, false, getRule().ele001110LexerRuleCallID(), getRuleCall$24$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$23() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, "superGrammarIdElements", true, false, getRule().ele001110LexerRuleCallID(), getRuleCall$24$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeAssignment$25() throws Exception {
- while(doConsumeAssignment$25()) {}
- return true;
+ protected int consumeAssignment$25() throws Exception {
+ IMarker marker = mark();
+ while(doConsumeAssignment$25() == ConsumeResult.SUCCESS) {
+ marker.release();
+ marker = mark();
+ }
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeAssignment$25() throws Exception {
- if (consumeNonTerminal(abstractMetamodelDeclarationConsumer, "metamodelDeclarations", true, false, getRule().ele010ParserRuleCallAbstractMetamodelDeclaration()))
- return true;
- return false;
+ protected int doConsumeAssignment$25() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(abstractMetamodelDeclarationConsumer, "metamodelDeclarations", true, false, getRule().ele010ParserRuleCallAbstractMetamodelDeclaration());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeAssignment$27() throws Exception {
- if (doConsumeAssignment$27()) {
- while(doConsumeAssignment$27()) {}
- return true;
+ protected int consumeAssignment$27() throws Exception {
+ IMarker marker = mark();
+ int result = doConsumeAssignment$27();
+ if (result == ConsumeResult.SUCCESS) {
+ marker.release();
+ marker = mark();
+ while(doConsumeAssignment$27()==ConsumeResult.SUCCESS) {
+ marker.release();
+ marker = mark();
+ }
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
+ } else {
+ error("Could not find token.", getRule().ele1AssignmentRules());
}
- return false;
+ marker.release();
+ return result;
}
- protected boolean doConsumeAssignment$27() throws Exception {
- if (consumeNonTerminal(abstractRuleConsumer, "rules", true, false, getRule().ele10ParserRuleCallAbstractRule()))
- return true;
- return false;
+ protected int doConsumeAssignment$27() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(abstractRuleConsumer, "rules", true, false, getRule().ele10ParserRuleCallAbstractRule());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
public GrammarElements getRule() {
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageGroupConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageGroupConsumer.java
index 99c8576..411bc56 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageGroupConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageGroupConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -31,59 +32,75 @@ public final class XtextGrammarTestLanguageGroupConsumer extends NonTerminalCons
super(input, markerFactory, tokenAcceptor, hiddenTokenHandler, consumerUtil, hiddenTokens);
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeRuleCall$2()) {
- marker.rollback();
+ int result;
+ result = consumeRuleCall$2();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0ParserRuleCallAbstractToken());
marker.release();
- return false;
+ return result;
}
- if (!consumeGroup$3()) {
- marker.rollback();
+ result = consumeGroup$3();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1Group());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeRuleCall$2() throws Exception {
+ protected int consumeRuleCall$2() throws Exception {
return consumeNonTerminal(abstractTokenConsumer, null, false, false, getRule().ele0ParserRuleCallAbstractToken());
}
- protected boolean consumeGroup$3() throws Exception {
- while(doConsumeGroup$3()) {}
- return true;
+ protected int consumeGroup$3() throws Exception {
+ IMarker marker = mark();
+ while(doConsumeGroup$3() == ConsumeResult.SUCCESS) {
+ marker.release();
+ marker = mark();
+ }
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeGroup$3() throws Exception {
+ protected int doConsumeGroup$3() throws Exception {
final IMarker marker = mark();
- if (!consumeAction$4()) {
- marker.rollback();
+ int result;
+ result = consumeAction$4();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele10ActionGroupabstractTokens());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$6()) {
- marker.rollback();
+ result = consumeAssignment$6();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele11AssignmentAbstractTokens());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeAction$4() {
+ protected int consumeAction$4() {
consumeAction("Group", "abstractTokens", true);
- return true;
+ return ConsumeResult.SUCCESS;
}
- protected boolean consumeAssignment$6() throws Exception {
- if (consumeNonTerminal(abstractTokenConsumer, "abstractTokens", true, false, getRule().ele110ParserRuleCallAbstractToken()))
- return true;
- return false;
+ protected int consumeAssignment$6() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(abstractTokenConsumer, "abstractTokens", true, false, getRule().ele110ParserRuleCallAbstractToken());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
public GroupElements getRule() {
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageKeywordConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageKeywordConsumer.java
index 70242ae..0146cdb 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageKeywordConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageKeywordConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -34,14 +35,18 @@ public final class XtextGrammarTestLanguageKeywordConsumer extends NonTerminalCo
ruleCall$2$Delimiter = ISequenceMatcher.Factory.nullMatcher();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeAssignment$1();
}
- protected boolean consumeAssignment$1() throws Exception {
- if (consumeTerminal(stringConsumer, "value", false, false, getRule().ele0LexerRuleCallSTRING(), getRuleCall$2$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$1() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(stringConsumer, "value", false, false, getRule().ele0LexerRuleCallSTRING(), getRuleCall$2$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
public KeywordElements getRule() {
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageLexerRuleConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageLexerRuleConsumer.java
index 4161ce7..080bfcb 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageLexerRuleConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageLexerRuleConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -56,110 +57,173 @@ public final class XtextGrammarTestLanguageLexerRuleConsumer extends NonTerminal
ruleCall$17$Delimiter = ISequenceMatcher.Factory.nullMatcher();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeAlternatives$6()) {
- marker.rollback();
+ int result;
+ result = consumeAlternatives$6();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00000Alternatives());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$9()) {
- marker.rollback();
+ result = consumeAssignment$9();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00001AssignmentName());
marker.release();
- return false;
+ return result;
}
- if (!consumeGroup$11()) {
- marker.rollback();
+ result = consumeGroup$11();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0001Group());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$15()) {
- marker.rollback();
+ result = consumeKeyword$15();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele001KeywordColon());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$16()) {
- marker.rollback();
+ result = consumeAssignment$16();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele01AssignmentBody());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$18()) {
- marker.rollback();
+ result = consumeKeyword$18();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1KeywordSemicolon());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeAlternatives$6() throws Exception {
- if (consumeKeyword$7())
- return true;
- if (consumeKeyword$8())
- return true;
- return false;
+ protected int consumeAlternatives$6() throws Exception {
+ int result = ConsumeResult.SUCCESS;
+ IMarker bestMarker = mark();
+ IMarker currentMarker;
+ int tempResult;
+ currentMarker = bestMarker.copy();
+ tempResult = consumeKeyword$7();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ currentMarker = bestMarker.copy();
+ tempResult = consumeKeyword$8();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ bestMarker.release();
+ return result;
}
- protected boolean consumeKeyword$7() throws Exception {
+ protected int consumeKeyword$7() throws Exception {
return consumeKeyword(getRule().ele000000KeywordNative(), null, false, false, getKeyword$7$Delimiter());
}
- protected boolean consumeKeyword$8() throws Exception {
+ protected int consumeKeyword$8() throws Exception {
return consumeKeyword(getRule().ele000001KeywordLexer(), null, false, false, getKeyword$8$Delimiter());
}
- protected boolean consumeAssignment$9() throws Exception {
- if (consumeTerminal(idConsumer, "name", false, false, getRule().ele000010LexerRuleCallID(), getRuleCall$10$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$9() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, "name", false, false, getRule().ele000010LexerRuleCallID(), getRuleCall$10$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeGroup$11() throws Exception {
- doConsumeGroup$11();
- return true;
+ protected int consumeGroup$11() throws Exception {
+ IMarker marker = mark();
+ int result = doConsumeGroup$11();
+ if (result != ConsumeResult.SUCCESS)
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeGroup$11() throws Exception {
+ protected int doConsumeGroup$11() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$12()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$12();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00010KeywordReturns());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$13()) {
- marker.rollback();
+ result = consumeAssignment$13();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00011AssignmentType());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$12() throws Exception {
+ protected int consumeKeyword$12() throws Exception {
return consumeKeyword(getRule().ele00010KeywordReturns(), null, false, false, getKeyword$12$Delimiter());
}
- protected boolean consumeAssignment$13() throws Exception {
- if (consumeNonTerminal(typeRefConsumer, "type", false, false, getRule().ele000110ParserRuleCallTypeRef()))
- return true;
- return false;
+ protected int consumeAssignment$13() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(typeRefConsumer, "type", false, false, getRule().ele000110ParserRuleCallTypeRef());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeKeyword$15() throws Exception {
+ protected int consumeKeyword$15() throws Exception {
return consumeKeyword(getRule().ele001KeywordColon(), null, false, false, getKeyword$15$Delimiter());
}
- protected boolean consumeAssignment$16() throws Exception {
- if (consumeTerminal(stringConsumer, "body", false, false, getRule().ele010LexerRuleCallSTRING(), getRuleCall$17$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$16() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(stringConsumer, "body", false, false, getRule().ele010LexerRuleCallSTRING(), getRuleCall$17$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeKeyword$18() throws Exception {
+ protected int consumeKeyword$18() throws Exception {
return consumeKeyword(getRule().ele1KeywordSemicolon(), null, false, false, getKeyword$18$Delimiter());
}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageNegatedTokenConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageNegatedTokenConsumer.java
index e6b638f..4703225 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageNegatedTokenConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageNegatedTokenConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -34,34 +35,41 @@ public final class XtextGrammarTestLanguageNegatedTokenConsumer extends NonTermi
keyword$2$Delimiter = ICharacterClass.Factory.nullClass();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$2()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$2();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0KeywordExclamationMark());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$3()) {
- marker.rollback();
+ result = consumeAssignment$3();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1AssignmentTerminal());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$2() throws Exception {
+ protected int consumeKeyword$2() throws Exception {
return consumeKeyword(getRule().ele0KeywordExclamationMark(), null, false, false, getKeyword$2$Delimiter());
}
- protected boolean consumeAssignment$3() throws Exception {
- if (consumeNonTerminal(terminalTokenElementConsumer, "terminal", false, false, getRule().ele10ParserRuleCallTerminalTokenElement()))
- return true;
- return false;
+ protected int consumeAssignment$3() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(terminalTokenElementConsumer, "terminal", false, false, getRule().ele10ParserRuleCallTerminalTokenElement());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
public NegatedTokenElements getRule() {
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageParenthesizedElementConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageParenthesizedElementConsumer.java
index cfa60d8..49de242 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageParenthesizedElementConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageParenthesizedElementConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -37,40 +38,44 @@ public final class XtextGrammarTestLanguageParenthesizedElementConsumer extends
keyword$5$Delimiter = ICharacterClass.Factory.nullClass();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$3()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$3();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00KeywordLeftParenthesis());
marker.release();
- return false;
+ return result;
}
- if (!consumeRuleCall$4()) {
- marker.rollback();
+ result = consumeRuleCall$4();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele01ParserRuleCallAlternatives());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$5()) {
- marker.rollback();
+ result = consumeKeyword$5();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1KeywordRightParenthesis());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$3() throws Exception {
+ protected int consumeKeyword$3() throws Exception {
return consumeKeyword(getRule().ele00KeywordLeftParenthesis(), null, false, false, getKeyword$3$Delimiter());
}
- protected boolean consumeRuleCall$4() throws Exception {
+ protected int consumeRuleCall$4() throws Exception {
return consumeNonTerminal(alternativesConsumer, null, false, false, getRule().ele01ParserRuleCallAlternatives());
}
- protected boolean consumeKeyword$5() throws Exception {
+ protected int consumeKeyword$5() throws Exception {
return consumeKeyword(getRule().ele1KeywordRightParenthesis(), null, false, false, getKeyword$5$Delimiter());
}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageParenthesizedTerminalElementConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageParenthesizedTerminalElementConsumer.java
index 866220b..23f82c2 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageParenthesizedTerminalElementConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageParenthesizedTerminalElementConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -37,40 +38,44 @@ public final class XtextGrammarTestLanguageParenthesizedTerminalElementConsumer
keyword$5$Delimiter = ICharacterClass.Factory.nullClass();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$3()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$3();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00KeywordLeftParenthesis());
marker.release();
- return false;
+ return result;
}
- if (!consumeRuleCall$4()) {
- marker.rollback();
+ result = consumeRuleCall$4();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele01ParserRuleCallTerminalAlternatives());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$5()) {
- marker.rollback();
+ result = consumeKeyword$5();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1KeywordRightParenthesis());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$3() throws Exception {
+ protected int consumeKeyword$3() throws Exception {
return consumeKeyword(getRule().ele00KeywordLeftParenthesis(), null, false, false, getKeyword$3$Delimiter());
}
- protected boolean consumeRuleCall$4() throws Exception {
+ protected int consumeRuleCall$4() throws Exception {
return consumeNonTerminal(terminalAlternativesConsumer, null, false, false, getRule().ele01ParserRuleCallTerminalAlternatives());
}
- protected boolean consumeKeyword$5() throws Exception {
+ protected int consumeKeyword$5() throws Exception {
return consumeKeyword(getRule().ele1KeywordRightParenthesis(), null, false, false, getKeyword$5$Delimiter());
}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageParserRuleConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageParserRuleConsumer.java
index e3b0ce7..9fc76a5 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageParserRuleConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageParserRuleConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -65,165 +66,214 @@ public final class XtextGrammarTestLanguageParserRuleConsumer extends NonTermina
ruleCall$7$Delimiter = ISequenceMatcher.Factory.nullMatcher();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeAssignment$6()) {
- marker.rollback();
+ int result;
+ result = consumeAssignment$6();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00000AssignmentName());
marker.release();
- return false;
+ return result;
}
- if (!consumeGroup$8()) {
- marker.rollback();
+ result = consumeGroup$8();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00001Group());
marker.release();
- return false;
+ return result;
}
- if (!consumeGroup$12()) {
- marker.rollback();
+ result = consumeGroup$12();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0001Group());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$28()) {
- marker.rollback();
+ result = consumeKeyword$28();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele001KeywordColon());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$29()) {
- marker.rollback();
+ result = consumeAssignment$29();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele01AssignmentAlternatives());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$31()) {
- marker.rollback();
+ result = consumeKeyword$31();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1KeywordSemicolon());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeAssignment$6() throws Exception {
- if (consumeTerminal(idConsumer, "name", false, false, getRule().ele000000LexerRuleCallID(), getRuleCall$7$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$6() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, "name", false, false, getRule().ele000000LexerRuleCallID(), getRuleCall$7$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeGroup$8() throws Exception {
- doConsumeGroup$8();
- return true;
+ protected int consumeGroup$8() throws Exception {
+ IMarker marker = mark();
+ int result = doConsumeGroup$8();
+ if (result != ConsumeResult.SUCCESS)
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeGroup$8() throws Exception {
+ protected int doConsumeGroup$8() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$9()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$9();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele000010KeywordReturns());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$10()) {
- marker.rollback();
+ result = consumeAssignment$10();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele000011AssignmentType());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$9() throws Exception {
+ protected int consumeKeyword$9() throws Exception {
return consumeKeyword(getRule().ele000010KeywordReturns(), null, false, false, getKeyword$9$Delimiter());
}
- protected boolean consumeAssignment$10() throws Exception {
- if (consumeNonTerminal(typeRefConsumer, "type", false, false, getRule().ele0000110ParserRuleCallTypeRef()))
- return true;
- return false;
+ protected int consumeAssignment$10() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(typeRefConsumer, "type", false, false, getRule().ele0000110ParserRuleCallTypeRef());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeGroup$12() throws Exception {
- doConsumeGroup$12();
- return true;
+ protected int consumeGroup$12() throws Exception {
+ IMarker marker = mark();
+ int result = doConsumeGroup$12();
+ if (result != ConsumeResult.SUCCESS)
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeGroup$12() throws Exception {
+ protected int doConsumeGroup$12() throws Exception {
final IMarker marker = mark();
- if (!consumeAssignment$16()) {
- marker.rollback();
+ int result;
+ result = consumeAssignment$16();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00010000AssignmentDefinesHiddenTokens());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$18()) {
- marker.rollback();
+ result = consumeKeyword$18();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00010001KeywordLeftParenthesis());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$19()) {
- marker.rollback();
+ result = consumeAssignment$19();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0001001AssignmentHiddenTokens());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$23()) {
- marker.rollback();
+ result = consumeKeyword$23();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0001010KeywordComma());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$24()) {
- marker.rollback();
+ result = consumeAssignment$24();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0001011AssignmentHiddenTokens());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$27()) {
- marker.rollback();
+ result = consumeKeyword$27();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00011KeywordRightParenthesis());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeAssignment$16() throws Exception {
- if (consumeKeyword(getRule().ele000100000KeywordHidden(), "definesHiddenTokens", false, true, getKeyword$17$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$16() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeKeyword(getRule().ele000100000KeywordHidden(), "definesHiddenTokens", false, true, getKeyword$17$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeKeyword$18() throws Exception {
+ protected int consumeKeyword$18() throws Exception {
return consumeKeyword(getRule().ele00010001KeywordLeftParenthesis(), null, false, false, getKeyword$18$Delimiter());
}
- protected boolean consumeAssignment$19() throws Exception {
- if (consumeTerminal(idConsumer, null, true, false, getRule().ele00010010CrossReferenceEStringAbstractRule(), getCrossReference$20$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$19() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, null, true, false, getRule().ele00010010CrossReferenceEStringAbstractRule(), getCrossReference$20$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeKeyword$23() throws Exception {
+ protected int consumeKeyword$23() throws Exception {
return consumeKeyword(getRule().ele0001010KeywordComma(), null, false, false, getKeyword$23$Delimiter());
}
- protected boolean consumeAssignment$24() throws Exception {
- if (consumeTerminal(idConsumer, null, true, false, getRule().ele00010110CrossReferenceEStringAbstractRule(), getCrossReference$25$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$24() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, null, true, false, getRule().ele00010110CrossReferenceEStringAbstractRule(), getCrossReference$25$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeKeyword$27() throws Exception {
+ protected int consumeKeyword$27() throws Exception {
return consumeKeyword(getRule().ele00011KeywordRightParenthesis(), null, false, false, getKeyword$27$Delimiter());
}
- protected boolean consumeKeyword$28() throws Exception {
+ protected int consumeKeyword$28() throws Exception {
return consumeKeyword(getRule().ele001KeywordColon(), null, false, false, getKeyword$28$Delimiter());
}
- protected boolean consumeAssignment$29() throws Exception {
- if (consumeNonTerminal(alternativesConsumer, "alternatives", false, false, getRule().ele010ParserRuleCallAlternatives()))
- return true;
- return false;
+ protected int consumeAssignment$29() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(alternativesConsumer, "alternatives", false, false, getRule().ele010ParserRuleCallAlternatives());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeKeyword$31() throws Exception {
+ protected int consumeKeyword$31() throws Exception {
return consumeKeyword(getRule().ele1KeywordSemicolon(), null, false, false, getKeyword$31$Delimiter());
}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageReferencedMetamodelConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageReferencedMetamodelConsumer.java
index 90dda28..68326a5 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageReferencedMetamodelConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageReferencedMetamodelConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -45,70 +46,89 @@ public final class XtextGrammarTestLanguageReferencedMetamodelConsumer extends N
ruleCall$10$Delimiter = ISequenceMatcher.Factory.nullMatcher();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$3()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$3();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00KeywordImport());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$4()) {
- marker.rollback();
+ result = consumeAssignment$4();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele01AssignmentEPackage());
marker.release();
- return false;
+ return result;
}
- if (!consumeGroup$7()) {
- marker.rollback();
+ result = consumeGroup$7();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1Group());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$3() throws Exception {
+ protected int consumeKeyword$3() throws Exception {
return consumeKeyword(getRule().ele00KeywordImport(), null, false, false, getKeyword$3$Delimiter());
}
- protected boolean consumeAssignment$4() throws Exception {
- if (consumeTerminal(stringConsumer, null, false, false, getRule().ele010CrossReferenceEStringEPackage(), getCrossReference$5$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$4() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(stringConsumer, null, false, false, getRule().ele010CrossReferenceEStringEPackage(), getCrossReference$5$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeGroup$7() throws Exception {
- doConsumeGroup$7();
- return true;
+ protected int consumeGroup$7() throws Exception {
+ IMarker marker = mark();
+ int result = doConsumeGroup$7();
+ if (result != ConsumeResult.SUCCESS)
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeGroup$7() throws Exception {
+ protected int doConsumeGroup$7() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$8()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$8();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele10KeywordAs());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$9()) {
- marker.rollback();
+ result = consumeAssignment$9();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele11AssignmentAlias());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$8() throws Exception {
+ protected int consumeKeyword$8() throws Exception {
return consumeKeyword(getRule().ele10KeywordAs(), null, false, false, getKeyword$8$Delimiter());
}
- protected boolean consumeAssignment$9() throws Exception {
- if (consumeTerminal(idConsumer, "alias", false, false, getRule().ele110LexerRuleCallID(), getRuleCall$10$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$9() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, "alias", false, false, getRule().ele110LexerRuleCallID(), getRuleCall$10$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
public ReferencedMetamodelElements getRule() {
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageRuleCallConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageRuleCallConsumer.java
index 2bb854b..4ee0201 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageRuleCallConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageRuleCallConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -34,14 +35,18 @@ public final class XtextGrammarTestLanguageRuleCallConsumer extends NonTerminalC
crossReference$2$Delimiter = ISequenceMatcher.Factory.nullMatcher();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeAssignment$1();
}
- protected boolean consumeAssignment$1() throws Exception {
- if (consumeTerminal(idConsumer, null, false, false, getRule().ele0CrossReferenceEStringAbstractRule(), getCrossReference$2$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$1() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, null, false, false, getRule().ele0CrossReferenceEStringAbstractRule(), getCrossReference$2$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
public RuleCallElements getRule() {
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageTerminalAlternativesConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageTerminalAlternativesConsumer.java
index 014d61c..e7020e6 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageTerminalAlternativesConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageTerminalAlternativesConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -34,68 +35,85 @@ public final class XtextGrammarTestLanguageTerminalAlternativesConsumer extends
keyword$7$Delimiter = ICharacterClass.Factory.nullClass();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeRuleCall$2()) {
- marker.rollback();
+ int result;
+ result = consumeRuleCall$2();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0ParserRuleCallTerminalGroup());
marker.release();
- return false;
+ return result;
}
- if (!consumeGroup$3()) {
- marker.rollback();
+ result = consumeGroup$3();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1Group());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeRuleCall$2() throws Exception {
+ protected int consumeRuleCall$2() throws Exception {
return consumeNonTerminal(terminalGroupConsumer, null, false, false, getRule().ele0ParserRuleCallTerminalGroup());
}
- protected boolean consumeGroup$3() throws Exception {
- while(doConsumeGroup$3()) {}
- return true;
+ protected int consumeGroup$3() throws Exception {
+ IMarker marker = mark();
+ while(doConsumeGroup$3() == ConsumeResult.SUCCESS) {
+ marker.release();
+ marker = mark();
+ }
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeGroup$3() throws Exception {
+ protected int doConsumeGroup$3() throws Exception {
final IMarker marker = mark();
- if (!consumeAction$5()) {
- marker.rollback();
+ int result;
+ result = consumeAction$5();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele100ActionAlternativesgroups());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$7()) {
- marker.rollback();
+ result = consumeKeyword$7();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele101KeywordVerticalLine());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$8()) {
- marker.rollback();
+ result = consumeAssignment$8();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele11AssignmentGroups());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeAction$5() {
+ protected int consumeAction$5() {
consumeAction("Alternatives", "groups", true);
- return true;
+ return ConsumeResult.SUCCESS;
}
- protected boolean consumeKeyword$7() throws Exception {
+ protected int consumeKeyword$7() throws Exception {
return consumeKeyword(getRule().ele101KeywordVerticalLine(), null, false, false, getKeyword$7$Delimiter());
}
- protected boolean consumeAssignment$8() throws Exception {
- if (consumeNonTerminal(terminalGroupConsumer, "groups", true, false, getRule().ele110ParserRuleCallTerminalGroup()))
- return true;
- return false;
+ protected int consumeAssignment$8() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(terminalGroupConsumer, "groups", true, false, getRule().ele110ParserRuleCallTerminalGroup());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
public TerminalAlternativesElements getRule() {
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageTerminalGroupConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageTerminalGroupConsumer.java
index 643f4c6..dc5880b 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageTerminalGroupConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageTerminalGroupConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -31,59 +32,75 @@ public final class XtextGrammarTestLanguageTerminalGroupConsumer extends NonTerm
super(input, markerFactory, tokenAcceptor, hiddenTokenHandler, consumerUtil, hiddenTokens);
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeRuleCall$2()) {
- marker.rollback();
+ int result;
+ result = consumeRuleCall$2();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0ParserRuleCallTerminalToken());
marker.release();
- return false;
+ return result;
}
- if (!consumeGroup$3()) {
- marker.rollback();
+ result = consumeGroup$3();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1Group());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeRuleCall$2() throws Exception {
+ protected int consumeRuleCall$2() throws Exception {
return consumeNonTerminal(terminalTokenConsumer, null, false, false, getRule().ele0ParserRuleCallTerminalToken());
}
- protected boolean consumeGroup$3() throws Exception {
- while(doConsumeGroup$3()) {}
- return true;
+ protected int consumeGroup$3() throws Exception {
+ IMarker marker = mark();
+ while(doConsumeGroup$3() == ConsumeResult.SUCCESS) {
+ marker.release();
+ marker = mark();
+ }
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeGroup$3() throws Exception {
+ protected int doConsumeGroup$3() throws Exception {
final IMarker marker = mark();
- if (!consumeAction$4()) {
- marker.rollback();
+ int result;
+ result = consumeAction$4();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele10ActionGroupabstractTokens());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$6()) {
- marker.rollback();
+ result = consumeAssignment$6();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele11AssignmentAbstractTokens());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeAction$4() {
+ protected int consumeAction$4() {
consumeAction("Group", "abstractTokens", true);
- return true;
+ return ConsumeResult.SUCCESS;
}
- protected boolean consumeAssignment$6() throws Exception {
- if (consumeNonTerminal(terminalTokenConsumer, "abstractTokens", true, false, getRule().ele110ParserRuleCallTerminalToken()))
- return true;
- return false;
+ protected int consumeAssignment$6() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(terminalTokenConsumer, "abstractTokens", true, false, getRule().ele110ParserRuleCallTerminalToken());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
public TerminalGroupElements getRule() {
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageTerminalRuleConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageTerminalRuleConsumer.java
index f60af22..e8a55c1 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageTerminalRuleConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageTerminalRuleConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -50,100 +51,130 @@ public final class XtextGrammarTestLanguageTerminalRuleConsumer extends NonTermi
ruleCall$9$Delimiter = ISequenceMatcher.Factory.nullMatcher();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeAssignment$6()) {
- marker.rollback();
+ int result;
+ result = consumeAssignment$6();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00000AssignmentTerminal());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$8()) {
- marker.rollback();
+ result = consumeAssignment$8();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00001AssignmentName());
marker.release();
- return false;
+ return result;
}
- if (!consumeGroup$10()) {
- marker.rollback();
+ result = consumeGroup$10();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0001Group());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$14()) {
- marker.rollback();
+ result = consumeKeyword$14();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele001KeywordColon());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$15()) {
- marker.rollback();
+ result = consumeAssignment$15();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele01AssignmentAlternatives());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$17()) {
- marker.rollback();
+ result = consumeKeyword$17();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1KeywordSemicolon());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeAssignment$6() throws Exception {
- if (consumeKeyword(getRule().ele000000KeywordTerminal(), "terminal", false, true, getKeyword$7$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$6() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeKeyword(getRule().ele000000KeywordTerminal(), "terminal", false, true, getKeyword$7$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeAssignment$8() throws Exception {
- if (consumeTerminal(idConsumer, "name", false, false, getRule().ele000010LexerRuleCallID(), getRuleCall$9$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$8() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, "name", false, false, getRule().ele000010LexerRuleCallID(), getRuleCall$9$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeGroup$10() throws Exception {
- doConsumeGroup$10();
- return true;
+ protected int consumeGroup$10() throws Exception {
+ IMarker marker = mark();
+ int result = doConsumeGroup$10();
+ if (result != ConsumeResult.SUCCESS)
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeGroup$10() throws Exception {
+ protected int doConsumeGroup$10() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$11()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$11();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00010KeywordReturns());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$12()) {
- marker.rollback();
+ result = consumeAssignment$12();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00011AssignmentType());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$11() throws Exception {
+ protected int consumeKeyword$11() throws Exception {
return consumeKeyword(getRule().ele00010KeywordReturns(), null, false, false, getKeyword$11$Delimiter());
}
- protected boolean consumeAssignment$12() throws Exception {
- if (consumeNonTerminal(typeRefConsumer, "type", false, false, getRule().ele000110ParserRuleCallTypeRef()))
- return true;
- return false;
+ protected int consumeAssignment$12() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(typeRefConsumer, "type", false, false, getRule().ele000110ParserRuleCallTypeRef());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeKeyword$14() throws Exception {
+ protected int consumeKeyword$14() throws Exception {
return consumeKeyword(getRule().ele001KeywordColon(), null, false, false, getKeyword$14$Delimiter());
}
- protected boolean consumeAssignment$15() throws Exception {
- if (consumeNonTerminal(terminalAlternativesConsumer, "alternatives", false, false, getRule().ele010ParserRuleCallTerminalAlternatives()))
- return true;
- return false;
+ protected int consumeAssignment$15() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(terminalAlternativesConsumer, "alternatives", false, false, getRule().ele010ParserRuleCallTerminalAlternatives());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeKeyword$17() throws Exception {
+ protected int consumeKeyword$17() throws Exception {
return consumeKeyword(getRule().ele1KeywordSemicolon(), null, false, false, getKeyword$17$Delimiter());
}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageTerminalTokenConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageTerminalTokenConsumer.java
index cc70c16..eb6e1cc 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageTerminalTokenConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageTerminalTokenConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -40,43 +41,58 @@ public final class XtextGrammarTestLanguageTerminalTokenConsumer extends NonTerm
keyword$8$Delimiter = ICharacterClass.Factory.nullClass();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeRuleCall$2()) {
- marker.rollback();
+ int result;
+ result = consumeRuleCall$2();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0ParserRuleCallTerminalTokenElement());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$3()) {
- marker.rollback();
+ result = consumeAssignment$3();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1AssignmentCardinality());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeRuleCall$2() throws Exception {
+ protected int consumeRuleCall$2() throws Exception {
return consumeNonTerminal(terminalTokenElementConsumer, null, false, false, getRule().ele0ParserRuleCallTerminalTokenElement());
}
- protected boolean consumeAssignment$3() throws Exception {
- doConsumeAssignment$3();
- return true;
+ protected int consumeAssignment$3() throws Exception {
+ IMarker marker = mark();
+ int result = doConsumeAssignment$3();
+ if (result != ConsumeResult.SUCCESS)
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeAssignment$3() throws Exception {
- if (consumeKeyword(getRule().ele1000KeywordQuestionMark(), "cardinality", false, false, getKeyword$6$Delimiter()))
- return true;
- if (consumeKeyword(getRule().ele1001KeywordAsterisk(), "cardinality", false, false, getKeyword$7$Delimiter()))
- return true;
- if (consumeKeyword(getRule().ele101KeywordPlusSign(), "cardinality", false, false, getKeyword$8$Delimiter()))
- return true;
- return false;
+ protected int doConsumeAssignment$3() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeKeyword(getRule().ele1000KeywordQuestionMark(), "cardinality", false, false, getKeyword$6$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ tempResult = consumeKeyword(getRule().ele1001KeywordAsterisk(), "cardinality", false, false, getKeyword$7$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ tempResult = consumeKeyword(getRule().ele101KeywordPlusSign(), "cardinality", false, false, getKeyword$8$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
public TerminalTokenElements getRule() {
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageTerminalTokenElementConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageTerminalTokenElementConsumer.java
index 55a944c..2e94638 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageTerminalTokenElementConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageTerminalTokenElementConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -39,41 +40,126 @@ public final class XtextGrammarTestLanguageTerminalTokenElementConsumer extends
super(input, markerFactory, tokenAcceptor, hiddenTokenHandler, consumerUtil, hiddenTokens);
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeAlternatives$1();
}
- protected boolean consumeAlternatives$1() throws Exception {
- if (consumeRuleCall$5())
- return true;
- if (consumeRuleCall$6())
- return true;
- if (consumeRuleCall$7())
- return true;
- if (consumeRuleCall$8())
- return true;
- if (consumeRuleCall$9())
- return true;
- return false;
+ protected int consumeAlternatives$1() throws Exception {
+ int result = ConsumeResult.SUCCESS;
+ IMarker bestMarker = mark();
+ IMarker currentMarker;
+ int tempResult;
+ currentMarker = bestMarker.copy();
+ tempResult = consumeRuleCall$5();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ currentMarker = bestMarker.copy();
+ tempResult = consumeRuleCall$6();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ currentMarker = bestMarker.copy();
+ tempResult = consumeRuleCall$7();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ currentMarker = bestMarker.copy();
+ tempResult = consumeRuleCall$8();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ currentMarker = bestMarker.copy();
+ tempResult = consumeRuleCall$9();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ bestMarker.release();
+ return result;
}
- protected boolean consumeRuleCall$5() throws Exception {
+ protected int consumeRuleCall$5() throws Exception {
return consumeNonTerminal(characterRangeConsumer, null, false, false, getRule().ele0000ParserRuleCallCharacterRange());
}
- protected boolean consumeRuleCall$6() throws Exception {
+ protected int consumeRuleCall$6() throws Exception {
return consumeNonTerminal(ruleCallConsumer, null, false, false, getRule().ele0001ParserRuleCallRuleCall());
}
- protected boolean consumeRuleCall$7() throws Exception {
+ protected int consumeRuleCall$7() throws Exception {
return consumeNonTerminal(parenthesizedTerminalElementConsumer, null, false, false, getRule().ele001ParserRuleCallParenthesizedTerminalElement());
}
- protected boolean consumeRuleCall$8() throws Exception {
+ protected int consumeRuleCall$8() throws Exception {
return consumeNonTerminal(abstractNegatedTokenConsumer, null, false, false, getRule().ele01ParserRuleCallAbstractNegatedToken());
}
- protected boolean consumeRuleCall$9() throws Exception {
+ protected int consumeRuleCall$9() throws Exception {
return consumeNonTerminal(wildcardConsumer, null, false, false, getRule().ele1ParserRuleCallWildcard());
}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageTypeRefConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageTypeRefConsumer.java
index ab86a57..ed6e3f7 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageTypeRefConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageTypeRefConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -40,61 +41,79 @@ public final class XtextGrammarTestLanguageTypeRefConsumer extends NonTerminalCo
keyword$6$Delimiter = ICharacterClass.Factory.nullClass();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeGroup$2()) {
- marker.rollback();
+ int result;
+ result = consumeGroup$2();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0Group());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$7()) {
- marker.rollback();
+ result = consumeAssignment$7();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1AssignmentType());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeGroup$2() throws Exception {
- doConsumeGroup$2();
- return true;
+ protected int consumeGroup$2() throws Exception {
+ IMarker marker = mark();
+ int result = doConsumeGroup$2();
+ if (result != ConsumeResult.SUCCESS)
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeGroup$2() throws Exception {
+ protected int doConsumeGroup$2() throws Exception {
final IMarker marker = mark();
- if (!consumeAssignment$3()) {
- marker.rollback();
+ int result;
+ result = consumeAssignment$3();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00AssignmentMetamodel());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$6()) {
- marker.rollback();
+ result = consumeKeyword$6();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele01KeywordColonColon());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeAssignment$3() throws Exception {
- if (consumeTerminal(idConsumer, null, false, false, getRule().ele000CrossReferenceEStringAbstractMetamodelDeclaration(), getCrossReference$4$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$3() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, null, false, false, getRule().ele000CrossReferenceEStringAbstractMetamodelDeclaration(), getCrossReference$4$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeKeyword$6() throws Exception {
+ protected int consumeKeyword$6() throws Exception {
return consumeKeyword(getRule().ele01KeywordColonColon(), null, false, false, getKeyword$6$Delimiter());
}
- protected boolean consumeAssignment$7() throws Exception {
- if (consumeTerminal(idConsumer, null, false, false, getRule().ele10CrossReferenceEStringEClassifier(), getCrossReference$8$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$7() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, null, false, false, getRule().ele10CrossReferenceEStringEClassifier(), getCrossReference$8$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
public TypeRefElements getRule() {
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageUpToTokenConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageUpToTokenConsumer.java
index cd8ffb7..a1c8c2c 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageUpToTokenConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageUpToTokenConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -34,34 +35,41 @@ public final class XtextGrammarTestLanguageUpToTokenConsumer extends NonTerminal
keyword$2$Delimiter = ICharacterClass.Factory.nullClass();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$2()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$2();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0KeywordHyphenMinusGreaterThanSign());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$3()) {
- marker.rollback();
+ result = consumeAssignment$3();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1AssignmentTerminal());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$2() throws Exception {
+ protected int consumeKeyword$2() throws Exception {
return consumeKeyword(getRule().ele0KeywordHyphenMinusGreaterThanSign(), null, false, false, getKeyword$2$Delimiter());
}
- protected boolean consumeAssignment$3() throws Exception {
- if (consumeNonTerminal(terminalTokenElementConsumer, "terminal", false, false, getRule().ele10ParserRuleCallTerminalTokenElement()))
- return true;
- return false;
+ protected int consumeAssignment$3() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(terminalTokenElementConsumer, "terminal", false, false, getRule().ele10ParserRuleCallTerminalTokenElement());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
public UpToTokenElements getRule() {
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageWildcardConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageWildcardConsumer.java
index 9aedc38..d2fe5c2 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageWildcardConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/packrat/consumers/XtextGrammarTestLanguageWildcardConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -32,14 +33,18 @@ public final class XtextGrammarTestLanguageWildcardConsumer extends NonTerminalC
keyword$2$Delimiter = ICharacterClass.Factory.nullClass();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeAssignment$1();
}
- protected boolean consumeAssignment$1() throws Exception {
- if (consumeKeyword(getRule().ele0KeywordFullStop(), "isWildcard", false, true, getKeyword$2$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$1() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeKeyword(getRule().ele0KeywordFullStop(), "isWildcard", false, true, getKeyword$2$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
public WildcardElements getRule() {
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/XtextTerminalsTestLanguage.ecore b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/XtextTerminalsTestLanguage.ecore
index f03a642..64ced3d 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/XtextTerminalsTestLanguage.ecore
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/XtextTerminalsTestLanguage.ecore
@@ -14,10 +14,10 @@
<eStructuralFeatures xsi:type="ecore:EReference" name="rules" unique="false" upperBound="-1" eType="//AbstractRule" containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="AbstractRule">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="type" eType="//TypeRef" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name">
<eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EReference" name="type" eType="//TypeRef" containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="AbstractMetamodelDeclaration">
<eStructuralFeatures xsi:type="ecore:EReference" name="ePackage">
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/TerminalRulesTestLanguageANY_OTHERConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/TerminalRulesTestLanguageANY_OTHERConsumer.java
index 77a4c35..54a2d8c 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/TerminalRulesTestLanguageANY_OTHERConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/TerminalRulesTestLanguageANY_OTHERConsumer.java
@@ -7,6 +7,7 @@ import org.eclipse.xtext.AbstractRule;
import org.eclipse.xtext.parser.packrat.ICharSequenceWithOffset;
import org.eclipse.xtext.parser.packrat.IMarkerFactory;
import org.eclipse.xtext.parser.packrat.consumers.AbstractRuleAwareTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -22,8 +23,8 @@ public final class TerminalRulesTestLanguageANY_OTHERConsumer extends AbstractRu
super(input, markerFactory, tokenAcceptor);
}
- protected boolean doConsume() {
- return consumeWildcard$1();
+ protected int doConsume() {
+ return consumeWildcard$1() ? ConsumeResult.SUCCESS : ConsumeResult.EMPTY_MATCH;
}
protected boolean consumeWildcard$1() {
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/TerminalRulesTestLanguageIDConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/TerminalRulesTestLanguageIDConsumer.java
index d38adc6..3a6397f 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/TerminalRulesTestLanguageIDConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/TerminalRulesTestLanguageIDConsumer.java
@@ -7,6 +7,7 @@ import org.eclipse.xtext.AbstractRule;
import org.eclipse.xtext.parser.packrat.ICharSequenceWithOffset;
import org.eclipse.xtext.parser.packrat.IMarkerFactory;
import org.eclipse.xtext.parser.packrat.consumers.AbstractRuleAwareTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -22,8 +23,8 @@ public final class TerminalRulesTestLanguageIDConsumer extends AbstractRuleAware
super(input, markerFactory, tokenAcceptor);
}
- protected boolean doConsume() {
- return consumeGroup$1();
+ protected int doConsume() {
+ return consumeGroup$1() ? ConsumeResult.SUCCESS : ConsumeResult.EMPTY_MATCH;
}
protected boolean consumeGroup$1() {
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/TerminalRulesTestLanguageINTConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/TerminalRulesTestLanguageINTConsumer.java
index 83c74ab..3b87994 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/TerminalRulesTestLanguageINTConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/TerminalRulesTestLanguageINTConsumer.java
@@ -7,6 +7,7 @@ import org.eclipse.xtext.AbstractRule;
import org.eclipse.xtext.parser.packrat.ICharSequenceWithOffset;
import org.eclipse.xtext.parser.packrat.IMarkerFactory;
import org.eclipse.xtext.parser.packrat.consumers.AbstractRuleAwareTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -22,8 +23,8 @@ public final class TerminalRulesTestLanguageINTConsumer extends AbstractRuleAwar
super(input, markerFactory, tokenAcceptor);
}
- protected boolean doConsume() {
- return consumeCharacterRange$1();
+ protected int doConsume() {
+ return consumeCharacterRange$1() ? ConsumeResult.SUCCESS : ConsumeResult.EMPTY_MATCH;
}
protected boolean consumeCharacterRange$1() {
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/TerminalRulesTestLanguageML_COMMENTConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/TerminalRulesTestLanguageML_COMMENTConsumer.java
index 55eff26..c15a35b 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/TerminalRulesTestLanguageML_COMMENTConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/TerminalRulesTestLanguageML_COMMENTConsumer.java
@@ -7,6 +7,7 @@ import org.eclipse.xtext.AbstractRule;
import org.eclipse.xtext.parser.packrat.ICharSequenceWithOffset;
import org.eclipse.xtext.parser.packrat.IMarkerFactory;
import org.eclipse.xtext.parser.packrat.consumers.AbstractRuleAwareTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -22,8 +23,8 @@ public final class TerminalRulesTestLanguageML_COMMENTConsumer extends AbstractR
super(input, markerFactory, tokenAcceptor);
}
- protected boolean doConsume() {
- return consumeGroup$1();
+ protected int doConsume() {
+ return consumeGroup$1() ? ConsumeResult.SUCCESS : ConsumeResult.EMPTY_MATCH;
}
protected boolean consumeGroup$1() {
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/TerminalRulesTestLanguageModelConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/TerminalRulesTestLanguageModelConsumer.java
index edfff5b..3e51bb4 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/TerminalRulesTestLanguageModelConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/TerminalRulesTestLanguageModelConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -64,68 +65,213 @@ public final class TerminalRulesTestLanguageModelConsumer extends NonTerminalCon
ruleCall$20$Delimiter = ISequenceMatcher.Factory.nullMatcher();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeAlternatives$1();
}
- protected boolean consumeAlternatives$1() throws Exception {
- if (consumeAssignment$7())
- return true;
- if (consumeAssignment$9())
- return true;
- if (consumeAssignment$11())
- return true;
- if (consumeAssignment$13())
- return true;
- if (consumeAssignment$15())
- return true;
- if (consumeAssignment$17())
- return true;
- if (consumeAssignment$19())
- return true;
- return false;
+ protected int consumeAlternatives$1() throws Exception {
+ int result = ConsumeResult.SUCCESS;
+ IMarker bestMarker = mark();
+ IMarker currentMarker;
+ int tempResult;
+ currentMarker = bestMarker.copy();
+ tempResult = consumeAssignment$7();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ currentMarker = bestMarker.copy();
+ tempResult = consumeAssignment$9();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ currentMarker = bestMarker.copy();
+ tempResult = consumeAssignment$11();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ currentMarker = bestMarker.copy();
+ tempResult = consumeAssignment$13();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ currentMarker = bestMarker.copy();
+ tempResult = consumeAssignment$15();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ currentMarker = bestMarker.copy();
+ tempResult = consumeAssignment$17();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ currentMarker = bestMarker.copy();
+ tempResult = consumeAssignment$19();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ bestMarker.release();
+ return result;
}
- protected boolean consumeAssignment$7() throws Exception {
- if (consumeTerminal(idConsumer, "idValue", false, false, getRule().ele0000000ParserRuleCallID(), getRuleCall$8$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$7() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, "idValue", false, false, getRule().ele0000000ParserRuleCallID(), getRuleCall$8$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeAssignment$9() throws Exception {
- if (consumeTerminal(intConsumer, "intValue", false, false, getRule().ele0000010ParserRuleCallINT(), getRuleCall$10$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$9() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(intConsumer, "intValue", false, false, getRule().ele0000010ParserRuleCallINT(), getRuleCall$10$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeAssignment$11() throws Exception {
- if (consumeTerminal(stringConsumer, "stringValue", false, false, getRule().ele000010ParserRuleCallSTRING(), getRuleCall$12$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$11() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(stringConsumer, "stringValue", false, false, getRule().ele000010ParserRuleCallSTRING(), getRuleCall$12$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeAssignment$13() throws Exception {
- if (consumeTerminal(mlCommentConsumer, "mlCommentValue", false, false, getRule().ele00010ParserRuleCallML_COMMENT(), getRuleCall$14$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$13() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(mlCommentConsumer, "mlCommentValue", false, false, getRule().ele00010ParserRuleCallML_COMMENT(), getRuleCall$14$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeAssignment$15() throws Exception {
- if (consumeTerminal(slCommentConsumer, "slCommentValue", false, false, getRule().ele0010ParserRuleCallSL_COMMENT(), getRuleCall$16$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$15() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(slCommentConsumer, "slCommentValue", false, false, getRule().ele0010ParserRuleCallSL_COMMENT(), getRuleCall$16$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeAssignment$17() throws Exception {
- if (consumeTerminal(wsConsumer, "wsValue", false, false, getRule().ele010ParserRuleCallWS(), getRuleCall$18$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$17() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(wsConsumer, "wsValue", false, false, getRule().ele010ParserRuleCallWS(), getRuleCall$18$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeAssignment$19() throws Exception {
- if (consumeTerminal(anyOtherConsumer, "anyValue", false, false, getRule().ele10ParserRuleCallANY_OTHER(), getRuleCall$20$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$19() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(anyOtherConsumer, "anyValue", false, false, getRule().ele10ParserRuleCallANY_OTHER(), getRuleCall$20$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
public ModelElements getRule() {
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/TerminalRulesTestLanguageSL_COMMENTConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/TerminalRulesTestLanguageSL_COMMENTConsumer.java
index c15ced6..3db10f7 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/TerminalRulesTestLanguageSL_COMMENTConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/TerminalRulesTestLanguageSL_COMMENTConsumer.java
@@ -7,6 +7,7 @@ import org.eclipse.xtext.AbstractRule;
import org.eclipse.xtext.parser.packrat.ICharSequenceWithOffset;
import org.eclipse.xtext.parser.packrat.IMarkerFactory;
import org.eclipse.xtext.parser.packrat.consumers.AbstractRuleAwareTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -22,8 +23,8 @@ public final class TerminalRulesTestLanguageSL_COMMENTConsumer extends AbstractR
super(input, markerFactory, tokenAcceptor);
}
- protected boolean doConsume() {
- return consumeGroup$1();
+ protected int doConsume() {
+ return consumeGroup$1() ? ConsumeResult.SUCCESS : ConsumeResult.EMPTY_MATCH;
}
protected boolean consumeGroup$1() {
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/TerminalRulesTestLanguageSTRINGConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/TerminalRulesTestLanguageSTRINGConsumer.java
index 0b0926a..d12d97b 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/TerminalRulesTestLanguageSTRINGConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/TerminalRulesTestLanguageSTRINGConsumer.java
@@ -7,6 +7,7 @@ import org.eclipse.xtext.AbstractRule;
import org.eclipse.xtext.parser.packrat.ICharSequenceWithOffset;
import org.eclipse.xtext.parser.packrat.IMarkerFactory;
import org.eclipse.xtext.parser.packrat.consumers.AbstractRuleAwareTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -22,8 +23,8 @@ public final class TerminalRulesTestLanguageSTRINGConsumer extends AbstractRuleA
super(input, markerFactory, tokenAcceptor);
}
- protected boolean doConsume() {
- return consumeAlternatives$1();
+ protected int doConsume() {
+ return consumeAlternatives$1() ? ConsumeResult.SUCCESS : ConsumeResult.EMPTY_MATCH;
}
protected boolean consumeAlternatives$1() {
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/TerminalRulesTestLanguageWSConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/TerminalRulesTestLanguageWSConsumer.java
index 40d78f6..fe783fb 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/TerminalRulesTestLanguageWSConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/TerminalRulesTestLanguageWSConsumer.java
@@ -7,6 +7,7 @@ import org.eclipse.xtext.AbstractRule;
import org.eclipse.xtext.parser.packrat.ICharSequenceWithOffset;
import org.eclipse.xtext.parser.packrat.IMarkerFactory;
import org.eclipse.xtext.parser.packrat.consumers.AbstractRuleAwareTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -22,8 +23,8 @@ public final class TerminalRulesTestLanguageWSConsumer extends AbstractRuleAware
super(input, markerFactory, tokenAcceptor);
}
- protected boolean doConsume() {
- return consumeAlternatives$1();
+ protected int doConsume() {
+ return consumeAlternatives$1() ? ConsumeResult.SUCCESS : ConsumeResult.EMPTY_MATCH;
}
protected boolean consumeAlternatives$1() {
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageANY_OTHERConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageANY_OTHERConsumer.java
index 82eb4f8..c221ad6 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageANY_OTHERConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageANY_OTHERConsumer.java
@@ -7,6 +7,7 @@ import org.eclipse.xtext.AbstractRule;
import org.eclipse.xtext.parser.packrat.ICharSequenceWithOffset;
import org.eclipse.xtext.parser.packrat.IMarkerFactory;
import org.eclipse.xtext.parser.packrat.consumers.AbstractRuleAwareTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -22,8 +23,8 @@ public final class XtextTerminalsTestLanguageANY_OTHERConsumer extends AbstractR
super(input, markerFactory, tokenAcceptor);
}
- protected boolean doConsume() {
- return consumeWildcard$1();
+ protected int doConsume() {
+ return consumeWildcard$1() ? ConsumeResult.SUCCESS : ConsumeResult.EMPTY_MATCH;
}
protected boolean consumeWildcard$1() {
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageAbstractMetamodelDeclarationConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageAbstractMetamodelDeclarationConsumer.java
index 64c6ba4..74ddfe8 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageAbstractMetamodelDeclarationConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageAbstractMetamodelDeclarationConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -33,23 +34,60 @@ public final class XtextTerminalsTestLanguageAbstractMetamodelDeclarationConsume
super(input, markerFactory, tokenAcceptor, hiddenTokenHandler, consumerUtil, hiddenTokens);
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeAlternatives$1();
}
- protected boolean consumeAlternatives$1() throws Exception {
- if (consumeRuleCall$2())
- return true;
- if (consumeRuleCall$3())
- return true;
- return false;
+ protected int consumeAlternatives$1() throws Exception {
+ int result = ConsumeResult.SUCCESS;
+ IMarker bestMarker = mark();
+ IMarker currentMarker;
+ int tempResult;
+ currentMarker = bestMarker.copy();
+ tempResult = consumeRuleCall$2();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ currentMarker = bestMarker.copy();
+ tempResult = consumeRuleCall$3();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ bestMarker.release();
+ return result;
}
- protected boolean consumeRuleCall$2() throws Exception {
+ protected int consumeRuleCall$2() throws Exception {
return consumeNonTerminal(generatedMetamodelConsumer, null, false, false, getRule().ele0ParserRuleCallGeneratedMetamodel());
}
- protected boolean consumeRuleCall$3() throws Exception {
+ protected int consumeRuleCall$3() throws Exception {
return consumeNonTerminal(referencedMetamodelConsumer, null, false, false, getRule().ele1ParserRuleCallReferencedMetamodel());
}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageAbstractNegatedTokenConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageAbstractNegatedTokenConsumer.java
index 77f792b..03bbb50 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageAbstractNegatedTokenConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageAbstractNegatedTokenConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -33,23 +34,60 @@ public final class XtextTerminalsTestLanguageAbstractNegatedTokenConsumer extend
super(input, markerFactory, tokenAcceptor, hiddenTokenHandler, consumerUtil, hiddenTokens);
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeAlternatives$1();
}
- protected boolean consumeAlternatives$1() throws Exception {
- if (consumeRuleCall$2())
- return true;
- if (consumeRuleCall$3())
- return true;
- return false;
+ protected int consumeAlternatives$1() throws Exception {
+ int result = ConsumeResult.SUCCESS;
+ IMarker bestMarker = mark();
+ IMarker currentMarker;
+ int tempResult;
+ currentMarker = bestMarker.copy();
+ tempResult = consumeRuleCall$2();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ currentMarker = bestMarker.copy();
+ tempResult = consumeRuleCall$3();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ bestMarker.release();
+ return result;
}
- protected boolean consumeRuleCall$2() throws Exception {
+ protected int consumeRuleCall$2() throws Exception {
return consumeNonTerminal(negatedTokenConsumer, null, false, false, getRule().ele0ParserRuleCallNegatedToken());
}
- protected boolean consumeRuleCall$3() throws Exception {
+ protected int consumeRuleCall$3() throws Exception {
return consumeNonTerminal(upToTokenConsumer, null, false, false, getRule().ele1ParserRuleCallUpToToken());
}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageAbstractRuleConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageAbstractRuleConsumer.java
index 77c3e47..431e018 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageAbstractRuleConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageAbstractRuleConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -35,29 +36,82 @@ public final class XtextTerminalsTestLanguageAbstractRuleConsumer extends NonTer
super(input, markerFactory, tokenAcceptor, hiddenTokenHandler, consumerUtil, hiddenTokens);
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeAlternatives$1();
}
- protected boolean consumeAlternatives$1() throws Exception {
- if (consumeRuleCall$3())
- return true;
- if (consumeRuleCall$4())
- return true;
- if (consumeRuleCall$5())
- return true;
- return false;
+ protected int consumeAlternatives$1() throws Exception {
+ int result = ConsumeResult.SUCCESS;
+ IMarker bestMarker = mark();
+ IMarker currentMarker;
+ int tempResult;
+ currentMarker = bestMarker.copy();
+ tempResult = consumeRuleCall$3();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ currentMarker = bestMarker.copy();
+ tempResult = consumeRuleCall$4();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ currentMarker = bestMarker.copy();
+ tempResult = consumeRuleCall$5();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ bestMarker.release();
+ return result;
}
- protected boolean consumeRuleCall$3() throws Exception {
+ protected int consumeRuleCall$3() throws Exception {
return consumeNonTerminal(lexerRuleConsumer, null, false, false, getRule().ele00ParserRuleCallLexerRule());
}
- protected boolean consumeRuleCall$4() throws Exception {
+ protected int consumeRuleCall$4() throws Exception {
return consumeNonTerminal(parserRuleConsumer, null, false, false, getRule().ele01ParserRuleCallParserRule());
}
- protected boolean consumeRuleCall$5() throws Exception {
+ protected int consumeRuleCall$5() throws Exception {
return consumeNonTerminal(terminalRuleConsumer, null, false, false, getRule().ele1ParserRuleCallTerminalRule());
}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageAbstractTerminalConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageAbstractTerminalConsumer.java
index b4ae205..2861d89 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageAbstractTerminalConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageAbstractTerminalConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -37,35 +38,104 @@ public final class XtextTerminalsTestLanguageAbstractTerminalConsumer extends No
super(input, markerFactory, tokenAcceptor, hiddenTokenHandler, consumerUtil, hiddenTokens);
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeAlternatives$1();
}
- protected boolean consumeAlternatives$1() throws Exception {
- if (consumeRuleCall$4())
- return true;
- if (consumeRuleCall$5())
- return true;
- if (consumeRuleCall$6())
- return true;
- if (consumeRuleCall$7())
- return true;
- return false;
+ protected int consumeAlternatives$1() throws Exception {
+ int result = ConsumeResult.SUCCESS;
+ IMarker bestMarker = mark();
+ IMarker currentMarker;
+ int tempResult;
+ currentMarker = bestMarker.copy();
+ tempResult = consumeRuleCall$4();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ currentMarker = bestMarker.copy();
+ tempResult = consumeRuleCall$5();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ currentMarker = bestMarker.copy();
+ tempResult = consumeRuleCall$6();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ currentMarker = bestMarker.copy();
+ tempResult = consumeRuleCall$7();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ bestMarker.release();
+ return result;
}
- protected boolean consumeRuleCall$4() throws Exception {
+ protected int consumeRuleCall$4() throws Exception {
return consumeNonTerminal(keywordConsumer, null, false, false, getRule().ele000ParserRuleCallKeyword());
}
- protected boolean consumeRuleCall$5() throws Exception {
+ protected int consumeRuleCall$5() throws Exception {
return consumeNonTerminal(ruleCallConsumer, null, false, false, getRule().ele001ParserRuleCallRuleCall());
}
- protected boolean consumeRuleCall$6() throws Exception {
+ protected int consumeRuleCall$6() throws Exception {
return consumeNonTerminal(parenthesizedElementConsumer, null, false, false, getRule().ele01ParserRuleCallParenthesizedElement());
}
- protected boolean consumeRuleCall$7() throws Exception {
+ protected int consumeRuleCall$7() throws Exception {
return consumeNonTerminal(crossReferenceConsumer, null, false, false, getRule().ele1ParserRuleCallCrossReference());
}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageAbstractTokenConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageAbstractTokenConsumer.java
index 0c10049..652d5bd 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageAbstractTokenConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageAbstractTokenConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -44,61 +45,129 @@ public final class XtextTerminalsTestLanguageAbstractTokenConsumer extends NonTe
keyword$12$Delimiter = ICharacterClass.Factory.nullClass();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeAlternatives$2()) {
- marker.rollback();
+ int result;
+ result = consumeAlternatives$2();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0Alternatives());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$7()) {
- marker.rollback();
+ result = consumeAssignment$7();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1AssignmentCardinality());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeAlternatives$2() throws Exception {
- if (consumeRuleCall$4())
- return true;
- if (consumeRuleCall$5())
- return true;
- if (consumeRuleCall$6())
- return true;
- return false;
+ protected int consumeAlternatives$2() throws Exception {
+ int result = ConsumeResult.SUCCESS;
+ IMarker bestMarker = mark();
+ IMarker currentMarker;
+ int tempResult;
+ currentMarker = bestMarker.copy();
+ tempResult = consumeRuleCall$4();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ currentMarker = bestMarker.copy();
+ tempResult = consumeRuleCall$5();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ currentMarker = bestMarker.copy();
+ tempResult = consumeRuleCall$6();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ bestMarker.release();
+ return result;
}
- protected boolean consumeRuleCall$4() throws Exception {
+ protected int consumeRuleCall$4() throws Exception {
return consumeNonTerminal(assignmentConsumer, null, false, false, getRule().ele000ParserRuleCallAssignment());
}
- protected boolean consumeRuleCall$5() throws Exception {
+ protected int consumeRuleCall$5() throws Exception {
return consumeNonTerminal(actionConsumer, null, false, false, getRule().ele001ParserRuleCallAction());
}
- protected boolean consumeRuleCall$6() throws Exception {
+ protected int consumeRuleCall$6() throws Exception {
return consumeNonTerminal(abstractTerminalConsumer, null, false, false, getRule().ele01ParserRuleCallAbstractTerminal());
}
- protected boolean consumeAssignment$7() throws Exception {
- doConsumeAssignment$7();
- return true;
+ protected int consumeAssignment$7() throws Exception {
+ IMarker marker = mark();
+ int result = doConsumeAssignment$7();
+ if (result != ConsumeResult.SUCCESS)
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeAssignment$7() throws Exception {
- if (consumeKeyword(getRule().ele1000KeywordQuestionMark(), "cardinality", false, false, getKeyword$10$Delimiter()))
- return true;
- if (consumeKeyword(getRule().ele1001KeywordAsterisk(), "cardinality", false, false, getKeyword$11$Delimiter()))
- return true;
- if (consumeKeyword(getRule().ele101KeywordPlusSign(), "cardinality", false, false, getKeyword$12$Delimiter()))
- return true;
- return false;
+ protected int doConsumeAssignment$7() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeKeyword(getRule().ele1000KeywordQuestionMark(), "cardinality", false, false, getKeyword$10$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ tempResult = consumeKeyword(getRule().ele1001KeywordAsterisk(), "cardinality", false, false, getKeyword$11$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ tempResult = consumeKeyword(getRule().ele101KeywordPlusSign(), "cardinality", false, false, getKeyword$12$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
public AbstractTokenElements getRule() {
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageActionConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageActionConsumer.java
index a5924c4..fef1be7 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageActionConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageActionConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -60,118 +61,148 @@ public final class XtextTerminalsTestLanguageActionConsumer extends NonTerminalC
ruleCall$16$Delimiter = ISequenceMatcher.Factory.nullMatcher();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$8()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$8();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0000000KeywordLeftCurlyBracket());
marker.release();
- return false;
+ return result;
}
- if (!consumeGroup$9()) {
- marker.rollback();
+ result = consumeGroup$9();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0000001Group());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$12()) {
- marker.rollback();
+ result = consumeAssignment$12();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele000001AssignmentTypeName());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$14()) {
- marker.rollback();
+ result = consumeKeyword$14();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00001KeywordFullStop());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$15()) {
- marker.rollback();
+ result = consumeAssignment$15();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0001AssignmentFeature());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$17()) {
- marker.rollback();
+ result = consumeAssignment$17();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele001AssignmentOperator());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$21()) {
- marker.rollback();
+ result = consumeKeyword$21();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele01KeywordCurrent());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$22()) {
- marker.rollback();
+ result = consumeKeyword$22();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1KeywordRightCurlyBracket());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$8() throws Exception {
+ protected int consumeKeyword$8() throws Exception {
return consumeKeyword(getRule().ele0000000KeywordLeftCurlyBracket(), null, false, false, getKeyword$8$Delimiter());
}
- protected boolean consumeGroup$9() throws Exception {
- doConsumeGroup$9();
- return true;
+ protected int consumeGroup$9() throws Exception {
+ IMarker marker = mark();
+ int result = doConsumeGroup$9();
+ if (result != ConsumeResult.SUCCESS)
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeGroup$9() throws Exception {
+ protected int doConsumeGroup$9() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$10()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$10();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00000010KeywordCurrent());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$11()) {
- marker.rollback();
+ result = consumeKeyword$11();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00000011KeywordEqualsSign());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$10() throws Exception {
+ protected int consumeKeyword$10() throws Exception {
return consumeKeyword(getRule().ele00000010KeywordCurrent(), null, false, false, getKeyword$10$Delimiter());
}
- protected boolean consumeKeyword$11() throws Exception {
+ protected int consumeKeyword$11() throws Exception {
return consumeKeyword(getRule().ele00000011KeywordEqualsSign(), null, false, false, getKeyword$11$Delimiter());
}
- protected boolean consumeAssignment$12() throws Exception {
- if (consumeNonTerminal(typeRefConsumer, "typeName", false, false, getRule().ele0000010ParserRuleCallTypeRef()))
- return true;
- return false;
+ protected int consumeAssignment$12() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(typeRefConsumer, "typeName", false, false, getRule().ele0000010ParserRuleCallTypeRef());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeKeyword$14() throws Exception {
+ protected int consumeKeyword$14() throws Exception {
return consumeKeyword(getRule().ele00001KeywordFullStop(), null, false, false, getKeyword$14$Delimiter());
}
- protected boolean consumeAssignment$15() throws Exception {
- if (consumeTerminal(idConsumer, "feature", false, false, getRule().ele00010ParserRuleCallID(), getRuleCall$16$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$15() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, "feature", false, false, getRule().ele00010ParserRuleCallID(), getRuleCall$16$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeAssignment$17() throws Exception {
- if (consumeKeyword(getRule().ele00100KeywordEqualsSign(), "operator", false, false, getKeyword$19$Delimiter()))
- return true;
- if (consumeKeyword(getRule().ele00101KeywordPlusSignEqualsSign(), "operator", false, false, getKeyword$20$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$17() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeKeyword(getRule().ele00100KeywordEqualsSign(), "operator", false, false, getKeyword$19$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ tempResult = consumeKeyword(getRule().ele00101KeywordPlusSignEqualsSign(), "operator", false, false, getKeyword$20$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeKeyword$21() throws Exception {
+ protected int consumeKeyword$21() throws Exception {
return consumeKeyword(getRule().ele01KeywordCurrent(), null, false, false, getKeyword$21$Delimiter());
}
- protected boolean consumeKeyword$22() throws Exception {
+ protected int consumeKeyword$22() throws Exception {
return consumeKeyword(getRule().ele1KeywordRightCurlyBracket(), null, false, false, getKeyword$22$Delimiter());
}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageAlternativesConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageAlternativesConsumer.java
index f807ecf..ddf059a 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageAlternativesConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageAlternativesConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -34,68 +35,85 @@ public final class XtextTerminalsTestLanguageAlternativesConsumer extends NonTer
keyword$7$Delimiter = ICharacterClass.Factory.nullClass();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeRuleCall$2()) {
- marker.rollback();
+ int result;
+ result = consumeRuleCall$2();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0ParserRuleCallGroup());
marker.release();
- return false;
+ return result;
}
- if (!consumeGroup$3()) {
- marker.rollback();
+ result = consumeGroup$3();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1Group());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeRuleCall$2() throws Exception {
+ protected int consumeRuleCall$2() throws Exception {
return consumeNonTerminal(groupConsumer, null, false, false, getRule().ele0ParserRuleCallGroup());
}
- protected boolean consumeGroup$3() throws Exception {
- while(doConsumeGroup$3()) {}
- return true;
+ protected int consumeGroup$3() throws Exception {
+ IMarker marker = mark();
+ while(doConsumeGroup$3() == ConsumeResult.SUCCESS) {
+ marker.release();
+ marker = mark();
+ }
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeGroup$3() throws Exception {
+ protected int doConsumeGroup$3() throws Exception {
final IMarker marker = mark();
- if (!consumeAction$5()) {
- marker.rollback();
+ int result;
+ result = consumeAction$5();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele100ActionAlternativesgroups());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$7()) {
- marker.rollback();
+ result = consumeKeyword$7();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele101KeywordVerticalLine());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$8()) {
- marker.rollback();
+ result = consumeAssignment$8();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele11AssignmentGroups());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeAction$5() {
+ protected int consumeAction$5() {
consumeAction("Alternatives", "groups", true);
- return true;
+ return ConsumeResult.SUCCESS;
}
- protected boolean consumeKeyword$7() throws Exception {
+ protected int consumeKeyword$7() throws Exception {
return consumeKeyword(getRule().ele101KeywordVerticalLine(), null, false, false, getKeyword$7$Delimiter());
}
- protected boolean consumeAssignment$8() throws Exception {
- if (consumeNonTerminal(groupConsumer, "groups", true, false, getRule().ele110ParserRuleCallGroup()))
- return true;
- return false;
+ protected int consumeAssignment$8() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(groupConsumer, "groups", true, false, getRule().ele110ParserRuleCallGroup());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
public AlternativesElements getRule() {
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageAssignmentConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageAssignmentConsumer.java
index 200203d..0e0e948 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageAssignmentConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageAssignmentConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -45,51 +46,71 @@ public final class XtextTerminalsTestLanguageAssignmentConsumer extends NonTermi
ruleCall$4$Delimiter = ISequenceMatcher.Factory.nullMatcher();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeAssignment$3()) {
- marker.rollback();
+ int result;
+ result = consumeAssignment$3();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00AssignmentFeature());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$5()) {
- marker.rollback();
+ result = consumeAssignment$5();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele01AssignmentOperator());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$11()) {
- marker.rollback();
+ result = consumeAssignment$11();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1AssignmentTerminal());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeAssignment$3() throws Exception {
- if (consumeTerminal(idConsumer, "feature", false, false, getRule().ele000ParserRuleCallID(), getRuleCall$4$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$3() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, "feature", false, false, getRule().ele000ParserRuleCallID(), getRuleCall$4$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeAssignment$5() throws Exception {
- if (consumeKeyword(getRule().ele01000KeywordPlusSignEqualsSign(), "operator", false, false, getKeyword$8$Delimiter()))
- return true;
- if (consumeKeyword(getRule().ele01001KeywordEqualsSign(), "operator", false, false, getKeyword$9$Delimiter()))
- return true;
- if (consumeKeyword(getRule().ele0101KeywordQuestionMarkEqualsSign(), "operator", false, false, getKeyword$10$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$5() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeKeyword(getRule().ele01000KeywordPlusSignEqualsSign(), "operator", false, false, getKeyword$8$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ tempResult = consumeKeyword(getRule().ele01001KeywordEqualsSign(), "operator", false, false, getKeyword$9$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ tempResult = consumeKeyword(getRule().ele0101KeywordQuestionMarkEqualsSign(), "operator", false, false, getKeyword$10$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeAssignment$11() throws Exception {
- if (consumeNonTerminal(abstractTerminalConsumer, "terminal", false, false, getRule().ele10ParserRuleCallAbstractTerminal()))
- return true;
- return false;
+ protected int consumeAssignment$11() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(abstractTerminalConsumer, "terminal", false, false, getRule().ele10ParserRuleCallAbstractTerminal());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
public AssignmentElements getRule() {
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageCharacterRangeConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageCharacterRangeConsumer.java
index e4a3a91..1197088 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageCharacterRangeConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageCharacterRangeConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -34,68 +35,83 @@ public final class XtextTerminalsTestLanguageCharacterRangeConsumer extends NonT
keyword$7$Delimiter = ICharacterClass.Factory.nullClass();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeRuleCall$2()) {
- marker.rollback();
+ int result;
+ result = consumeRuleCall$2();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0ParserRuleCallKeyword());
marker.release();
- return false;
+ return result;
}
- if (!consumeGroup$3()) {
- marker.rollback();
+ result = consumeGroup$3();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1Group());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeRuleCall$2() throws Exception {
+ protected int consumeRuleCall$2() throws Exception {
return consumeNonTerminal(keywordConsumer, null, false, false, getRule().ele0ParserRuleCallKeyword());
}
- protected boolean consumeGroup$3() throws Exception {
- doConsumeGroup$3();
- return true;
+ protected int consumeGroup$3() throws Exception {
+ IMarker marker = mark();
+ int result = doConsumeGroup$3();
+ if (result != ConsumeResult.SUCCESS)
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeGroup$3() throws Exception {
+ protected int doConsumeGroup$3() throws Exception {
final IMarker marker = mark();
- if (!consumeAction$5()) {
- marker.rollback();
+ int result;
+ result = consumeAction$5();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele100ActionCharacterRangeleft());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$7()) {
- marker.rollback();
+ result = consumeKeyword$7();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele101KeywordFullStopFullStop());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$8()) {
- marker.rollback();
+ result = consumeAssignment$8();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele11AssignmentRight());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeAction$5() {
+ protected int consumeAction$5() {
consumeAction("CharacterRange", "left", false);
- return true;
+ return ConsumeResult.SUCCESS;
}
- protected boolean consumeKeyword$7() throws Exception {
+ protected int consumeKeyword$7() throws Exception {
return consumeKeyword(getRule().ele101KeywordFullStopFullStop(), null, false, false, getKeyword$7$Delimiter());
}
- protected boolean consumeAssignment$8() throws Exception {
- if (consumeNonTerminal(keywordConsumer, "right", false, false, getRule().ele110ParserRuleCallKeyword()))
- return true;
- return false;
+ protected int consumeAssignment$8() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(keywordConsumer, "right", false, false, getRule().ele110ParserRuleCallKeyword());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
public CharacterRangeElements getRule() {
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageCrossReferenceConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageCrossReferenceConsumer.java
index 1237ed7..7395ed9 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageCrossReferenceConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageCrossReferenceConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -45,78 +46,98 @@ public final class XtextTerminalsTestLanguageCrossReferenceConsumer extends NonT
keyword$12$Delimiter = ICharacterClass.Factory.nullClass();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$4()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$4();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele000KeywordLeftSquareBracket());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$5()) {
- marker.rollback();
+ result = consumeAssignment$5();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele001AssignmentType());
marker.release();
- return false;
+ return result;
}
- if (!consumeGroup$7()) {
- marker.rollback();
+ result = consumeGroup$7();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele01Group());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$12()) {
- marker.rollback();
+ result = consumeKeyword$12();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1KeywordRightSquareBracket());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$4() throws Exception {
+ protected int consumeKeyword$4() throws Exception {
return consumeKeyword(getRule().ele000KeywordLeftSquareBracket(), null, false, false, getKeyword$4$Delimiter());
}
- protected boolean consumeAssignment$5() throws Exception {
- if (consumeNonTerminal(typeRefConsumer, "type", false, false, getRule().ele0010ParserRuleCallTypeRef()))
- return true;
- return false;
+ protected int consumeAssignment$5() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(typeRefConsumer, "type", false, false, getRule().ele0010ParserRuleCallTypeRef());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeGroup$7() throws Exception {
- doConsumeGroup$7();
- return true;
+ protected int consumeGroup$7() throws Exception {
+ IMarker marker = mark();
+ int result = doConsumeGroup$7();
+ if (result != ConsumeResult.SUCCESS)
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeGroup$7() throws Exception {
+ protected int doConsumeGroup$7() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$8()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$8();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele010KeywordVerticalLine());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$9()) {
- marker.rollback();
+ result = consumeAssignment$9();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele011AssignmentRule());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$8() throws Exception {
+ protected int consumeKeyword$8() throws Exception {
return consumeKeyword(getRule().ele010KeywordVerticalLine(), null, false, false, getKeyword$8$Delimiter());
}
- protected boolean consumeAssignment$9() throws Exception {
- if (consumeTerminal(idConsumer, null, false, false, getRule().ele0110CrossReferenceEStringAbstractRule(), getCrossReference$10$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$9() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, null, false, false, getRule().ele0110CrossReferenceEStringAbstractRule(), getCrossReference$10$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeKeyword$12() throws Exception {
+ protected int consumeKeyword$12() throws Exception {
return consumeKeyword(getRule().ele1KeywordRightSquareBracket(), null, false, false, getKeyword$12$Delimiter());
}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageGeneratedMetamodelConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageGeneratedMetamodelConsumer.java
index a7d88c5..45de9a4 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageGeneratedMetamodelConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageGeneratedMetamodelConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -48,81 +49,105 @@ public final class XtextTerminalsTestLanguageGeneratedMetamodelConsumer extends
ruleCall$13$Delimiter = ISequenceMatcher.Factory.nullMatcher();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$4()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$4();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele000KeywordGenerate());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$5()) {
- marker.rollback();
+ result = consumeAssignment$5();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele001AssignmentName());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$7()) {
- marker.rollback();
+ result = consumeAssignment$7();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele01AssignmentEPackage());
marker.release();
- return false;
+ return result;
}
- if (!consumeGroup$10()) {
- marker.rollback();
+ result = consumeGroup$10();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1Group());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$4() throws Exception {
+ protected int consumeKeyword$4() throws Exception {
return consumeKeyword(getRule().ele000KeywordGenerate(), null, false, false, getKeyword$4$Delimiter());
}
- protected boolean consumeAssignment$5() throws Exception {
- if (consumeTerminal(idConsumer, "name", false, false, getRule().ele0010ParserRuleCallID(), getRuleCall$6$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$5() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, "name", false, false, getRule().ele0010ParserRuleCallID(), getRuleCall$6$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeAssignment$7() throws Exception {
- if (consumeTerminal(stringConsumer, null, false, false, getRule().ele010CrossReferenceEStringEPackage(), getCrossReference$8$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$7() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(stringConsumer, null, false, false, getRule().ele010CrossReferenceEStringEPackage(), getCrossReference$8$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeGroup$10() throws Exception {
- doConsumeGroup$10();
- return true;
+ protected int consumeGroup$10() throws Exception {
+ IMarker marker = mark();
+ int result = doConsumeGroup$10();
+ if (result != ConsumeResult.SUCCESS)
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeGroup$10() throws Exception {
+ protected int doConsumeGroup$10() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$11()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$11();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele10KeywordAs());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$12()) {
- marker.rollback();
+ result = consumeAssignment$12();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele11AssignmentAlias());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$11() throws Exception {
+ protected int consumeKeyword$11() throws Exception {
return consumeKeyword(getRule().ele10KeywordAs(), null, false, false, getKeyword$11$Delimiter());
}
- protected boolean consumeAssignment$12() throws Exception {
- if (consumeTerminal(idConsumer, "alias", false, false, getRule().ele110ParserRuleCallID(), getRuleCall$13$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$12() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, "alias", false, false, getRule().ele110ParserRuleCallID(), getRuleCall$13$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
public GeneratedMetamodelElements getRule() {
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageGrammarConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageGrammarConsumer.java
index c51f579..286a471 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageGrammarConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageGrammarConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -62,191 +63,307 @@ public final class XtextTerminalsTestLanguageGrammarConsumer extends NonTerminal
ruleCall$24$Delimiter = ISequenceMatcher.Factory.nullMatcher();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeAlternatives$6()) {
- marker.rollback();
+ int result;
+ result = consumeAlternatives$6();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00000Alternatives());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$10()) {
- marker.rollback();
+ result = consumeAssignment$10();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00001AssignmentIdElements());
marker.release();
- return false;
+ return result;
}
- if (!consumeGroup$12()) {
- marker.rollback();
+ result = consumeGroup$12();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0001Group());
marker.release();
- return false;
+ return result;
}
- if (!consumeGroup$16()) {
- marker.rollback();
+ result = consumeGroup$16();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele001Group());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$25()) {
- marker.rollback();
+ result = consumeAssignment$25();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele01AssignmentMetamodelDeclarations());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$27()) {
- marker.rollback();
+ result = consumeAssignment$27();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1AssignmentRules());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeAlternatives$6() throws Exception {
- if (consumeAssignment$7())
- return true;
- if (consumeKeyword$9())
- return true;
- return false;
+ protected int consumeAlternatives$6() throws Exception {
+ int result = ConsumeResult.SUCCESS;
+ IMarker bestMarker = mark();
+ IMarker currentMarker;
+ int tempResult;
+ currentMarker = bestMarker.copy();
+ tempResult = consumeAssignment$7();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ currentMarker = bestMarker.copy();
+ tempResult = consumeKeyword$9();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ bestMarker.release();
+ return result;
}
- protected boolean consumeAssignment$7() throws Exception {
- if (consumeKeyword(getRule().ele0000000KeywordAbstractLanguage(), "abstract", false, true, getKeyword$8$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$7() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeKeyword(getRule().ele0000000KeywordAbstractLanguage(), "abstract", false, true, getKeyword$8$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeKeyword$9() throws Exception {
+ protected int consumeKeyword$9() throws Exception {
return consumeKeyword(getRule().ele000001KeywordLanguage(), null, false, false, getKeyword$9$Delimiter());
}
- protected boolean consumeAssignment$10() throws Exception {
- if (consumeTerminal(idConsumer, "idElements", true, false, getRule().ele000010ParserRuleCallID(), getRuleCall$11$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$10() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, "idElements", true, false, getRule().ele000010ParserRuleCallID(), getRuleCall$11$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeGroup$12() throws Exception {
- while(doConsumeGroup$12()) {}
- return true;
+ protected int consumeGroup$12() throws Exception {
+ IMarker marker = mark();
+ while(doConsumeGroup$12() == ConsumeResult.SUCCESS) {
+ marker.release();
+ marker = mark();
+ }
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeGroup$12() throws Exception {
+ protected int doConsumeGroup$12() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$13()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$13();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00010KeywordFullStop());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$14()) {
- marker.rollback();
+ result = consumeAssignment$14();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00011AssignmentIdElements());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$13() throws Exception {
+ protected int consumeKeyword$13() throws Exception {
return consumeKeyword(getRule().ele00010KeywordFullStop(), null, false, false, getKeyword$13$Delimiter());
}
- protected boolean consumeAssignment$14() throws Exception {
- if (consumeTerminal(idConsumer, "idElements", true, false, getRule().ele000110ParserRuleCallID(), getRuleCall$15$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$14() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, "idElements", true, false, getRule().ele000110ParserRuleCallID(), getRuleCall$15$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeGroup$16() throws Exception {
- doConsumeGroup$16();
- return true;
+ protected int consumeGroup$16() throws Exception {
+ IMarker marker = mark();
+ int result = doConsumeGroup$16();
+ if (result != ConsumeResult.SUCCESS)
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeGroup$16() throws Exception {
+ protected int doConsumeGroup$16() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$18()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$18();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00100KeywordExtends());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$19()) {
- marker.rollback();
+ result = consumeAssignment$19();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00101AssignmentSuperGrammarIdElements());
marker.release();
- return false;
+ return result;
}
- if (!consumeGroup$21()) {
- marker.rollback();
+ result = consumeGroup$21();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0011Group());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$18() throws Exception {
+ protected int consumeKeyword$18() throws Exception {
return consumeKeyword(getRule().ele00100KeywordExtends(), null, false, false, getKeyword$18$Delimiter());
}
- protected boolean consumeAssignment$19() throws Exception {
- if (consumeTerminal(idConsumer, "superGrammarIdElements", true, false, getRule().ele001010ParserRuleCallID(), getRuleCall$20$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$19() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, "superGrammarIdElements", true, false, getRule().ele001010ParserRuleCallID(), getRuleCall$20$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeGroup$21() throws Exception {
- while(doConsumeGroup$21()) {}
- return true;
+ protected int consumeGroup$21() throws Exception {
+ IMarker marker = mark();
+ while(doConsumeGroup$21() == ConsumeResult.SUCCESS) {
+ marker.release();
+ marker = mark();
+ }
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeGroup$21() throws Exception {
+ protected int doConsumeGroup$21() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$22()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$22();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00110KeywordFullStop());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$23()) {
- marker.rollback();
+ result = consumeAssignment$23();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00111AssignmentSuperGrammarIdElements());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$22() throws Exception {
+ protected int consumeKeyword$22() throws Exception {
return consumeKeyword(getRule().ele00110KeywordFullStop(), null, false, false, getKeyword$22$Delimiter());
}
- protected boolean consumeAssignment$23() throws Exception {
- if (consumeTerminal(idConsumer, "superGrammarIdElements", true, false, getRule().ele001110ParserRuleCallID(), getRuleCall$24$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$23() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, "superGrammarIdElements", true, false, getRule().ele001110ParserRuleCallID(), getRuleCall$24$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeAssignment$25() throws Exception {
- while(doConsumeAssignment$25()) {}
- return true;
+ protected int consumeAssignment$25() throws Exception {
+ IMarker marker = mark();
+ while(doConsumeAssignment$25() == ConsumeResult.SUCCESS) {
+ marker.release();
+ marker = mark();
+ }
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeAssignment$25() throws Exception {
- if (consumeNonTerminal(abstractMetamodelDeclarationConsumer, "metamodelDeclarations", true, false, getRule().ele010ParserRuleCallAbstractMetamodelDeclaration()))
- return true;
- return false;
+ protected int doConsumeAssignment$25() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(abstractMetamodelDeclarationConsumer, "metamodelDeclarations", true, false, getRule().ele010ParserRuleCallAbstractMetamodelDeclaration());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeAssignment$27() throws Exception {
- if (doConsumeAssignment$27()) {
- while(doConsumeAssignment$27()) {}
- return true;
+ protected int consumeAssignment$27() throws Exception {
+ IMarker marker = mark();
+ int result = doConsumeAssignment$27();
+ if (result == ConsumeResult.SUCCESS) {
+ marker.release();
+ marker = mark();
+ while(doConsumeAssignment$27()==ConsumeResult.SUCCESS) {
+ marker.release();
+ marker = mark();
+ }
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
+ } else {
+ error("Could not find token.", getRule().ele1AssignmentRules());
}
- return false;
+ marker.release();
+ return result;
}
- protected boolean doConsumeAssignment$27() throws Exception {
- if (consumeNonTerminal(abstractRuleConsumer, "rules", true, false, getRule().ele10ParserRuleCallAbstractRule()))
- return true;
- return false;
+ protected int doConsumeAssignment$27() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(abstractRuleConsumer, "rules", true, false, getRule().ele10ParserRuleCallAbstractRule());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
public GrammarElements getRule() {
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageGroupConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageGroupConsumer.java
index e0a359e..2dd2a5e 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageGroupConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageGroupConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -31,59 +32,75 @@ public final class XtextTerminalsTestLanguageGroupConsumer extends NonTerminalCo
super(input, markerFactory, tokenAcceptor, hiddenTokenHandler, consumerUtil, hiddenTokens);
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeRuleCall$2()) {
- marker.rollback();
+ int result;
+ result = consumeRuleCall$2();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0ParserRuleCallAbstractToken());
marker.release();
- return false;
+ return result;
}
- if (!consumeGroup$3()) {
- marker.rollback();
+ result = consumeGroup$3();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1Group());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeRuleCall$2() throws Exception {
+ protected int consumeRuleCall$2() throws Exception {
return consumeNonTerminal(abstractTokenConsumer, null, false, false, getRule().ele0ParserRuleCallAbstractToken());
}
- protected boolean consumeGroup$3() throws Exception {
- while(doConsumeGroup$3()) {}
- return true;
+ protected int consumeGroup$3() throws Exception {
+ IMarker marker = mark();
+ while(doConsumeGroup$3() == ConsumeResult.SUCCESS) {
+ marker.release();
+ marker = mark();
+ }
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeGroup$3() throws Exception {
+ protected int doConsumeGroup$3() throws Exception {
final IMarker marker = mark();
- if (!consumeAction$4()) {
- marker.rollback();
+ int result;
+ result = consumeAction$4();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele10ActionGroupabstractTokens());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$6()) {
- marker.rollback();
+ result = consumeAssignment$6();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele11AssignmentAbstractTokens());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeAction$4() {
+ protected int consumeAction$4() {
consumeAction("Group", "abstractTokens", true);
- return true;
+ return ConsumeResult.SUCCESS;
}
- protected boolean consumeAssignment$6() throws Exception {
- if (consumeNonTerminal(abstractTokenConsumer, "abstractTokens", true, false, getRule().ele110ParserRuleCallAbstractToken()))
- return true;
- return false;
+ protected int consumeAssignment$6() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(abstractTokenConsumer, "abstractTokens", true, false, getRule().ele110ParserRuleCallAbstractToken());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
public GroupElements getRule() {
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageIDConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageIDConsumer.java
index c159e4a..04dec9a 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageIDConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageIDConsumer.java
@@ -7,6 +7,7 @@ import org.eclipse.xtext.AbstractRule;
import org.eclipse.xtext.parser.packrat.ICharSequenceWithOffset;
import org.eclipse.xtext.parser.packrat.IMarkerFactory;
import org.eclipse.xtext.parser.packrat.consumers.AbstractRuleAwareTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -22,8 +23,8 @@ public final class XtextTerminalsTestLanguageIDConsumer extends AbstractRuleAwar
super(input, markerFactory, tokenAcceptor);
}
- protected boolean doConsume() {
- return consumeGroup$1();
+ protected int doConsume() {
+ return consumeGroup$1() ? ConsumeResult.SUCCESS : ConsumeResult.EMPTY_MATCH;
}
protected boolean consumeGroup$1() {
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageINTConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageINTConsumer.java
index d2ef8b2..1fa0454 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageINTConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageINTConsumer.java
@@ -7,6 +7,7 @@ import org.eclipse.xtext.AbstractRule;
import org.eclipse.xtext.parser.packrat.ICharSequenceWithOffset;
import org.eclipse.xtext.parser.packrat.IMarkerFactory;
import org.eclipse.xtext.parser.packrat.consumers.AbstractRuleAwareTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -22,8 +23,8 @@ public final class XtextTerminalsTestLanguageINTConsumer extends AbstractRuleAwa
super(input, markerFactory, tokenAcceptor);
}
- protected boolean doConsume() {
- return consumeCharacterRange$1();
+ protected int doConsume() {
+ return consumeCharacterRange$1() ? ConsumeResult.SUCCESS : ConsumeResult.EMPTY_MATCH;
}
protected boolean consumeCharacterRange$1() {
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageKeywordConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageKeywordConsumer.java
index 9cc8d0c..ed2f8d9 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageKeywordConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageKeywordConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -34,14 +35,18 @@ public final class XtextTerminalsTestLanguageKeywordConsumer extends NonTerminal
ruleCall$2$Delimiter = ISequenceMatcher.Factory.nullMatcher();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeAssignment$1();
}
- protected boolean consumeAssignment$1() throws Exception {
- if (consumeTerminal(stringConsumer, "value", false, false, getRule().ele0ParserRuleCallSTRING(), getRuleCall$2$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$1() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(stringConsumer, "value", false, false, getRule().ele0ParserRuleCallSTRING(), getRuleCall$2$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
public KeywordElements getRule() {
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageLexerRuleConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageLexerRuleConsumer.java
index 7c60888..24c4b5d 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageLexerRuleConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageLexerRuleConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -56,110 +57,173 @@ public final class XtextTerminalsTestLanguageLexerRuleConsumer extends NonTermin
ruleCall$17$Delimiter = ISequenceMatcher.Factory.nullMatcher();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeAlternatives$6()) {
- marker.rollback();
+ int result;
+ result = consumeAlternatives$6();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00000Alternatives());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$9()) {
- marker.rollback();
+ result = consumeAssignment$9();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00001AssignmentName());
marker.release();
- return false;
+ return result;
}
- if (!consumeGroup$11()) {
- marker.rollback();
+ result = consumeGroup$11();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0001Group());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$15()) {
- marker.rollback();
+ result = consumeKeyword$15();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele001KeywordColon());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$16()) {
- marker.rollback();
+ result = consumeAssignment$16();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele01AssignmentBody());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$18()) {
- marker.rollback();
+ result = consumeKeyword$18();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1KeywordSemicolon());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeAlternatives$6() throws Exception {
- if (consumeKeyword$7())
- return true;
- if (consumeKeyword$8())
- return true;
- return false;
+ protected int consumeAlternatives$6() throws Exception {
+ int result = ConsumeResult.SUCCESS;
+ IMarker bestMarker = mark();
+ IMarker currentMarker;
+ int tempResult;
+ currentMarker = bestMarker.copy();
+ tempResult = consumeKeyword$7();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ currentMarker = bestMarker.copy();
+ tempResult = consumeKeyword$8();
+ if (tempResult == ConsumeResult.SUCCESS) {
+ if (bestMarker != currentMarker) {
+ bestMarker.discard();
+ }
+ currentMarker.release();
+ return tempResult;
+ }
+ if (tempResult > result) {
+ bestMarker.discard();
+ bestMarker = currentMarker;
+ result = tempResult;
+ } else {
+ currentMarker.discard();
+ }
+ currentMarker = null;
+ bestMarker.activate();
+ bestMarker.release();
+ return result;
}
- protected boolean consumeKeyword$7() throws Exception {
+ protected int consumeKeyword$7() throws Exception {
return consumeKeyword(getRule().ele000000KeywordNative(), null, false, false, getKeyword$7$Delimiter());
}
- protected boolean consumeKeyword$8() throws Exception {
+ protected int consumeKeyword$8() throws Exception {
return consumeKeyword(getRule().ele000001KeywordLexer(), null, false, false, getKeyword$8$Delimiter());
}
- protected boolean consumeAssignment$9() throws Exception {
- if (consumeTerminal(idConsumer, "name", false, false, getRule().ele000010ParserRuleCallID(), getRuleCall$10$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$9() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, "name", false, false, getRule().ele000010ParserRuleCallID(), getRuleCall$10$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeGroup$11() throws Exception {
- doConsumeGroup$11();
- return true;
+ protected int consumeGroup$11() throws Exception {
+ IMarker marker = mark();
+ int result = doConsumeGroup$11();
+ if (result != ConsumeResult.SUCCESS)
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeGroup$11() throws Exception {
+ protected int doConsumeGroup$11() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$12()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$12();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00010KeywordReturns());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$13()) {
- marker.rollback();
+ result = consumeAssignment$13();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00011AssignmentType());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$12() throws Exception {
+ protected int consumeKeyword$12() throws Exception {
return consumeKeyword(getRule().ele00010KeywordReturns(), null, false, false, getKeyword$12$Delimiter());
}
- protected boolean consumeAssignment$13() throws Exception {
- if (consumeNonTerminal(typeRefConsumer, "type", false, false, getRule().ele000110ParserRuleCallTypeRef()))
- return true;
- return false;
+ protected int consumeAssignment$13() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(typeRefConsumer, "type", false, false, getRule().ele000110ParserRuleCallTypeRef());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeKeyword$15() throws Exception {
+ protected int consumeKeyword$15() throws Exception {
return consumeKeyword(getRule().ele001KeywordColon(), null, false, false, getKeyword$15$Delimiter());
}
- protected boolean consumeAssignment$16() throws Exception {
- if (consumeTerminal(stringConsumer, "body", false, false, getRule().ele010ParserRuleCallSTRING(), getRuleCall$17$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$16() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(stringConsumer, "body", false, false, getRule().ele010ParserRuleCallSTRING(), getRuleCall$17$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeKeyword$18() throws Exception {
+ protected int consumeKeyword$18() throws Exception {
return consumeKeyword(getRule().ele1KeywordSemicolon(), null, false, false, getKeyword$18$Delimiter());
}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageML_COMMENTConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageML_COMMENTConsumer.java
index 3a0e8a3..42807a5 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageML_COMMENTConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageML_COMMENTConsumer.java
@@ -7,6 +7,7 @@ import org.eclipse.xtext.AbstractRule;
import org.eclipse.xtext.parser.packrat.ICharSequenceWithOffset;
import org.eclipse.xtext.parser.packrat.IMarkerFactory;
import org.eclipse.xtext.parser.packrat.consumers.AbstractRuleAwareTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -22,8 +23,8 @@ public final class XtextTerminalsTestLanguageML_COMMENTConsumer extends Abstract
super(input, markerFactory, tokenAcceptor);
}
- protected boolean doConsume() {
- return consumeGroup$1();
+ protected int doConsume() {
+ return consumeGroup$1() ? ConsumeResult.SUCCESS : ConsumeResult.EMPTY_MATCH;
}
protected boolean consumeGroup$1() {
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageNegatedTokenConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageNegatedTokenConsumer.java
index f7f5dcd..02b7ce0 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageNegatedTokenConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageNegatedTokenConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -34,34 +35,41 @@ public final class XtextTerminalsTestLanguageNegatedTokenConsumer extends NonTer
keyword$2$Delimiter = ICharacterClass.Factory.nullClass();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$2()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$2();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0KeywordExclamationMark());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$3()) {
- marker.rollback();
+ result = consumeAssignment$3();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1AssignmentTerminal());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$2() throws Exception {
+ protected int consumeKeyword$2() throws Exception {
return consumeKeyword(getRule().ele0KeywordExclamationMark(), null, false, false, getKeyword$2$Delimiter());
}
- protected boolean consumeAssignment$3() throws Exception {
- if (consumeNonTerminal(terminalTokenElementConsumer, "terminal", false, false, getRule().ele10ParserRuleCallTerminalTokenElement()))
- return true;
- return false;
+ protected int consumeAssignment$3() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(terminalTokenElementConsumer, "terminal", false, false, getRule().ele10ParserRuleCallTerminalTokenElement());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
public NegatedTokenElements getRule() {
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageParenthesizedElementConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageParenthesizedElementConsumer.java
index 33aa803..81e2f0a 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageParenthesizedElementConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageParenthesizedElementConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -37,40 +38,44 @@ public final class XtextTerminalsTestLanguageParenthesizedElementConsumer extend
keyword$5$Delimiter = ICharacterClass.Factory.nullClass();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$3()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$3();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00KeywordLeftParenthesis());
marker.release();
- return false;
+ return result;
}
- if (!consumeRuleCall$4()) {
- marker.rollback();
+ result = consumeRuleCall$4();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele01ParserRuleCallAlternatives());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$5()) {
- marker.rollback();
+ result = consumeKeyword$5();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1KeywordRightParenthesis());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$3() throws Exception {
+ protected int consumeKeyword$3() throws Exception {
return consumeKeyword(getRule().ele00KeywordLeftParenthesis(), null, false, false, getKeyword$3$Delimiter());
}
- protected boolean consumeRuleCall$4() throws Exception {
+ protected int consumeRuleCall$4() throws Exception {
return consumeNonTerminal(alternativesConsumer, null, false, false, getRule().ele01ParserRuleCallAlternatives());
}
- protected boolean consumeKeyword$5() throws Exception {
+ protected int consumeKeyword$5() throws Exception {
return consumeKeyword(getRule().ele1KeywordRightParenthesis(), null, false, false, getKeyword$5$Delimiter());
}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageParenthesizedTerminalElementConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageParenthesizedTerminalElementConsumer.java
index b300ced..121e4ef 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageParenthesizedTerminalElementConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageParenthesizedTerminalElementConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -37,40 +38,44 @@ public final class XtextTerminalsTestLanguageParenthesizedTerminalElementConsume
keyword$5$Delimiter = ICharacterClass.Factory.nullClass();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$3()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$3();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00KeywordLeftParenthesis());
marker.release();
- return false;
+ return result;
}
- if (!consumeRuleCall$4()) {
- marker.rollback();
+ result = consumeRuleCall$4();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele01ParserRuleCallTerminalAlternatives());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$5()) {
- marker.rollback();
+ result = consumeKeyword$5();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1KeywordRightParenthesis());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$3() throws Exception {
+ protected int consumeKeyword$3() throws Exception {
return consumeKeyword(getRule().ele00KeywordLeftParenthesis(), null, false, false, getKeyword$3$Delimiter());
}
- protected boolean consumeRuleCall$4() throws Exception {
+ protected int consumeRuleCall$4() throws Exception {
return consumeNonTerminal(terminalAlternativesConsumer, null, false, false, getRule().ele01ParserRuleCallTerminalAlternatives());
}
- protected boolean consumeKeyword$5() throws Exception {
+ protected int consumeKeyword$5() throws Exception {
return consumeKeyword(getRule().ele1KeywordRightParenthesis(), null, false, false, getKeyword$5$Delimiter());
}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageParserRuleConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageParserRuleConsumer.java
index 56a5e5d..5ec5677 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageParserRuleConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageParserRuleConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -65,181 +66,238 @@ public final class XtextTerminalsTestLanguageParserRuleConsumer extends NonTermi
ruleCall$7$Delimiter = ISequenceMatcher.Factory.nullMatcher();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeAssignment$6()) {
- marker.rollback();
+ int result;
+ result = consumeAssignment$6();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00000AssignmentName());
marker.release();
- return false;
+ return result;
}
- if (!consumeGroup$8()) {
- marker.rollback();
+ result = consumeGroup$8();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00001Group());
marker.release();
- return false;
+ return result;
}
- if (!consumeGroup$12()) {
- marker.rollback();
+ result = consumeGroup$12();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0001Group());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$28()) {
- marker.rollback();
+ result = consumeKeyword$28();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele001KeywordColon());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$29()) {
- marker.rollback();
+ result = consumeAssignment$29();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele01AssignmentAlternatives());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$31()) {
- marker.rollback();
+ result = consumeKeyword$31();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1KeywordSemicolon());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeAssignment$6() throws Exception {
- if (consumeTerminal(idConsumer, "name", false, false, getRule().ele000000ParserRuleCallID(), getRuleCall$7$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$6() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, "name", false, false, getRule().ele000000ParserRuleCallID(), getRuleCall$7$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeGroup$8() throws Exception {
- doConsumeGroup$8();
- return true;
+ protected int consumeGroup$8() throws Exception {
+ IMarker marker = mark();
+ int result = doConsumeGroup$8();
+ if (result != ConsumeResult.SUCCESS)
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeGroup$8() throws Exception {
+ protected int doConsumeGroup$8() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$9()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$9();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele000010KeywordReturns());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$10()) {
- marker.rollback();
+ result = consumeAssignment$10();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele000011AssignmentType());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$9() throws Exception {
+ protected int consumeKeyword$9() throws Exception {
return consumeKeyword(getRule().ele000010KeywordReturns(), null, false, false, getKeyword$9$Delimiter());
}
- protected boolean consumeAssignment$10() throws Exception {
- if (consumeNonTerminal(typeRefConsumer, "type", false, false, getRule().ele0000110ParserRuleCallTypeRef()))
- return true;
- return false;
+ protected int consumeAssignment$10() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(typeRefConsumer, "type", false, false, getRule().ele0000110ParserRuleCallTypeRef());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeGroup$12() throws Exception {
- doConsumeGroup$12();
- return true;
+ protected int consumeGroup$12() throws Exception {
+ IMarker marker = mark();
+ int result = doConsumeGroup$12();
+ if (result != ConsumeResult.SUCCESS)
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeGroup$12() throws Exception {
+ protected int doConsumeGroup$12() throws Exception {
final IMarker marker = mark();
- if (!consumeAssignment$16()) {
- marker.rollback();
+ int result;
+ result = consumeAssignment$16();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00010000AssignmentDefinesHiddenTokens());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$18()) {
- marker.rollback();
+ result = consumeKeyword$18();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00010001KeywordLeftParenthesis());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$19()) {
- marker.rollback();
+ result = consumeAssignment$19();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0001001AssignmentHiddenTokens());
marker.release();
- return false;
+ return result;
}
- if (!consumeGroup$22()) {
- marker.rollback();
+ result = consumeGroup$22();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele000101Group());
marker.release();
- return false;
+ return result;
}
- if (!consumeKeyword$27()) {
- marker.rollback();
+ result = consumeKeyword$27();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00011KeywordRightParenthesis());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeAssignment$16() throws Exception {
- if (consumeKeyword(getRule().ele000100000KeywordHidden(), "definesHiddenTokens", false, true, getKeyword$17$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$16() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeKeyword(getRule().ele000100000KeywordHidden(), "definesHiddenTokens", false, true, getKeyword$17$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeKeyword$18() throws Exception {
+ protected int consumeKeyword$18() throws Exception {
return consumeKeyword(getRule().ele00010001KeywordLeftParenthesis(), null, false, false, getKeyword$18$Delimiter());
}
- protected boolean consumeAssignment$19() throws Exception {
- if (consumeTerminal(idConsumer, null, true, false, getRule().ele00010010CrossReferenceEStringAbstractRule(), getCrossReference$20$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$19() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, null, true, false, getRule().ele00010010CrossReferenceEStringAbstractRule(), getCrossReference$20$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeGroup$22() throws Exception {
- while(doConsumeGroup$22()) {}
- return true;
+ protected int consumeGroup$22() throws Exception {
+ IMarker marker = mark();
+ while(doConsumeGroup$22() == ConsumeResult.SUCCESS) {
+ marker.release();
+ marker = mark();
+ }
+ marker.rollback();
+ marker.release();
+ return ConsumeResult.SUCCESS;
}
- protected boolean doConsumeGroup$22() throws Exception {
+ protected int doConsumeGroup$22() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$23()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$23();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0001010KeywordComma());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$24()) {
- marker.rollback();
+ result = consumeAssignment$24();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele0001011AssignmentHiddenTokens());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$23() throws Exception {
+ protected int consumeKeyword$23() throws Exception {
return consumeKeyword(getRule().ele0001010KeywordComma(), null, false, false, getKeyword$23$Delimiter());
}
- protected boolean consumeAssignment$24() throws Exception {
- if (consumeTerminal(idConsumer, null, true, false, getRule().ele00010110CrossReferenceEStringAbstractRule(), getCrossReference$25$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$24() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(idConsumer, null, true, false, getRule().ele00010110CrossReferenceEStringAbstractRule(), getCrossReference$25$Delimiter());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeKeyword$27() throws Exception {
+ protected int consumeKeyword$27() throws Exception {
return consumeKeyword(getRule().ele00011KeywordRightParenthesis(), null, false, false, getKeyword$27$Delimiter());
}
- protected boolean consumeKeyword$28() throws Exception {
+ protected int consumeKeyword$28() throws Exception {
return consumeKeyword(getRule().ele001KeywordColon(), null, false, false, getKeyword$28$Delimiter());
}
- protected boolean consumeAssignment$29() throws Exception {
- if (consumeNonTerminal(alternativesConsumer, "alternatives", false, false, getRule().ele010ParserRuleCallAlternatives()))
- return true;
- return false;
+ protected int consumeAssignment$29() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeNonTerminal(alternativesConsumer, "alternatives", false, false, getRule().ele010ParserRuleCallAlternatives());
+ if (tempResult == ConsumeResult.SUCCESS)
+ return tempResult;
+ result = tempResult >= result ? tempResult : result;
+ return result;
}
- protected boolean consumeKeyword$31() throws Exception {
+ protected int consumeKeyword$31() throws Exception {
return consumeKeyword(getRule().ele1KeywordSemicolon(), null, false, false, getKeyword$31$Delimiter());
}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageReferencedMetamodelConsumer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageReferencedMetamodelConsumer.java
index f2f8ad4..ed90da2 100644
--- a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageReferencedMetamodelConsumer.java
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/parser/terminalrules/parser/packrat/consumers/XtextTerminalsTestLanguageReferencedMetamodelConsumer.java
@@ -11,6 +11,7 @@ import org.eclipse.xtext.parser.packrat.IMarkerFactory.IMarker;
import org.eclipse.xtext.parser.packrat.consumers.IConsumerUtility;
import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.ConsumeResult;
import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
import org.eclipse.xtext.parser.packrat.matching.ISequenceMatcher;
import org.eclipse.xtext.parser.packrat.tokens.IParsedTokenAcceptor;
@@ -45,70 +46,89 @@ public final class XtextTerminalsTestLanguageReferencedMetamodelConsumer extends
ruleCall$10$Delimiter = ISequenceMatcher.Factory.nullMatcher();
}
- protected boolean doConsume() throws Exception {
+ protected int doConsume() throws Exception {
return consumeGroup$1();
}
- protected boolean consumeGroup$1() throws Exception {
+ protected int consumeGroup$1() throws Exception {
final IMarker marker = mark();
- if (!consumeKeyword$3()) {
- marker.rollback();
+ int result;
+ result = consumeKeyword$3();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele00KeywordImport());
marker.release();
- return false;
+ return result;
}
- if (!consumeAssignment$4()) {
- marker.rollback();
+ result = consumeAssignment$4();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele01AssignmentEPackage());
marker.release();
- return false;
+ return result;
}
- if (!consumeGroup$7()) {
- marker.rollback();
+ result = consumeGroup$7();
+ if (result!=ConsumeResult.SUCCESS) {
+ error("Another token expected.", getRule().ele1Group());
marker.release();
- return false;
+ return result;
}
marker.release();
- return true;
+ return result;
}
- protected boolean consumeKeyword$3() throws Exception {
+ protected int consumeKeyword$3() throws Exception {
return consumeKeyword(getRule().ele00KeywordImport(), null, false, false, getKeyword$3$Delimiter());
}
- protected boolean consumeAssignment$4() throws Exception {
- if (consumeTerminal(stringConsumer, null, false, false, getRule().ele010CrossReferenceEStringEPackage(), getCrossReference$5$Delimiter()))
- return true;
- return false;
+ protected int consumeAssignment$4() throws Exception {
+ int result = Integer.MIN_VALUE;
+ int tempResult;
+ tempResult = consumeTerminal(stringConsumer, null, false, false, getRule().ele010CrossReferenceEStringEPackage(), getCrossReference$5$Delimiter());
+ if (tempResult ==