summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMoritz Eysholdt2011-07-14 09:53:21 (EDT)
committerSebastian Zarnekow2011-07-14 17:24:50 (EDT)
commit1bb019d1645715ab3c43ae4bf430775f601c7995 (patch)
tree1eb52fa80245c57216df1c119207292047c0a279
parentd4f53401c36c4f70bc7c821379e37f3ef8092eeb (diff)
downloadorg.eclipse.mwe-1bb019d1645715ab3c43ae4bf430775f601c7995.zip
org.eclipse.mwe-1bb019d1645715ab3c43ae4bf430775f601c7995.tar.gz
org.eclipse.mwe-1bb019d1645715ab3c43ae4bf430775f601c7995.tar.bz2
Migrated mwe2.language to the new serializer
Signed-off-by: Sebastian Zarnekow <Sebastian.Zarnekow@itemis.de>
-rw-r--r--plugins/org.eclipse.emf.mwe2.language/META-INF/MANIFEST.MF6
-rw-r--r--plugins/org.eclipse.emf.mwe2.language/model/Mwe2.genmodel32
-rw-r--r--plugins/org.eclipse.emf.mwe2.language/src-gen/org/eclipse/emf/mwe2/language/AbstractMwe2RuntimeModule.java16
-rw-r--r--plugins/org.eclipse.emf.mwe2.language/src-gen/org/eclipse/emf/mwe2/language/parseTreeConstruction/Mwe2ParsetreeConstructor.java2775
-rw-r--r--plugins/org.eclipse.emf.mwe2.language/src-gen/org/eclipse/emf/mwe2/language/serializer/AbstractMwe2SemanticSequencer.java311
-rw-r--r--plugins/org.eclipse.emf.mwe2.language/src-gen/org/eclipse/emf/mwe2/language/serializer/AbstractMwe2SyntacticSequencer.java35
-rw-r--r--plugins/org.eclipse.emf.mwe2.language/src/org/eclipse/emf/mwe2/language/GenerateMwe2.java4
-rw-r--r--plugins/org.eclipse.emf.mwe2.language/src/org/eclipse/emf/mwe2/language/serializer/Mwe2SemanticSequencer.java53
-rw-r--r--plugins/org.eclipse.emf.mwe2.language/src/org/eclipse/emf/mwe2/language/serializer/Mwe2SyntacticSequencer.java4
-rw-r--r--tests/org.eclipse.emf.mwe2.language.tests/src/org/eclipse/emf/mwe2/language/tests/serializer/Mwe2SerializerTest.java84
10 files changed, 521 insertions, 2799 deletions
diff --git a/plugins/org.eclipse.emf.mwe2.language/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.mwe2.language/META-INF/MANIFEST.MF
index 6e4b98a..77549fa 100644
--- a/plugins/org.eclipse.emf.mwe2.language/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.mwe2.language/META-INF/MANIFEST.MF
@@ -27,12 +27,12 @@ Export-Package: org.eclipse.emf.mwe2.language,
org.eclipse.emf.mwe2.language.mwe2,
org.eclipse.emf.mwe2.language.mwe2.impl,
org.eclipse.emf.mwe2.language.mwe2.util,
- org.eclipse.emf.mwe2.language.parseTreeConstruction,
org.eclipse.emf.mwe2.language.parser.antlr,
org.eclipse.emf.mwe2.language.parser.antlr.internal,
+ org.eclipse.emf.mwe2.language.parser.antlr.lexer,
org.eclipse.emf.mwe2.language.resource,
org.eclipse.emf.mwe2.language.scoping,
+ org.eclipse.emf.mwe2.language.serializer,
org.eclipse.emf.mwe2.language.services,
- org.eclipse.emf.mwe2.language.validation,
- org.eclipse.emf.mwe2.language.parser.antlr.lexer
+ org.eclipse.emf.mwe2.language.validation
diff --git a/plugins/org.eclipse.emf.mwe2.language/model/Mwe2.genmodel b/plugins/org.eclipse.emf.mwe2.language/model/Mwe2.genmodel
index 1fefaeb..6137d24 100644
--- a/plugins/org.eclipse.emf.mwe2.language/model/Mwe2.genmodel
+++ b/plugins/org.eclipse.emf.mwe2.language/model/Mwe2.genmodel
@@ -5,8 +5,10 @@
editDirectory="/org.eclipse.emf.mwe2.language.edit/src" editorDirectory="/org.eclipse.emf.mwe2.language.editor/src"
modelPluginID="org.eclipse.emf.mwe2.language" forceOverwrite="true" modelName="Mwe2"
updateClasspath="false" rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container"
- facadeHelperClass="" complianceLevel="5.0" copyrightFields="false" editPluginID="org.eclipse.emf.mwe2.language.edit"
- editorPluginID="org.eclipse.emf.mwe2.language.editor" usedGenPackages="../../org.eclipse.xtext.common.types/model/JavaVMTypes.genmodel#//types">
+ importerID="org.eclipse.emf.importer.ecore" complianceLevel="5.0" copyrightFields="false"
+ editPluginID="org.eclipse.emf.mwe2.language.edit" editorPluginID="org.eclipse.emf.mwe2.language.editor"
+ usedGenPackages="../../org.eclipse.xtext.common.types/model/JavaVMTypes.genmodel#//types">
+ <foreignModel>Mwe2.ecore</foreignModel>
<genPackages prefix="Mwe2" basePackage="org.eclipse.emf.mwe2.language" disposableProviderFactory="true"
ecorePackage="Mwe2.ecore#/">
<genClasses ecoreClass="Mwe2.ecore#//Module">
@@ -35,29 +37,27 @@
<genClasses ecoreClass="Mwe2.ecore#//Assignment">
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference Mwe2.ecore#//Assignment/feature"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference Mwe2.ecore#//Assignment/value"/>
+ <genFeatures property="Readonly" createChild="false" ecoreFeature="ecore:EAttribute Mwe2.ecore#//Assignment/featureName"/>
</genClasses>
- <genClasses ecoreClass="Mwe2.ecore#//Value"/>
- <genClasses ecoreClass="Mwe2.ecore#//StringLiteral">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference Mwe2.ecore#//StringLiteral/value"/>
+ <genClasses ecoreClass="Mwe2.ecore#//Value">
+ <genOperations ecoreOperation="Mwe2.ecore#//Value/getActualType"/>
</genClasses>
<genClasses ecoreClass="Mwe2.ecore#//BooleanLiteral">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute Mwe2.ecore#//BooleanLiteral/isTrue"/>
</genClasses>
- <genClasses ecoreClass="Mwe2.ecore#//Reference">
- <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference Mwe2.ecore#//Reference/referable"/>
- </genClasses>
- <genClasses ecoreClass="Mwe2.ecore#//CompoundString">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute Mwe2.ecore#//CompoundString/begin"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference Mwe2.ecore#//CompoundString/parts"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute Mwe2.ecore#//CompoundString/end"/>
- <genOperations ecoreOperation="Mwe2.ecore#//CompoundString/getResolvedString"/>
+ <genClasses ecoreClass="Mwe2.ecore#//Reference"/>
+ <genClasses ecoreClass="Mwe2.ecore#//StringLiteral">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute Mwe2.ecore#//StringLiteral/begin"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference Mwe2.ecore#//StringLiteral/parts"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute Mwe2.ecore#//StringLiteral/end"/>
</genClasses>
<genClasses ecoreClass="Mwe2.ecore#//StringPart"/>
- <genClasses ecoreClass="Mwe2.ecore#//PropertyReference">
- <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference Mwe2.ecore#//PropertyReference/property"/>
- </genClasses>
+ <genClasses ecoreClass="Mwe2.ecore#//PropertyReference"/>
<genClasses ecoreClass="Mwe2.ecore#//PlainString">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute Mwe2.ecore#//PlainString/value"/>
</genClasses>
+ <genClasses image="false" ecoreClass="Mwe2.ecore#//AbstractReference">
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference Mwe2.ecore#//AbstractReference/referable"/>
+ </genClasses>
</genPackages>
</genmodel:GenModel>
diff --git a/plugins/org.eclipse.emf.mwe2.language/src-gen/org/eclipse/emf/mwe2/language/AbstractMwe2RuntimeModule.java b/plugins/org.eclipse.emf.mwe2.language/src-gen/org/eclipse/emf/mwe2/language/AbstractMwe2RuntimeModule.java
index c724e31..3e5373b 100644
--- a/plugins/org.eclipse.emf.mwe2.language/src-gen/org/eclipse/emf/mwe2/language/AbstractMwe2RuntimeModule.java
+++ b/plugins/org.eclipse.emf.mwe2.language/src-gen/org/eclipse/emf/mwe2/language/AbstractMwe2RuntimeModule.java
@@ -39,9 +39,19 @@ public abstract class AbstractMwe2RuntimeModule extends DefaultRuntimeModule {
return org.eclipse.emf.mwe2.language.services.Mwe2GrammarAccess.class;
}
- // contributed by org.eclipse.xtext.generator.parseTreeConstructor.ParseTreeConstructorFragment
- public Class<? extends org.eclipse.xtext.parsetree.reconstr.IParseTreeConstructor> bindIParseTreeConstructor() {
- return org.eclipse.emf.mwe2.language.parseTreeConstruction.Mwe2ParsetreeConstructor.class;
+ // contributed by org.eclipse.xtext.generator.serializer.SerializerFragment
+ public Class<? extends org.eclipse.xtext.serializer.sequencer.ISemanticSequencer> bindISemanticSequencer() {
+ return org.eclipse.emf.mwe2.language.serializer.Mwe2SemanticSequencer.class;
+ }
+
+ // contributed by org.eclipse.xtext.generator.serializer.SerializerFragment
+ public Class<? extends org.eclipse.xtext.serializer.sequencer.ISyntacticSequencer> bindISyntacticSequencer() {
+ return org.eclipse.emf.mwe2.language.serializer.Mwe2SyntacticSequencer.class;
+ }
+
+ // contributed by org.eclipse.xtext.generator.serializer.SerializerFragment
+ public Class<? extends org.eclipse.xtext.serializer.ISerializer> bindISerializer() {
+ return org.eclipse.xtext.serializer.impl.Serializer.class;
}
// contributed by org.eclipse.xtext.generator.parser.antlr.ex.rt.AntlrGeneratorFragment
diff --git a/plugins/org.eclipse.emf.mwe2.language/src-gen/org/eclipse/emf/mwe2/language/parseTreeConstruction/Mwe2ParsetreeConstructor.java b/plugins/org.eclipse.emf.mwe2.language/src-gen/org/eclipse/emf/mwe2/language/parseTreeConstruction/Mwe2ParsetreeConstructor.java
deleted file mode 100644
index afb83ab..0000000
--- a/plugins/org.eclipse.emf.mwe2.language/src-gen/org/eclipse/emf/mwe2/language/parseTreeConstruction/Mwe2ParsetreeConstructor.java
+++ /dev/null
@@ -1,2775 +0,0 @@
-/*
-* generated by Xtext
-*/
-package org.eclipse.emf.mwe2.language.parseTreeConstruction;
-
-import org.eclipse.emf.ecore.*;
-import org.eclipse.xtext.*;
-import org.eclipse.xtext.parsetree.reconstr.IEObjectConsumer;
-import org.eclipse.xtext.parsetree.reconstr.impl.AbstractParseTreeConstructor;
-
-import org.eclipse.emf.mwe2.language.services.Mwe2GrammarAccess;
-
-import com.google.inject.Inject;
-
-@SuppressWarnings("all")
-public class Mwe2ParsetreeConstructor extends AbstractParseTreeConstructor {
-
- @Inject
- private Mwe2GrammarAccess grammarAccess;
-
- @Override
- protected AbstractToken getRootToken(IEObjectConsumer inst) {
- return new ThisRootNode(inst);
- }
-
-protected class ThisRootNode extends RootToken {
- public ThisRootNode(IEObjectConsumer inst) {
- super(inst);
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new Module_Group(this, this, 0, inst);
- case 1: return new DeclaredProperty_Group(this, this, 1, inst);
- case 2: return new RootComponent_Group(this, this, 2, inst);
- case 3: return new Component_Group(this, this, 3, inst);
- case 4: return new Import_Group(this, this, 4, inst);
- case 5: return new Assignment_Group(this, this, 5, inst);
- case 6: return new Value_Alternatives(this, this, 6, inst);
- case 7: return new BooleanLiteral_Group(this, this, 7, inst);
- case 8: return new Reference_ReferableAssignment(this, this, 8, inst);
- case 9: return new StringLiteral_Alternatives(this, this, 9, inst);
- case 10: return new PropertyReference_Group(this, this, 10, inst);
- case 11: return new PropertyReferenceImpl_ReferableAssignment(this, this, 11, inst);
- case 12: return new PlainString_ValueAssignment(this, this, 12, inst);
- default: return null;
- }
- }
-}
-
-
-/************ begin Rule Module ****************
- *
- * Module:
- * {Module} "module" canonicalName=FQN imports+=Import* declaredProperties+=DeclaredProperty* root=RootComponent;
- *
- **/
-
-// {Module} "module" canonicalName=FQN imports+=Import* declaredProperties+=DeclaredProperty* root=RootComponent
-protected class Module_Group extends GroupToken {
-
- public Module_Group(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Group getGrammarElement() {
- return grammarAccess.getModuleAccess().getGroup();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new Module_RootAssignment_5(lastRuleCallOrigin, this, 0, inst);
- default: return null;
- }
- }
-
- @Override
- public IEObjectConsumer tryConsume() {
- if(getEObject().eClass() != grammarAccess.getModuleAccess().getModuleAction_0().getType().getClassifier())
- return null;
- return eObjectConsumer;
- }
-
-}
-
-// {Module}
-protected class Module_ModuleAction_0 extends ActionToken {
-
- public Module_ModuleAction_0(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Action getGrammarElement() {
- return grammarAccess.getModuleAccess().getModuleAction_0();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- default: return lastRuleCallOrigin.createFollowerAfterReturn(this, index, index, inst);
- }
- }
-
- @Override
- public IEObjectConsumer tryConsume() {
- if(!eObjectConsumer.isConsumed()) return null;
- return eObjectConsumer;
- }
-}
-
-// "module"
-protected class Module_ModuleKeyword_1 extends KeywordToken {
-
- public Module_ModuleKeyword_1(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Keyword getGrammarElement() {
- return grammarAccess.getModuleAccess().getModuleKeyword_1();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new Module_ModuleAction_0(lastRuleCallOrigin, this, 0, inst);
- default: return null;
- }
- }
-
-}
-
-// canonicalName=FQN
-protected class Module_CanonicalNameAssignment_2 extends AssignmentToken {
-
- public Module_CanonicalNameAssignment_2(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Assignment getGrammarElement() {
- return grammarAccess.getModuleAccess().getCanonicalNameAssignment_2();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new Module_ModuleKeyword_1(lastRuleCallOrigin, this, 0, inst);
- default: return null;
- }
- }
-
- @Override
- public IEObjectConsumer tryConsume() {
- if((value = eObjectConsumer.getConsumable("canonicalName",true)) == null) return null;
- IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("canonicalName");
- if(valueSerializer.isValid(obj.getEObject(), grammarAccess.getModuleAccess().getCanonicalNameFQNParserRuleCall_2_0(), value, null)) {
- type = AssignmentType.DATATYPE_RULE_CALL;
- element = grammarAccess.getModuleAccess().getCanonicalNameFQNParserRuleCall_2_0();
- return obj;
- }
- return null;
- }
-
-}
-
-// imports+=Import*
-protected class Module_ImportsAssignment_3 extends AssignmentToken {
-
- public Module_ImportsAssignment_3(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Assignment getGrammarElement() {
- return grammarAccess.getModuleAccess().getImportsAssignment_3();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new Import_Group(this, this, 0, inst);
- default: return null;
- }
- }
-
- @Override
- public IEObjectConsumer tryConsume() {
- if((value = eObjectConsumer.getConsumable("imports",false)) == null) return null;
- IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("imports");
- if(value instanceof EObject) { // org::eclipse::xtext::impl::RuleCallImpl
- IEObjectConsumer param = createEObjectConsumer((EObject)value);
- if(param.isInstanceOf(grammarAccess.getImportRule().getType().getClassifier())) {
- type = AssignmentType.PARSER_RULE_CALL;
- element = grammarAccess.getModuleAccess().getImportsImportParserRuleCall_3_0();
- consumed = obj;
- return param;
- }
- }
- return null;
- }
-
- @Override
- public AbstractToken createFollowerAfterReturn(AbstractToken next, int actIndex, int index, IEObjectConsumer inst) {
- if(value == inst.getEObject() && !inst.isConsumed()) return null;
- switch(index) {
- case 0: return new Module_ImportsAssignment_3(lastRuleCallOrigin, next, actIndex, consumed);
- case 1: return new Module_CanonicalNameAssignment_2(lastRuleCallOrigin, next, actIndex, consumed);
- default: return null;
- }
- }
-}
-
-// declaredProperties+=DeclaredProperty*
-protected class Module_DeclaredPropertiesAssignment_4 extends AssignmentToken {
-
- public Module_DeclaredPropertiesAssignment_4(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Assignment getGrammarElement() {
- return grammarAccess.getModuleAccess().getDeclaredPropertiesAssignment_4();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new DeclaredProperty_Group(this, this, 0, inst);
- default: return null;
- }
- }
-
- @Override
- public IEObjectConsumer tryConsume() {
- if((value = eObjectConsumer.getConsumable("declaredProperties",false)) == null) return null;
- IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("declaredProperties");
- if(value instanceof EObject) { // org::eclipse::xtext::impl::RuleCallImpl
- IEObjectConsumer param = createEObjectConsumer((EObject)value);
- if(param.isInstanceOf(grammarAccess.getDeclaredPropertyRule().getType().getClassifier())) {
- type = AssignmentType.PARSER_RULE_CALL;
- element = grammarAccess.getModuleAccess().getDeclaredPropertiesDeclaredPropertyParserRuleCall_4_0();
- consumed = obj;
- return param;
- }
- }
- return null;
- }
-
- @Override
- public AbstractToken createFollowerAfterReturn(AbstractToken next, int actIndex, int index, IEObjectConsumer inst) {
- if(value == inst.getEObject() && !inst.isConsumed()) return null;
- switch(index) {
- case 0: return new Module_DeclaredPropertiesAssignment_4(lastRuleCallOrigin, next, actIndex, consumed);
- case 1: return new Module_ImportsAssignment_3(lastRuleCallOrigin, next, actIndex, consumed);
- case 2: return new Module_CanonicalNameAssignment_2(lastRuleCallOrigin, next, actIndex, consumed);
- default: return null;
- }
- }
-}
-
-// root=RootComponent
-protected class Module_RootAssignment_5 extends AssignmentToken {
-
- public Module_RootAssignment_5(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Assignment getGrammarElement() {
- return grammarAccess.getModuleAccess().getRootAssignment_5();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new RootComponent_Group(this, this, 0, inst);
- default: return null;
- }
- }
-
- @Override
- public IEObjectConsumer tryConsume() {
- if((value = eObjectConsumer.getConsumable("root",true)) == null) return null;
- IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("root");
- if(value instanceof EObject) { // org::eclipse::xtext::impl::RuleCallImpl
- IEObjectConsumer param = createEObjectConsumer((EObject)value);
- if(param.isInstanceOf(grammarAccess.getRootComponentRule().getType().getClassifier())) {
- type = AssignmentType.PARSER_RULE_CALL;
- element = grammarAccess.getModuleAccess().getRootRootComponentParserRuleCall_5_0();
- consumed = obj;
- return param;
- }
- }
- return null;
- }
-
- @Override
- public AbstractToken createFollowerAfterReturn(AbstractToken next, int actIndex, int index, IEObjectConsumer inst) {
- if(value == inst.getEObject() && !inst.isConsumed()) return null;
- switch(index) {
- case 0: return new Module_DeclaredPropertiesAssignment_4(lastRuleCallOrigin, next, actIndex, consumed);
- case 1: return new Module_ImportsAssignment_3(lastRuleCallOrigin, next, actIndex, consumed);
- case 2: return new Module_CanonicalNameAssignment_2(lastRuleCallOrigin, next, actIndex, consumed);
- default: return null;
- }
- }
-}
-
-
-/************ end Rule Module ****************/
-
-
-/************ begin Rule DeclaredProperty ****************
- *
- * DeclaredProperty:
- * "var" type=[types::JvmType|FQN]? name=FQN ("=" default=Value)?;
- *
- **/
-
-// "var" type=[types::JvmType|FQN]? name=FQN ("=" default=Value)?
-protected class DeclaredProperty_Group extends GroupToken {
-
- public DeclaredProperty_Group(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Group getGrammarElement() {
- return grammarAccess.getDeclaredPropertyAccess().getGroup();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new DeclaredProperty_Group_3(lastRuleCallOrigin, this, 0, inst);
- case 1: return new DeclaredProperty_NameAssignment_2(lastRuleCallOrigin, this, 1, inst);
- default: return null;
- }
- }
-
- @Override
- public IEObjectConsumer tryConsume() {
- if(getEObject().eClass() != grammarAccess.getDeclaredPropertyRule().getType().getClassifier())
- return null;
- return eObjectConsumer;
- }
-
-}
-
-// "var"
-protected class DeclaredProperty_VarKeyword_0 extends KeywordToken {
-
- public DeclaredProperty_VarKeyword_0(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Keyword getGrammarElement() {
- return grammarAccess.getDeclaredPropertyAccess().getVarKeyword_0();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- default: return lastRuleCallOrigin.createFollowerAfterReturn(this, index, index, inst);
- }
- }
-
-}
-
-// type=[types::JvmType|FQN]?
-protected class DeclaredProperty_TypeAssignment_1 extends AssignmentToken {
-
- public DeclaredProperty_TypeAssignment_1(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Assignment getGrammarElement() {
- return grammarAccess.getDeclaredPropertyAccess().getTypeAssignment_1();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new DeclaredProperty_VarKeyword_0(lastRuleCallOrigin, this, 0, inst);
- default: return null;
- }
- }
-
- @Override
- public IEObjectConsumer tryConsume() {
- if((value = eObjectConsumer.getConsumable("type",false)) == null) return null;
- IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("type");
- if(value instanceof EObject) { // org::eclipse::xtext::impl::CrossReferenceImpl
- IEObjectConsumer param = createEObjectConsumer((EObject)value);
- if(param.isInstanceOf(grammarAccess.getDeclaredPropertyAccess().getTypeJvmTypeCrossReference_1_0().getType().getClassifier())) {
- type = AssignmentType.CROSS_REFERENCE;
- element = grammarAccess.getDeclaredPropertyAccess().getTypeJvmTypeCrossReference_1_0();
- return obj;
- }
- }
- return null;
- }
-
-}
-
-// name=FQN
-protected class DeclaredProperty_NameAssignment_2 extends AssignmentToken {
-
- public DeclaredProperty_NameAssignment_2(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Assignment getGrammarElement() {
- return grammarAccess.getDeclaredPropertyAccess().getNameAssignment_2();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new DeclaredProperty_TypeAssignment_1(lastRuleCallOrigin, this, 0, inst);
- case 1: return new DeclaredProperty_VarKeyword_0(lastRuleCallOrigin, this, 1, inst);
- default: return null;
- }
- }
-
- @Override
- public IEObjectConsumer tryConsume() {
- if((value = eObjectConsumer.getConsumable("name",true)) == null) return null;
- IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("name");
- if(valueSerializer.isValid(obj.getEObject(), grammarAccess.getDeclaredPropertyAccess().getNameFQNParserRuleCall_2_0(), value, null)) {
- type = AssignmentType.DATATYPE_RULE_CALL;
- element = grammarAccess.getDeclaredPropertyAccess().getNameFQNParserRuleCall_2_0();
- return obj;
- }
- return null;
- }
-
-}
-
-// ("=" default=Value)?
-protected class DeclaredProperty_Group_3 extends GroupToken {
-
- public DeclaredProperty_Group_3(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Group getGrammarElement() {
- return grammarAccess.getDeclaredPropertyAccess().getGroup_3();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new DeclaredProperty_DefaultAssignment_3_1(lastRuleCallOrigin, this, 0, inst);
- default: return null;
- }
- }
-
-}
-
-// "="
-protected class DeclaredProperty_EqualsSignKeyword_3_0 extends KeywordToken {
-
- public DeclaredProperty_EqualsSignKeyword_3_0(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Keyword getGrammarElement() {
- return grammarAccess.getDeclaredPropertyAccess().getEqualsSignKeyword_3_0();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new DeclaredProperty_NameAssignment_2(lastRuleCallOrigin, this, 0, inst);
- default: return null;
- }
- }
-
-}
-
-// default=Value
-protected class DeclaredProperty_DefaultAssignment_3_1 extends AssignmentToken {
-
- public DeclaredProperty_DefaultAssignment_3_1(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Assignment getGrammarElement() {
- return grammarAccess.getDeclaredPropertyAccess().getDefaultAssignment_3_1();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new Value_Alternatives(this, this, 0, inst);
- default: return null;
- }
- }
-
- @Override
- public IEObjectConsumer tryConsume() {
- if((value = eObjectConsumer.getConsumable("default",false)) == null) return null;
- IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("default");
- if(value instanceof EObject) { // org::eclipse::xtext::impl::RuleCallImpl
- IEObjectConsumer param = createEObjectConsumer((EObject)value);
- if(param.isInstanceOf(grammarAccess.getValueRule().getType().getClassifier())) {
- type = AssignmentType.PARSER_RULE_CALL;
- element = grammarAccess.getDeclaredPropertyAccess().getDefaultValueParserRuleCall_3_1_0();
- consumed = obj;
- return param;
- }
- }
- return null;
- }
-
- @Override
- public AbstractToken createFollowerAfterReturn(AbstractToken next, int actIndex, int index, IEObjectConsumer inst) {
- if(value == inst.getEObject() && !inst.isConsumed()) return null;
- switch(index) {
- case 0: return new DeclaredProperty_EqualsSignKeyword_3_0(lastRuleCallOrigin, next, actIndex, consumed);
- default: return null;
- }
- }
-}
-
-
-
-/************ end Rule DeclaredProperty ****************/
-
-
-/************ begin Rule RootComponent ****************
- *
- * RootComponent returns Component:
- * {Component} (type=[types::JvmType|FQN] | "@" module=[Module|FQN]) (":" name=FQN)? autoInject?="auto-inject"? "{"
- * assignment+=Assignment* "}";
- *
- **/
-
-// {Component} (type=[types::JvmType|FQN] | "@" module=[Module|FQN]) (":" name=FQN)? autoInject?="auto-inject"? "{"
-// assignment+=Assignment* "}"
-protected class RootComponent_Group extends GroupToken {
-
- public RootComponent_Group(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Group getGrammarElement() {
- return grammarAccess.getRootComponentAccess().getGroup();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new RootComponent_RightCurlyBracketKeyword_6(lastRuleCallOrigin, this, 0, inst);
- default: return null;
- }
- }
-
- @Override
- public IEObjectConsumer tryConsume() {
- if(getEObject().eClass() != grammarAccess.getRootComponentAccess().getComponentAction_0().getType().getClassifier())
- return null;
- return eObjectConsumer;
- }
-
-}
-
-// {Component}
-protected class RootComponent_ComponentAction_0 extends ActionToken {
-
- public RootComponent_ComponentAction_0(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Action getGrammarElement() {
- return grammarAccess.getRootComponentAccess().getComponentAction_0();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- default: return lastRuleCallOrigin.createFollowerAfterReturn(this, index, index, inst);
- }
- }
-
- @Override
- public IEObjectConsumer tryConsume() {
- if(!eObjectConsumer.isConsumed()) return null;
- return eObjectConsumer;
- }
-}
-
-// type=[types::JvmType|FQN] | "@" module=[Module|FQN]
-protected class RootComponent_Alternatives_1 extends AlternativesToken {
-
- public RootComponent_Alternatives_1(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Alternatives getGrammarElement() {
- return grammarAccess.getRootComponentAccess().getAlternatives_1();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new RootComponent_TypeAssignment_1_0(lastRuleCallOrigin, this, 0, inst);
- case 1: return new RootComponent_Group_1_1(lastRuleCallOrigin, this, 1, inst);
- default: return null;
- }
- }
-
-}
-
-// type=[types::JvmType|FQN]
-protected class RootComponent_TypeAssignment_1_0 extends AssignmentToken {
-
- public RootComponent_TypeAssignment_1_0(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Assignment getGrammarElement() {
- return grammarAccess.getRootComponentAccess().getTypeAssignment_1_0();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new RootComponent_ComponentAction_0(lastRuleCallOrigin, this, 0, inst);
- default: return null;
- }
- }
-
- @Override
- public IEObjectConsumer tryConsume() {
- if((value = eObjectConsumer.getConsumable("type",true)) == null) return null;
- IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("type");
- if(value instanceof EObject) { // org::eclipse::xtext::impl::CrossReferenceImpl
- IEObjectConsumer param = createEObjectConsumer((EObject)value);
- if(param.isInstanceOf(grammarAccess.getRootComponentAccess().getTypeJvmTypeCrossReference_1_0_0().getType().getClassifier())) {
- type = AssignmentType.CROSS_REFERENCE;
- element = grammarAccess.getRootComponentAccess().getTypeJvmTypeCrossReference_1_0_0();
- return obj;
- }
- }
- return null;
- }
-
-}
-
-// "@" module=[Module|FQN]
-protected class RootComponent_Group_1_1 extends GroupToken {
-
- public RootComponent_Group_1_1(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Group getGrammarElement() {
- return grammarAccess.getRootComponentAccess().getGroup_1_1();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new RootComponent_ModuleAssignment_1_1_1(lastRuleCallOrigin, this, 0, inst);
- default: return null;
- }
- }
-
-}
-
-// "@"
-protected class RootComponent_CommercialAtKeyword_1_1_0 extends KeywordToken {
-
- public RootComponent_CommercialAtKeyword_1_1_0(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Keyword getGrammarElement() {
- return grammarAccess.getRootComponentAccess().getCommercialAtKeyword_1_1_0();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new RootComponent_ComponentAction_0(lastRuleCallOrigin, this, 0, inst);
- default: return null;
- }
- }
-
-}
-
-// module=[Module|FQN]
-protected class RootComponent_ModuleAssignment_1_1_1 extends AssignmentToken {
-
- public RootComponent_ModuleAssignment_1_1_1(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Assignment getGrammarElement() {
- return grammarAccess.getRootComponentAccess().getModuleAssignment_1_1_1();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new RootComponent_CommercialAtKeyword_1_1_0(lastRuleCallOrigin, this, 0, inst);
- default: return null;
- }
- }
-
- @Override
- public IEObjectConsumer tryConsume() {
- if((value = eObjectConsumer.getConsumable("module",true)) == null) return null;
- IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("module");
- if(value instanceof EObject) { // org::eclipse::xtext::impl::CrossReferenceImpl
- IEObjectConsumer param = createEObjectConsumer((EObject)value);
- if(param.isInstanceOf(grammarAccess.getRootComponentAccess().getModuleModuleCrossReference_1_1_1_0().getType().getClassifier())) {
- type = AssignmentType.CROSS_REFERENCE;
- element = grammarAccess.getRootComponentAccess().getModuleModuleCrossReference_1_1_1_0();
- return obj;
- }
- }
- return null;
- }
-
-}
-
-
-
-// (":" name=FQN)?
-protected class RootComponent_Group_2 extends GroupToken {
-
- public RootComponent_Group_2(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Group getGrammarElement() {
- return grammarAccess.getRootComponentAccess().getGroup_2();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new RootComponent_NameAssignment_2_1(lastRuleCallOrigin, this, 0, inst);
- default: return null;
- }
- }
-
-}
-
-// ":"
-protected class RootComponent_ColonKeyword_2_0 extends KeywordToken {
-
- public RootComponent_ColonKeyword_2_0(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Keyword getGrammarElement() {
- return grammarAccess.getRootComponentAccess().getColonKeyword_2_0();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new RootComponent_Alternatives_1(lastRuleCallOrigin, this, 0, inst);
- default: return null;
- }
- }
-
-}
-
-// name=FQN
-protected class RootComponent_NameAssignment_2_1 extends AssignmentToken {
-
- public RootComponent_NameAssignment_2_1(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Assignment getGrammarElement() {
- return grammarAccess.getRootComponentAccess().getNameAssignment_2_1();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new RootComponent_ColonKeyword_2_0(lastRuleCallOrigin, this, 0, inst);
- default: return null;
- }
- }
-
- @Override
- public IEObjectConsumer tryConsume() {
- if((value = eObjectConsumer.getConsumable("name",false)) == null) return null;
- IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("name");
- if(valueSerializer.isValid(obj.getEObject(), grammarAccess.getRootComponentAccess().getNameFQNParserRuleCall_2_1_0(), value, null)) {
- type = AssignmentType.DATATYPE_RULE_CALL;
- element = grammarAccess.getRootComponentAccess().getNameFQNParserRuleCall_2_1_0();
- return obj;
- }
- return null;
- }
-
-}
-
-
-// autoInject?="auto-inject"?
-protected class RootComponent_AutoInjectAssignment_3 extends AssignmentToken {
-
- public RootComponent_AutoInjectAssignment_3(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Assignment getGrammarElement() {
- return grammarAccess.getRootComponentAccess().getAutoInjectAssignment_3();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new RootComponent_Group_2(lastRuleCallOrigin, this, 0, inst);
- case 1: return new RootComponent_Alternatives_1(lastRuleCallOrigin, this, 1, inst);
- default: return null;
- }
- }
-
- @Override
- public IEObjectConsumer tryConsume() {
- if((value = eObjectConsumer.getConsumable("autoInject",false)) == null) return null;
- IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("autoInject");
- if(Boolean.TRUE.equals(value)) { // org::eclipse::xtext::impl::KeywordImpl
- type = AssignmentType.KEYWORD;
- element = grammarAccess.getRootComponentAccess().getAutoInjectAutoInjectKeyword_3_0();
- return obj;
- }
- return null;
- }
-
-}
-
-// "{"
-protected class RootComponent_LeftCurlyBracketKeyword_4 extends KeywordToken {
-
- public RootComponent_LeftCurlyBracketKeyword_4(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Keyword getGrammarElement() {
- return grammarAccess.getRootComponentAccess().getLeftCurlyBracketKeyword_4();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new RootComponent_AutoInjectAssignment_3(lastRuleCallOrigin, this, 0, inst);
- case 1: return new RootComponent_Group_2(lastRuleCallOrigin, this, 1, inst);
- case 2: return new RootComponent_Alternatives_1(lastRuleCallOrigin, this, 2, inst);
- default: return null;
- }
- }
-
-}
-
-// assignment+=Assignment*
-protected class RootComponent_AssignmentAssignment_5 extends AssignmentToken {
-
- public RootComponent_AssignmentAssignment_5(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Assignment getGrammarElement() {
- return grammarAccess.getRootComponentAccess().getAssignmentAssignment_5();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new Assignment_Group(this, this, 0, inst);
- default: return null;
- }
- }
-
- @Override
- public IEObjectConsumer tryConsume() {
- if((value = eObjectConsumer.getConsumable("assignment",false)) == null) return null;
- IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("assignment");
- if(value instanceof EObject) { // org::eclipse::xtext::impl::RuleCallImpl
- IEObjectConsumer param = createEObjectConsumer((EObject)value);
- if(param.isInstanceOf(grammarAccess.getAssignmentRule().getType().getClassifier())) {
- type = AssignmentType.PARSER_RULE_CALL;
- element = grammarAccess.getRootComponentAccess().getAssignmentAssignmentParserRuleCall_5_0();
- consumed = obj;
- return param;
- }
- }
- return null;
- }
-
- @Override
- public AbstractToken createFollowerAfterReturn(AbstractToken next, int actIndex, int index, IEObjectConsumer inst) {
- if(value == inst.getEObject() && !inst.isConsumed()) return null;
- switch(index) {
- case 0: return new RootComponent_AssignmentAssignment_5(lastRuleCallOrigin, next, actIndex, consumed);
- case 1: return new RootComponent_LeftCurlyBracketKeyword_4(lastRuleCallOrigin, next, actIndex, consumed);
- default: return null;
- }
- }
-}
-
-// "}"
-protected class RootComponent_RightCurlyBracketKeyword_6 extends KeywordToken {
-
- public RootComponent_RightCurlyBracketKeyword_6(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Keyword getGrammarElement() {
- return grammarAccess.getRootComponentAccess().getRightCurlyBracketKeyword_6();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new RootComponent_AssignmentAssignment_5(lastRuleCallOrigin, this, 0, inst);
- case 1: return new RootComponent_LeftCurlyBracketKeyword_4(lastRuleCallOrigin, this, 1, inst);
- default: return null;
- }
- }
-
-}
-
-
-/************ end Rule RootComponent ****************/
-
-
-/************ begin Rule Component ****************
- *
- * Component:
- * {Component} (type=[types::JvmType|FQN] | "@" module=[Module|FQN])? (":" name=FQN)? autoInject?="auto-inject"? "{"
- * assignment+=Assignment* "}";
- *
- **/
-
-// {Component} (type=[types::JvmType|FQN] | "@" module=[Module|FQN])? (":" name=FQN)? autoInject?="auto-inject"? "{"
-// assignment+=Assignment* "}"
-protected class Component_Group extends GroupToken {
-
- public Component_Group(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Group getGrammarElement() {
- return grammarAccess.getComponentAccess().getGroup();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new Component_RightCurlyBracketKeyword_6(lastRuleCallOrigin, this, 0, inst);
- default: return null;
- }
- }
-
- @Override
- public IEObjectConsumer tryConsume() {
- if(getEObject().eClass() != grammarAccess.getComponentAccess().getComponentAction_0().getType().getClassifier())
- return null;
- return eObjectConsumer;
- }
-
-}
-
-// {Component}
-protected class Component_ComponentAction_0 extends ActionToken {
-
- public Component_ComponentAction_0(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Action getGrammarElement() {
- return grammarAccess.getComponentAccess().getComponentAction_0();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- default: return lastRuleCallOrigin.createFollowerAfterReturn(this, index, index, inst);
- }
- }
-
- @Override
- public IEObjectConsumer tryConsume() {
- if(!eObjectConsumer.isConsumed()) return null;
- return eObjectConsumer;
- }
-}
-
-// (type=[types::JvmType|FQN] | "@" module=[Module|FQN])?
-protected class Component_Alternatives_1 extends AlternativesToken {
-
- public Component_Alternatives_1(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Alternatives getGrammarElement() {
- return grammarAccess.getComponentAccess().getAlternatives_1();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new Component_TypeAssignment_1_0(lastRuleCallOrigin, this, 0, inst);
- case 1: return new Component_Group_1_1(lastRuleCallOrigin, this, 1, inst);
- default: return null;
- }
- }
-
-}
-
-// type=[types::JvmType|FQN]
-protected class Component_TypeAssignment_1_0 extends AssignmentToken {
-
- public Component_TypeAssignment_1_0(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Assignment getGrammarElement() {
- return grammarAccess.getComponentAccess().getTypeAssignment_1_0();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new Component_ComponentAction_0(lastRuleCallOrigin, this, 0, inst);
- default: return null;
- }
- }
-
- @Override
- public IEObjectConsumer tryConsume() {
- if((value = eObjectConsumer.getConsumable("type",true)) == null) return null;
- IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("type");
- if(value instanceof EObject) { // org::eclipse::xtext::impl::CrossReferenceImpl
- IEObjectConsumer param = createEObjectConsumer((EObject)value);
- if(param.isInstanceOf(grammarAccess.getComponentAccess().getTypeJvmTypeCrossReference_1_0_0().getType().getClassifier())) {
- type = AssignmentType.CROSS_REFERENCE;
- element = grammarAccess.getComponentAccess().getTypeJvmTypeCrossReference_1_0_0();
- return obj;
- }
- }
- return null;
- }
-
-}
-
-// "@" module=[Module|FQN]
-protected class Component_Group_1_1 extends GroupToken {
-
- public Component_Group_1_1(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Group getGrammarElement() {
- return grammarAccess.getComponentAccess().getGroup_1_1();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new Component_ModuleAssignment_1_1_1(lastRuleCallOrigin, this, 0, inst);
- default: return null;
- }
- }
-
-}
-
-// "@"
-protected class Component_CommercialAtKeyword_1_1_0 extends KeywordToken {
-
- public Component_CommercialAtKeyword_1_1_0(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Keyword getGrammarElement() {
- return grammarAccess.getComponentAccess().getCommercialAtKeyword_1_1_0();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new Component_ComponentAction_0(lastRuleCallOrigin, this, 0, inst);
- default: return null;
- }
- }
-
-}
-
-// module=[Module|FQN]
-protected class Component_ModuleAssignment_1_1_1 extends AssignmentToken {
-
- public Component_ModuleAssignment_1_1_1(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Assignment getGrammarElement() {
- return grammarAccess.getComponentAccess().getModuleAssignment_1_1_1();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new Component_CommercialAtKeyword_1_1_0(lastRuleCallOrigin, this, 0, inst);
- default: return null;
- }
- }
-
- @Override
- public IEObjectConsumer tryConsume() {
- if((value = eObjectConsumer.getConsumable("module",true)) == null) return null;
- IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("module");
- if(value instanceof EObject) { // org::eclipse::xtext::impl::CrossReferenceImpl
- IEObjectConsumer param = createEObjectConsumer((EObject)value);
- if(param.isInstanceOf(grammarAccess.getComponentAccess().getModuleModuleCrossReference_1_1_1_0().getType().getClassifier())) {
- type = AssignmentType.CROSS_REFERENCE;
- element = grammarAccess.getComponentAccess().getModuleModuleCrossReference_1_1_1_0();
- return obj;
- }
- }
- return null;
- }
-
-}
-
-
-
-// (":" name=FQN)?
-protected class Component_Group_2 extends GroupToken {
-
- public Component_Group_2(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Group getGrammarElement() {
- return grammarAccess.getComponentAccess().getGroup_2();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new Component_NameAssignment_2_1(lastRuleCallOrigin, this, 0, inst);
- default: return null;
- }
- }
-
-}
-
-// ":"
-protected class Component_ColonKeyword_2_0 extends KeywordToken {
-
- public Component_ColonKeyword_2_0(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Keyword getGrammarElement() {
- return grammarAccess.getComponentAccess().getColonKeyword_2_0();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new Component_Alternatives_1(lastRuleCallOrigin, this, 0, inst);
- case 1: return new Component_ComponentAction_0(lastRuleCallOrigin, this, 1, inst);
- default: return null;
- }
- }
-
-}
-
-// name=FQN
-protected class Component_NameAssignment_2_1 extends AssignmentToken {
-
- public Component_NameAssignment_2_1(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Assignment getGrammarElement() {
- return grammarAccess.getComponentAccess().getNameAssignment_2_1();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new Component_ColonKeyword_2_0(lastRuleCallOrigin, this, 0, inst);
- default: return null;
- }
- }
-
- @Override
- public IEObjectConsumer tryConsume() {
- if((value = eObjectConsumer.getConsumable("name",false)) == null) return null;
- IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("name");
- if(valueSerializer.isValid(obj.getEObject(), grammarAccess.getComponentAccess().getNameFQNParserRuleCall_2_1_0(), value, null)) {
- type = AssignmentType.DATATYPE_RULE_CALL;
- element = grammarAccess.getComponentAccess().getNameFQNParserRuleCall_2_1_0();
- return obj;
- }
- return null;
- }
-
-}
-
-
-// autoInject?="auto-inject"?
-protected class Component_AutoInjectAssignment_3 extends AssignmentToken {
-
- public Component_AutoInjectAssignment_3(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Assignment getGrammarElement() {
- return grammarAccess.getComponentAccess().getAutoInjectAssignment_3();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new Component_Group_2(lastRuleCallOrigin, this, 0, inst);
- case 1: return new Component_Alternatives_1(lastRuleCallOrigin, this, 1, inst);
- case 2: return new Component_ComponentAction_0(lastRuleCallOrigin, this, 2, inst);
- default: return null;
- }
- }
-
- @Override
- public IEObjectConsumer tryConsume() {
- if((value = eObjectConsumer.getConsumable("autoInject",false)) == null) return null;
- IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("autoInject");
- if(Boolean.TRUE.equals(value)) { // org::eclipse::xtext::impl::KeywordImpl
- type = AssignmentType.KEYWORD;
- element = grammarAccess.getComponentAccess().getAutoInjectAutoInjectKeyword_3_0();
- return obj;
- }
- return null;
- }
-
-}
-
-// "{"
-protected class Component_LeftCurlyBracketKeyword_4 extends KeywordToken {
-
- public Component_LeftCurlyBracketKeyword_4(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Keyword getGrammarElement() {
- return grammarAccess.getComponentAccess().getLeftCurlyBracketKeyword_4();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new Component_AutoInjectAssignment_3(lastRuleCallOrigin, this, 0, inst);
- case 1: return new Component_Group_2(lastRuleCallOrigin, this, 1, inst);
- case 2: return new Component_Alternatives_1(lastRuleCallOrigin, this, 2, inst);
- case 3: return new Component_ComponentAction_0(lastRuleCallOrigin, this, 3, inst);
- default: return null;
- }
- }
-
-}
-
-// assignment+=Assignment*
-protected class Component_AssignmentAssignment_5 extends AssignmentToken {
-
- public Component_AssignmentAssignment_5(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Assignment getGrammarElement() {
- return grammarAccess.getComponentAccess().getAssignmentAssignment_5();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new Assignment_Group(this, this, 0, inst);
- default: return null;
- }
- }
-
- @Override
- public IEObjectConsumer tryConsume() {
- if((value = eObjectConsumer.getConsumable("assignment",false)) == null) return null;
- IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("assignment");
- if(value instanceof EObject) { // org::eclipse::xtext::impl::RuleCallImpl
- IEObjectConsumer param = createEObjectConsumer((EObject)value);
- if(param.isInstanceOf(grammarAccess.getAssignmentRule().getType().getClassifier())) {
- type = AssignmentType.PARSER_RULE_CALL;
- element = grammarAccess.getComponentAccess().getAssignmentAssignmentParserRuleCall_5_0();
- consumed = obj;
- return param;
- }
- }
- return null;
- }
-
- @Override
- public AbstractToken createFollowerAfterReturn(AbstractToken next, int actIndex, int index, IEObjectConsumer inst) {
- if(value == inst.getEObject() && !inst.isConsumed()) return null;
- switch(index) {
- case 0: return new Component_AssignmentAssignment_5(lastRuleCallOrigin, next, actIndex, consumed);
- case 1: return new Component_LeftCurlyBracketKeyword_4(lastRuleCallOrigin, next, actIndex, consumed);
- default: return null;
- }
- }
-}
-
-// "}"
-protected class Component_RightCurlyBracketKeyword_6 extends KeywordToken {
-
- public Component_RightCurlyBracketKeyword_6(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Keyword getGrammarElement() {
- return grammarAccess.getComponentAccess().getRightCurlyBracketKeyword_6();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new Component_AssignmentAssignment_5(lastRuleCallOrigin, this, 0, inst);
- case 1: return new Component_LeftCurlyBracketKeyword_4(lastRuleCallOrigin, this, 1, inst);
- default: return null;
- }
- }
-
-}
-
-
-/************ end Rule Component ****************/
-
-
-/************ begin Rule Import ****************
- *
- * Import:
- * "import" importedNamespace=ImportedFQN;
- *
- **/
-
-// "import" importedNamespace=ImportedFQN
-protected class Import_Group extends GroupToken {
-
- public Import_Group(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Group getGrammarElement() {
- return grammarAccess.getImportAccess().getGroup();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new Import_ImportedNamespaceAssignment_1(lastRuleCallOrigin, this, 0, inst);
- default: return null;
- }
- }
-
- @Override
- public IEObjectConsumer tryConsume() {
- if(getEObject().eClass() != grammarAccess.getImportRule().getType().getClassifier())
- return null;
- return eObjectConsumer;
- }
-
-}
-
-// "import"
-protected class Import_ImportKeyword_0 extends KeywordToken {
-
- public Import_ImportKeyword_0(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Keyword getGrammarElement() {
- return grammarAccess.getImportAccess().getImportKeyword_0();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- default: return lastRuleCallOrigin.createFollowerAfterReturn(this, index, index, inst);
- }
- }
-
-}
-
-// importedNamespace=ImportedFQN
-protected class Import_ImportedNamespaceAssignment_1 extends AssignmentToken {
-
- public Import_ImportedNamespaceAssignment_1(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Assignment getGrammarElement() {
- return grammarAccess.getImportAccess().getImportedNamespaceAssignment_1();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new Import_ImportKeyword_0(lastRuleCallOrigin, this, 0, inst);
- default: return null;
- }
- }
-
- @Override
- public IEObjectConsumer tryConsume() {
- if((value = eObjectConsumer.getConsumable("importedNamespace",true)) == null) return null;
- IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("importedNamespace");
- if(valueSerializer.isValid(obj.getEObject(), grammarAccess.getImportAccess().getImportedNamespaceImportedFQNParserRuleCall_1_0(), value, null)) {
- type = AssignmentType.DATATYPE_RULE_CALL;
- element = grammarAccess.getImportAccess().getImportedNamespaceImportedFQNParserRuleCall_1_0();
- return obj;
- }
- return null;
- }
-
-}
-
-
-/************ end Rule Import ****************/
-
-
-
-/************ begin Rule Assignment ****************
- *
- * Assignment:
- * feature=[types::JvmIdentifiableElement|FQN] "=" value=Value;
- *
- **/
-
-// feature=[types::JvmIdentifiableElement|FQN] "=" value=Value
-protected class Assignment_Group extends GroupToken {
-
- public Assignment_Group(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Group getGrammarElement() {
- return grammarAccess.getAssignmentAccess().getGroup();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new Assignment_ValueAssignment_2(lastRuleCallOrigin, this, 0, inst);
- default: return null;
- }
- }
-
- @Override
- public IEObjectConsumer tryConsume() {
- if(getEObject().eClass() != grammarAccess.getAssignmentRule().getType().getClassifier())
- return null;
- return eObjectConsumer;
- }
-
-}
-
-// feature=[types::JvmIdentifiableElement|FQN]
-protected class Assignment_FeatureAssignment_0 extends AssignmentToken {
-
- public Assignment_FeatureAssignment_0(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Assignment getGrammarElement() {
- return grammarAccess.getAssignmentAccess().getFeatureAssignment_0();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- default: return lastRuleCallOrigin.createFollowerAfterReturn(this, index, index, inst);
- }
- }
-
- @Override
- public IEObjectConsumer tryConsume() {
- if((value = eObjectConsumer.getConsumable("feature",true)) == null) return null;
- IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("feature");
- if(value instanceof EObject) { // org::eclipse::xtext::impl::CrossReferenceImpl
- IEObjectConsumer param = createEObjectConsumer((EObject)value);
- if(param.isInstanceOf(grammarAccess.getAssignmentAccess().getFeatureJvmIdentifiableElementCrossReference_0_0().getType().getClassifier())) {
- type = AssignmentType.CROSS_REFERENCE;
- element = grammarAccess.getAssignmentAccess().getFeatureJvmIdentifiableElementCrossReference_0_0();
- return obj;
- }
- }
- return null;
- }
-
-}
-
-// "="
-protected class Assignment_EqualsSignKeyword_1 extends KeywordToken {
-
- public Assignment_EqualsSignKeyword_1(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Keyword getGrammarElement() {
- return grammarAccess.getAssignmentAccess().getEqualsSignKeyword_1();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new Assignment_FeatureAssignment_0(lastRuleCallOrigin, this, 0, inst);
- default: return null;
- }
- }
-
-}
-
-// value=Value
-protected class Assignment_ValueAssignment_2 extends AssignmentToken {
-
- public Assignment_ValueAssignment_2(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Assignment getGrammarElement() {
- return grammarAccess.getAssignmentAccess().getValueAssignment_2();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new Value_Alternatives(this, this, 0, inst);
- default: return null;
- }
- }
-
- @Override
- public IEObjectConsumer tryConsume() {
- if((value = eObjectConsumer.getConsumable("value",true)) == null) return null;
- IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("value");
- if(value instanceof EObject) { // org::eclipse::xtext::impl::RuleCallImpl
- IEObjectConsumer param = createEObjectConsumer((EObject)value);
- if(param.isInstanceOf(grammarAccess.getValueRule().getType().getClassifier())) {
- type = AssignmentType.PARSER_RULE_CALL;
- element = grammarAccess.getAssignmentAccess().getValueValueParserRuleCall_2_0();
- consumed = obj;
- return param;
- }
- }
- return null;
- }
-
- @Override
- public AbstractToken createFollowerAfterReturn(AbstractToken next, int actIndex, int index, IEObjectConsumer inst) {
- if(value == inst.getEObject() && !inst.isConsumed()) return null;
- switch(index) {
- case 0: return new Assignment_EqualsSignKeyword_1(lastRuleCallOrigin, next, actIndex, consumed);
- default: return null;
- }
- }
-}
-
-
-/************ end Rule Assignment ****************/
-
-
-/************ begin Rule Value ****************
- *
- * Value:
- * Component | StringLiteral | BooleanLiteral | Reference;
- *
- **/
-
-// Component | StringLiteral | BooleanLiteral | Reference
-protected class Value_Alternatives extends AlternativesToken {
-
- public Value_Alternatives(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Alternatives getGrammarElement() {
- return grammarAccess.getValueAccess().getAlternatives();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new Value_ComponentParserRuleCall_0(lastRuleCallOrigin, this, 0, inst);
- case 1: return new Value_StringLiteralParserRuleCall_1(lastRuleCallOrigin, this, 1, inst);
- case 2: return new Value_BooleanLiteralParserRuleCall_2(lastRuleCallOrigin, this, 2, inst);
- case 3: return new Value_ReferenceParserRuleCall_3(lastRuleCallOrigin, this, 3, inst);
- default: return null;
- }
- }
-
- @Override
- public IEObjectConsumer tryConsume() {
- if(getEObject().eClass() != grammarAccess.getBooleanLiteralAccess().getBooleanLiteralAction_0().getType().getClassifier() &&
- getEObject().eClass() != grammarAccess.getComponentAccess().getComponentAction_0().getType().getClassifier() &&
- getEObject().eClass() != grammarAccess.getReferenceRule().getType().getClassifier() &&
- getEObject().eClass() != grammarAccess.getStringLiteralRule().getType().getClassifier())
- return null;
- return eObjectConsumer;
- }
-
-}
-
-// Component
-protected class Value_ComponentParserRuleCall_0 extends RuleCallToken {
-
- public Value_ComponentParserRuleCall_0(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public RuleCall getGrammarElement() {
- return grammarAccess.getValueAccess().getComponentParserRuleCall_0();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new Component_Group(this, this, 0, inst);
- default: return null;
- }
- }
-
- @Override
- public IEObjectConsumer tryConsume() {
- if(getEObject().eClass() != grammarAccess.getComponentAccess().getComponentAction_0().getType().getClassifier())
- return null;
- if(checkForRecursion(Component_Group.class, eObjectConsumer)) return null;
- return eObjectConsumer;
- }
-
- @Override
- public AbstractToken createFollowerAfterReturn(AbstractToken next, int actIndex, int index, IEObjectConsumer inst) {
- switch(index) {
- default: return lastRuleCallOrigin.createFollowerAfterReturn(next, actIndex , index, inst);
- }
- }
-}
-
-// StringLiteral
-protected class Value_StringLiteralParserRuleCall_1 extends RuleCallToken {
-
- public Value_StringLiteralParserRuleCall_1(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public RuleCall getGrammarElement() {
- return grammarAccess.getValueAccess().getStringLiteralParserRuleCall_1();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new StringLiteral_Alternatives(this, this, 0, inst);
- default: return null;
- }
- }
-
- @Override
- public IEObjectConsumer tryConsume() {
- if(getEObject().eClass() != grammarAccess.getStringLiteralRule().getType().getClassifier())
- return null;
- if(checkForRecursion(StringLiteral_Alternatives.class, eObjectConsumer)) return null;
- return eObjectConsumer;
- }
-
- @Override
- public AbstractToken createFollowerAfterReturn(AbstractToken next, int actIndex, int index, IEObjectConsumer inst) {
- switch(index) {
- default: return lastRuleCallOrigin.createFollowerAfterReturn(next, actIndex , index, inst);
- }
- }
-}
-
-// BooleanLiteral
-protected class Value_BooleanLiteralParserRuleCall_2 extends RuleCallToken {
-
- public Value_BooleanLiteralParserRuleCall_2(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public RuleCall getGrammarElement() {
- return grammarAccess.getValueAccess().getBooleanLiteralParserRuleCall_2();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new BooleanLiteral_Group(this, this, 0, inst);
- default: return null;
- }
- }
-
- @Override
- public IEObjectConsumer tryConsume() {
- if(getEObject().eClass() != grammarAccess.getBooleanLiteralAccess().getBooleanLiteralAction_0().getType().getClassifier())
- return null;
- if(checkForRecursion(BooleanLiteral_Group.class, eObjectConsumer)) return null;
- return eObjectConsumer;
- }
-
- @Override
- public AbstractToken createFollowerAfterReturn(AbstractToken next, int actIndex, int index, IEObjectConsumer inst) {
- switch(index) {
- default: return lastRuleCallOrigin.createFollowerAfterReturn(next, actIndex , index, inst);
- }
- }
-}
-
-// Reference
-protected class Value_ReferenceParserRuleCall_3 extends RuleCallToken {
-
- public Value_ReferenceParserRuleCall_3(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public RuleCall getGrammarElement() {
- return grammarAccess.getValueAccess().getReferenceParserRuleCall_3();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new Reference_ReferableAssignment(this, this, 0, inst);
- default: return null;
- }
- }
-
- @Override
- public IEObjectConsumer tryConsume() {
- if(getEObject().eClass() != grammarAccess.getReferenceRule().getType().getClassifier())
- return null;
- if(checkForRecursion(Reference_ReferableAssignment.class, eObjectConsumer)) return null;
- return eObjectConsumer;
- }
-
- @Override
- public AbstractToken createFollowerAfterReturn(AbstractToken next, int actIndex, int index, IEObjectConsumer inst) {
- switch(index) {
- default: return lastRuleCallOrigin.createFollowerAfterReturn(next, actIndex , index, inst);
- }
- }
-}
-
-
-/************ end Rule Value ****************/
-
-
-/************ begin Rule BooleanLiteral ****************
- *
- * BooleanLiteral:
- * {BooleanLiteral} (isTrue?="true" | "false");
- *
- **/
-
-// {BooleanLiteral} (isTrue?="true" | "false")
-protected class BooleanLiteral_Group extends GroupToken {
-
- public BooleanLiteral_Group(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Group getGrammarElement() {
- return grammarAccess.getBooleanLiteralAccess().getGroup();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new BooleanLiteral_Alternatives_1(lastRuleCallOrigin, this, 0, inst);
- default: return null;
- }
- }
-
- @Override
- public IEObjectConsumer tryConsume() {
- if(getEObject().eClass() != grammarAccess.getBooleanLiteralAccess().getBooleanLiteralAction_0().getType().getClassifier())
- return null;
- return eObjectConsumer;
- }
-
-}
-
-// {BooleanLiteral}
-protected class BooleanLiteral_BooleanLiteralAction_0 extends ActionToken {
-
- public BooleanLiteral_BooleanLiteralAction_0(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Action getGrammarElement() {
- return grammarAccess.getBooleanLiteralAccess().getBooleanLiteralAction_0();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- default: return lastRuleCallOrigin.createFollowerAfterReturn(this, index, index, inst);
- }
- }
-
- @Override
- public IEObjectConsumer tryConsume() {
- if(!eObjectConsumer.isConsumed()) return null;
- return eObjectConsumer;
- }
-}
-
-// isTrue?="true" | "false"
-protected class BooleanLiteral_Alternatives_1 extends AlternativesToken {
-
- public BooleanLiteral_Alternatives_1(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Alternatives getGrammarElement() {
- return grammarAccess.getBooleanLiteralAccess().getAlternatives_1();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new BooleanLiteral_IsTrueAssignment_1_0(lastRuleCallOrigin, this, 0, inst);
- case 1: return new BooleanLiteral_FalseKeyword_1_1(lastRuleCallOrigin, this, 1, inst);
- default: return null;
- }
- }
-
-}
-
-// isTrue?="true"
-protected class BooleanLiteral_IsTrueAssignment_1_0 extends AssignmentToken {
-
- public BooleanLiteral_IsTrueAssignment_1_0(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Assignment getGrammarElement() {
- return grammarAccess.getBooleanLiteralAccess().getIsTrueAssignment_1_0();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new BooleanLiteral_BooleanLiteralAction_0(lastRuleCallOrigin, this, 0, inst);
- default: return null;
- }
- }
-
- @Override
- public IEObjectConsumer tryConsume() {
- if((value = eObjectConsumer.getConsumable("isTrue",true)) == null) return null;
- IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("isTrue");
- if(Boolean.TRUE.equals(value)) { // org::eclipse::xtext::impl::KeywordImpl
- type = AssignmentType.KEYWORD;
- element = grammarAccess.getBooleanLiteralAccess().getIsTrueTrueKeyword_1_0_0();
- return obj;
- }
- return null;
- }
-
-}
-
-// "false"
-protected class BooleanLiteral_FalseKeyword_1_1 extends KeywordToken {
-
- public BooleanLiteral_FalseKeyword_1_1(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Keyword getGrammarElement() {
- return grammarAccess.getBooleanLiteralAccess().getFalseKeyword_1_1();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new BooleanLiteral_BooleanLiteralAction_0(lastRuleCallOrigin, this, 0, inst);
- default: return null;
- }
- }
-
-}
-
-
-
-/************ end Rule BooleanLiteral ****************/
-
-
-/************ begin Rule Reference ****************
- *
- * Reference:
- * referable=[Referrable|FQN];
- *
- **/
-
-// referable=[Referrable|FQN]
-protected class Reference_ReferableAssignment extends AssignmentToken {
-
- public Reference_ReferableAssignment(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Assignment getGrammarElement() {
- return grammarAccess.getReferenceAccess().getReferableAssignment();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- default: return lastRuleCallOrigin.createFollowerAfterReturn(this, index, index, inst);
- }
- }
-
- @Override
- public IEObjectConsumer tryConsume() {
- if(getEObject().eClass() != grammarAccess.getReferenceRule().getType().getClassifier())
- return null;
- if((value = eObjectConsumer.getConsumable("referable",true)) == null) return null;
- IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("referable");
- if(value instanceof EObject) { // org::eclipse::xtext::impl::CrossReferenceImpl
- IEObjectConsumer param = createEObjectConsumer((EObject)value);
- if(param.isInstanceOf(grammarAccess.getReferenceAccess().getReferableReferrableCrossReference_0().getType().getClassifier())) {
- type = AssignmentType.CROSS_REFERENCE;
- element = grammarAccess.getReferenceAccess().getReferableReferrableCrossReference_0();
- return obj;
- }
- }
- return null;
- }
-
-}
-
-/************ end Rule Reference ****************/
-
-
-
-/************ begin Rule StringLiteral ****************
- *
- * StringLiteral hidden():
- * begin="\'" parts+=PlainString? (parts+=PropertyReference parts+=PlainString?)* end="\'" | begin="\""
- * parts+=PlainString? (parts+=PropertyReference parts+=PlainString?)* end="\"";
- *
- **/
-
-// begin="\'" parts+=PlainString? (parts+=PropertyReference parts+=PlainString?)* end="\'" | begin="\"" parts+=PlainString?
-// (parts+=PropertyReference parts+=PlainString?)* end="\""
-protected class StringLiteral_Alternatives extends AlternativesToken {
-
- public StringLiteral_Alternatives(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Alternatives getGrammarElement() {
- return grammarAccess.getStringLiteralAccess().getAlternatives();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new StringLiteral_Group_0(lastRuleCallOrigin, this, 0, inst);
- case 1: return new StringLiteral_Group_1(lastRuleCallOrigin, this, 1, inst);
- default: return null;
- }
- }
-
- @Override
- public IEObjectConsumer tryConsume() {
- if(getEObject().eClass() != grammarAccess.getStringLiteralRule().getType().getClassifier())
- return null;
- return eObjectConsumer;
- }
-
-}
-
-// begin="\'" parts+=PlainString? (parts+=PropertyReference parts+=PlainString?)* end="\'"
-protected class StringLiteral_Group_0 extends GroupToken {
-
- public StringLiteral_Group_0(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Group getGrammarElement() {
- return grammarAccess.getStringLiteralAccess().getGroup_0();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new StringLiteral_EndAssignment_0_3(lastRuleCallOrigin, this, 0, inst);
- default: return null;
- }
- }
-
-}
-
-// begin="\'"
-protected class StringLiteral_BeginAssignment_0_0 extends AssignmentToken {
-
- public StringLiteral_BeginAssignment_0_0(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Assignment getGrammarElement() {
- return grammarAccess.getStringLiteralAccess().getBeginAssignment_0_0();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- default: return lastRuleCallOrigin.createFollowerAfterReturn(this, index, index, inst);
- }
- }
-
- @Override
- public IEObjectConsumer tryConsume() {
- if((value = eObjectConsumer.getConsumable("begin",true)) == null) return null;
- IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("begin");
- if(keywordSerializer.isValid(obj.getEObject(), grammarAccess.getStringLiteralAccess().getBeginApostropheKeyword_0_0_0(), value, null)) {
- type = AssignmentType.KEYWORD;
- element = grammarAccess.getStringLiteralAccess().getBeginApostropheKeyword_0_0_0();
- return obj;
- }
- return null;
- }
-
-}
-
-// parts+=PlainString?
-protected class StringLiteral_PartsAssignment_0_1 extends AssignmentToken {
-
- public StringLiteral_PartsAssignment_0_1(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Assignment getGrammarElement() {
- return grammarAccess.getStringLiteralAccess().getPartsAssignment_0_1();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new PlainString_ValueAssignment(this, this, 0, inst);
- default: return null;
- }
- }
-
- @Override
- public IEObjectConsumer tryConsume() {
- if((value = eObjectConsumer.getConsumable("parts",false)) == null) return null;
- IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("parts");
- if(value instanceof EObject) { // org::eclipse::xtext::impl::RuleCallImpl
- IEObjectConsumer param = createEObjectConsumer((EObject)value);
- if(param.isInstanceOf(grammarAccess.getPlainStringRule().getType().getClassifier())) {
- type = AssignmentType.PARSER_RULE_CALL;
- element = grammarAccess.getStringLiteralAccess().getPartsPlainStringParserRuleCall_0_1_0();
- consumed = obj;
- return param;
- }
- }
- return null;
- }
-
- @Override
- public AbstractToken createFollowerAfterReturn(AbstractToken next, int actIndex, int index, IEObjectConsumer inst) {
- if(value == inst.getEObject() && !inst.isConsumed()) return null;
- switch(index) {
- case 0: return new StringLiteral_BeginAssignment_0_0(lastRuleCallOrigin, next, actIndex, consumed);
- default: return null;
- }
- }
-}
-
-// (parts+=PropertyReference parts+=PlainString?)*
-protected class StringLiteral_Group_0_2 extends GroupToken {
-
- public StringLiteral_Group_0_2(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Group getGrammarElement() {
- return grammarAccess.getStringLiteralAccess().getGroup_0_2();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new StringLiteral_PartsAssignment_0_2_1(lastRuleCallOrigin, this, 0, inst);
- case 1: return new StringLiteral_PartsAssignment_0_2_0(lastRuleCallOrigin, this, 1, inst);
- default: return null;
- }
- }
-
-}
-
-// parts+=PropertyReference
-protected class StringLiteral_PartsAssignment_0_2_0 extends AssignmentToken {
-
- public StringLiteral_PartsAssignment_0_2_0(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Assignment getGrammarElement() {
- return grammarAccess.getStringLiteralAccess().getPartsAssignment_0_2_0();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new PropertyReference_Group(this, this, 0, inst);
- default: return null;
- }
- }
-
- @Override
- public IEObjectConsumer tryConsume() {
- if((value = eObjectConsumer.getConsumable("parts",true)) == null) return null;
- IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("parts");
- if(value instanceof EObject) { // org::eclipse::xtext::impl::RuleCallImpl
- IEObjectConsumer param = createEObjectConsumer((EObject)value);
- if(param.isInstanceOf(grammarAccess.getPropertyReferenceRule().getType().getClassifier())) {
- type = AssignmentType.PARSER_RULE_CALL;
- element = grammarAccess.getStringLiteralAccess().getPartsPropertyReferenceParserRuleCall_0_2_0_0();
- consumed = obj;
- return param;
- }
- }
- return null;
- }
-
- @Override
- public AbstractToken createFollowerAfterReturn(AbstractToken next, int actIndex, int index, IEObjectConsumer inst) {
- if(value == inst.getEObject() && !inst.isConsumed()) return null;
- switch(index) {
- case 0: return new StringLiteral_Group_0_2(lastRuleCallOrigin, next, actIndex, consumed);
- case 1: return new StringLiteral_PartsAssignment_0_1(lastRuleCallOrigin, next, actIndex, consumed);
- case 2: return new StringLiteral_BeginAssignment_0_0(lastRuleCallOrigin, next, actIndex, consumed);
- default: return null;
- }
- }
-}
-
-// parts+=PlainString?
-protected class StringLiteral_PartsAssignment_0_2_1 extends AssignmentToken {
-
- public StringLiteral_PartsAssignment_0_2_1(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Assignment getGrammarElement() {
- return grammarAccess.getStringLiteralAccess().getPartsAssignment_0_2_1();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new PlainString_ValueAssignment(this, this, 0, inst);
- default: return null;
- }
- }
-
- @Override
- public IEObjectConsumer tryConsume() {
- if((value = eObjectConsumer.getConsumable("parts",false)) == null) return null;
- IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("parts");
- if(value instanceof EObject) { // org::eclipse::xtext::impl::RuleCallImpl
- IEObjectConsumer param = createEObjectConsumer((EObject)value);
- if(param.isInstanceOf(grammarAccess.getPlainStringRule().getType().getClassifier())) {
- type = AssignmentType.PARSER_RULE_CALL;
- element = grammarAccess.getStringLiteralAccess().getPartsPlainStringParserRuleCall_0_2_1_0();
- consumed = obj;
- return param;
- }
- }
- return null;
- }
-
- @Override
- public AbstractToken createFollowerAfterReturn(AbstractToken next, int actIndex, int index, IEObjectConsumer inst) {
- if(value == inst.getEObject() && !inst.isConsumed()) return null;
- switch(index) {
- case 0: return new StringLiteral_PartsAssignment_0_2_0(lastRuleCallOrigin, next, actIndex, consumed);
- default: return null;
- }
- }
-}
-
-
-// end="\'"
-protected class StringLiteral_EndAssignment_0_3 extends AssignmentToken {
-
- public StringLiteral_EndAssignment_0_3(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Assignment getGrammarElement() {
- return grammarAccess.getStringLiteralAccess().getEndAssignment_0_3();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new StringLiteral_Group_0_2(lastRuleCallOrigin, this, 0, inst);
- case 1: return new StringLiteral_PartsAssignment_0_1(lastRuleCallOrigin, this, 1, inst);
- case 2: return new StringLiteral_BeginAssignment_0_0(lastRuleCallOrigin, this, 2, inst);
- default: return null;
- }
- }
-
- @Override
- public IEObjectConsumer tryConsume() {
- if((value = eObjectConsumer.getConsumable("end",true)) == null) return null;
- IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("end");
- if(keywordSerializer.isValid(obj.getEObject(), grammarAccess.getStringLiteralAccess().getEndApostropheKeyword_0_3_0(), value, null)) {
- type = AssignmentType.KEYWORD;
- element = grammarAccess.getStringLiteralAccess().getEndApostropheKeyword_0_3_0();
- return obj;
- }
- return null;
- }
-
-}
-
-
-// begin="\"" parts+=PlainString? (parts+=PropertyReference parts+=PlainString?)* end="\""
-protected class StringLiteral_Group_1 extends GroupToken {
-
- public StringLiteral_Group_1(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Group getGrammarElement() {
- return grammarAccess.getStringLiteralAccess().getGroup_1();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new StringLiteral_EndAssignment_1_3(lastRuleCallOrigin, this, 0, inst);
- default: return null;
- }
- }
-
-}
-
-// begin="\""
-protected class StringLiteral_BeginAssignment_1_0 extends AssignmentToken {
-
- public StringLiteral_BeginAssignment_1_0(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Assignment getGrammarElement() {
- return grammarAccess.getStringLiteralAccess().getBeginAssignment_1_0();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- default: return lastRuleCallOrigin.createFollowerAfterReturn(this, index, index, inst);
- }
- }
-
- @Override
- public IEObjectConsumer tryConsume() {
- if((value = eObjectConsumer.getConsumable("begin",true)) == null) return null;
- IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("begin");
- if(keywordSerializer.isValid(obj.getEObject(), grammarAccess.getStringLiteralAccess().getBeginQuotationMarkKeyword_1_0_0(), value, null)) {
- type = AssignmentType.KEYWORD;
- element = grammarAccess.getStringLiteralAccess().getBeginQuotationMarkKeyword_1_0_0();
- return obj;
- }
- return null;
- }
-
-}
-
-// parts+=PlainString?
-protected class StringLiteral_PartsAssignment_1_1 extends AssignmentToken {
-
- public StringLiteral_PartsAssignment_1_1(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Assignment getGrammarElement() {
- return grammarAccess.getStringLiteralAccess().getPartsAssignment_1_1();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new PlainString_ValueAssignment(this, this, 0, inst);
- default: return null;
- }
- }
-
- @Override
- public IEObjectConsumer tryConsume() {
- if((value = eObjectConsumer.getConsumable("parts",false)) == null) return null;
- IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("parts");
- if(value instanceof EObject) { // org::eclipse::xtext::impl::RuleCallImpl
- IEObjectConsumer param = createEObjectConsumer((EObject)value);
- if(param.isInstanceOf(grammarAccess.getPlainStringRule().getType().getClassifier())) {
- type = AssignmentType.PARSER_RULE_CALL;
- element = grammarAccess.getStringLiteralAccess().getPartsPlainStringParserRuleCall_1_1_0();
- consumed = obj;
- return param;
- }
- }
- return null;
- }
-
- @Override
- public AbstractToken createFollowerAfterReturn(AbstractToken next, int actIndex, int index, IEObjectConsumer inst) {
- if(value == inst.getEObject() && !inst.isConsumed()) return null;
- switch(index) {
- case 0: return new StringLiteral_BeginAssignment_1_0(lastRuleCallOrigin, next, actIndex, consumed);
- default: return null;
- }
- }
-}
-
-// (parts+=PropertyReference parts+=PlainString?)*
-protected class StringLiteral_Group_1_2 extends GroupToken {
-
- public StringLiteral_Group_1_2(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Group getGrammarElement() {
- return grammarAccess.getStringLiteralAccess().getGroup_1_2();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new StringLiteral_PartsAssignment_1_2_1(lastRuleCallOrigin, this, 0, inst);
- case 1: return new StringLiteral_PartsAssignment_1_2_0(lastRuleCallOrigin, this, 1, inst);
- default: return null;
- }
- }
-
-}
-
-// parts+=PropertyReference
-protected class StringLiteral_PartsAssignment_1_2_0 extends AssignmentToken {
-
- public StringLiteral_PartsAssignment_1_2_0(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Assignment getGrammarElement() {
- return grammarAccess.getStringLiteralAccess().getPartsAssignment_1_2_0();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new PropertyReference_Group(this, this, 0, inst);
- default: return null;
- }
- }
-
- @Override
- public IEObjectConsumer tryConsume() {
- if((value = eObjectConsumer.getConsumable("parts",true)) == null) return null;
- IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("parts");
- if(value instanceof EObject) { // org::eclipse::xtext::impl::RuleCallImpl
- IEObjectConsumer param = createEObjectConsumer((EObject)value);
- if(param.isInstanceOf(grammarAccess.getPropertyReferenceRule().getType().getClassifier())) {
- type = AssignmentType.PARSER_RULE_CALL;
- element = grammarAccess.getStringLiteralAccess().getPartsPropertyReferenceParserRuleCall_1_2_0_0();
- consumed = obj;
- return param;
- }
- }
- return null;
- }
-
- @Override
- public AbstractToken createFollowerAfterReturn(AbstractToken next, int actIndex, int index, IEObjectConsumer inst) {
- if(value == inst.getEObject() && !inst.isConsumed()) return null;
- switch(index) {
- case 0: return new StringLiteral_Group_1_2(lastRuleCallOrigin, next, actIndex, consumed);
- case 1: return new StringLiteral_PartsAssignment_1_1(lastRuleCallOrigin, next, actIndex, consumed);
- case 2: return new StringLiteral_BeginAssignment_1_0(lastRuleCallOrigin, next, actIndex, consumed);
- default: return null;
- }
- }
-}
-
-// parts+=PlainString?
-protected class StringLiteral_PartsAssignment_1_2_1 extends AssignmentToken {
-
- public StringLiteral_PartsAssignment_1_2_1(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Assignment getGrammarElement() {
- return grammarAccess.getStringLiteralAccess().getPartsAssignment_1_2_1();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new PlainString_ValueAssignment(this, this, 0, inst);
- default: return null;
- }
- }
-
- @Override
- public IEObjectConsumer tryConsume() {
- if((value = eObjectConsumer.getConsumable("parts",false)) == null) return null;
- IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("parts");
- if(value instanceof EObject) { // org::eclipse::xtext::impl::RuleCallImpl
- IEObjectConsumer param = createEObjectConsumer((EObject)value);
- if(param.isInstanceOf(grammarAccess.getPlainStringRule().getType().getClassifier())) {
- type = AssignmentType.PARSER_RULE_CALL;
- element = grammarAccess.getStringLiteralAccess().getPartsPlainStringParserRuleCall_1_2_1_0();
- consumed = obj;
- return param;
- }
- }
- return null;
- }
-
- @Override
- public AbstractToken createFollowerAfterReturn(AbstractToken next, int actIndex, int index, IEObjectConsumer inst) {
- if(value == inst.getEObject() && !inst.isConsumed()) return null;
- switch(index) {
- case 0: return new StringLiteral_PartsAssignment_1_2_0(lastRuleCallOrigin, next, actIndex, consumed);
- default: return null;
- }
- }
-}
-
-
-// end="\""
-protected class StringLiteral_EndAssignment_1_3 extends AssignmentToken {
-
- public StringLiteral_EndAssignment_1_3(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Assignment getGrammarElement() {
- return grammarAccess.getStringLiteralAccess().getEndAssignment_1_3();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new StringLiteral_Group_1_2(lastRuleCallOrigin, this, 0, inst);
- case 1: return new StringLiteral_PartsAssignment_1_1(lastRuleCallOrigin, this, 1, inst);
- case 2: return new StringLiteral_BeginAssignment_1_0(lastRuleCallOrigin, this, 2, inst);
- default: return null;
- }
- }
-
- @Override
- public IEObjectConsumer tryConsume() {
- if((value = eObjectConsumer.getConsumable("end",true)) == null) return null;
- IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("end");
- if(keywordSerializer.isValid(obj.getEObject(), grammarAccess.getStringLiteralAccess().getEndQuotationMarkKeyword_1_3_0(), value, null)) {
- type = AssignmentType.KEYWORD;
- element = grammarAccess.getStringLiteralAccess().getEndQuotationMarkKeyword_1_3_0();
- return obj;
- }
- return null;
- }
-
-}
-
-
-
-/************ end Rule StringLiteral ****************/
-
-
-/************ begin Rule PropertyReference ****************
- *
- * PropertyReference hidden():
- * "${" PropertyReferenceImpl "}";
- *
- **/
-
-// "${" PropertyReferenceImpl "}"
-protected class PropertyReference_Group extends GroupToken {
-
- public PropertyReference_Group(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Group getGrammarElement() {
- return grammarAccess.getPropertyReferenceAccess().getGroup();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new PropertyReference_RightCurlyBracketKeyword_2(lastRuleCallOrigin, this, 0, inst);
- default: return null;
- }
- }
-
- @Override
- public IEObjectConsumer tryConsume() {
- if(getEObject().eClass() != grammarAccess.getPropertyReferenceImplRule().getType().getClassifier())
- return null;
- return eObjectConsumer;
- }
-
-}
-
-// "${"
-protected class PropertyReference_DollarSignLeftCurlyBracketKeyword_0 extends KeywordToken {
-
- public PropertyReference_DollarSignLeftCurlyBracketKeyword_0(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Keyword getGrammarElement() {
- return grammarAccess.getPropertyReferenceAccess().getDollarSignLeftCurlyBracketKeyword_0();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- default: return lastRuleCallOrigin.createFollowerAfterReturn(this, index, index, inst);
- }
- }
-
-}
-
-// PropertyReferenceImpl
-protected class PropertyReference_PropertyReferenceImplParserRuleCall_1 extends RuleCallToken {
-
- public PropertyReference_PropertyReferenceImplParserRuleCall_1(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public RuleCall getGrammarElement() {
- return grammarAccess.getPropertyReferenceAccess().getPropertyReferenceImplParserRuleCall_1();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new PropertyReferenceImpl_ReferableAssignment(this, this, 0, inst);
- default: return null;
- }
- }
-
- @Override
- public IEObjectConsumer tryConsume() {
- if(checkForRecursion(PropertyReferenceImpl_ReferableAssignment.class, eObjectConsumer)) return null;
- return eObjectConsumer;
- }
-
- @Override
- public AbstractToken createFollowerAfterReturn(AbstractToken next, int actIndex, int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new PropertyReference_DollarSignLeftCurlyBracketKeyword_0(lastRuleCallOrigin, next, actIndex, inst);
- default: return null;
- }
- }
-}
-
-// "}"
-protected class PropertyReference_RightCurlyBracketKeyword_2 extends KeywordToken {
-
- public PropertyReference_RightCurlyBracketKeyword_2(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Keyword getGrammarElement() {
- return grammarAccess.getPropertyReferenceAccess().getRightCurlyBracketKeyword_2();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- case 0: return new PropertyReference_PropertyReferenceImplParserRuleCall_1(lastRuleCallOrigin, this, 0, inst);
- default: return null;
- }
- }
-
-}
-
-
-/************ end Rule PropertyReference ****************/
-
-
-/************ begin Rule PropertyReferenceImpl ****************
- *
- * PropertyReferenceImpl returns PropertyReference hidden(WS, ML_COMMENT, SL_COMMENT):
- * referable=[DeclaredProperty|FQN];
- *
- **/
-
-// referable=[DeclaredProperty|FQN]
-protected class PropertyReferenceImpl_ReferableAssignment extends AssignmentToken {
-
- public PropertyReferenceImpl_ReferableAssignment(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Assignment getGrammarElement() {
- return grammarAccess.getPropertyReferenceImplAccess().getReferableAssignment();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- default: return lastRuleCallOrigin.createFollowerAfterReturn(this, index, index, inst);
- }
- }
-
- @Override
- public IEObjectConsumer tryConsume() {
- if(getEObject().eClass() != grammarAccess.getPropertyReferenceImplRule().getType().getClassifier())
- return null;
- if((value = eObjectConsumer.getConsumable("referable",true)) == null) return null;
- IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("referable");
- if(value instanceof EObject) { // org::eclipse::xtext::impl::CrossReferenceImpl
- IEObjectConsumer param = createEObjectConsumer((EObject)value);
- if(param.isInstanceOf(grammarAccess.getPropertyReferenceImplAccess().getReferableDeclaredPropertyCrossReference_0().getType().getClassifier())) {
- type = AssignmentType.CROSS_REFERENCE;
- element = grammarAccess.getPropertyReferenceImplAccess().getReferableDeclaredPropertyCrossReference_0();
- return obj;
- }
- }
- return null;
- }
-
-}
-
-/************ end Rule PropertyReferenceImpl ****************/
-
-
-/************ begin Rule PlainString ****************
- *
- * PlainString:
- * value=ConstantValue;
- *
- **/
-
-// value=ConstantValue
-protected class PlainString_ValueAssignment extends AssignmentToken {
-
- public PlainString_ValueAssignment(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
- super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
- }
-
- @Override
- public Assignment getGrammarElement() {
- return grammarAccess.getPlainStringAccess().getValueAssignment();
- }
-
- @Override
- public AbstractToken createFollower(int index, IEObjectConsumer inst) {
- switch(index) {
- default: return lastRuleCallOrigin.createFollowerAfterReturn(this, index, index, inst);
- }
- }
-
- @Override
- public IEObjectConsumer tryConsume() {
- if(getEObject().eClass() != grammarAccess.getPlainStringRule().getType().getClassifier())
- return null;
- if((value = eObjectConsumer.getConsumable("value",true)) == null) return null;
- IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("value");
- if(valueSerializer.isValid(obj.getEObject(), grammarAccess.getPlainStringAccess().getValueConstantValueParserRuleCall_0(), value, null)) {
- type = AssignmentType.DATATYPE_RULE_CALL;
- element = grammarAccess.getPlainStringAccess().getValueConstantValueParserRuleCall_0();
- return obj;
- }
- return null;
- }
-
-}
-
-/************ end Rule PlainString ****************/
-
-
-}
diff --git a/plugins/org.eclipse.emf.mwe2.language/src-gen/org/eclipse/emf/mwe2/language/serializer/AbstractMwe2SemanticSequencer.java b/plugins/org.eclipse.emf.mwe2.language/src-gen/org/eclipse/emf/mwe2/language/serializer/AbstractMwe2SemanticSequencer.java
new file mode 100644
index 0000000..f3735da
--- /dev/null
+++ b/plugins/org.eclipse.emf.mwe2.language/src-gen/org/eclipse/emf/mwe2/language/serializer/AbstractMwe2SemanticSequencer.java
@@ -0,0 +1,311 @@
+package org.eclipse.emf.mwe2.language.serializer;
+
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.mwe2.language.mwe2.Assignment;
+import org.eclipse.emf.mwe2.language.mwe2.BooleanLiteral;
+import org.eclipse.emf.mwe2.language.mwe2.Component;
+import org.eclipse.emf.mwe2.language.mwe2.DeclaredProperty;
+import org.eclipse.emf.mwe2.language.mwe2.Import;
+import org.eclipse.emf.mwe2.language.mwe2.Module;
+import org.eclipse.emf.mwe2.language.mwe2.Mwe2Package;
+import org.eclipse.emf.mwe2.language.mwe2.PlainString;
+import org.eclipse.emf.mwe2.language.mwe2.PropertyReference;
+import org.eclipse.emf.mwe2.language.mwe2.Reference;
+import org.eclipse.emf.mwe2.language.mwe2.StringLiteral;
+import org.eclipse.emf.mwe2.language.services.Mwe2GrammarAccess;
+import org.eclipse.xtext.serializer.acceptor.ISemanticSequenceAcceptor;
+import org.eclipse.xtext.serializer.acceptor.SequenceFeeder;
+import org.eclipse.xtext.serializer.diagnostic.ISemanticSequencerDiagnosticProvider;
+import org.eclipse.xtext.serializer.diagnostic.ISerializationDiagnostic.Acceptor;
+import org.eclipse.xtext.serializer.sequencer.AbstractSemanticSequencer;
+import org.eclipse.xtext.serializer.sequencer.GenericSequencer;
+import org.eclipse.xtext.serializer.sequencer.ISemanticNodeProvider.INodesForEObjectProvider;
+import org.eclipse.xtext.serializer.sequencer.ISemanticSequencer;
+import org.eclipse.xtext.serializer.sequencer.ITransientValueService;
+import org.eclipse.xtext.serializer.sequencer.ITransientValueService.ValueTransient;
+
+@SuppressWarnings("restriction")
+public class AbstractMwe2SemanticSequencer extends AbstractSemanticSequencer {
+
+ @Inject
+ protected Mwe2GrammarAccess grammarAccess;
+
+ @Inject
+ protected ISemanticSequencerDiagnosticProvider diagnosticProvider;
+
+ @Inject
+ protected ITransientValueService transientValues;
+
+ @Inject
+ @GenericSequencer
+ protected Provider<ISemanticSequencer> genericSequencerProvider;
+
+ protected ISemanticSequencer genericSequencer;
+
+
+ @Override
+ public void init(ISemanticSequencer sequencer, ISemanticSequenceAcceptor sequenceAcceptor, Acceptor errorAcceptor) {
+ super.init(sequencer, sequenceAcceptor, errorAcceptor);
+ this.genericSequencer = genericSequencerProvider.get();
+ this.genericSequencer.init(sequencer, sequenceAcceptor, errorAcceptor);
+ }
+
+ public void createSequence(EObject context, EObject semanticObject) {
+ if(semanticObject.eClass().getEPackage() == Mwe2Package.eINSTANCE) switch(semanticObject.eClass().getClassifierID()) {
+ case Mwe2Package.ASSIGNMENT:
+ if(context == grammarAccess.getAssignmentRule()) {
+ sequence_Assignment_Assignment(context, (Assignment) semanticObject);
+ return;
+ }
+ else break;
+ case Mwe2Package.BOOLEAN_LITERAL:
+ if(context == grammarAccess.getValueRule() ||
+ context == grammarAccess.getBooleanLiteralRule()) {
+ sequence_BooleanLiteral_BooleanLiteral(context, (BooleanLiteral) semanticObject);
+ return;
+ }
+ else break;
+ case Mwe2Package.COMPONENT:
+ if(context == grammarAccess.getComponentRule() ||
+ context == grammarAccess.getValueRule()) {
+ sequence_Component_Component(context, (Component) semanticObject);
+ return;
+ }
+ else if(context == grammarAccess.getRootComponentRule()) {
+ sequence_RootComponent_Component(context, (Component) semanticObject);
+ return;
+ }
+ else break;
+ case Mwe2Package.DECLARED_PROPERTY:
+ if(context == grammarAccess.getDeclaredPropertyRule()) {
+ sequence_DeclaredProperty_DeclaredProperty(context, (DeclaredProperty) semanticObject);
+ return;
+ }
+ else break;
+ case Mwe2Package.IMPORT:
+ if(context == grammarAccess.getImportRule()) {
+ sequence_Import_Import(context, (Import) semanticObject);
+ return;
+ }
+ else break;
+ case Mwe2Package.MODULE:
+ if(context == grammarAccess.getModuleRule()) {
+ sequence_Module_Module(context, (Module) semanticObject);
+ return;
+ }
+ else break;
+ case Mwe2Package.PLAIN_STRING:
+ if(context == grammarAccess.getPlainStringRule()) {
+ sequence_PlainString_PlainString(context, (PlainString) semanticObject);
+ return;
+ }
+ else break;
+ case Mwe2Package.PROPERTY_REFERENCE:
+ if(context == grammarAccess.getPropertyReferenceRule() ||
+ context == grammarAccess.getPropertyReferenceImplRule()) {
+ sequence_PropertyReferenceImpl_PropertyReference(context, (PropertyReference) semanticObject);
+ return;
+ }
+ else break;
+ case Mwe2Package.REFERENCE:
+ if(context == grammarAccess.getValueRule() ||
+ context == grammarAccess.getReferenceRule()) {
+ sequence_Reference_Reference(context, (Reference) semanticObject);
+ return;
+ }
+ else break;
+ case Mwe2Package.STRING_LITERAL:
+ if(context == grammarAccess.getValueRule() ||
+ context == grammarAccess.getStringLiteralRule()) {
+ sequence_StringLiteral_StringLiteral(context, (StringLiteral) semanticObject);
+ return;
+ }
+ else break;
+ }
+ if (errorAcceptor != null) errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
+ }
+
+ /**
+ * Constraint:
+ * (feature=[JvmIdentifiableElement|FQN] value=Value)
+ *
+ * Features:
+ * feature[1, 1]
+ * value[1, 1]
+ */
+ protected void sequence_Assignment_Assignment(EObject context, Assignment semanticObject) {
+ genericSequencer.createSequence(context, semanticObject);
+ }
+
+
+ /**
+ * Constraint:
+ * (isTrue?='true'?)
+ *
+ * Features:
+ * isTrue[0, 1]
+ */
+ protected void sequence_BooleanLiteral_BooleanLiteral(EObject context, BooleanLiteral semanticObject) {
+ genericSequencer.createSequence(context, semanticObject);
+ }
+
+
+ /**
+ * Constraint:
+ * ((type=[JvmType|FQN] | module=[Module|FQN])? name=FQN? autoInject?='auto-inject'? assignment+=Assignment*)
+ *
+ * Features:
+ * type[0, 1]
+ * EXCLUDE_IF_SET module
+ * name[0, 1]
+ * module[0, 1]
+ * EXCLUDE_IF_SET type
+ * autoInject[0, 1]
+ * assignment[0, *]
+ */
+ protected void sequence_Component_Component(EObject context, Component semanticObject) {
+ genericSequencer.createSequence(context, semanticObject);
+ }
+
+
+ /**
+ * Constraint:
+ * (type=[JvmType|FQN]? name=FQN default=Value?)
+ *
+ * Features:
+ * type[0, 1]
+ * name[1, 1]
+ * default[0, 1]
+ */
+ protected void sequence_DeclaredProperty_DeclaredProperty(EObject context, DeclaredProperty semanticObject) {
+ genericSequencer.createSequence(context, semanticObject);
+ }
+
+
+ /**
+ * Constraint:
+ * importedNamespace=ImportedFQN
+ *
+ * Features:
+ * importedNamespace[1, 1]
+ */
+ protected void sequence_Import_Import(EObject context, Import semanticObject) {
+ if(errorAcceptor != null) {
+ if(transientValues.isValueTransient(semanticObject, Mwe2Package.Literals.IMPORT__IMPORTED_NAMESPACE) == ValueTransient.YES)
+ errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, Mwe2Package.Literals.IMPORT__IMPORTED_NAMESPACE));
+ }
+ INodesForEObjectProvider nodes = createNodeProvider(semanticObject);
+ SequenceFeeder feeder = createSequencerFeeder(semanticObject, nodes);
+ feeder.accept(grammarAccess.getImportAccess().getImportedNamespaceImportedFQNParserRuleCall_1_0(), semanticObject.getImportedNamespace());
+ feeder.finish();
+ }
+
+
+ /**
+ * Constraint:
+ * (canonicalName=FQN imports+=Import* declaredProperties+=DeclaredProperty* root=RootComponent)
+ *
+ * Features:
+ * canonicalName[1, 1]
+ * imports[0, *]
+ * declaredProperties[0, *]
+ * root[1, 1]
+ */
+ protected void sequence_Module_Module(EObject context, Module semanticObject) {
+ genericSequencer.createSequence(context, semanticObject);
+ }
+
+
+ /**
+ * Constraint:
+ * value=ConstantValue
+ *
+ * Features:
+ * value[1, 1]
+ */
+ protected void sequence_PlainString_PlainString(EObject context, PlainString semanticObject) {
+ if(errorAcceptor != null) {
+ if(transientValues.isValueTransient(semanticObject, Mwe2Package.Literals.PLAIN_STRING__VALUE) == ValueTransient.YES)
+ errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, Mwe2Package.Literals.PLAIN_STRING__VALUE));
+ }
+ INodesForEObjectProvider nodes = createNodeProvider(semanticObject);
+ SequenceFeeder feeder = createSequencerFeeder(semanticObject, nodes);
+ feeder.accept(grammarAccess.getPlainStringAccess().getValueConstantValueParserRuleCall_0(), semanticObject.getValue());
+ feeder.finish();
+ }
+
+
+ /**
+ * Constraint:
+ * referable=[DeclaredProperty|FQN]
+ *
+ * Features:
+ * referable[1, 1]
+ */
+ protected void sequence_PropertyReferenceImpl_PropertyReference(EObject context, PropertyReference semanticObject) {
+ if(errorAcceptor != null) {
+ if(transientValues.isValueTransient(semanticObject, Mwe2Package.Literals.ABSTRACT_REFERENCE__REFERABLE) == ValueTransient.YES)
+ errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, Mwe2Package.Literals.ABSTRACT_REFERENCE__REFERABLE));
+ }
+ INodesForEObjectProvider nodes = createNodeProvider(semanticObject);
+ SequenceFeeder feeder = createSequencerFeeder(semanticObject, nodes);
+ feeder.accept(grammarAccess.getPropertyReferenceImplAccess().getReferableDeclaredPropertyFQNParserRuleCall_0_1(), semanticObject.getReferable());
+ feeder.finish();
+ }
+
+
+ /**
+ * Constraint:
+ * referable=[Referrable|FQN]
+ *
+ * Features:
+ * referable[1, 1]
+ */
+ protected void sequence_Reference_Reference(EObject context, Reference semanticObject) {
+ if(errorAcceptor != null) {
+ if(transientValues.isValueTransient(semanticObject, Mwe2Package.Literals.ABSTRACT_REFERENCE__REFERABLE) == ValueTransient.YES)
+ errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, Mwe2Package.Literals.ABSTRACT_REFERENCE__REFERABLE));
+ }
+ INodesForEObjectProvider nodes = createNodeProvider(semanticObject);
+ SequenceFeeder feeder = createSequencerFeeder(semanticObject, nodes);
+ feeder.accept(grammarAccess.getReferenceAccess().getReferableReferrableFQNParserRuleCall_0_1(), semanticObject.getReferable());
+ feeder.finish();
+ }
+
+
+ /**
+ * Constraint:
+ * ((type=[JvmType|FQN] | module=[Module|FQN]) name=FQN? autoInject?='auto-inject'? assignment+=Assignment*)
+ *
+ * Features:
+ * type[0, 1]
+ * EXCLUDE_IF_SET module
+ * name[0, 1]
+ * module[0, 1]
+ * EXCLUDE_IF_SET type
+ * autoInject[0, 1]
+ * assignment[0, *]
+ */
+ protected void sequence_RootComponent_Component(EObject context, Component semanticObject) {
+ genericSequencer.createSequence(context, semanticObject);
+ }
+
+
+ /**
+ * Constraint:
+ * (
+ * (begin=''' parts+=PlainString? (parts+=PropertyReference parts+=PlainString?)* end=''') |
+ * (begin='"' parts+=PlainString? (parts+=PropertyReference parts+=PlainString?)* end='"')
+ * )
+ *
+ * Features:
+ * begin[2, 2]
+ * parts[0, *]
+ * end[2, 2]
+ */
+ protected void sequence_StringLiteral_StringLiteral(EObject context, StringLiteral semanticObject) {
+ genericSequencer.createSequence(context, semanticObject);
+ }
+}
diff --git a/plugins/org.eclipse.emf.mwe2.language/src-gen/org/eclipse/emf/mwe2/language/serializer/AbstractMwe2SyntacticSequencer.java b/plugins/org.eclipse.emf.mwe2.language/src-gen/org/eclipse/emf/mwe2/language/serializer/AbstractMwe2SyntacticSequencer.java
new file mode 100644
index 0000000..6ece510
--- /dev/null
+++ b/plugins/org.eclipse.emf.mwe2.language/src-gen/org/eclipse/emf/mwe2/language/serializer/AbstractMwe2SyntacticSequencer.java
@@ -0,0 +1,35 @@
+package org.eclipse.emf.mwe2.language.serializer;
+
+import com.google.inject.Inject;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.mwe2.language.services.Mwe2GrammarAccess;
+import org.eclipse.xtext.IGrammarAccess;
+import org.eclipse.xtext.RuleCall;
+import org.eclipse.xtext.nodemodel.INode;
+import org.eclipse.xtext.serializer.analysis.ISyntacticSequencerPDAProvider.ISynTransition;
+import org.eclipse.xtext.serializer.sequencer.AbstractSyntacticSequencer;
+
+@SuppressWarnings("restriction")
+public class AbstractMwe2SyntacticSequencer extends AbstractSyntacticSequencer {
+
+ protected Mwe2GrammarAccess grammarAccess;
+
+ @Inject
+ protected void init(IGrammarAccess access) {
+ grammarAccess = (Mwe2GrammarAccess) access;
+ }
+
+ @Override
+ protected String getUnassignedRuleCallToken(RuleCall ruleCall, INode node) {
+ return "";
+ }
+
+
+ @Override
+ protected void emitUnassignedTokens(EObject semanticObject, ISynTransition transition, INode fromNode, INode toNode) {
+ if (!transition.isSyntacticallyAmbiguous())
+ return;
+ acceptNodes(transition, fromNode, toNode);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.mwe2.language/src/org/eclipse/emf/mwe2/language/GenerateMwe2.java b/plugins/org.eclipse.emf.mwe2.language/src/org/eclipse/emf/mwe2/language/GenerateMwe2.java
index 8d3037f..e6f7cd2 100644
--- a/plugins/org.eclipse.emf.mwe2.language/src/org/eclipse/emf/mwe2/language/GenerateMwe2.java
+++ b/plugins/org.eclipse.emf.mwe2.language/src/org/eclipse/emf/mwe2/language/GenerateMwe2.java
@@ -17,12 +17,12 @@ import org.eclipse.xtext.generator.builder.BuilderIntegrationFragment;
import org.eclipse.xtext.generator.exporting.QualifiedNamesFragment;
import org.eclipse.xtext.generator.formatting.FormatterFragment;
import org.eclipse.xtext.generator.grammarAccess.GrammarAccessFragment;
-import org.eclipse.xtext.generator.parseTreeConstructor.ParseTreeConstructorFragment;
import org.eclipse.xtext.generator.parser.antlr.ex.ExternalAntlrLexerFragment;
import org.eclipse.xtext.generator.parser.antlr.ex.ca.ContentAssistParserGeneratorFragment;
import org.eclipse.xtext.generator.parser.antlr.ex.rt.AntlrGeneratorFragment;
import org.eclipse.xtext.generator.resourceFactory.ResourceFactoryFragment;
import org.eclipse.xtext.generator.scoping.ImportNamespacesScopingFragment;
+import org.eclipse.xtext.generator.serializer.SerializerFragment;
import org.eclipse.xtext.generator.types.TypesGeneratorFragment;
import org.eclipse.xtext.generator.validation.JavaValidatorFragment;
import org.eclipse.xtext.ui.generator.contentAssist.JavaBasedContentAssistFragment;
@@ -96,7 +96,7 @@ public class GenerateMwe2 {
addFragment(new GrammarAccessFragment());
// the serialization component
- addFragment(new ParseTreeConstructorFragment());
+ addFragment(new SerializerFragment());
// a custom ResourceFactory for use with EMF
ResourceFactoryFragment resourceFragment = new ResourceFactoryFragment();
diff --git a/plugins/org.eclipse.emf.mwe2.language/src/org/eclipse/emf/mwe2/language/serializer/Mwe2SemanticSequencer.java b/plugins/org.eclipse.emf.mwe2.language/src/org/eclipse/emf/mwe2/language/serializer/Mwe2SemanticSequencer.java
new file mode 100644
index 0000000..30d1a81
--- /dev/null
+++ b/plugins/org.eclipse.emf.mwe2.language/src/org/eclipse/emf/mwe2/language/serializer/Mwe2SemanticSequencer.java
@@ -0,0 +1,53 @@
+package org.eclipse.emf.mwe2.language.serializer;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.mwe2.language.mwe2.PlainString;
+import org.eclipse.emf.mwe2.language.mwe2.StringLiteral;
+import org.eclipse.emf.mwe2.language.services.Mwe2GrammarAccess.StringLiteralElements;
+import org.eclipse.xtext.serializer.acceptor.SequenceFeeder;
+import org.eclipse.xtext.serializer.sequencer.ISemanticNodeProvider.INodesForEObjectProvider;
+
+@SuppressWarnings("restriction")
+public class Mwe2SemanticSequencer extends AbstractMwe2SemanticSequencer {
+
+ @Override
+ protected void sequence_StringLiteral_StringLiteral(EObject context, StringLiteral lit) {
+ INodesForEObjectProvider nodes = createNodeProvider(lit);
+ SequenceFeeder feeder = createSequencerFeeder(lit, nodes);
+ StringLiteralElements g = grammarAccess.getStringLiteralAccess();
+ if ("'".equals(lit.getBegin())) {
+ feeder.accept(g.getBeginApostropheKeyword_0_0_0());
+ if (!lit.getParts().isEmpty()) {
+ if (lit.getParts().get(0) instanceof PlainString)
+ feeder.accept(g.getPartsPlainStringParserRuleCall_0_1_0(), lit.getParts().get(0), 0);
+ int i = 1;
+ while (i < lit.getParts().size()) {
+ feeder.accept(g.getPartsPropertyReferenceParserRuleCall_0_2_0_0(), lit.getParts().get(i), i);
+ i++;
+ if (lit.getParts().get(i) instanceof PlainString) {
+ feeder.accept(g.getPartsPlainStringParserRuleCall_0_2_1_0(), lit.getParts().get(i), i);
+ i++;
+ }
+ }
+ }
+ feeder.accept(g.getEndApostropheKeyword_0_3_0());
+ } else {
+ feeder.accept(g.getBeginQuotationMarkKeyword_1_0_0());
+ if (!lit.getParts().isEmpty()) {
+ if (lit.getParts().get(0) instanceof PlainString)
+ feeder.accept(g.getPartsPlainStringParserRuleCall_1_1_0(), lit.getParts().get(0), 0);
+ int i = 1;
+ while (i < lit.getParts().size()) {
+ feeder.accept(g.getPartsPropertyReferenceParserRuleCall_1_2_0_0(), lit.getParts().get(i), i);
+ i++;
+ if (lit.getParts().get(i) instanceof PlainString) {
+ feeder.accept(g.getPartsPlainStringParserRuleCall_1_2_1_0(), lit.getParts().get(i), i);
+ i++;
+ }
+ }
+ }
+ feeder.accept(g.getEndQuotationMarkKeyword_1_3_0());
+ }
+ feeder.finish();
+ }
+}
diff --git a/plugins/org.eclipse.emf.mwe2.language/src/org/eclipse/emf/mwe2/language/serializer/Mwe2SyntacticSequencer.java b/plugins/org.eclipse.emf.mwe2.language/src/org/eclipse/emf/mwe2/language/serializer/Mwe2SyntacticSequencer.java
new file mode 100644
index 0000000..5751b3f
--- /dev/null
+++ b/plugins/org.eclipse.emf.mwe2.language/src/org/eclipse/emf/mwe2/language/serializer/Mwe2SyntacticSequencer.java
@@ -0,0 +1,4 @@
+package org.eclipse.emf.mwe2.language.serializer;
+
+public class Mwe2SyntacticSequencer extends AbstractMwe2SyntacticSequencer {
+}
diff --git a/tests/org.eclipse.emf.mwe2.language.tests/src/org/eclipse/emf/mwe2/language/tests/serializer/Mwe2SerializerTest.java b/tests/org.eclipse.emf.mwe2.language.tests/src/org/eclipse/emf/mwe2/language/tests/serializer/Mwe2SerializerTest.java
new file mode 100644
index 0000000..9172edb
--- /dev/null
+++ b/tests/org.eclipse.emf.mwe2.language.tests/src/org/eclipse/emf/mwe2/language/tests/serializer/Mwe2SerializerTest.java
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * Copyright (c) 2011 itemis AG (http://www.itemis.eu) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.emf.mwe2.language.tests.serializer;
+
+import org.eclipse.emf.mwe2.language.Mwe2StandaloneSetup;
+import org.eclipse.emf.mwe2.language.mwe2.Component;
+import org.eclipse.xtext.EcoreUtil2;
+import org.eclipse.xtext.junit.AbstractXtextTests;
+import org.eclipse.xtext.junit.serializer.SerializerTester;
+
+/**
+ * @author Moritz Eysholdt - Initial contribution and API
+ */
+public class Mwe2SerializerTest extends AbstractXtextTests {
+ private SerializerTester tester;
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ with(new Mwe2StandaloneSetup());
+ tester = get(SerializerTester.class);
+ }
+
+ public void testSimple() throws Exception {
+ StringBuilder module = new StringBuilder();
+ module.append("module foo\n");
+ module.append("org.eclipse.emf.mwe2.runtime.workflow.Workflow {}");
+ tester.assertSerializeWithNodeModel(module.toString());
+ tester.assertSerializeWithoutNodeModel(module.toString());
+ }
+
+ public void testIntegration() throws Exception {
+ StringBuilder module = new StringBuilder();
+ module.append("module foo\n");
+ module.append("var bool1 = true\n");
+ module.append("var bool2 = false\n");
+ module.append("var str1 = 'xxx${bool1}xx'\n");
+ module.append("var str2 = \"xxx${bool2}xx\"\n");
+ module.append("var comp1 = org.eclipse.emf.mwe2.runtime.workflow.Workflow {} \n");
+ module.append("var ref1 = bool1 \n");
+ module.append("org.eclipse.emf.mwe2.runtime.workflow.Workflow {\n");
+ module.append(" bean = java.lang.String {}");
+ module.append(" component = @foo {}");
+ module.append(" component = @foo : bar.baz auto-inject {}");
+ module.append("}");
+ tester.assertSerializeWithNodeModel(module.toString());
+ tester.assertSerializeWithoutNodeModel(module.toString());
+ }
+
+ public void testStrings() throws Exception {
+ StringBuilder module = new StringBuilder();
+ module.append("module foo\n");
+ module.append("var bool1 = true\n");
+ module.append("var bool2 = false\n");
+ module.append("var str1 = 'xxx${bool1}xx'\n");
+ module.append("var str2 = \"xxx${bool2}xx\"\n");
+ module.append("var str3 = \" xxx ${ bool2 } xx \"\n");
+ module.append("var str4 = \"xxx${bool1}${bool2}xx\"\n");
+ module.append("org.eclipse.emf.mwe2.runtime.workflow.Workflow {}");
+ tester.assertSerializeWithNodeModel(module.toString());
+ tester.assertSerializeWithoutNodeModel(module.toString());
+ }
+
+ public void testComponents() throws Exception {
+ StringBuilder module = new StringBuilder();
+ module.append("module foo\n");
+ module.append("org.eclipse.emf.mwe2.runtime.workflow.Workflow {\n");
+ module.append(" bean = java.lang.String {}");
+ module.append(" component = @foo {}");
+ module.append(" component = @foo : bar.baz auto-inject {}");
+ module.append(" component = :other {}");
+ module.append("}");
+ for (Component comp : EcoreUtil2.getAllContentsOfType(getModel(module.toString()), Component.class)) {
+ tester.assertSerializeWithNodeModel(comp);
+ tester.assertSerializeWithoutNodeModel(comp);
+ }
+ }
+
+}