summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorszarnekow2009-03-19 13:01:31 (EDT)
committer sefftinge2009-03-19 13:01:31 (EDT)
commit78357bfa80b516c506fa7bf44fb5880a64148443 (patch)
tree144e640d288cc3e5b26ccb24482cd8112f46ffd3
parent1227f7779f3868c435dc1a05dd5a675933a62ace (diff)
downloadorg.eclipse.xtext-78357bfa80b516c506fa7bf44fb5880a64148443.zip
org.eclipse.xtext-78357bfa80b516c506fa7bf44fb5880a64148443.tar.gz
org.eclipse.xtext-78357bfa80b516c506fa7bf44fb5880a64148443.tar.bz2
enum rules: content assist + tests
-rw-r--r--plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/DefaultContentAssistCalculator.java16
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/META-INF/MANIFEST.MF8
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/plugin.xml_gen77
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/enums/EnumsFactory.java37
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/enums/EnumsPackage.java116
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/enums/ExistingEnum.java253
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/enums/impl/EnumsFactoryImpl.java154
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/enums/impl/EnumsPackageImpl.java188
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/GenXtextGrammarTestLanguageScopeProvider.ext24
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/AbstractEnumRulesTestLanguageRuntimeModule.java91
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/AbstractEnumRulesTestLanguageUiModule.java35
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/EnumRulesTestLanguage.ecore13
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/EnumRulesTestLanguage.genmodel24
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/EnumRulesTestLanguage.xmi221
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/EnumRulesTestLanguageCheckValidator.java24
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/EnumRulesTestLanguageExecutableExtensionFactory.java45
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/EnumRulesTestLanguageScopeProvider.java19
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/EnumRulesTestLanguageStandaloneSetup.java44
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/GenEnumRulesTestLanguageProposalProvider.java70
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/GenEnumRulesTestLanguageScopeProvider.ext19
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/enumRulesTestLanguage/EnumRulesTestLanguageFactory.java46
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/enumRulesTestLanguage/EnumRulesTestLanguagePackage.java213
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/enumRulesTestLanguage/GeneratedEnum.java226
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/enumRulesTestLanguage/Model.java89
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/enumRulesTestLanguage/impl/EnumRulesTestLanguageFactoryImpl.java166
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/enumRulesTestLanguage/impl/EnumRulesTestLanguagePackageImpl.java246
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/enumRulesTestLanguage/impl/ModelImpl.java239
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/enumRulesTestLanguage/util/EnumRulesTestLanguageAdapterFactory.java135
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/enumRulesTestLanguage/util/EnumRulesTestLanguageSwitch.java141
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parseTreeConstruction/EnumRulesTestLanguageParsetreeConstructor.java263
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/EnumRulesTestLanguageAntlrTokenFileProvider.java15
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/EnumRulesTestLanguageParser.java56
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g228
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.tokens12
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguageLexer.java1117
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguageParser.java499
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage__.g37
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/packrat/EnumRulesTestLanguageDelimiters.java22
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/packrat/EnumRulesTestLanguagePackratParser.java31
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/packrat/EnumRulesTestLanguageParserConfiguration.java128
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/packrat/consumers/EnumRulesTestLanguageExistingEnumConsumer.java148
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/packrat/consumers/EnumRulesTestLanguageGeneratedEnumConsumer.java121
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/packrat/consumers/EnumRulesTestLanguageModelConsumer.java301
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/services/EnumRulesTestLanguageGrammarAccess.java236
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/testlanguages/GenReferenceGrammarTestLanguageScopeProvider.ext8
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/ui/common/tests/Activator.java2
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/enumrules/EnumRulesTestLanguageChecks.chk13
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/enumrules/EnumRulesTestLanguageProposalProvider.java6
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/enumrules/EnumRulesTestLanguageRuntimeModule.java11
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/enumrules/EnumRulesTestLanguageScopeProvider.ext18
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/enumrules/EnumRulesTestLanguageUiModule.java11
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/ui/common/GenerateTestLanguages.mwe5
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/ContentAssistProcessorTestBuilder.java5
-rw-r--r--tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/DefaultContentAssistProcessorTest.java38
54 files changed, 6286 insertions, 24 deletions
diff --git a/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/DefaultContentAssistCalculator.java b/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/DefaultContentAssistCalculator.java
index af9a2c1..d0a678a 100644
--- a/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/DefaultContentAssistCalculator.java
+++ b/plugins/org.eclipse.xtext.ui.common/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/DefaultContentAssistCalculator.java
@@ -9,6 +9,7 @@
package org.eclipse.xtext.ui.common.editor.contentassist.impl;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
@@ -22,6 +23,8 @@ import org.eclipse.xtext.Action;
import org.eclipse.xtext.Alternatives;
import org.eclipse.xtext.Assignment;
import org.eclipse.xtext.CrossReference;
+import org.eclipse.xtext.EnumLiteralDeclaration;
+import org.eclipse.xtext.EnumRule;
import org.eclipse.xtext.GrammarUtil;
import org.eclipse.xtext.Group;
import org.eclipse.xtext.Keyword;
@@ -67,6 +70,11 @@ public class DefaultContentAssistCalculator extends XtextSwitch<List<AbstractEle
}
return elementList;
}
+
+ @Override
+ public List<AbstractElement> caseEnumLiteralDeclaration(EnumLiteralDeclaration object) {
+ return Arrays.asList(object.getLiteral(), object);
+ }
@Override
public List<AbstractElement> caseGroup(Group group) {
@@ -80,7 +88,7 @@ public class DefaultContentAssistCalculator extends XtextSwitch<List<AbstractEle
}
return elementList;
}
-
+
@Override
public List<AbstractElement> caseAssignment(Assignment assignment) {
List<AbstractElement> elementList = new ArrayList<AbstractElement>();
@@ -99,8 +107,8 @@ public class DefaultContentAssistCalculator extends XtextSwitch<List<AbstractEle
public List<AbstractElement> caseRuleCall(RuleCall ruleCall) {
List<AbstractElement> elementList = new ArrayList<AbstractElement>(Collections.singleton(ruleCall));
AbstractRule abstractRule = ruleCall.getRule();
- if (abstractRule instanceof ParserRule) {
- addWithNullCheck(elementList, doSwitch(((ParserRule) abstractRule).getAlternatives()));
+ if (abstractRule instanceof ParserRule || abstractRule instanceof EnumRule) {
+ addWithNullCheck(elementList, doSwitch(abstractRule.getAlternatives()));
}
return elementList;
}
@@ -124,7 +132,7 @@ public class DefaultContentAssistCalculator extends XtextSwitch<List<AbstractEle
private boolean isOptional(AbstractElement groupElement) {
boolean isOptional = true;
if ((groupElement instanceof Group || groupElement instanceof Alternatives) && !GrammarUtil.isOptionalCardinality(groupElement)) {
- EList<AbstractElement> abstractTokens = groupElement instanceof Group ?
+ EList<AbstractElement> abstractTokens = groupElement instanceof Group ?
((Group) groupElement).getTokens() : ((Alternatives) groupElement).getGroups();
for (Iterator<AbstractElement> iterator = abstractTokens.iterator(); isOptional && iterator.hasNext();) {
AbstractElement abstractElement = iterator.next();
diff --git a/tests/org.eclipse.xtext.ui.common.tests/META-INF/MANIFEST.MF b/tests/org.eclipse.xtext.ui.common.tests/META-INF/MANIFEST.MF
index a6b8147..3b8810d 100644
--- a/tests/org.eclipse.xtext.ui.common.tests/META-INF/MANIFEST.MF
+++ b/tests/org.eclipse.xtext.ui.common.tests/META-INF/MANIFEST.MF
@@ -64,5 +64,11 @@ Export-Package: org.eclipse.xtext.ui.common,
org.eclipse.xtext.testlanguages.parseTreeConstruction,
org.eclipse.xtext.testlanguages.parser.antlr,
org.eclipse.xtext.testlanguages.referenceGrammar,
- org.eclipse.xtext.testlanguages.treeTestLanguage
+ org.eclipse.xtext.testlanguages.treeTestLanguage,
+ org.eclipse.xtext.enumrules.enumRulesTestLanguage,
+ org.eclipse.xtext.enumrules,
+ org.eclipse.xtext.enumrules.parser.packrat,
+ org.eclipse.xtext.enumrules.parser.packrat.consumers,
+ org.eclipse.xtext.enumrules.parseTreeConstruction,
+ org.eclipse.xtext.enumrules.parser.antlr
diff --git a/tests/org.eclipse.xtext.ui.common.tests/plugin.xml_gen b/tests/org.eclipse.xtext.ui.common.tests/plugin.xml_gen
index e633c8d..793ca2b 100644
--- a/tests/org.eclipse.xtext.ui.common.tests/plugin.xml_gen
+++ b/tests/org.eclipse.xtext.ui.common.tests/plugin.xml_gen
@@ -466,4 +466,81 @@
</extension>
+ <extension point="org.eclipse.emf.ecore.generated_package">
+ <package
+ uri = "http://www.eclipse.org/2009/tmf/xtext/EnumRulesTest"
+ class = "org.eclipse.xtext.enumrules.enumRulesTestLanguage.EnumRulesTestLanguagePackage"
+ genModel = "org/eclipse/xtext/enumrules/EnumRulesTestLanguage.genmodel" />
+
+ </extension>
+
+
+<!-- adding resource factories -->
+
+ <extension
+ point="org.eclipse.emf.ecore.extension_parser">
+ <parser
+ class="org.eclipse.xtext.enumrules.EnumRulesTestLanguageExecutableExtensionFactory:org.eclipse.xtext.resource.XtextResourceFactory"
+ type="enumrulestestlanguage">
+ </parser>
+ </extension>
+
+
+ <extension
+ point="org.eclipse.ui.editors">
+ <editor
+ class="org.eclipse.xtext.enumrules.EnumRulesTestLanguageExecutableExtensionFactory:org.eclipse.xtext.ui.core.editor.XtextEditor"
+ contributorClass="org.eclipse.ui.editors.text.TextEditorActionContributor"
+ default="true"
+ extensions="enumrulestestlanguage"
+ id="org.eclipse.xtext.enumrules.EnumRulesTestLanguage"
+ name="EnumRulesTestLanguage Editor">
+ </editor>
+ </extension>
+ <extension
+ point="org.eclipse.ui.handlers">
+ <handler
+ class="org.eclipse.xtext.enumrules.EnumRulesTestLanguageExecutableExtensionFactory:org.eclipse.xtext.ui.common.editor.hyperlinking.OpenDeclarationHandler"
+ commandId="org.eclipse.xtext.ui.common.editor.hyperlinking.OpenDeclaration">
+ <activeWhen>
+ <reference
+ definitionId="isActiveEditorAnInstanceOfXtextEditor">
+ </reference>
+ </activeWhen>
+ </handler>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.preferencePages">
+ <page
+ class="org.eclipse.xtext.enumrules.EnumRulesTestLanguageExecutableExtensionFactory:org.eclipse.xtext.ui.core.editor.preferences.LanguageRootPreferencePage"
+ id="org.eclipse.xtext.enumrules.EnumRulesTestLanguage"
+ name="EnumRulesTestLanguage">
+ <keywordReference
+ id="org.eclipse.xtext.enumrules.ui.keyword_EnumRulesTestLanguage">
+ </keywordReference>
+ </page>
+ <page
+ category="org.eclipse.xtext.enumrules.EnumRulesTestLanguage"
+ class="org.eclipse.xtext.enumrules.EnumRulesTestLanguageExecutableExtensionFactory:org.eclipse.xtext.ui.core.editor.preferences.EditorPreferencePage"
+ id="org.eclipse.xtext.enumrules.EnumRulesTestLanguage.editor"
+ name="Editor">
+ <keywordReference
+ id="org.eclipse.xtext.keyword.editor">
+ </keywordReference>
+ </page>
+ </extension>
+ <extension
+ point="org.eclipse.ui.keywords">
+ <keyword
+ id="org.eclipse.xtext.enumrules.ui.keyword_EnumRulesTestLanguage"
+ label="EnumRulesTestLanguage">
+ </keyword>
+ <keyword
+ id="org.eclipse.xtext.enumrules.EnumRulesTestLanguage.tasktags"
+ label="Task Tags">
+ </keyword>
+ </extension>
+
+
</plugin>
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/enums/EnumsFactory.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/enums/EnumsFactory.java
new file mode 100644
index 0000000..d253576
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/enums/EnumsFactory.java
@@ -0,0 +1,37 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ */
+package enums;
+
+import org.eclipse.emf.ecore.EFactory;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Factory</b> for the model.
+ * It provides a create method for each non-abstract class of the model.
+ * <!-- end-user-doc -->
+ * @see enums.EnumsPackage
+ * @generated
+ */
+public interface EnumsFactory extends EFactory
+{
+ /**
+ * The singleton instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EnumsFactory eINSTANCE = enums.impl.EnumsFactoryImpl.init();
+
+ /**
+ * Returns the package supported by this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the package supported by this factory.
+ * @generated
+ */
+ EnumsPackage getEnumsPackage();
+
+} //EnumsFactory
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/enums/EnumsPackage.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/enums/EnumsPackage.java
new file mode 100644
index 0000000..c0176a9
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/enums/EnumsPackage.java
@@ -0,0 +1,116 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ */
+package enums;
+
+import org.eclipse.emf.ecore.EEnum;
+import org.eclipse.emf.ecore.EPackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Package</b> for the model.
+ * It contains accessors for the meta objects to represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ * @see enums.EnumsFactory
+ * @model kind="package"
+ * @generated
+ */
+public interface EnumsPackage extends EPackage
+{
+ /**
+ * The package name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNAME = "enums";
+
+ /**
+ * The package namespace URI.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNS_URI = "http://www.eclipse.org/2009/tmf/xtext/EnumRulesTestLanguage/imported";
+
+ /**
+ * The package namespace name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNS_PREFIX = "enums";
+
+ /**
+ * The singleton instance of the package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EnumsPackage eINSTANCE = enums.impl.EnumsPackageImpl.init();
+
+ /**
+ * The meta object id for the '{@link enums.ExistingEnum <em>Existing Enum</em>}' enum.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see enums.ExistingEnum
+ * @see enums.impl.EnumsPackageImpl#getExistingEnum()
+ * @generated
+ */
+ int EXISTING_ENUM = 0;
+
+
+ /**
+ * Returns the meta object for enum '{@link enums.ExistingEnum <em>Existing Enum</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for enum '<em>Existing Enum</em>'.
+ * @see enums.ExistingEnum
+ * @generated
+ */
+ EEnum getExistingEnum();
+
+ /**
+ * Returns the factory that creates the instances of the model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the factory that creates the instances of the model.
+ * @generated
+ */
+ EnumsFactory getEnumsFactory();
+
+ /**
+ * <!-- begin-user-doc -->
+ * Defines literals for the meta objects that represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ interface Literals
+ {
+ /**
+ * The meta object literal for the '{@link enums.ExistingEnum <em>Existing Enum</em>}' enum.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see enums.ExistingEnum
+ * @see enums.impl.EnumsPackageImpl#getExistingEnum()
+ * @generated
+ */
+ EEnum EXISTING_ENUM = eINSTANCE.getExistingEnum();
+
+ }
+
+} //EnumsPackage
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/enums/ExistingEnum.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/enums/ExistingEnum.java
new file mode 100644
index 0000000..2741fe8
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/enums/ExistingEnum.java
@@ -0,0 +1,253 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ */
+package enums;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.emf.common.util.Enumerator;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the literals of the enumeration '<em><b>Existing Enum</b></em>',
+ * and utility methods for working with them.
+ * <!-- end-user-doc -->
+ * @see enums.EnumsPackage#getExistingEnum()
+ * @model
+ * @generated
+ */
+public enum ExistingEnum implements Enumerator
+{
+ /**
+ * The '<em><b>Same Name</b></em>' literal object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #SAME_NAME_VALUE
+ * @generated
+ * @ordered
+ */
+ SAME_NAME(3, "SameName", "SameName"),
+
+ /**
+ * The '<em><b>Overridden Literal</b></em>' literal object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #OVERRIDDEN_LITERAL_VALUE
+ * @generated
+ * @ordered
+ */
+ OVERRIDDEN_LITERAL(2, "OverriddenLiteral", "OtherLiteral"),
+
+ /**
+ * The '<em><b>Different Name</b></em>' literal object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #DIFFERENT_NAME_VALUE
+ * @generated
+ * @ordered
+ */
+ DIFFERENT_NAME(1, "DifferentName", "DifferentLiteral");
+
+ /**
+ * The '<em><b>Same Name</b></em>' literal value.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of '<em><b>Same Name</b></em>' literal object isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @see #SAME_NAME
+ * @model name="SameName"
+ * @generated
+ * @ordered
+ */
+ public static final int SAME_NAME_VALUE = 3;
+
+ /**
+ * The '<em><b>Overridden Literal</b></em>' literal value.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of '<em><b>Overridden Literal</b></em>' literal object isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @see #OVERRIDDEN_LITERAL
+ * @model name="OverriddenLiteral" literal="OtherLiteral"
+ * @generated
+ * @ordered
+ */
+ public static final int OVERRIDDEN_LITERAL_VALUE = 2;
+
+ /**
+ * The '<em><b>Different Name</b></em>' literal value.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of '<em><b>Different Name</b></em>' literal object isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @see #DIFFERENT_NAME
+ * @model name="DifferentName" literal="DifferentLiteral"
+ * @generated
+ * @ordered
+ */
+ public static final int DIFFERENT_NAME_VALUE = 1;
+
+ /**
+ * An array of all the '<em><b>Existing Enum</b></em>' enumerators.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static final ExistingEnum[] VALUES_ARRAY =
+ new ExistingEnum[]
+ {
+ SAME_NAME,
+ OVERRIDDEN_LITERAL,
+ DIFFERENT_NAME,
+ };
+
+ /**
+ * A public read-only list of all the '<em><b>Existing Enum</b></em>' enumerators.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final List<ExistingEnum> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
+
+ /**
+ * Returns the '<em><b>Existing Enum</b></em>' literal with the specified literal value.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static ExistingEnum get(String literal)
+ {
+ for (int i = 0; i < VALUES_ARRAY.length; ++i)
+ {
+ ExistingEnum result = VALUES_ARRAY[i];
+ if (result.toString().equals(literal))
+ {
+ return result;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Returns the '<em><b>Existing Enum</b></em>' literal with the specified name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static ExistingEnum getByName(String name)
+ {
+ for (int i = 0; i < VALUES_ARRAY.length; ++i)
+ {
+ ExistingEnum result = VALUES_ARRAY[i];
+ if (result.getName().equals(name))
+ {
+ return result;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Returns the '<em><b>Existing Enum</b></em>' literal with the specified integer value.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static ExistingEnum get(int value)
+ {
+ switch (value)
+ {
+ case SAME_NAME_VALUE: return SAME_NAME;
+ case OVERRIDDEN_LITERAL_VALUE: return OVERRIDDEN_LITERAL;
+ case DIFFERENT_NAME_VALUE: return DIFFERENT_NAME;
+ }
+ return null;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private final int value;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private final String name;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private final String literal;
+
+ /**
+ * Only this class can construct instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private ExistingEnum(int value, String name, String literal)
+ {
+ this.value = value;
+ this.name = name;
+ this.literal = literal;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public int getValue()
+ {
+ return value;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getLiteral()
+ {
+ return literal;
+ }
+
+ /**
+ * Returns the literal value of the enumerator, which is its string representation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString()
+ {
+ return literal;
+ }
+
+} //ExistingEnum
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/enums/impl/EnumsFactoryImpl.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/enums/impl/EnumsFactoryImpl.java
new file mode 100644
index 0000000..ccc13b0
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/enums/impl/EnumsFactoryImpl.java
@@ -0,0 +1,154 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ */
+package enums.impl;
+
+import enums.*;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EDataType;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.impl.EFactoryImpl;
+
+import org.eclipse.emf.ecore.plugin.EcorePlugin;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Factory</b>.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class EnumsFactoryImpl extends EFactoryImpl implements EnumsFactory
+{
+ /**
+ * Creates the default factory implementation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static EnumsFactory init()
+ {
+ try
+ {
+ EnumsFactory theEnumsFactory = (EnumsFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.eclipse.org/2009/tmf/xtext/EnumRulesTestLanguage/imported");
+ if (theEnumsFactory != null)
+ {
+ return theEnumsFactory;
+ }
+ }
+ catch (Exception exception)
+ {
+ EcorePlugin.INSTANCE.log(exception);
+ }
+ return new EnumsFactoryImpl();
+ }
+
+ /**
+ * Creates an instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EnumsFactoryImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public EObject create(EClass eClass)
+ {
+ switch (eClass.getClassifierID())
+ {
+ default:
+ throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object createFromString(EDataType eDataType, String initialValue)
+ {
+ switch (eDataType.getClassifierID())
+ {
+ case EnumsPackage.EXISTING_ENUM:
+ return createExistingEnumFromString(eDataType, initialValue);
+ default:
+ throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String convertToString(EDataType eDataType, Object instanceValue)
+ {
+ switch (eDataType.getClassifierID())
+ {
+ case EnumsPackage.EXISTING_ENUM:
+ return convertExistingEnumToString(eDataType, instanceValue);
+ default:
+ throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ExistingEnum createExistingEnumFromString(EDataType eDataType, String initialValue)
+ {
+ ExistingEnum result = ExistingEnum.get(initialValue);
+ if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
+ return result;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String convertExistingEnumToString(EDataType eDataType, Object instanceValue)
+ {
+ return instanceValue == null ? null : instanceValue.toString();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EnumsPackage getEnumsPackage()
+ {
+ return (EnumsPackage)getEPackage();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @deprecated
+ * @generated
+ */
+ @Deprecated
+ public static EnumsPackage getPackage()
+ {
+ return EnumsPackage.eINSTANCE;
+ }
+
+} //EnumsFactoryImpl
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/enums/impl/EnumsPackageImpl.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/enums/impl/EnumsPackageImpl.java
new file mode 100644
index 0000000..89fbed0
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/enums/impl/EnumsPackageImpl.java
@@ -0,0 +1,188 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ */
+package enums.impl;
+
+import enums.EnumsFactory;
+import enums.EnumsPackage;
+import enums.ExistingEnum;
+
+import org.eclipse.emf.ecore.EEnum;
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.impl.EPackageImpl;
+
+import org.eclipse.xtext.enumrules.enumRulesTestLanguage.EnumRulesTestLanguagePackage;
+
+import org.eclipse.xtext.enumrules.enumRulesTestLanguage.impl.EnumRulesTestLanguagePackageImpl;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Package</b>.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class EnumsPackageImpl extends EPackageImpl implements EnumsPackage
+{
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EEnum existingEnumEEnum = null;
+
+ /**
+ * Creates an instance of the model <b>Package</b>, registered with
+ * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
+ * package URI value.
+ * <p>Note: the correct way to create the package is via the static
+ * factory method {@link #init init()}, which also performs
+ * initialization of the package, or returns the registered package,
+ * if one already exists.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.ecore.EPackage.Registry
+ * @see enums.EnumsPackage#eNS_URI
+ * @see #init()
+ * @generated
+ */
+ private EnumsPackageImpl()
+ {
+ super(eNS_URI, EnumsFactory.eINSTANCE);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static boolean isInited = false;
+
+ /**
+ * Creates, registers, and initializes the <b>Package</b> for this
+ * model, and for any others upon which it depends. Simple
+ * dependencies are satisfied by calling this method on all
+ * dependent packages before doing anything else. This method drives
+ * initialization for interdependent packages directly, in parallel
+ * with this package, itself.
+ * <p>Of this package and its interdependencies, all packages which
+ * have not yet been registered by their URI values are first created
+ * and registered. The packages are then initialized in two steps:
+ * meta-model objects for all of the packages are created before any
+ * are initialized, since one package's meta-model objects may refer to
+ * those of another.
+ * <p>Invocation of this method will not affect any packages that have
+ * already been initialized.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #eNS_URI
+ * @see #createPackageContents()
+ * @see #initializePackageContents()
+ * @generated
+ */
+ public static EnumsPackage init()
+ {
+ if (isInited) return (EnumsPackage)EPackage.Registry.INSTANCE.getEPackage(EnumsPackage.eNS_URI);
+
+ // Obtain or create and register package
+ EnumsPackageImpl theEnumsPackage = (EnumsPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof EnumsPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new EnumsPackageImpl());
+
+ isInited = true;
+
+ // Obtain or create and register interdependencies
+ EnumRulesTestLanguagePackageImpl theEnumRulesTestLanguagePackage = (EnumRulesTestLanguagePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(EnumRulesTestLanguagePackage.eNS_URI) instanceof EnumRulesTestLanguagePackageImpl ? EPackage.Registry.INSTANCE.getEPackage(EnumRulesTestLanguagePackage.eNS_URI) : EnumRulesTestLanguagePackage.eINSTANCE);
+
+ // Create package meta-data objects
+ theEnumsPackage.createPackageContents();
+ theEnumRulesTestLanguagePackage.createPackageContents();
+
+ // Initialize created meta-data
+ theEnumsPackage.initializePackageContents();
+ theEnumRulesTestLanguagePackage.initializePackageContents();
+
+ // Mark meta-data to indicate it can't be changed
+ theEnumsPackage.freeze();
+
+ return theEnumsPackage;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EEnum getExistingEnum()
+ {
+ return existingEnumEEnum;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EnumsFactory getEnumsFactory()
+ {
+ return (EnumsFactory)getEFactoryInstance();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private boolean isCreated = false;
+
+ /**
+ * Creates the meta-model objects for the package. This method is
+ * guarded to have no affect on any invocation but its first.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void createPackageContents()
+ {
+ if (isCreated) return;
+ isCreated = true;
+
+ // Create enums
+ existingEnumEEnum = createEEnum(EXISTING_ENUM);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private boolean isInitialized = false;
+
+ /**
+ * Complete the initialization of the package and its meta-model. This
+ * method is guarded to have no affect on any invocation but its first.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void initializePackageContents()
+ {
+ if (isInitialized) return;
+ isInitialized = true;
+
+ // Initialize package
+ setName(eNAME);
+ setNsPrefix(eNS_PREFIX);
+ setNsURI(eNS_URI);
+
+ // Initialize enums and add enum literals
+ initEEnum(existingEnumEEnum, ExistingEnum.class, "ExistingEnum");
+ addEEnumLiteral(existingEnumEEnum, ExistingEnum.SAME_NAME);
+ addEEnumLiteral(existingEnumEEnum, ExistingEnum.OVERRIDDEN_LITERAL);
+ addEEnumLiteral(existingEnumEEnum, ExistingEnum.DIFFERENT_NAME);
+
+ // Create resource
+ createResource(eNS_URI);
+ }
+
+} //EnumsPackageImpl
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/GenXtextGrammarTestLanguageScopeProvider.ext b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/GenXtextGrammarTestLanguageScopeProvider.ext
index cfa49ae..c7588c8 100644
--- a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/GenXtextGrammarTestLanguageScopeProvider.ext
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/GenXtextGrammarTestLanguageScopeProvider.ext
@@ -23,6 +23,18 @@ List[IScopedElement] scope_usedGrammars(Grammar this):
List[IScopedElement] scope_usedGrammars(emf::EObject this) :
allElements().collect(x | createScopedElement(x.referenceName(), x));
+List[IScopedElement] scope_hiddenTokens(Grammar this):
+ allElements().typeSelect(AbstractRule).collect(x | createScopedElement(x.referenceName(), x));
+
+List[IScopedElement] scope_hiddenTokens(emf::EObject this) :
+ allElements().collect(x | createScopedElement(x.referenceName(), x));
+
+List[IScopedElement] scope_hiddenTokens(ParserRule this):
+ allElements().typeSelect(AbstractRule).collect(x | createScopedElement(x.referenceName(), x));
+
+List[IScopedElement] scope_hiddenTokens(emf::EObject this) :
+ allElements().collect(x | createScopedElement(x.referenceName(), x));
+
List[IScopedElement] scope_rule(RuleCall this):
allElements().typeSelect(AbstractRule).collect(x | createScopedElement(x.referenceName(), x));
@@ -41,18 +53,6 @@ List[IScopedElement] scope_metamodel(TypeRef this):
List[IScopedElement] scope_metamodel(emf::EObject this) :
allElements().collect(x | createScopedElement(x.referenceName(), x));
-List[IScopedElement] scope_hiddenTokens(Grammar this):
- allElements().typeSelect(AbstractRule).collect(x | createScopedElement(x.referenceName(), x));
-
-List[IScopedElement] scope_hiddenTokens(emf::EObject this) :
- allElements().collect(x | createScopedElement(x.referenceName(), x));
-
-List[IScopedElement] scope_hiddenTokens(ParserRule this):
- allElements().typeSelect(AbstractRule).collect(x | createScopedElement(x.referenceName(), x));
-
-List[IScopedElement] scope_hiddenTokens(emf::EObject this) :
- allElements().collect(x | createScopedElement(x.referenceName(), x));
-
List[IScopedElement] scope_classifier(TypeRef this):
allElements().typeSelect(ecore::EClassifier).collect(x | createScopedElement(x.referenceName(), x));
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/AbstractEnumRulesTestLanguageRuntimeModule.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/AbstractEnumRulesTestLanguageRuntimeModule.java
new file mode 100644
index 0000000..d8f11a5
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/AbstractEnumRulesTestLanguageRuntimeModule.java
@@ -0,0 +1,91 @@
+
+/*
+ * generated by Xtext
+ */
+package org.eclipse.xtext.enumrules;
+
+import org.eclipse.xtext.Constants;
+import org.eclipse.xtext.service.DefaultRuntimeModule;
+
+import com.google.inject.Binder;
+import com.google.inject.name.Names;
+
+/**
+ * Manual modifications go to {org.eclipse.xtext.enumrules.EnumRulesTestLanguageRuntimeModule}
+ */
+public abstract class AbstractEnumRulesTestLanguageRuntimeModule extends DefaultRuntimeModule {
+
+ @Override
+ public void configure(Binder binder) {
+ super.configure(binder);
+ binder.bind(String.class).annotatedWith(Names.named(Constants.LANGUAGE_NAME)).toInstance(
+ "org.eclipse.xtext.enumrules.EnumRulesTestLanguage");
+ }
+
+
+
+ public Class<? extends org.eclipse.xtext.IGrammarAccess> bindIGrammarAccess() {
+ return org.eclipse.xtext.enumrules.services.EnumRulesTestLanguageGrammarAccess.class;
+ }
+
+
+ public Class<? extends org.eclipse.xtext.parser.packrat.IPackratParser> bindIPackratParser() {
+ return org.eclipse.xtext.enumrules.parser.packrat.EnumRulesTestLanguagePackratParser.class;
+ }
+
+
+ public Class<? extends org.eclipse.xtext.parsetree.reconstr.IParseTreeConstructor> bindIParseTreeConstructor() {
+ return org.eclipse.xtext.enumrules.parseTreeConstruction.EnumRulesTestLanguageParsetreeConstructor.class;
+ }
+
+ @org.eclipse.xtext.service.SingletonBinding
+ public Class<? extends org.eclipse.xtend.expression.ExecutionContext> bindExecutionContext() {
+ return org.eclipse.xtext.xtend.InjectableExecutionContext.class;
+ }
+
+ @org.eclipse.xtext.service.SingletonBinding
+ public Class<? extends org.eclipse.xtend.expression.ResourceManager> bindResourceManager() {
+ return org.eclipse.xtext.xtend.InjectableResourceManager.class;
+ }
+
+ @org.eclipse.xtext.service.SingletonBinding(eager=true)
+ public Class<? extends org.eclipse.xtext.enumrules.EnumRulesTestLanguageCheckValidator> bindEnumRulesTestLanguageCheckValidator() {
+ return org.eclipse.xtext.enumrules.EnumRulesTestLanguageCheckValidator.class;
+ }
+
+
+ public java.lang.ClassLoader bindClassLoader() {
+ return getClass().getClassLoader();
+ }
+
+
+ public Class<? extends org.eclipse.xtext.parser.antlr.IAntlrParser> bindIAntlrParser() {
+ return org.eclipse.xtext.enumrules.parser.antlr.EnumRulesTestLanguageParser.class;
+ }
+
+
+ public Class<? extends org.eclipse.xtext.parser.ITokenToStringConverter> bindITokenToStringConverter() {
+ return org.eclipse.xtext.parser.antlr.AntlrTokenToStringConverter.class;
+ }
+
+
+ public Class<? extends org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider> bindIAntlrTokenFileProvider() {
+ return org.eclipse.xtext.enumrules.parser.antlr.EnumRulesTestLanguageAntlrTokenFileProvider.class;
+ }
+
+
+ public Class<? extends org.eclipse.xtext.parser.antlr.Lexer> bindLexer() {
+ return org.eclipse.xtext.enumrules.parser.antlr.internal.InternalEnumRulesTestLanguageLexer.class;
+ }
+
+
+ public Class<? extends org.eclipse.xtext.parser.antlr.ITokenDefProvider> bindITokenDefProvider() {
+ return org.eclipse.xtext.parser.antlr.AntlrTokenDefProvider.class;
+ }
+
+
+ public Class<? extends org.eclipse.xtext.crossref.IScopeProvider> bindIScopeProvider() {
+ return org.eclipse.xtext.enumrules.EnumRulesTestLanguageScopeProvider.class;
+ }
+
+}
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/AbstractEnumRulesTestLanguageUiModule.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/AbstractEnumRulesTestLanguageUiModule.java
new file mode 100644
index 0000000..e6ed2a7
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/AbstractEnumRulesTestLanguageUiModule.java
@@ -0,0 +1,35 @@
+
+/*
+ * generated by Xtext
+ */
+package org.eclipse.xtext.enumrules;
+
+import org.eclipse.xtext.ui.common.service.DefaultUIModule;
+
+/**
+ * Manual modifications go to {org.eclipse.xtext.enumrules.EnumRulesTestLanguageUiModule}
+ */
+public abstract class AbstractEnumRulesTestLanguageUiModule extends DefaultUIModule {
+
+
+
+ public Class<? extends org.eclipse.xtext.ui.common.editor.syntaxcoloring.antlr.ITokenColorer> bindITokenColorer() {
+ return org.eclipse.xtext.ui.common.editor.syntaxcoloring.antlr.CommonAntlrTokenColorer.class;
+ }
+
+
+ public Class<? extends org.eclipse.jface.text.rules.ITokenScanner> bindITokenScanner() {
+ return org.eclipse.xtext.ui.common.editor.syntaxcoloring.antlr.AntlrTokenScanner.class;
+ }
+
+
+ public Class<? extends org.eclipse.xtext.ui.common.editor.syntaxcoloring.ITokenStyleProvider> bindITokenStyleProvider() {
+ return org.eclipse.xtext.ui.common.editor.syntaxcoloring.antlr.AntlrTokenStyleProvider.class;
+ }
+
+
+ public Class<? extends org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider> bindIProposalProvider() {
+ return org.eclipse.xtext.enumrules.EnumRulesTestLanguageProposalProvider.class;
+ }
+
+}
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/EnumRulesTestLanguage.ecore b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/EnumRulesTestLanguage.ecore
new file mode 100644
index 0000000..d490272
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/EnumRulesTestLanguage.ecore
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="ASCII"?>
+<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="enumRulesTestLanguage" nsURI="http://www.eclipse.org/2009/tmf/xtext/EnumRulesTest" nsPrefix="enumRulesTestLanguage">
+ <eClassifiers xsi:type="ecore:EClass" name="Model">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="existing">
+ <eType xsi:type="ecore:EEnum" href="classpath:/org/eclipse/xtext/enumrules/enums.ecore#//ExistingEnum"/>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="generated" eType="//GeneratedEnum"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EEnum" name="GeneratedEnum">
+ <eLiterals name="SameName" literal="SameName"/>
+ <eLiterals name="DifferentName" value="1" literal="DifferentLiteral"/>
+ </eClassifiers>
+</ecore:EPackage>
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/EnumRulesTestLanguage.genmodel b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/EnumRulesTestLanguage.genmodel
new file mode 100644
index 0000000..4169f20
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/EnumRulesTestLanguage.genmodel
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="ASCII"?>
+<genmodel:GenModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="../org.eclipse.xtext.ui.common.tests/src-gen" forceOverwrite="true" rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container" bundleManifest="false" complianceLevel="5.0" copyrightFields="false">
+ <genPackages prefix="EnumRulesTestLanguage" basePackage="org.eclipse.xtext.enumrules" disposableProviderFactory="true">
+ <ecorePackage href="EnumRulesTestLanguage.ecore#/"/>
+ <genEnums typeSafeEnumCompatible="false">
+ <ecoreEnum href="EnumRulesTestLanguage.ecore#//GeneratedEnum"/>
+ <genEnumLiterals>
+ <ecoreEnumLiteral href="EnumRulesTestLanguage.ecore#//GeneratedEnum/SameName"/>
+ </genEnumLiterals>
+ <genEnumLiterals>
+ <ecoreEnumLiteral href="EnumRulesTestLanguage.ecore#//GeneratedEnum/DifferentName"/>
+ </genEnumLiterals>
+ </genEnums>
+ <genClasses>
+ <ecoreClass href="EnumRulesTestLanguage.ecore#//Model"/>
+ <genFeatures createChild="false">
+ <ecoreFeature xsi:type="ecore:EAttribute" href="EnumRulesTestLanguage.ecore#//Model/existing"/>
+ </genFeatures>
+ <genFeatures createChild="false">
+ <ecoreFeature xsi:type="ecore:EAttribute" href="EnumRulesTestLanguage.ecore#//Model/generated"/>
+ </genFeatures>
+ </genClasses>
+ </genPackages>
+</genmodel:GenModel>
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/EnumRulesTestLanguage.xmi b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/EnumRulesTestLanguage.xmi
new file mode 100644
index 0000000..ab97b93
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/EnumRulesTestLanguage.xmi
@@ -0,0 +1,221 @@
+<?xml version="1.0" encoding="ASCII"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:xtext="http://www.eclipse.org/2008/Xtext">
+ <xtext:Grammar name="org.eclipse.xtext.enumrules.EnumRulesTestLanguage" usedGrammars="/1">
+ <metamodelDeclarations xsi:type="xtext:ReferencedMetamodel">
+ <ePackage href="http://www.eclipse.org/2009/tmf/xtext/EnumRulesTestLanguage/imported#/"/>
+ </metamodelDeclarations>
+ <metamodelDeclarations xsi:type="xtext:GeneratedMetamodel" name="enumRulesTestLanguage">
+ <ePackage href="http://www.eclipse.org/2009/tmf/xtext/EnumRulesTest#/"/>
+ </metamodelDeclarations>
+ <rules xsi:type="xtext:ParserRule" name="Model">
+ <type metamodel="/0/@metamodelDeclarations.1">
+ <classifier xsi:type="ecore:EClass" href="http://www.eclipse.org/2009/tmf/xtext/EnumRulesTest#//Model"/>
+ </type>
+ <alternatives xsi:type="xtext:Alternatives">
+ <groups xsi:type="xtext:Group">
+ <tokens xsi:type="xtext:Keyword" value="existing"/>
+ <tokens xsi:type="xtext:Assignment" feature="existing" operator="=">
+ <terminal xsi:type="xtext:RuleCall" rule="/0/@rules.1"/>
+ </tokens>
+ <tokens xsi:type="xtext:Group" cardinality="?">
+ <tokens xsi:type="xtext:Keyword" value="generated"/>
+ <tokens xsi:type="xtext:Assignment" feature="generated" operator="=">
+ <terminal xsi:type="xtext:RuleCall" rule="/0/@rules.2"/>
+ </tokens>
+ </tokens>
+ </groups>
+ <groups xsi:type="xtext:Group">
+ <tokens xsi:type="xtext:Keyword" value="generated"/>
+ <tokens xsi:type="xtext:Assignment" feature="generated" operator="=">
+ <terminal xsi:type="xtext:RuleCall" rule="/0/@rules.2"/>
+ </tokens>
+ </groups>
+ </alternatives>
+ </rules>
+ <rules xsi:type="xtext:EnumRule" name="ExistingEnum">
+ <type metamodel="/0/@metamodelDeclarations.0">
+ <classifier xsi:type="ecore:EEnum" href="http://www.eclipse.org/2009/tmf/xtext/EnumRulesTestLanguage/imported#//ExistingEnum"/>
+ </type>
+ <alternatives xsi:type="xtext:Alternatives">
+ <groups xsi:type="xtext:EnumLiteralDeclaration">
+ <enumLiteral href="http://www.eclipse.org/2009/tmf/xtext/EnumRulesTestLanguage/imported#//ExistingEnum/SameName"/>
+ <literal value="SameName"/>
+ </groups>
+ <groups xsi:type="xtext:EnumLiteralDeclaration">
+ <enumLiteral href="http://www.eclipse.org/2009/tmf/xtext/EnumRulesTestLanguage/imported#//ExistingEnum/OverriddenLiteral"/>
+ <literal value="overridden"/>
+ </groups>
+ <groups xsi:type="xtext:EnumLiteralDeclaration">
+ <enumLiteral href="http://www.eclipse.org/2009/tmf/xtext/EnumRulesTestLanguage/imported#//ExistingEnum/DifferentName"/>
+ <literal value="DifferentLiteral"/>
+ </groups>
+ </alternatives>
+ </rules>
+ <rules xsi:type="xtext:EnumRule" name="GeneratedEnum">
+ <type metamodel="/0/@metamodelDeclarations.1">
+ <classifier xsi:type="ecore:EEnum" href="http://www.eclipse.org/2009/tmf/xtext/EnumRulesTest#//GeneratedEnum"/>
+ </type>
+ <alternatives xsi:type="xtext:Alternatives">
+ <groups xsi:type="xtext:EnumLiteralDeclaration">
+ <enumLiteral href="http://www.eclipse.org/2009/tmf/xtext/EnumRulesTest#//GeneratedEnum/SameName"/>
+ <literal value="SameName"/>
+ </groups>
+ <groups xsi:type="xtext:EnumLiteralDeclaration">
+ <enumLiteral href="http://www.eclipse.org/2009/tmf/xtext/EnumRulesTest#//GeneratedEnum/DifferentName"/>
+ <literal value="DifferentLiteral"/>
+ </groups>
+ </alternatives>
+ </rules>
+ </xtext:Grammar>
+ <xtext:Grammar name="org.eclipse.xtext.common.Terminals" definesHiddenTokens="true" hiddenTokens="/1/@rules.5 /1/@rules.3 /1/@rules.4">
+ <metamodelDeclarations xsi:type="xtext:ReferencedMetamodel" alias="ecore">
+ <ePackage href="http://www.eclipse.org/emf/2002/Ecore#/"/>
+ </metamodelDeclarations>
+ <rules xsi:type="xtext:TerminalRule" name="ID">
+ <type metamodel="/1/@metamodelDeclarations.0">
+ <classifier xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </type>
+ <alternatives xsi:type="xtext:Group">
+ <tokens xsi:type="xtext:Keyword" cardinality="?" value="^"/>
+ <tokens xsi:type="xtext:Alternatives">
+ <groups xsi:type="xtext:CharacterRange">
+ <left value="a"/>
+ <right value="z"/>
+ </groups>
+ <groups xsi:type="xtext:CharacterRange">
+ <left value="A"/>
+ <right value="Z"/>
+ </groups>
+ <groups xsi:type="xtext:Keyword" value="_"/>
+ </tokens>
+ <tokens xsi:type="xtext:Alternatives" cardinality="*">
+ <groups xsi:type="xtext:CharacterRange">
+ <left value="a"/>
+ <right value="z"/>
+ </groups>
+ <groups xsi:type="xtext:CharacterRange">
+ <left value="A"/>
+ <right value="Z"/>
+ </groups>
+ <groups xsi:type="xtext:Keyword" value="_"/>
+ <groups xsi:type="xtext:CharacterRange">
+ <left value="0"/>
+ <right value="9"/>
+ </groups>
+ </tokens>
+ </alternatives>
+ </rules>
+ <rules xsi:type="xtext:TerminalRule" name="INT">
+ <type metamodel="/1/@metamodelDeclarations.0">
+ <classifier xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ </type>
+ <alternatives xsi:type="xtext:CharacterRange" cardinality="+">
+ <left value="0"/>
+ <right value="9"/>
+ </alternatives>
+ </rules>
+ <rules xsi:type="xtext:TerminalRule" name="STRING">
+ <type metamodel="/1/@metamodelDeclarations.0">
+ <classifier xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </type>
+ <alternatives xsi:type="xtext:Alternatives">
+ <groups xsi:type="xtext:Group">
+ <tokens xsi:type="xtext:Keyword" value="&quot;"/>
+ <tokens xsi:type="xtext:Alternatives" cardinality="*">
+ <groups xsi:type="xtext:Group">
+ <tokens xsi:type="xtext:Keyword" value="\"/>
+ <tokens xsi:type="xtext:Alternatives">
+ <groups xsi:type="xtext:Keyword" value="b"/>
+ <groups xsi:type="xtext:Keyword" value="t"/>
+ <groups xsi:type="xtext:Keyword" value="n"/>
+ <groups xsi:type="xtext:Keyword" value="f"/>
+ <groups xsi:type="xtext:Keyword" value="r"/>
+ <groups xsi:type="xtext:Keyword" value="&quot;"/>
+ <groups xsi:type="xtext:Keyword" value="'"/>
+ <groups xsi:type="xtext:Keyword" value="\"/>
+ </tokens>
+ </groups>
+ <groups xsi:type="xtext:NegatedToken">
+ <terminal xsi:type="xtext:Alternatives">
+ <groups xsi:type="xtext:Keyword" value="\"/>
+ <groups xsi:type="xtext:Keyword" value="&quot;"/>
+ </terminal>
+ </groups>
+ </tokens>
+ <tokens xsi:type="xtext:Keyword" value="&quot;"/>
+ </groups>
+ <groups xsi:type="xtext:Group">
+ <tokens xsi:type="xtext:Keyword" value="'"/>
+ <tokens xsi:type="xtext:Alternatives" cardinality="*">
+ <groups xsi:type="xtext:Group">
+ <tokens xsi:type="xtext:Keyword" value="\"/>
+ <tokens xsi:type="xtext:Alternatives">
+ <groups xsi:type="xtext:Keyword" value="b"/>
+ <groups xsi:type="xtext:Keyword" value="t"/>
+ <groups xsi:type="xtext:Keyword" value="n"/>
+ <groups xsi:type="xtext:Keyword" value="f"/>
+ <groups xsi:type="xtext:Keyword" value="r"/>
+ <groups xsi:type="xtext:Keyword" value="&quot;"/>
+ <groups xsi:type="xtext:Keyword" value="'"/>
+ <groups xsi:type="xtext:Keyword" value="\"/>
+ </tokens>
+ </groups>
+ <groups xsi:type="xtext:NegatedToken">
+ <terminal xsi:type="xtext:Alternatives">
+ <groups xsi:type="xtext:Keyword" value="\"/>
+ <groups xsi:type="xtext:Keyword" value="'"/>
+ </terminal>
+ </groups>
+ </tokens>
+ <tokens xsi:type="xtext:Keyword" value="'"/>
+ </groups>
+ </alternatives>
+ </rules>
+ <rules xsi:type="xtext:TerminalRule" name="ML_COMMENT">
+ <type metamodel="/1/@metamodelDeclarations.0">
+ <classifier xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </type>
+ <alternatives xsi:type="xtext:Group">
+ <tokens xsi:type="xtext:Keyword" value="/*"/>
+ <tokens xsi:type="xtext:UntilToken">
+ <terminal xsi:type="xtext:Keyword" value="*/"/>
+ </tokens>
+ </alternatives>
+ </rules>
+ <rules xsi:type="xtext:TerminalRule" name="SL_COMMENT">
+ <type metamodel="/1/@metamodelDeclarations.0">
+ <classifier xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </type>
+ <alternatives xsi:type="xtext:Group">
+ <tokens xsi:type="xtext:Keyword" value="//"/>
+ <tokens xsi:type="xtext:NegatedToken" cardinality="*">
+ <terminal xsi:type="xtext:Alternatives">
+ <groups xsi:type="xtext:Keyword" value="&#xA;"/>
+ <groups xsi:type="xtext:Keyword" value="&#xD;"/>
+ </terminal>
+ </tokens>
+ <tokens xsi:type="xtext:Group" cardinality="?">
+ <tokens xsi:type="xtext:Keyword" cardinality="?" value="&#xD;"/>
+ <tokens xsi:type="xtext:Keyword" value="&#xA;"/>
+ </tokens>
+ </alternatives>
+ </rules>
+ <rules xsi:type="xtext:TerminalRule" name="WS">
+ <type metamodel="/1/@metamodelDeclarations.0">
+ <classifier xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </type>
+ <alternatives xsi:type="xtext:Alternatives" cardinality="+">
+ <groups xsi:type="xtext:Keyword" value=" "/>
+ <groups xsi:type="xtext:Keyword" value="&#x9;"/>
+ <groups xsi:type="xtext:Keyword" value="&#xD;"/>
+ <groups xsi:type="xtext:Keyword" value="&#xA;"/>
+ </alternatives>
+ </rules>
+ <rules xsi:type="xtext:TerminalRule" name="ANY_OTHER">
+ <type metamodel="/1/@metamodelDeclarations.0">
+ <classifier xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </type>
+ <alternatives xsi:type="xtext:Wildcard"/>
+ </rules>
+ </xtext:Grammar>
+</xmi:XMI>
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/EnumRulesTestLanguageCheckValidator.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/EnumRulesTestLanguageCheckValidator.java
new file mode 100644
index 0000000..a6937b2
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/EnumRulesTestLanguageCheckValidator.java
@@ -0,0 +1,24 @@
+
+package org.eclipse.xtext.enumrules;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.xtext.validator.CheckType;
+
+public class EnumRulesTestLanguageCheckValidator extends org.eclipse.xtext.check.AbstractCheckValidator {
+
+ public EnumRulesTestLanguageCheckValidator() {
+ addCheckFile("org::eclipse::xtext::enumrules::EnumRulesTestLanguageChecks", CheckType.FAST);
+ }
+
+ @Override
+ protected List<? extends EPackage> getEPackages() {
+ List<EPackage> result = new ArrayList<EPackage>();
+
+ result.add(org.eclipse.xtext.enumrules.enumRulesTestLanguage.EnumRulesTestLanguagePackage.eINSTANCE);
+
+ return result;
+ }
+
+}
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/EnumRulesTestLanguageExecutableExtensionFactory.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/EnumRulesTestLanguageExecutableExtensionFactory.java
new file mode 100644
index 0000000..bf5a9d0
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/EnumRulesTestLanguageExecutableExtensionFactory.java
@@ -0,0 +1,45 @@
+
+/*
+ * generated by Xtext
+ */
+
+package org.eclipse.xtext.enumrules;
+
+import org.apache.log4j.Logger;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExecutableExtension;
+import org.eclipse.core.runtime.IExecutableExtensionFactory;
+import org.eclipse.core.runtime.Status;
+import org.osgi.framework.Bundle;
+
+/**
+ * generated
+ */
+public class EnumRulesTestLanguageExecutableExtensionFactory implements IExecutableExtensionFactory, IExecutableExtension {
+
+ private Logger log = Logger.getLogger(EnumRulesTestLanguageExecutableExtensionFactory.class);
+ private String clazzName;
+
+ public void setInitializationData(IConfigurationElement config, String propertyName, Object data)
+ throws CoreException {
+ if (data instanceof String) {
+ clazzName = (String) data;
+ }
+ else {
+ throw new IllegalArgumentException("couldn't handle passed data : "+data);
+ }
+ }
+
+ public Object create() throws CoreException {
+ Bundle bundle = org.eclipse.xtext.ui.common.tests.Activator.getInstance().getBundle();
+ try {
+ Class<?> class1 = bundle.loadClass(clazzName);
+ return org.eclipse.xtext.ui.common.tests.Activator.getInstance().getInjector("org.eclipse.xtext.enumrules.EnumRulesTestLanguage").getInstance(class1);
+ }
+ catch (Exception e) {
+ log.error(e);
+ throw new CoreException(new Status(Status.ERROR, bundle.getSymbolicName(), e.getMessage(),e));
+ }
+ }
+}
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/EnumRulesTestLanguageScopeProvider.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/EnumRulesTestLanguageScopeProvider.java
new file mode 100644
index 0000000..784cc5b
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/EnumRulesTestLanguageScopeProvider.java
@@ -0,0 +1,19 @@
+/*
+* generated by Xtext
+*/
+
+package org.eclipse.xtext.enumrules;
+
+import org.eclipse.xtext.xtend.crossref.AbstractXtendScopeProvider;
+
+/**
+ * An {@link IScopeProvider} that calls Xtend extensions.
+ */
+public class EnumRulesTestLanguageScopeProvider extends AbstractXtendScopeProvider {
+
+ @Override
+ protected String getMasterXtendFileName() {
+ return "org::eclipse::xtext::enumrules::EnumRulesTestLanguageScopeProvider";
+ }
+
+}
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/EnumRulesTestLanguageStandaloneSetup.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/EnumRulesTestLanguageStandaloneSetup.java
new file mode 100644
index 0000000..cd4122c
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/EnumRulesTestLanguageStandaloneSetup.java
@@ -0,0 +1,44 @@
+package org.eclipse.xtext.enumrules;
+
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.xtext.EcoreUtil2;
+import org.eclipse.xtext.ISetup;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.xtext.resource.IResourceFactory;
+
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+
+/**
+ * Generated from StandaloneSetup.xpt!
+ */
+public class EnumRulesTestLanguageStandaloneSetup implements ISetup {
+
+ public static void doSetup() {
+ new EnumRulesTestLanguageStandaloneSetup().createInjectorAndDoEMFRegistration();
+ }
+
+ public Injector createInjectorAndDoEMFRegistration() {
+ org.eclipse.xtext.common.TerminalsStandaloneSetup.doSetup();
+
+ Injector injector = createInjector();
+ register(injector);
+ return injector;
+ }
+
+ public Injector createInjector() {
+ return Guice.createInjector(new org.eclipse.xtext.enumrules.EnumRulesTestLanguageRuntimeModule());
+ }
+
+ public void register(Injector injector) {
+ if (!EPackage.Registry.INSTANCE.containsKey("http://www.eclipse.org/2009/tmf/xtext/EnumRulesTest")) {
+ EPackage.Registry.INSTANCE.put("http://www.eclipse.org/2009/tmf/xtext/EnumRulesTest", org.eclipse.xtext.enumrules.enumRulesTestLanguage.EnumRulesTestLanguagePackage.eINSTANCE);
+ }
+
+ org.eclipse.xtext.resource.IResourceFactory resourceFactory = injector.getInstance(org.eclipse.xtext.resource.IResourceFactory.class);
+ Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("enumrulestestlanguage", resourceFactory);
+
+ //TODO registration of EValidators should be added here, too
+
+ }
+}
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/GenEnumRulesTestLanguageProposalProvider.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/GenEnumRulesTestLanguageProposalProvider.java
new file mode 100644
index 0000000..5a4e296
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/GenEnumRulesTestLanguageProposalProvider.java
@@ -0,0 +1,70 @@
+/*
+* generated by Xtext
+*/
+package org.eclipse.xtext.enumrules;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.xtext.Assignment;
+import org.eclipse.xtext.CrossReference;
+import org.eclipse.xtext.RuleCall;
+import org.eclipse.xtext.ui.common.editor.contentassist.impl.AbstractJavaProposalProvider;
+import org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider;
+import org.eclipse.xtext.ui.common.editor.contentassist.IContentAssistContext;
+
+/**
+ * Represents a generated, default implementation of interface {@link IProposalProvider}.
+ * Mehtods are dynamically dispatched on the first parameter, i.e., you can override them
+ * with a more concrete subtype.
+ *
+ * @see org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider
+ */
+public class GenEnumRulesTestLanguageProposalProvider extends AbstractJavaProposalProvider {
+ //TODO remove this from template
+ private static final String UI_PLUGIN_ID = "ERROR_REMOVE_ME_FROM_TEMPLATE";
+
+ @Override
+ protected String getPluginId() {
+ return UI_PLUGIN_ID;
+ }
+
+
+
+ public List<? extends ICompletionProposal> completeModel_Existing(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeModel_Existing feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeModel_Generated(EObject model, Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeModel_Generated feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+
+
+ public List<? extends ICompletionProposal> complete(EObject model, RuleCall ruleCall, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ @Override
+ protected String getDefaultImageFilePath() {
+ return "icons/editor.gif";
+ }
+
+
+}
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/GenEnumRulesTestLanguageScopeProvider.ext b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/GenEnumRulesTestLanguageScopeProvider.ext
new file mode 100644
index 0000000..e3d9f3d
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/GenEnumRulesTestLanguageScopeProvider.ext
@@ -0,0 +1,19 @@
+/*
+* generated by Xtext
+*/
+
+import org::eclipse::xtext::crossref;
+
+import enums;
+import enumRulesTestLanguage;
+
+extension org::eclipse::xtext::xtend::crossref::ScopeProvider reexport;
+extension org::eclipse::xtend::util::stdlib::io;
+
+/**
+ * Represents a generated, default implementation of interface {@link IScopeProvider}.
+ *
+ * @see org.eclipse.xtext.ui.common.editor.contentassist.IScopeProvider
+ */
+
+
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/enumRulesTestLanguage/EnumRulesTestLanguageFactory.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/enumRulesTestLanguage/EnumRulesTestLanguageFactory.java
new file mode 100644
index 0000000..45539cb
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/enumRulesTestLanguage/EnumRulesTestLanguageFactory.java
@@ -0,0 +1,46 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ */
+package org.eclipse.xtext.enumrules.enumRulesTestLanguage;
+
+import org.eclipse.emf.ecore.EFactory;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Factory</b> for the model.
+ * It provides a create method for each non-abstract class of the model.
+ * <!-- end-user-doc -->
+ * @see org.eclipse.xtext.enumrules.enumRulesTestLanguage.EnumRulesTestLanguagePackage
+ * @generated
+ */
+public interface EnumRulesTestLanguageFactory extends EFactory
+{
+ /**
+ * The singleton instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EnumRulesTestLanguageFactory eINSTANCE = org.eclipse.xtext.enumrules.enumRulesTestLanguage.impl.EnumRulesTestLanguageFactoryImpl.init();
+
+ /**
+ * Returns a new object of class '<em>Model</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Model</em>'.
+ * @generated
+ */
+ Model createModel();
+
+ /**
+ * Returns the package supported by this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the package supported by this factory.
+ * @generated
+ */
+ EnumRulesTestLanguagePackage getEnumRulesTestLanguagePackage();
+
+} //EnumRulesTestLanguageFactory
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/enumRulesTestLanguage/EnumRulesTestLanguagePackage.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/enumRulesTestLanguage/EnumRulesTestLanguagePackage.java
new file mode 100644
index 0000000..403c3d2
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/enumRulesTestLanguage/EnumRulesTestLanguagePackage.java
@@ -0,0 +1,213 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ */
+package org.eclipse.xtext.enumrules.enumRulesTestLanguage;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EEnum;
+import org.eclipse.emf.ecore.EPackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Package</b> for the model.
+ * It contains accessors for the meta objects to represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ * @see org.eclipse.xtext.enumrules.enumRulesTestLanguage.EnumRulesTestLanguageFactory
+ * @model kind="package"
+ * @generated
+ */
+public interface EnumRulesTestLanguagePackage extends EPackage
+{
+ /**
+ * The package name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNAME = "enumRulesTestLanguage";
+
+ /**
+ * The package namespace URI.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNS_URI = "http://www.eclipse.org/2009/tmf/xtext/EnumRulesTest";
+
+ /**
+ * The package namespace name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNS_PREFIX = "enumRulesTestLanguage";
+
+ /**
+ * The singleton instance of the package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EnumRulesTestLanguagePackage eINSTANCE = org.eclipse.xtext.enumrules.enumRulesTestLanguage.impl.EnumRulesTestLanguagePackageImpl.init();
+
+ /**
+ * The meta object id for the '{@link org.eclipse.xtext.enumrules.enumRulesTestLanguage.impl.ModelImpl <em>Model</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.xtext.enumrules.enumRulesTestLanguage.impl.ModelImpl
+ * @see org.eclipse.xtext.enumrules.enumRulesTestLanguage.impl.EnumRulesTestLanguagePackageImpl#getModel()
+ * @generated
+ */
+ int MODEL = 0;
+
+ /**
+ * The feature id for the '<em><b>Existing</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int MODEL__EXISTING = 0;
+
+ /**
+ * The feature id for the '<em><b>Generated</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int MODEL__GENERATED = 1;
+
+ /**
+ * The number of structural features of the '<em>Model</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int MODEL_FEATURE_COUNT = 2;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.xtext.enumrules.enumRulesTestLanguage.GeneratedEnum <em>Generated Enum</em>}' enum.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.xtext.enumrules.enumRulesTestLanguage.GeneratedEnum
+ * @see org.eclipse.xtext.enumrules.enumRulesTestLanguage.impl.EnumRulesTestLanguagePackageImpl#getGeneratedEnum()
+ * @generated
+ */
+ int GENERATED_ENUM = 1;
+
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.xtext.enumrules.enumRulesTestLanguage.Model <em>Model</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Model</em>'.
+ * @see org.eclipse.xtext.enumrules.enumRulesTestLanguage.Model
+ * @generated
+ */
+ EClass getModel();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.xtext.enumrules.enumRulesTestLanguage.Model#getExisting <em>Existing</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Existing</em>'.
+ * @see org.eclipse.xtext.enumrules.enumRulesTestLanguage.Model#getExisting()
+ * @see #getModel()
+ * @generated
+ */
+ EAttribute getModel_Existing();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.xtext.enumrules.enumRulesTestLanguage.Model#getGenerated <em>Generated</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Generated</em>'.
+ * @see org.eclipse.xtext.enumrules.enumRulesTestLanguage.Model#getGenerated()
+ * @see #getModel()
+ * @generated
+ */
+ EAttribute getModel_Generated();
+
+ /**
+ * Returns the meta object for enum '{@link org.eclipse.xtext.enumrules.enumRulesTestLanguage.GeneratedEnum <em>Generated Enum</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for enum '<em>Generated Enum</em>'.
+ * @see org.eclipse.xtext.enumrules.enumRulesTestLanguage.GeneratedEnum
+ * @generated
+ */
+ EEnum getGeneratedEnum();
+
+ /**
+ * Returns the factory that creates the instances of the model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the factory that creates the instances of the model.
+ * @generated
+ */
+ EnumRulesTestLanguageFactory getEnumRulesTestLanguageFactory();
+
+ /**
+ * <!-- begin-user-doc -->
+ * Defines literals for the meta objects that represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ interface Literals
+ {
+ /**
+ * The meta object literal for the '{@link org.eclipse.xtext.enumrules.enumRulesTestLanguage.impl.ModelImpl <em>Model</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.xtext.enumrules.enumRulesTestLanguage.impl.ModelImpl
+ * @see org.eclipse.xtext.enumrules.enumRulesTestLanguage.impl.EnumRulesTestLanguagePackageImpl#getModel()
+ * @generated
+ */
+ EClass MODEL = eINSTANCE.getModel();
+
+ /**
+ * The meta object literal for the '<em><b>Existing</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute MODEL__EXISTING = eINSTANCE.getModel_Existing();
+
+ /**
+ * The meta object literal for the '<em><b>Generated</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute MODEL__GENERATED = eINSTANCE.getModel_Generated();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.xtext.enumrules.enumRulesTestLanguage.GeneratedEnum <em>Generated Enum</em>}' enum.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.xtext.enumrules.enumRulesTestLanguage.GeneratedEnum
+ * @see org.eclipse.xtext.enumrules.enumRulesTestLanguage.impl.EnumRulesTestLanguagePackageImpl#getGeneratedEnum()
+ * @generated
+ */
+ EEnum GENERATED_ENUM = eINSTANCE.getGeneratedEnum();
+
+ }
+
+} //EnumRulesTestLanguagePackage
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/enumRulesTestLanguage/GeneratedEnum.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/enumRulesTestLanguage/GeneratedEnum.java
new file mode 100644
index 0000000..794dcda
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/enumRulesTestLanguage/GeneratedEnum.java
@@ -0,0 +1,226 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ */
+package org.eclipse.xtext.enumrules.enumRulesTestLanguage;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.emf.common.util.Enumerator;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the literals of the enumeration '<em><b>Generated Enum</b></em>',
+ * and utility methods for working with them.
+ * <!-- end-user-doc -->
+ * @see org.eclipse.xtext.enumrules.enumRulesTestLanguage.EnumRulesTestLanguagePackage#getGeneratedEnum()
+ * @model
+ * @generated
+ */
+public enum GeneratedEnum implements Enumerator
+{
+ /**
+ * The '<em><b>Same Name</b></em>' literal object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #SAME_NAME_VALUE
+ * @generated
+ * @ordered
+ */
+ SAME_NAME(0, "SameName", "SameName"),
+
+ /**
+ * The '<em><b>Different Name</b></em>' literal object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #DIFFERENT_NAME_VALUE
+ * @generated
+ * @ordered
+ */
+ DIFFERENT_NAME(1, "DifferentName", "DifferentLiteral");
+
+ /**
+ * The '<em><b>Same Name</b></em>' literal value.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of '<em><b>Same Name</b></em>' literal object isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @see #SAME_NAME
+ * @model name="SameName"
+ * @generated
+ * @ordered
+ */
+ public static final int SAME_NAME_VALUE = 0;
+
+ /**
+ * The '<em><b>Different Name</b></em>' literal value.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of '<em><b>Different Name</b></em>' literal object isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @see #DIFFERENT_NAME
+ * @model name="DifferentName" literal="DifferentLiteral"
+ * @generated
+ * @ordered
+ */
+ public static final int DIFFERENT_NAME_VALUE = 1;
+
+ /**
+ * An array of all the '<em><b>Generated Enum</b></em>' enumerators.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static final GeneratedEnum[] VALUES_ARRAY =
+ new GeneratedEnum[]
+ {
+ SAME_NAME,
+ DIFFERENT_NAME,
+ };
+
+ /**
+ * A public read-only list of all the '<em><b>Generated Enum</b></em>' enumerators.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final List<GeneratedEnum> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
+
+ /**
+ * Returns the '<em><b>Generated Enum</b></em>' literal with the specified literal value.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static GeneratedEnum get(String literal)
+ {
+ for (int i = 0; i < VALUES_ARRAY.length; ++i)
+ {
+ GeneratedEnum result = VALUES_ARRAY[i];
+ if (result.toString().equals(literal))
+ {
+ return result;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Returns the '<em><b>Generated Enum</b></em>' literal with the specified name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static GeneratedEnum getByName(String name)
+ {
+ for (int i = 0; i < VALUES_ARRAY.length; ++i)
+ {
+ GeneratedEnum result = VALUES_ARRAY[i];
+ if (result.getName().equals(name))
+ {
+ return result;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Returns the '<em><b>Generated Enum</b></em>' literal with the specified integer value.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static GeneratedEnum get(int value)
+ {
+ switch (value)
+ {
+ case SAME_NAME_VALUE: return SAME_NAME;
+ case DIFFERENT_NAME_VALUE: return DIFFERENT_NAME;
+ }
+ return null;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private final int value;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private final String name;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private final String literal;
+
+ /**
+ * Only this class can construct instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private GeneratedEnum(int value, String name, String literal)
+ {
+ this.value = value;
+ this.name = name;
+ this.literal = literal;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public int getValue()
+ {
+ return value;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getLiteral()
+ {
+ return literal;
+ }
+
+ /**
+ * Returns the literal value of the enumerator, which is its string representation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString()
+ {
+ return literal;
+ }
+
+} //GeneratedEnum
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/enumRulesTestLanguage/Model.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/enumRulesTestLanguage/Model.java
new file mode 100644
index 0000000..7620cf4
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/enumRulesTestLanguage/Model.java
@@ -0,0 +1,89 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ */
+package org.eclipse.xtext.enumrules.enumRulesTestLanguage;
+
+import enums.ExistingEnum;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Model</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.xtext.enumrules.enumRulesTestLanguage.Model#getExisting <em>Existing</em>}</li>
+ * <li>{@link org.eclipse.xtext.enumrules.enumRulesTestLanguage.Model#getGenerated <em>Generated</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.xtext.enumrules.enumRulesTestLanguage.EnumRulesTestLanguagePackage#getModel()
+ * @model
+ * @generated
+ */
+public interface Model extends EObject
+{
+ /**
+ * Returns the value of the '<em><b>Existing</b></em>' attribute.
+ * The literals are from the enumeration {@link enums.ExistingEnum}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Existing</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Existing</em>' attribute.
+ * @see enums.ExistingEnum
+ * @see #setExisting(ExistingEnum)
+ * @see org.eclipse.xtext.enumrules.enumRulesTestLanguage.EnumRulesTestLanguagePackage#getModel_Existing()
+ * @model
+ * @generated
+ */
+ ExistingEnum getExisting();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.xtext.enumrules.enumRulesTestLanguage.Model#getExisting <em>Existing</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Existing</em>' attribute.
+ * @see enums.ExistingEnum
+ * @see #getExisting()
+ * @generated
+ */
+ void setExisting(ExistingEnum value);
+
+ /**
+ * Returns the value of the '<em><b>Generated</b></em>' attribute.
+ * The literals are from the enumeration {@link org.eclipse.xtext.enumrules.enumRulesTestLanguage.GeneratedEnum}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Generated</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Generated</em>' attribute.
+ * @see org.eclipse.xtext.enumrules.enumRulesTestLanguage.GeneratedEnum
+ * @see #setGenerated(GeneratedEnum)
+ * @see org.eclipse.xtext.enumrules.enumRulesTestLanguage.EnumRulesTestLanguagePackage#getModel_Generated()
+ * @model
+ * @generated
+ */
+ GeneratedEnum getGenerated();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.xtext.enumrules.enumRulesTestLanguage.Model#getGenerated <em>Generated</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Generated</em>' attribute.
+ * @see org.eclipse.xtext.enumrules.enumRulesTestLanguage.GeneratedEnum
+ * @see #getGenerated()
+ * @generated
+ */
+ void setGenerated(GeneratedEnum value);
+
+} // Model
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/enumRulesTestLanguage/impl/EnumRulesTestLanguageFactoryImpl.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/enumRulesTestLanguage/impl/EnumRulesTestLanguageFactoryImpl.java
new file mode 100644
index 0000000..10a362c
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/enumRulesTestLanguage/impl/EnumRulesTestLanguageFactoryImpl.java
@@ -0,0 +1,166 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ */
+package org.eclipse.xtext.enumrules.enumRulesTestLanguage.impl;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EDataType;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.impl.EFactoryImpl;
+
+import org.eclipse.emf.ecore.plugin.EcorePlugin;
+
+import org.eclipse.xtext.enumrules.enumRulesTestLanguage.*;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Factory</b>.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class EnumRulesTestLanguageFactoryImpl extends EFactoryImpl implements EnumRulesTestLanguageFactory
+{
+ /**
+ * Creates the default factory implementation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static EnumRulesTestLanguageFactory init()
+ {
+ try
+ {
+ EnumRulesTestLanguageFactory theEnumRulesTestLanguageFactory = (EnumRulesTestLanguageFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.eclipse.org/2009/tmf/xtext/EnumRulesTest");
+ if (theEnumRulesTestLanguageFactory != null)
+ {
+ return theEnumRulesTestLanguageFactory;
+ }
+ }
+ catch (Exception exception)
+ {
+ EcorePlugin.INSTANCE.log(exception);
+ }
+ return new EnumRulesTestLanguageFactoryImpl();
+ }
+
+ /**
+ * Creates an instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EnumRulesTestLanguageFactoryImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public EObject create(EClass eClass)
+ {
+ switch (eClass.getClassifierID())
+ {
+ case EnumRulesTestLanguagePackage.MODEL: return createModel();
+ default:
+ throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object createFromString(EDataType eDataType, String initialValue)
+ {
+ switch (eDataType.getClassifierID())
+ {
+ case EnumRulesTestLanguagePackage.GENERATED_ENUM:
+ return createGeneratedEnumFromString(eDataType, initialValue);
+ default:
+ throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String convertToString(EDataType eDataType, Object instanceValue)
+ {
+ switch (eDataType.getClassifierID())
+ {
+ case EnumRulesTestLanguagePackage.GENERATED_ENUM:
+ return convertGeneratedEnumToString(eDataType, instanceValue);
+ default:
+ throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Model createModel()
+ {
+ ModelImpl model = new ModelImpl();
+ return model;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public GeneratedEnum createGeneratedEnumFromString(EDataType eDataType, String initialValue)
+ {
+ GeneratedEnum result = GeneratedEnum.get(initialValue);
+ if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
+ return result;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String convertGeneratedEnumToString(EDataType eDataType, Object instanceValue)
+ {
+ return instanceValue == null ? null : instanceValue.toString();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EnumRulesTestLanguagePackage getEnumRulesTestLanguagePackage()
+ {
+ return (EnumRulesTestLanguagePackage)getEPackage();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @deprecated
+ * @generated
+ */
+ @Deprecated
+ public static EnumRulesTestLanguagePackage getPackage()
+ {
+ return EnumRulesTestLanguagePackage.eINSTANCE;
+ }
+
+} //EnumRulesTestLanguageFactoryImpl
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/enumRulesTestLanguage/impl/EnumRulesTestLanguagePackageImpl.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/enumRulesTestLanguage/impl/EnumRulesTestLanguagePackageImpl.java
new file mode 100644
index 0000000..db07649
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/enumRulesTestLanguage/impl/EnumRulesTestLanguagePackageImpl.java
@@ -0,0 +1,246 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ */
+package org.eclipse.xtext.enumrules.enumRulesTestLanguage.impl;
+
+import enums.EnumsPackage;
+
+import enums.impl.EnumsPackageImpl;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EEnum;
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.impl.EPackageImpl;
+
+import org.eclipse.xtext.enumrules.enumRulesTestLanguage.EnumRulesTestLanguageFactory;
+import org.eclipse.xtext.enumrules.enumRulesTestLanguage.EnumRulesTestLanguagePackage;
+import org.eclipse.xtext.enumrules.enumRulesTestLanguage.GeneratedEnum;
+import org.eclipse.xtext.enumrules.enumRulesTestLanguage.Model;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Package</b>.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class EnumRulesTestLanguagePackageImpl extends EPackageImpl implements EnumRulesTestLanguagePackage
+{
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass modelEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EEnum generatedEnumEEnum = null;
+
+ /**
+ * Creates an instance of the model <b>Package</b>, registered with
+ * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
+ * package URI value.
+ * <p>Note: the correct way to create the package is via the static
+ * factory method {@link #init init()}, which also performs
+ * initialization of the package, or returns the registered package,
+ * if one already exists.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.ecore.EPackage.Registry
+ * @see org.eclipse.xtext.enumrules.enumRulesTestLanguage.EnumRulesTestLanguagePackage#eNS_URI
+ * @see #init()
+ * @generated
+ */
+ private EnumRulesTestLanguagePackageImpl()
+ {
+ super(eNS_URI, EnumRulesTestLanguageFactory.eINSTANCE);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static boolean isInited = false;
+
+ /**
+ * Creates, registers, and initializes the <b>Package</b> for this
+ * model, and for any others upon which it depends. Simple
+ * dependencies are satisfied by calling this method on all
+ * dependent packages before doing anything else. This method drives
+ * initialization for interdependent packages directly, in parallel
+ * with this package, itself.
+ * <p>Of this package and its interdependencies, all packages which
+ * have not yet been registered by their URI values are first created
+ * and registered. The packages are then initialized in two steps:
+ * meta-model objects for all of the packages are created before any
+ * are initialized, since one package's meta-model objects may refer to
+ * those of another.
+ * <p>Invocation of this method will not affect any packages that have
+ * already been initialized.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #eNS_URI
+ * @see #createPackageContents()
+ * @see #initializePackageContents()
+ * @generated
+ */
+ public static EnumRulesTestLanguagePackage init()
+ {
+ if (isInited) return (EnumRulesTestLanguagePackage)EPackage.Registry.INSTANCE.getEPackage(EnumRulesTestLanguagePackage.eNS_URI);
+
+ // Obtain or create and register package
+ EnumRulesTestLanguagePackageImpl theEnumRulesTestLanguagePackage = (EnumRulesTestLanguagePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof EnumRulesTestLanguagePackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new EnumRulesTestLanguagePackageImpl());
+
+ isInited = true;
+
+ // Obtain or create and register interdependencies
+ EnumsPackageImpl theEnumsPackage = (EnumsPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(EnumsPackage.eNS_URI) instanceof EnumsPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(EnumsPackage.eNS_URI) : EnumsPackage.eINSTANCE);
+
+ // Create package meta-data objects
+ theEnumRulesTestLanguagePackage.createPackageContents();
+ theEnumsPackage.createPackageContents();
+
+ // Initialize created meta-data
+ theEnumRulesTestLanguagePackage.initializePackageContents();
+ theEnumsPackage.initializePackageContents();
+
+ // Mark meta-data to indicate it can't be changed
+ theEnumRulesTestLanguagePackage.freeze();
+
+ return theEnumRulesTestLanguagePackage;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getModel()
+ {
+ return modelEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getModel_Existing()
+ {
+ return (EAttribute)modelEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getModel_Generated()
+ {
+ return (EAttribute)modelEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EEnum getGeneratedEnum()
+ {
+ return generatedEnumEEnum;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EnumRulesTestLanguageFactory getEnumRulesTestLanguageFactory()
+ {
+ return (EnumRulesTestLanguageFactory)getEFactoryInstance();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private boolean isCreated = false;
+
+ /**
+ * Creates the meta-model objects for the package. This method is
+ * guarded to have no affect on any invocation but its first.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void createPackageContents()
+ {
+ if (isCreated) return;
+ isCreated = true;
+
+ // Create classes and their features
+ modelEClass = createEClass(MODEL);
+ createEAttribute(modelEClass, MODEL__EXISTING);
+ createEAttribute(modelEClass, MODEL__GENERATED);
+
+ // Create enums
+ generatedEnumEEnum = createEEnum(GENERATED_ENUM);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private boolean isInitialized = false;
+
+ /**
+ * Complete the initialization of the package and its meta-model. This
+ * method is guarded to have no affect on any invocation but its first.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void initializePackageContents()
+ {
+ if (isInitialized) return;
+ isInitialized = true;
+
+ // Initialize package
+ setName(eNAME);
+ setNsPrefix(eNS_PREFIX);
+ setNsURI(eNS_URI);
+
+ // Obtain other dependent packages
+ EnumsPackage theEnumsPackage = (EnumsPackage)EPackage.Registry.INSTANCE.getEPackage(EnumsPackage.eNS_URI);
+
+ // Create type parameters
+
+ // Set bounds for type parameters
+
+ // Add supertypes to classes
+
+ // Initialize classes and features; add operations and parameters
+ initEClass(modelEClass, Model.class, "Model", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getModel_Existing(), theEnumsPackage.getExistingEnum(), "existing", null, 0, 1, Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getModel_Generated(), this.getGeneratedEnum(), "generated", null, 0, 1, Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ // Initialize enums and add enum literals
+ initEEnum(generatedEnumEEnum, GeneratedEnum.class, "GeneratedEnum");
+ addEEnumLiteral(generatedEnumEEnum, GeneratedEnum.SAME_NAME);
+ addEEnumLiteral(generatedEnumEEnum, GeneratedEnum.DIFFERENT_NAME);
+
+ // Create resource
+ createResource(eNS_URI);
+ }
+
+} //EnumRulesTestLanguagePackageImpl
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/enumRulesTestLanguage/impl/ModelImpl.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/enumRulesTestLanguage/impl/ModelImpl.java
new file mode 100644
index 0000000..566975b
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/enumRulesTestLanguage/impl/ModelImpl.java
@@ -0,0 +1,239 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ */
+package org.eclipse.xtext.enumrules.enumRulesTestLanguage.impl;
+
+import enums.ExistingEnum;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.ecore.EClass;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
+
+import org.eclipse.xtext.enumrules.enumRulesTestLanguage.EnumRulesTestLanguagePackage;
+import org.eclipse.xtext.enumrules.enumRulesTestLanguage.GeneratedEnum;
+import org.eclipse.xtext.enumrules.enumRulesTestLanguage.Model;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Model</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.xtext.enumrules.enumRulesTestLanguage.impl.ModelImpl#getExisting <em>Existing</em>}</li>
+ * <li>{@link org.eclipse.xtext.enumrules.enumRulesTestLanguage.impl.ModelImpl#getGenerated <em>Generated</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class ModelImpl extends MinimalEObjectImpl.Container implements Model
+{
+ /**
+ * The default value of the '{@link #getExisting() <em>Existing</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getExisting()
+ * @generated
+ * @ordered
+ */
+ protected static final ExistingEnum EXISTING_EDEFAULT = ExistingEnum.SAME_NAME;
+
+ /**
+ * The cached value of the '{@link #getExisting() <em>Existing</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getExisting()
+ * @generated
+ * @ordered
+ */
+ protected ExistingEnum existing = EXISTING_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getGenerated() <em>Generated</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getGenerated()
+ * @generated
+ * @ordered
+ */
+ protected static final GeneratedEnum GENERATED_EDEFAULT = GeneratedEnum.SAME_NAME;
+
+ /**
+ * The cached value of the '{@link #getGenerated() <em>Generated</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getGenerated()
+ * @generated
+ * @ordered
+ */
+ protected GeneratedEnum generated = GENERATED_EDEFAULT;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ModelImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass()
+ {
+ return EnumRulesTestLanguagePackage.Literals.MODEL;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ExistingEnum getExisting()
+ {
+ return existing;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setExisting(ExistingEnum newExisting)
+ {
+ ExistingEnum oldExisting = existing;
+ existing = newExisting == null ? EXISTING_EDEFAULT : newExisting;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, EnumRulesTestLanguagePackage.MODEL__EXISTING, oldExisting, existing));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public GeneratedEnum getGenerated()
+ {
+ return generated;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setGenerated(GeneratedEnum newGenerated)
+ {
+ GeneratedEnum oldGenerated = generated;
+ generated = newGenerated == null ? GENERATED_EDEFAULT : newGenerated;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, EnumRulesTestLanguagePackage.MODEL__GENERATED, oldGenerated, generated));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType)
+ {
+ switch (featureID)
+ {
+ case EnumRulesTestLanguagePackage.MODEL__EXISTING:
+ return getExisting();
+ case EnumRulesTestLanguagePackage.MODEL__GENERATED:
+ return getGenerated();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue)
+ {
+ switch (featureID)
+ {
+ case EnumRulesTestLanguagePackage.MODEL__EXISTING:
+ setExisting((ExistingEnum)newValue);
+ return;
+ case EnumRulesTestLanguagePackage.MODEL__GENERATED:
+ setGenerated((GeneratedEnum)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID)
+ {
+ switch (featureID)
+ {
+ case EnumRulesTestLanguagePackage.MODEL__EXISTING:
+ setExisting(EXISTING_EDEFAULT);
+ return;
+ case EnumRulesTestLanguagePackage.MODEL__GENERATED:
+ setGenerated(GENERATED_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID)
+ {
+ switch (featureID)
+ {
+ case EnumRulesTestLanguagePackage.MODEL__EXISTING:
+ return existing != EXISTING_EDEFAULT;
+ case EnumRulesTestLanguagePackage.MODEL__GENERATED:
+ return generated != GENERATED_EDEFAULT;
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString()
+ {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (existing: ");
+ result.append(existing);
+ result.append(", generated: ");
+ result.append(generated);
+ result.append(')');
+ return result.toString();
+ }
+
+} //ModelImpl
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/enumRulesTestLanguage/util/EnumRulesTestLanguageAdapterFactory.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/enumRulesTestLanguage/util/EnumRulesTestLanguageAdapterFactory.java
new file mode 100644
index 0000000..14568dc
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/enumRulesTestLanguage/util/EnumRulesTestLanguageAdapterFactory.java
@@ -0,0 +1,135 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ */
+package org.eclipse.xtext.enumrules.enumRulesTestLanguage.util;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notifier;
+
+import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
+
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.xtext.enumrules.enumRulesTestLanguage.*;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Adapter Factory</b> for the model.
+ * It provides an adapter <code>createXXX</code> method for each class of the model.
+ * <!-- end-user-doc -->
+ * @see org.eclipse.xtext.enumrules.enumRulesTestLanguage.EnumRulesTestLanguagePackage
+ * @generated
+ */
+public class EnumRulesTestLanguageAdapterFactory extends AdapterFactoryImpl
+{
+ /**
+ * The cached model package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static EnumRulesTestLanguagePackage modelPackage;
+
+ /**
+ * Creates an instance of the adapter factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EnumRulesTestLanguageAdapterFactory()
+ {
+ if (modelPackage == null)
+ {
+ modelPackage = EnumRulesTestLanguagePackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Returns whether this factory is applicable for the type of the object.
+ * <!-- begin-user-doc -->
+ * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model.
+ * <!-- end-user-doc -->
+ * @return whether this factory is applicable for the type of the object.
+ * @generated
+ */
+ @Override
+ public boolean isFactoryForType(Object object)
+ {
+ if (object == modelPackage)
+ {
+ return true;
+ }
+ if (object instanceof EObject)
+ {
+ return ((EObject)object).eClass().getEPackage() == modelPackage;
+ }
+ return false;
+ }
+
+ /**
+ * The switch that delegates to the <code>createXXX</code> methods.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EnumRulesTestLanguageSwitch<Adapter> modelSwitch =
+ new EnumRulesTestLanguageSwitch<Adapter>()
+ {
+ @Override
+ public Adapter caseModel(Model object)
+ {
+ return createModelAdapter();
+ }
+ @Override
+ public Adapter defaultCase(EObject object)
+ {
+ return createEObjectAdapter();
+ }
+ };
+
+ /**
+ * Creates an adapter for the <code>target</code>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param target the object to adapt.
+ * @return the adapter for the <code>target</code>.
+ * @generated
+ */
+ @Override
+ public Adapter createAdapter(Notifier target)
+ {
+ return modelSwitch.doSwitch((EObject)target);
+ }
+
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.xtext.enumrules.enumRulesTestLanguage.Model <em>Model</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.xtext.enumrules.enumRulesTestLanguage.Model
+ * @generated
+ */
+ public Adapter createModelAdapter()
+ {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for the default case.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @generated
+ */
+ public Adapter createEObjectAdapter()
+ {
+ return null;
+ }
+
+} //EnumRulesTestLanguageAdapterFactory
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/enumRulesTestLanguage/util/EnumRulesTestLanguageSwitch.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/enumRulesTestLanguage/util/EnumRulesTestLanguageSwitch.java
new file mode 100644
index 0000000..9b412f1
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/enumRulesTestLanguage/util/EnumRulesTestLanguageSwitch.java
@@ -0,0 +1,141 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ */
+package org.eclipse.xtext.enumrules.enumRulesTestLanguage.util;
+
+import java.util.List;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.xtext.enumrules.enumRulesTestLanguage.*;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Switch</b> for the model's inheritance hierarchy.
+ * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
+ * to invoke the <code>caseXXX</code> method for each class of the model,
+ * starting with the actual class of the object
+ * and proceeding up the inheritance hierarchy
+ * until a non-null result is returned,
+ * which is the result of the switch.
+ * <!-- end-user-doc -->
+ * @see org.eclipse.xtext.enumrules.enumRulesTestLanguage.EnumRulesTestLanguagePackage
+ * @generated
+ */
+public class EnumRulesTestLanguageSwitch<T>
+{
+ /**
+ * The cached model package
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static EnumRulesTestLanguagePackage modelPackage;
+
+ /**
+ * Creates an instance of the switch.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EnumRulesTestLanguageSwitch()
+ {
+ if (modelPackage == null)
+ {
+ modelPackage = EnumRulesTestLanguagePackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the first non-null result returned by a <code>caseXXX</code> call.
+ * @generated
+ */
+ public T doSwitch(EObject theEObject)
+ {
+ return doSwitch(theEObject.eClass(), theEObject);
+ }
+
+ /**
+ * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the first non-null result returned by a <code>caseXXX</code> call.
+ * @generated
+ */
+ protected T doSwitch(EClass theEClass, EObject theEObject)
+ {
+ if (theEClass.eContainer() == modelPackage)
+ {
+ return doSwitch(theEClass.getClassifierID(), theEObject);
+ }
+ else
+ {
+ List<EClass> eSuperTypes = theEClass.getESuperTypes();
+ return
+ eSuperTypes.isEmpty() ?
+ defaultCase(theEObject) :
+ doSwitch(eSuperTypes.get(0), theEObject);
+ }
+ }
+
+ /**
+ * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the first non-null result returned by a <code>caseXXX</code> call.
+ * @generated
+ */
+ protected T doSwitch(int classifierID, EObject theEObject)
+ {
+ switch (classifierID)
+ {
+ case EnumRulesTestLanguagePackage.MODEL:
+ {
+ Model model = (Model)theEObject;
+ T result = caseModel(model);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ default: return defaultCase(theEObject);
+ }
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Model</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Model</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseModel(Model object)
+ {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch, but this is the last case anyway.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject)
+ * @generated
+ */
+ public T defaultCase(EObject object)
+ {
+ return null;
+ }
+
+} //EnumRulesTestLanguageSwitch
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parseTreeConstruction/EnumRulesTestLanguageParsetreeConstructor.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parseTreeConstruction/EnumRulesTestLanguageParsetreeConstructor.java
new file mode 100644
index 0000000..0e092e4
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parseTreeConstruction/EnumRulesTestLanguageParsetreeConstructor.java
@@ -0,0 +1,263 @@
+/*
+* generated by Xtext
+*/
+package org.eclipse.xtext.enumrules.parseTreeConstruction;
+
+//import org.apache.log4j.Logger;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.xtext.*;
+import org.eclipse.xtext.parsetree.reconstr.IInstanceDescription;
+import org.eclipse.xtext.parsetree.reconstr.impl.AbstractParseTreeConstructor;
+import org.eclipse.xtext.parsetree.reconstr.impl.AbstractParseTreeConstructor.AbstractToken.Solution;
+import org.eclipse.xtext.enumrules.services.EnumRulesTestLanguageGrammarAccess;
+
+import com.google.inject.Inject;
+
+public class EnumRulesTestLanguageParsetreeConstructor extends AbstractParseTreeConstructor {
+
+ @Inject
+ private EnumRulesTestLanguageGrammarAccess grammarAccess;
+
+ @Override
+ protected Solution internalSerialize(EObject obj) {
+ IInstanceDescription inst = getDescr(obj);
+ Solution s;
+ if(inst.isInstanceOf(grammarAccess.getModelRule().getType().getClassifier()) && (s = new Model_Alternatives(inst, null).firstSolution()) != null && isConsumed(s,null)) return s;
+ return null;
+ }
+
+
+/************ begin Rule Model ****************
+ *
+ * Model:
+ * "existing" existing=ExistingEnum ("generated" generated=GeneratedEnum)?|"generated" generated=GeneratedEnum;
+ *
+ **/
+
+// "existing" existing=ExistingEnum ("generated" generated=GeneratedEnum)?|"generated" generated=GeneratedEnum
+protected class Model_Alternatives extends AlternativesToken {
+
+ public Model_Alternatives(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ @Override
+ public Alternatives getGrammarElement() {
+ return grammarAccess.getModelAccess().getAlternatives();
+ }
+
+ protected AbstractToken createChild(int id) {
+ switch(id) {
+ case 0: return new Model_0_Group(current, this);
+ case 1: return new Model_1_Group(current, this);
+ default: return null;
+ }
+ }
+}
+
+// "existing" existing=ExistingEnum ("generated" generated=GeneratedEnum)?
+protected class Model_0_Group extends GroupToken {
+
+ public Model_0_Group(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ @Override
+ public Group getGrammarElement() {
+ return grammarAccess.getModelAccess().getGroup_0();
+ }
+
+ @Override
+ protected Solution createSolution() {
+ Solution s1 = new Model_0_2_Group(current, this).firstSolution();
+ while(s1 != null) {
+ Solution s2 = new Model_0_1_Assignment_existing(s1.getCurrent(), s1.getPredecessor()).firstSolution();
+ while(s2 != null) {
+ Solution s3 = new Model_0_0_Keyword_existing(s2.getCurrent(), s2.getPredecessor()).firstSolution();
+ if(s3 != null) {
+ last = s3.getPredecessor();
+ return s3;
+ } else {
+ s2 = s2.getPredecessor().nextSolution(this,s2);
+ }
+ }
+ s1 = s1.getPredecessor().nextSolution(this,s1);
+ }
+ return null;
+ }
+}
+
+// "existing"
+protected class Model_0_0_Keyword_existing extends KeywordToken {
+
+ public Model_0_0_Keyword_existing(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ public Keyword getGrammarElement() {
+ return grammarAccess.getModelAccess().getExistingKeyword_0_0();
+ }
+}
+
+// existing=ExistingEnum
+protected class Model_0_1_Assignment_existing extends AssignmentToken {
+
+ public Model_0_1_Assignment_existing(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ @Override
+ public Assignment getGrammarElement() {
+ return grammarAccess.getModelAccess().getExistingAssignment_0_1();
+ }
+
+ @Override
+ protected Solution createSolution() {
+ if((value = current.getConsumable("existing",IS_REQUIRED)) == null) return null;
+ IInstanceDescription obj = current.cloneAndConsume("existing");
+ if(Boolean.TRUE.booleanValue()) { // xtext::RuleCall FIXME: check if value is valid for datatype rule
+ type = AssignmentType.ERC;
+ element = grammarAccess.getModelAccess().getExistingExistingEnumEnumRuleCall_0_1_0();
+ return new Solution(obj);
+ }
+ return null;
+ }
+}
+
+// ("generated" generated=GeneratedEnum)?
+protected class Model_0_2_Group extends GroupToken {
+
+ public Model_0_2_Group(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, !IS_REQUIRED);
+ }
+
+ @Override
+ public Group getGrammarElement() {
+ return grammarAccess.getModelAccess().getGroup_0_2();
+ }
+
+ @Override
+ protected Solution createSolution() {
+ Solution s1 = new Model_0_2_1_Assignment_generated(current, this).firstSolution();
+ while(s1 != null) {
+ Solution s2 = new Model_0_2_0_Keyword_generated(s1.getCurrent(), s1.getPredecessor()).firstSolution();
+ if(s2 != null) {
+ last = s2.getPredecessor();
+ return s2;
+ } else {
+ s1 = s1.getPredecessor().nextSolution(this,s1);
+ }
+ }
+ return null;
+ }
+}
+
+// "generated"
+protected class Model_0_2_0_Keyword_generated extends KeywordToken {
+
+ public Model_0_2_0_Keyword_generated(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ public Keyword getGrammarElement() {
+ return grammarAccess.getModelAccess().getGeneratedKeyword_0_2_0();
+ }
+}
+
+// generated=GeneratedEnum
+protected class Model_0_2_1_Assignment_generated extends AssignmentToken {
+
+ public Model_0_2_1_Assignment_generated(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ @Override
+ public Assignment getGrammarElement() {
+ return grammarAccess.getModelAccess().getGeneratedAssignment_0_2_1();
+ }
+
+ @Override
+ protected Solution createSolution() {
+ if((value = current.getConsumable("generated",!IS_REQUIRED)) == null) return null;
+ IInstanceDescription obj = current.cloneAndConsume("generated");
+ if(Boolean.TRUE.booleanValue()) { // xtext::RuleCall FIXME: check if value is valid for datatype rule
+ type = AssignmentType.ERC;
+ element = grammarAccess.getModelAccess().getGeneratedGeneratedEnumEnumRuleCall_0_2_1_0();
+ return new Solution(obj);
+ }
+ return null;
+ }
+}
+
+
+
+// "generated" generated=GeneratedEnum
+protected class Model_1_Group extends GroupToken {
+
+ public Model_1_Group(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ @Override
+ public Group getGrammarElement() {
+ return grammarAccess.getModelAccess().getGroup_1();
+ }
+
+ @Override
+ protected Solution createSolution() {
+ Solution s1 = new Model_1_1_Assignment_generated(current, this).firstSolution();
+ while(s1 != null) {
+ Solution s2 = new Model_1_0_Keyword_generated(s1.getCurrent(), s1.getPredecessor()).firstSolution();
+ if(s2 != null) {
+ last = s2.getPredecessor();
+ return s2;
+ } else {
+ s1 = s1.getPredecessor().nextSolution(this,s1);
+ }
+ }
+ return null;
+ }
+}
+
+// "generated"
+protected class Model_1_0_Keyword_generated extends KeywordToken {
+
+ public Model_1_0_Keyword_generated(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ public Keyword getGrammarElement() {
+ return grammarAccess.getModelAccess().getGeneratedKeyword_1_0();
+ }
+}
+
+// generated=GeneratedEnum
+protected class Model_1_1_Assignment_generated extends AssignmentToken {
+
+ public Model_1_1_Assignment_generated(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ @Override
+ public Assignment getGrammarElement() {
+ return grammarAccess.getModelAccess().getGeneratedAssignment_1_1();
+ }
+
+ @Override
+ protected Solution createSolution() {
+ if((value = current.getConsumable("generated",IS_REQUIRED)) == null) return null;
+ IInstanceDescription obj = current.cloneAndConsume("generated");
+ if(Boolean.TRUE.booleanValue()) { // xtext::RuleCall FIXME: check if value is valid for datatype rule
+ type = AssignmentType.ERC;
+ element = grammarAccess.getModelAccess().getGeneratedGeneratedEnumEnumRuleCall_1_1_0();
+ return new Solution(obj);
+ }
+ return null;
+ }
+}
+
+
+
+/************ end Rule Model ****************/
+
+}
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/EnumRulesTestLanguageAntlrTokenFileProvider.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/EnumRulesTestLanguageAntlrTokenFileProvider.java
new file mode 100644
index 0000000..ded5198
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/EnumRulesTestLanguageAntlrTokenFileProvider.java
@@ -0,0 +1,15 @@
+/*
+* generated by Xtext
+*/
+package org.eclipse.xtext.enumrules.parser.antlr;
+
+import java.io.InputStream;
+import org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider;
+
+public class EnumRulesTestLanguageAntlrTokenFileProvider implements IAntlrTokenFileProvider {
+
+ public InputStream getAntlrTokenFile() {
+ ClassLoader classLoader = getClass().getClassLoader();
+ return classLoader.getResourceAsStream("org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.tokens");
+ }
+}
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/EnumRulesTestLanguageParser.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/EnumRulesTestLanguageParser.java
new file mode 100644
index 0000000..e84d2fb
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/EnumRulesTestLanguageParser.java
@@ -0,0 +1,56 @@
+/*
+* generated by Xtext
+*/
+package org.eclipse.xtext.enumrules.parser.antlr;
+
+import org.antlr.runtime.ANTLRInputStream;
+import org.eclipse.xtext.parser.antlr.ITokenDefProvider;
+import org.eclipse.xtext.parser.IParseResult;
+import org.eclipse.xtext.parser.ParseException;
+import org.eclipse.xtext.parser.antlr.XtextTokenStream;
+
+import com.google.inject.Inject;
+
+import org.eclipse.xtext.enumrules.parser.antlr.internal.InternalEnumRulesTestLanguageLexer;
+import org.eclipse.xtext.enumrules.parser.antlr.internal.InternalEnumRulesTestLanguageParser;
+
+import org.eclipse.xtext.enumrules.services.EnumRulesTestLanguageGrammarAccess;
+
+public class EnumRulesTestLanguageParser extends org.eclipse.xtext.parser.antlr.AbstractAntlrParser {
+
+ @Inject
+ protected ITokenDefProvider antlrTokenDefProvider;
+
+ @Inject
+ private EnumRulesTestLanguageGrammarAccess grammarAccess;
+
+ @Override
+ protected IParseResult parse(String ruleName, ANTLRInputStream in) {
+ org.eclipse.xtext.enumrules.parser.antlr.internal.InternalEnumRulesTestLanguageLexer lexer = new org.eclipse.xtext.enumrules.parser.antlr.internal.InternalEnumRulesTestLanguageLexer(in);
+ XtextTokenStream stream = new XtextTokenStream(lexer, antlrTokenDefProvider);
+ stream.setInitialHiddenTokens("RULE_WS", "RULE_ML_COMMENT", "RULE_SL_COMMENT");
+ org.eclipse.xtext.enumrules.parser.antlr.internal.InternalEnumRulesTestLanguageParser parser = new org.eclipse.xtext.enumrules.parser.antlr.internal.InternalEnumRulesTestLanguageParser(
+ stream, getElementFactory(), grammarAccess);
+ parser.setTokenTypeMap(antlrTokenDefProvider.getTokenDefMap());
+ try {
+ if(ruleName != null)
+ return parser.parse(ruleName);
+ return parser.parse();
+ } catch (Exception re) {
+ throw new ParseException(re.getMessage(),re);
+ }
+ }
+
+ @Override
+ protected String getDefaultRuleName() {
+ return "Model";
+ }
+
+ public EnumRulesTestLanguageGrammarAccess getGrammarAccess() {
+ return this.grammarAccess;
+ }
+
+ public void setGrammarAccess(EnumRulesTestLanguageGrammarAccess grammarAccess) {
+ this.grammarAccess = grammarAccess;
+ }
+}
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g
new file mode 100644
index 0000000..e11ab5d
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g
@@ -0,0 +1,228 @@
+/*
+* generated by Xtext
+*/
+grammar InternalEnumRulesTestLanguage;
+
+options {
+ superClass=AbstractInternalAntlrParser;
+}
+
+@lexer::header {
+package org.eclipse.xtext.enumrules.parser.antlr.internal;
+
+// Hack: Use our own Lexer superclass by means of import.
+// Currently there is no other way to specify the superclass for the lexer.
+import org.eclipse.xtext.parser.antlr.Lexer;
+}
+
+@parser::header {
+package org.eclipse.xtext.enumrules.parser.antlr.internal;
+
+import java.io.InputStream;
+import org.eclipse.xtext.*;
+import org.eclipse.xtext.parser.*;
+import org.eclipse.xtext.parser.impl.*;
+import org.eclipse.xtext.parsetree.*;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.common.util.Enumerator;
+import org.eclipse.xtext.parser.antlr.AbstractInternalAntlrParser;
+import org.eclipse.xtext.parser.antlr.XtextTokenStream;
+import org.eclipse.xtext.parser.antlr.XtextTokenStream.HiddenTokens;
+import org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken;
+import org.eclipse.xtext.conversion.ValueConverterException;
+import org.eclipse.xtext.enumrules.services.EnumRulesTestLanguageGrammarAccess;
+
+}
+
+@parser::members {
+
+ private EnumRulesTestLanguageGrammarAccess grammarAccess;
+
+ public InternalEnumRulesTestLanguageParser(TokenStream input, IAstFactory factory, EnumRulesTestLanguageGrammarAccess grammarAccess) {
+ super(input, factory, grammarAccess.getGrammar());
+ this.grammarAccess = grammarAccess;
+ }
+
+ @Override
+ protected InputStream getTokenFile() {
+ ClassLoader classLoader = getClass().getClassLoader();
+ return classLoader.getResourceAsStream("org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.tokens");
+ }
+
+ @Override
+ protected String getFirstRuleName() {
+ return "Model";
+ }
+}
+
+@rulecatch {
+ catch (RecognitionException re) {
+ recover(input,re);
+ appendSkippedTokens();
+ }
+}
+
+
+
+
+// Entry rule entryRuleModel
+entryRuleModel returns [EObject current=null] :
+ { currentNode = createCompositeNode(grammarAccess.getModelRule(), currentNode); }
+ iv_ruleModel=ruleModel
+ { $current=$iv_ruleModel.current; }
+ EOF
+;
+
+// Rule Model
+ruleModel returns [EObject current=null]
+ @init { EObject temp=null; setCurrentLookahead(); resetLookahead();
+ }
+ @after { resetLookahead();
+ lastConsumedNode = currentNode;
+ }:
+(('existing'
+ {
+ createLeafNode(grammarAccess.getModelAccess().getExistingKeyword_0_0(), null);
+ }
+(
+
+
+ {
+ currentNode=createCompositeNode(grammarAccess.getModelAccess().getExistingExistingEnumEnumRuleCall_0_1_0(), currentNode);
+ }
+ lv_existing_1=ruleExistingEnum
+ {
+ if ($current==null) {
+ $current = factory.create(grammarAccess.getModelRule().getType().getClassifier());
+ associateNodeWithAstElement(currentNode, $current);
+ }
+
+ try {
+ set($current, "existing", lv_existing_1, "ExistingEnum", lastConsumedNode);
+ } catch (ValueConverterException vce) {
+ handleValueConverterException(vce);
+ }
+ currentNode = currentNode.getParent();
+ }
+
+)('generated'
+ {
+ createLeafNode(grammarAccess.getModelAccess().getGeneratedKeyword_0_2_0(), null);
+ }
+(
+
+
+ {
+ currentNode=createCompositeNode(grammarAccess.getModelAccess().getGeneratedGeneratedEnumEnumRuleCall_0_2_1_0(), currentNode);
+ }
+ lv_generated_3=ruleGeneratedEnum
+ {
+ if ($current==null) {
+ $current = factory.create(grammarAccess.getModelRule().getType().getClassifier());
+ associateNodeWithAstElement(currentNode, $current);
+ }
+
+ try {
+ set($current, "generated", lv_generated_3, "GeneratedEnum", lastConsumedNode);
+ } catch (ValueConverterException vce) {
+ handleValueConverterException(vce);
+ }
+ currentNode = currentNode.getParent();
+ }
+
+))?)
+ |('generated'
+ {
+ createLeafNode(grammarAccess.getModelAccess().getGeneratedKeyword_1_0(), null);
+ }
+(
+
+
+ {
+ currentNode=createCompositeNode(grammarAccess.getModelAccess().getGeneratedGeneratedEnumEnumRuleCall_1_1_0(), currentNode);
+ }
+ lv_generated_5=ruleGeneratedEnum
+ {
+ if ($current==null) {
+ $current = factory.create(grammarAccess.getModelRule().getType().getClassifier());
+ associateNodeWithAstElement(currentNode, $current);
+ }
+
+ try {
+ set($current, "generated", lv_generated_5, "GeneratedEnum", lastConsumedNode);
+ } catch (ValueConverterException vce) {
+ handleValueConverterException(vce);
+ }
+ currentNode = currentNode.getParent();
+ }
+
+)));
+
+
+
+
+
+// Rule ExistingEnum
+ruleExistingEnum returns [Enumerator current=null]
+ @init { setCurrentLookahead(); resetLookahead(); }
+ @after { resetLookahead();
+ lastConsumedNode = currentNode;
+ }:
+(( 'SameName'
+ {
+ $current = grammarAccess.getExistingEnumAccess().getSameNameEnumLiteralDeclaration_0().getEnumLiteral().getInstance();
+ createLeafNode(grammarAccess.getExistingEnumAccess().getSameNameEnumLiteralDeclaration_0(), null);
+ }
+)
+ |( 'overridden'
+ {
+ $current = grammarAccess.getExistingEnumAccess().getOverriddenLiteralEnumLiteralDeclaration_1().getEnumLiteral().getInstance();
+ createLeafNode(grammarAccess.getExistingEnumAccess().getOverriddenLiteralEnumLiteralDeclaration_1(), null);
+ }
+)
+ |( 'DifferentLiteral'
+ {
+ $current = grammarAccess.getExistingEnumAccess().getDifferentNameEnumLiteralDeclaration_2().getEnumLiteral().getInstance();
+ createLeafNode(grammarAccess.getExistingEnumAccess().getDifferentNameEnumLiteralDeclaration_2(), null);
+ }
+));
+
+
+
+// Rule GeneratedEnum
+ruleGeneratedEnum returns [Enumerator current=null]
+ @init { setCurrentLookahead(); resetLookahead(); }
+ @after { resetLookahead();
+ lastConsumedNode = currentNode;
+ }:
+(( 'SameName'
+ {
+ $current = grammarAccess.getGeneratedEnumAccess().getSameNameEnumLiteralDeclaration_0().getEnumLiteral().getInstance();
+ createLeafNode(grammarAccess.getGeneratedEnumAccess().getSameNameEnumLiteralDeclaration_0(), null);
+ }
+)
+ |( 'DifferentLiteral'
+ {
+ $current = grammarAccess.getGeneratedEnumAccess().getDifferentNameEnumLiteralDeclaration_1().getEnumLiteral().getInstance();
+ createLeafNode(grammarAccess.getGeneratedEnumAccess().getDifferentNameEnumLiteralDeclaration_1(), null);
+ }
+));
+
+
+
+RULE_ID : '^'? ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'_'|'0'..'9')*;
+
+RULE_INT : ('0'..'9')+;
+
+RULE_STRING : ('\"' ('\\' ('b'|'t'|'n'|'f'|'r'|'\"'|'\''|'\\')|~(('\\'|'\"')))* '\"'|'\'' ('\\' ('b'|'t'|'n'|'f'|'r'|'\"'|'\''|'\\')|~(('\\'|'\'')))* '\'');
+
+RULE_ML_COMMENT : '/*' ( options {greedy=false;} : . )*'*/';
+
+RULE_SL_COMMENT : '//' ~(('\n'|'\r'))* ('\r'? '\n')?;
+
+RULE_WS : (' '|'\t'|'\r'|'\n')+;
+
+RULE_ANY_OTHER : .;
+
+
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.tokens b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.tokens
new file mode 100644
index 0000000..2df4f69
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.tokens
@@ -0,0 +1,12 @@
+RULE_ML_COMMENT=7
+RULE_ID=4
+RULE_WS=9
+RULE_INT=5
+RULE_STRING=6
+RULE_ANY_OTHER=10
+RULE_SL_COMMENT=8
+'generated'=12
+'SameName'=13
+'existing'=11
+'DifferentLiteral'=15
+'overridden'=14
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguageLexer.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguageLexer.java
new file mode 100644
index 0000000..079dd5e
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguageLexer.java
@@ -0,0 +1,1117 @@
+package org.eclipse.xtext.enumrules.parser.antlr.internal;
+
+// Hack: Use our own Lexer superclass by means of import.
+// Currently there is no other way to specify the superclass for the lexer.
+import org.eclipse.xtext.parser.antlr.Lexer;
+
+
+import org.antlr.runtime.*;
+import java.util.Stack;
+import java.util.List;
+import java.util.ArrayList;
+
+public class InternalEnumRulesTestLanguageLexer extends Lexer {
+ public static final int RULE_ML_COMMENT=7;
+ public static final int T14=14;
+ public static final int RULE_ID=4;
+ public static final int RULE_WS=9;
+ public static final int T11=11;
+ public static final int T15=15;
+ public static final int EOF=-1;
+ public static final int RULE_INT=5;
+ public static final int RULE_STRING=6;
+ public static final int T12=12;
+ public static final int Tokens=16;
+ public static final int RULE_ANY_OTHER=10;
+ public static final int RULE_SL_COMMENT=8;
+ public static final int T13=13;
+ public InternalEnumRulesTestLanguageLexer() {;}
+ public InternalEnumRulesTestLanguageLexer(CharStream input) {
+ super(input);
+ }
+ public String getGrammarFileName() { return "../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g"; }
+
+ // $ANTLR start T11
+ public final void mT11() throws RecognitionException {
+ try {
+ int _type = T11;
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:10:5: ( 'existing' )
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:10:7: 'existing'
+ {
+ match("existing");
+
+
+ }
+
+ this.type = _type;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end T11
+
+ // $ANTLR start T12
+ public final void mT12() throws RecognitionException {
+ try {
+ int _type = T12;
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:11:5: ( 'generated' )
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:11:7: 'generated'
+ {
+ match("generated");
+
+
+ }
+
+ this.type = _type;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end T12
+
+ // $ANTLR start T13
+ public final void mT13() throws RecognitionException {
+ try {
+ int _type = T13;
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:12:5: ( 'SameName' )
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:12:7: 'SameName'
+ {
+ match("SameName");
+
+
+ }
+
+ this.type = _type;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end T13
+
+ // $ANTLR start T14
+ public final void mT14() throws RecognitionException {
+ try {
+ int _type = T14;
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:13:5: ( 'overridden' )
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:13:7: 'overridden'
+ {
+ match("overridden");
+
+
+ }
+
+ this.type = _type;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end T14
+
+ // $ANTLR start T15
+ public final void mT15() throws RecognitionException {
+ try {
+ int _type = T15;
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:14:5: ( 'DifferentLiteral' )
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:14:7: 'DifferentLiteral'
+ {
+ match("DifferentLiteral");
+
+
+ }
+
+ this.type = _type;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end T15
+
+ // $ANTLR start RULE_ID
+ public final void mRULE_ID() throws RecognitionException {
+ try {
+ int _type = RULE_ID;
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:214:9: ( ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* )
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:214:11: ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )*
+ {
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:214:11: ( '^' )?
+ int alt1=2;
+ int LA1_0 = input.LA(1);
+
+ if ( (LA1_0=='^') ) {
+ alt1=1;
+ }
+ switch (alt1) {
+ case 1 :
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:214:11: '^'
+ {
+ match('^');
+
+ }
+ break;
+
+ }
+
+ if ( (input.LA(1)>='A' && input.LA(1)<='Z')||input.LA(1)=='_'||(input.LA(1)>='a' && input.LA(1)<='z') ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse =
+ new MismatchedSetException(null,input);
+ recover(mse); throw mse;
+ }
+
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:214:40: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )*
+ loop2:
+ do {
+ int alt2=2;
+ int LA2_0 = input.LA(1);
+
+ if ( ((LA2_0>='0' && LA2_0<='9')||(LA2_0>='A' && LA2_0<='Z')||LA2_0=='_'||(LA2_0>='a' && LA2_0<='z')) ) {
+ alt2=1;
+ }
+
+
+ switch (alt2) {
+ case 1 :
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:
+ {
+ if ( (input.LA(1)>='0' && input.LA(1)<='9')||(input.LA(1)>='A' && input.LA(1)<='Z')||input.LA(1)=='_'||(input.LA(1)>='a' && input.LA(1)<='z') ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse =
+ new MismatchedSetException(null,input);
+ recover(mse); throw mse;
+ }
+
+
+ }
+ break;
+
+ default :
+ break loop2;
+ }
+ } while (true);
+
+
+ }
+
+ this.type = _type;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end RULE_ID
+
+ // $ANTLR start RULE_INT
+ public final void mRULE_INT() throws RecognitionException {
+ try {
+ int _type = RULE_INT;
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:216:10: ( ( '0' .. '9' )+ )
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:216:12: ( '0' .. '9' )+
+ {
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:216:12: ( '0' .. '9' )+
+ int cnt3=0;
+ loop3:
+ do {
+ int alt3=2;
+ int LA3_0 = input.LA(1);
+
+ if ( ((LA3_0>='0' && LA3_0<='9')) ) {
+ alt3=1;
+ }
+
+
+ switch (alt3) {
+ case 1 :
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:216:13: '0' .. '9'
+ {
+ matchRange('0','9');
+
+ }
+ break;
+
+ default :
+ if ( cnt3 >= 1 ) break loop3;
+ EarlyExitException eee =
+ new EarlyExitException(3, input);
+ throw eee;
+ }
+ cnt3++;
+ } while (true);
+
+
+ }
+
+ this.type = _type;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end RULE_INT
+
+ // $ANTLR start RULE_STRING
+ public final void mRULE_STRING() throws RecognitionException {
+ try {
+ int _type = RULE_STRING;
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:218:13: ( ( '\\\"' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\\"' ) ) )* '\\\"' | '\\'' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) )
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:218:15: ( '\\\"' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\\"' ) ) )* '\\\"' | '\\'' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' )
+ {
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:218:15: ( '\\\"' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\\"' ) ) )* '\\\"' | '\\'' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' )
+ int alt6=2;
+ int LA6_0 = input.LA(1);
+
+ if ( (LA6_0=='\"') ) {
+ alt6=1;
+ }
+ else if ( (LA6_0=='\'') ) {
+ alt6=2;
+ }
+ else {
+ NoViableAltException nvae =
+ new NoViableAltException("218:15: ( '\\\"' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\\"' ) ) )* '\\\"' | '\\'' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' )", 6, 0, input);
+
+ throw nvae;
+ }
+ switch (alt6) {
+ case 1 :
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:218:16: '\\\"' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\\"' ) ) )* '\\\"'
+ {
+ match('\"');
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:218:21: ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\\"' ) ) )*
+ loop4:
+ do {
+ int alt4=3;
+ int LA4_0 = input.LA(1);
+
+ if ( (LA4_0=='\\') ) {
+ alt4=1;
+ }
+ else if ( ((LA4_0>='\u0000' && LA4_0<='!')||(LA4_0>='#' && LA4_0<='[')||(LA4_0>=']' && LA4_0<='\uFFFE')) ) {
+ alt4=2;
+ }
+
+
+ switch (alt4) {
+ case 1 :
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:218:22: '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' )
+ {
+ match('\\');
+ if ( input.LA(1)=='\"'||input.LA(1)=='\''||input.LA(1)=='\\'||input.LA(1)=='b'||input.LA(1)=='f'||input.LA(1)=='n'||input.LA(1)=='r'||input.LA(1)=='t' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse =
+ new MismatchedSetException(null,input);
+ recover(mse); throw mse;
+ }
+
+
+ }
+ break;
+ case 2 :
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:218:64: ~ ( ( '\\\\' | '\\\"' ) )
+ {
+ if ( (input.LA(1)>='\u0000' && input.LA(1)<='!')||(input.LA(1)>='#' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFE') ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse =
+ new MismatchedSetException(null,input);
+ recover(mse); throw mse;
+ }
+
+
+ }
+ break;
+
+ default :
+ break loop4;
+ }
+ } while (true);
+
+ match('\"');
+
+ }
+ break;
+ case 2 :
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:218:86: '\\'' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\'' ) ) )* '\\''
+ {
+ match('\'');
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:218:91: ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\'' ) ) )*
+ loop5:
+ do {
+ int alt5=3;
+ int LA5_0 = input.LA(1);
+
+ if ( (LA5_0=='\\') ) {
+ alt5=1;
+ }
+ else if ( ((LA5_0>='\u0000' && LA5_0<='&')||(LA5_0>='(' && LA5_0<='[')||(LA5_0>=']' && LA5_0<='\uFFFE')) ) {
+ alt5=2;
+ }
+
+
+ switch (alt5) {
+ case 1 :
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:218:92: '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' )
+ {
+ match('\\');
+ if ( input.LA(1)=='\"'||input.LA(1)=='\''||input.LA(1)=='\\'||input.LA(1)=='b'||input.LA(1)=='f'||input.LA(1)=='n'||input.LA(1)=='r'||input.LA(1)=='t' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse =
+ new MismatchedSetException(null,input);
+ recover(mse); throw mse;
+ }
+
+
+ }
+ break;
+ case 2 :
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:218:134: ~ ( ( '\\\\' | '\\'' ) )
+ {
+ if ( (input.LA(1)>='\u0000' && input.LA(1)<='&')||(input.LA(1)>='(' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFE') ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse =
+ new MismatchedSetException(null,input);
+ recover(mse); throw mse;
+ }
+
+
+ }
+ break;
+
+ default :
+ break loop5;
+ }
+ } while (true);
+
+ match('\'');
+
+ }
+ break;
+
+ }
+
+
+ }
+
+ this.type = _type;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end RULE_STRING
+
+ // $ANTLR start RULE_ML_COMMENT
+ public final void mRULE_ML_COMMENT() throws RecognitionException {
+ try {
+ int _type = RULE_ML_COMMENT;
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:220:17: ( '/*' ( options {greedy=false; } : . )* '*/' )
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:220:19: '/*' ( options {greedy=false; } : . )* '*/'
+ {
+ match("/*");
+
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:220:24: ( options {greedy=false; } : . )*
+ loop7:
+ do {
+ int alt7=2;
+ int LA7_0 = input.LA(1);
+
+ if ( (LA7_0=='*') ) {
+ int LA7_1 = input.LA(2);
+
+ if ( (LA7_1=='/') ) {
+ alt7=2;
+ }
+ else if ( ((LA7_1>='\u0000' && LA7_1<='.')||(LA7_1>='0' && LA7_1<='\uFFFE')) ) {
+ alt7=1;
+ }
+
+
+ }
+ else if ( ((LA7_0>='\u0000' && LA7_0<=')')||(LA7_0>='+' && LA7_0<='\uFFFE')) ) {
+ alt7=1;
+ }
+
+
+ switch (alt7) {
+ case 1 :
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:220:52: .
+ {
+ matchAny();
+
+ }
+ break;
+
+ default :
+ break loop7;
+ }
+ } while (true);
+
+ match("*/");
+
+
+ }
+
+ this.type = _type;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end RULE_ML_COMMENT
+
+ // $ANTLR start RULE_SL_COMMENT
+ public final void mRULE_SL_COMMENT() throws RecognitionException {
+ try {
+ int _type = RULE_SL_COMMENT;
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:222:17: ( '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? )
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:222:19: '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )?
+ {
+ match("//");
+
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:222:24: (~ ( ( '\\n' | '\\r' ) ) )*
+ loop8:
+ do {
+ int alt8=2;
+ int LA8_0 = input.LA(1);
+
+ if ( ((LA8_0>='\u0000' && LA8_0<='\t')||(LA8_0>='\u000B' && LA8_0<='\f')||(LA8_0>='\u000E' && LA8_0<='\uFFFE')) ) {
+ alt8=1;
+ }
+
+
+ switch (alt8) {
+ case 1 :
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:222:24: ~ ( ( '\\n' | '\\r' ) )
+ {
+ if ( (input.LA(1)>='\u0000' && input.LA(1)<='\t')||(input.LA(1)>='\u000B' && input.LA(1)<='\f')||(input.LA(1)>='\u000E' && input.LA(1)<='\uFFFE') ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse =
+ new MismatchedSetException(null,input);
+ recover(mse); throw mse;
+ }
+
+
+ }
+ break;
+
+ default :
+ break loop8;
+ }
+ } while (true);
+
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:222:40: ( ( '\\r' )? '\\n' )?
+ int alt10=2;
+ int LA10_0 = input.LA(1);
+
+ if ( (LA10_0=='\n'||LA10_0=='\r') ) {
+ alt10=1;
+ }
+ switch (alt10) {
+ case 1 :
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:222:41: ( '\\r' )? '\\n'
+ {
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:222:41: ( '\\r' )?
+ int alt9=2;
+ int LA9_0 = input.LA(1);
+
+ if ( (LA9_0=='\r') ) {
+ alt9=1;
+ }
+ switch (alt9) {
+ case 1 :
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:222:41: '\\r'
+ {
+ match('\r');
+
+ }
+ break;
+
+ }
+
+ match('\n');
+
+ }
+ break;
+
+ }
+
+
+ }
+
+ this.type = _type;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end RULE_SL_COMMENT
+
+ // $ANTLR start RULE_WS
+ public final void mRULE_WS() throws RecognitionException {
+ try {
+ int _type = RULE_WS;
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:224:9: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ )
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:224:11: ( ' ' | '\\t' | '\\r' | '\\n' )+
+ {
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:224:11: ( ' ' | '\\t' | '\\r' | '\\n' )+
+ int cnt11=0;
+ loop11:
+ do {
+ int alt11=2;
+ int LA11_0 = input.LA(1);
+
+ if ( ((LA11_0>='\t' && LA11_0<='\n')||LA11_0=='\r'||LA11_0==' ') ) {
+ alt11=1;
+ }
+
+
+ switch (alt11) {
+ case 1 :
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:
+ {
+ if ( (input.LA(1)>='\t' && input.LA(1)<='\n')||input.LA(1)=='\r'||input.LA(1)==' ' ) {
+ input.consume();
+
+ }
+ else {
+ MismatchedSetException mse =
+ new MismatchedSetException(null,input);
+ recover(mse); throw mse;
+ }
+
+
+ }
+ break;
+
+ default :
+ if ( cnt11 >= 1 ) break loop11;
+ EarlyExitException eee =
+ new EarlyExitException(11, input);
+ throw eee;
+ }
+ cnt11++;
+ } while (true);
+
+
+ }
+
+ this.type = _type;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end RULE_WS
+
+ // $ANTLR start RULE_ANY_OTHER
+ public final void mRULE_ANY_OTHER() throws RecognitionException {
+ try {
+ int _type = RULE_ANY_OTHER;
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:226:16: ( . )
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:226:18: .
+ {
+ matchAny();
+
+ }
+
+ this.type = _type;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end RULE_ANY_OTHER
+
+ public void mTokens() throws RecognitionException {
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:1:8: ( T11 | T12 | T13 | T14 | T15 | RULE_ID | RULE_INT | RULE_STRING | RULE_ML_COMMENT | RULE_SL_COMMENT | RULE_WS | RULE_ANY_OTHER )
+ int alt12=12;
+ int LA12_0 = input.LA(1);
+
+ if ( (LA12_0=='e') ) {
+ int LA12_1 = input.LA(2);
+
+ if ( (LA12_1=='x') ) {
+ int LA12_14 = input.LA(3);
+
+ if ( (LA12_14=='i') ) {
+ int LA12_25 = input.LA(4);
+
+ if ( (LA12_25=='s') ) {
+ int LA12_30 = input.LA(5);
+
+ if ( (LA12_30=='t') ) {
+ int LA12_35 = input.LA(6);
+
+ if ( (LA12_35=='i') ) {
+ int LA12_40 = input.LA(7);
+
+ if ( (LA12_40=='n') ) {
+ int LA12_45 = input.LA(8);
+
+ if ( (LA12_45=='g') ) {
+ int LA12_50 = input.LA(9);
+
+ if ( ((LA12_50>='0' && LA12_50<='9')||(LA12_50>='A' && LA12_50<='Z')||LA12_50=='_'||(LA12_50>='a' && LA12_50<='z')) ) {
+ alt12=6;
+ }
+ else {
+ alt12=1;}
+ }
+ else {
+ alt12=6;}
+ }
+ else {
+ alt12=6;}
+ }
+ else {
+ alt12=6;}
+ }
+ else {
+ alt12=6;}
+ }
+ else {
+ alt12=6;}
+ }
+ else {
+ alt12=6;}
+ }
+ else {
+ alt12=6;}
+ }
+ else if ( (LA12_0=='g') ) {
+ int LA12_2 = input.LA(2);
+
+ if ( (LA12_2=='e') ) {
+ int LA12_16 = input.LA(3);
+
+ if ( (LA12_16=='n') ) {
+ int LA12_26 = input.LA(4);
+
+ if ( (LA12_26=='e') ) {
+ int LA12_31 = input.LA(5);
+
+ if ( (LA12_31=='r') ) {
+ int LA12_36 = input.LA(6);
+
+ if ( (LA12_36=='a') ) {
+ int LA12_41 = input.LA(7);
+
+ if ( (LA12_41=='t') ) {
+ int LA12_46 = input.LA(8);
+
+ if ( (LA12_46=='e') ) {
+ int LA12_51 = input.LA(9);
+
+ if ( (LA12_51=='d') ) {
+ int LA12_56 = input.LA(10);
+
+ if ( ((LA12_56>='0' && LA12_56<='9')||(LA12_56>='A' && LA12_56<='Z')||LA12_56=='_'||(LA12_56>='a' && LA12_56<='z')) ) {
+ alt12=6;
+ }
+ else {
+ alt12=2;}
+ }
+ else {
+ alt12=6;}
+ }
+ else {
+ alt12=6;}
+ }
+ else {
+ alt12=6;}
+ }
+ else {
+ alt12=6;}
+ }
+ else {
+ alt12=6;}
+ }
+ else {
+ alt12=6;}
+ }
+ else {
+ alt12=6;}
+ }
+ else {
+ alt12=6;}
+ }
+ else if ( (LA12_0=='S') ) {
+ int LA12_3 = input.LA(2);
+
+ if ( (LA12_3=='a') ) {
+ int LA12_17 = input.LA(3);
+
+ if ( (LA12_17=='m') ) {
+ int LA12_27 = input.LA(4);
+
+ if ( (LA12_27=='e') ) {
+ int LA12_32 = input.LA(5);
+
+ if ( (LA12_32=='N') ) {
+ int LA12_37 = input.LA(6);
+
+ if ( (LA12_37=='a') ) {
+ int LA12_42 = input.LA(7);
+
+ if ( (LA12_42=='m') ) {
+ int LA12_47 = input.LA(8);
+
+ if ( (LA12_47=='e') ) {
+ int LA12_52 = input.LA(9);
+
+ if ( ((LA12_52>='0' && LA12_52<='9')||(LA12_52>='A' && LA12_52<='Z')||LA12_52=='_'||(LA12_52>='a' && LA12_52<='z')) ) {
+ alt12=6;
+ }
+ else {
+ alt12=3;}
+ }
+ else {
+ alt12=6;}
+ }
+ else {
+ alt12=6;}
+ }
+ else {
+ alt12=6;}
+ }
+ else {
+ alt12=6;}
+ }
+ else {
+ alt12=6;}
+ }
+ else {
+ alt12=6;}
+ }
+ else {
+ alt12=6;}
+ }
+ else if ( (LA12_0=='o') ) {
+ int LA12_4 = input.LA(2);
+
+ if ( (LA12_4=='v') ) {
+ int LA12_18 = input.LA(3);
+
+ if ( (LA12_18=='e') ) {
+ int LA12_28 = input.LA(4);
+
+ if ( (LA12_28=='r') ) {
+ int LA12_33 = input.LA(5);
+
+ if ( (LA12_33=='r') ) {
+ int LA12_38 = input.LA(6);
+
+ if ( (LA12_38=='i') ) {
+ int LA12_43 = input.LA(7);
+
+ if ( (LA12_43=='d') ) {
+ int LA12_48 = input.LA(8);
+
+ if ( (LA12_48=='d') ) {
+ int LA12_53 = input.LA(9);
+
+ if ( (LA12_53=='e') ) {
+ int LA12_58 = input.LA(10);
+
+ if ( (LA12_58=='n') ) {
+ int LA12_61 = input.LA(11);
+
+ if ( ((LA12_61>='0' && LA12_61<='9')||(LA12_61>='A' && LA12_61<='Z')||LA12_61=='_'||(LA12_61>='a' && LA12_61<='z')) ) {
+ alt12=6;
+ }
+ else {
+ alt12=4;}
+ }
+ else {
+ alt12=6;}
+ }
+ else {
+ alt12=6;}
+ }
+ else {
+ alt12=6;}
+ }
+ else {
+ alt12=6;}
+ }
+ else {
+ alt12=6;}
+ }
+ else {
+ alt12=6;}
+ }
+ else {
+ alt12=6;}
+ }
+ else {
+ alt12=6;}
+ }
+ else {
+ alt12=6;}
+ }
+ else if ( (LA12_0=='D') ) {
+ int LA12_5 = input.LA(2);
+
+ if ( (LA12_5=='i') ) {
+ int LA12_19 = input.LA(3);
+
+ if ( (LA12_19=='f') ) {
+ int LA12_29 = input.LA(4);
+
+ if ( (LA12_29=='f') ) {
+ int LA12_34 = input.LA(5);
+
+ if ( (LA12_34=='e') ) {
+ int LA12_39 = input.LA(6);
+
+ if ( (LA12_39=='r') ) {
+ int LA12_44 = input.LA(7);
+
+ if ( (LA12_44=='e') ) {
+ int LA12_49 = input.LA(8);
+
+ if ( (LA12_49=='n') ) {
+ int LA12_54 = input.LA(9);
+
+ if ( (LA12_54=='t') ) {
+ int LA12_59 = input.LA(10);
+
+ if ( (LA12_59=='L') ) {
+ int LA12_62 = input.LA(11);
+
+ if ( (LA12_62=='i') ) {
+ int LA12_64 = input.LA(12);
+
+ if ( (LA12_64=='t') ) {
+ int LA12_65 = input.LA(13);
+
+ if ( (LA12_65=='e') ) {
+ int LA12_66 = input.LA(14);
+
+ if ( (LA12_66=='r') ) {
+ int LA12_67 = input.LA(15);
+
+ if ( (LA12_67=='a') ) {
+ int LA12_68 = input.LA(16);
+
+ if ( (LA12_68=='l') ) {
+ int LA12_69 = input.LA(17);
+
+ if ( ((LA12_69>='0' && LA12_69<='9')||(LA12_69>='A' && LA12_69<='Z')||LA12_69=='_'||(LA12_69>='a' && LA12_69<='z')) ) {
+ alt12=6;
+ }
+ else {
+ alt12=5;}
+ }
+ else {
+ alt12=6;}
+ }
+ else {
+ alt12=6;}
+ }
+ else {
+ alt12=6;}
+ }
+ else {
+ alt12=6;}
+ }
+ else {
+ alt12=6;}
+ }
+ else {
+ alt12=6;}
+ }
+ else {
+ alt12=6;}
+ }
+ else {
+ alt12=6;}
+ }
+ else {
+ alt12=6;}
+ }
+ else {
+ alt12=6;}
+ }
+ else {
+ alt12=6;}
+ }
+ else {
+ alt12=6;}
+ }
+ else {
+ alt12=6;}
+ }
+ else {
+ alt12=6;}
+ }
+ else {
+ alt12=6;}
+ }
+ else if ( (LA12_0=='^') ) {
+ int LA12_6 = input.LA(2);
+
+ if ( ((LA12_6>='A' && LA12_6<='Z')||LA12_6=='_'||(LA12_6>='a' && LA12_6<='z')) ) {
+ alt12=6;
+ }
+ else {
+ alt12=12;}
+ }
+ else if ( ((LA12_0>='A' && LA12_0<='C')||(LA12_0>='E' && LA12_0<='R')||(LA12_0>='T' && LA12_0<='Z')||LA12_0=='_'||(LA12_0>='a' && LA12_0<='d')||LA12_0=='f'||(LA12_0>='h' && LA12_0<='n')||(LA12_0>='p' && LA12_0<='z')) ) {
+ alt12=6;
+ }
+ else if ( ((LA12_0>='0' && LA12_0<='9')) ) {
+ alt12=7;
+ }
+ else if ( (LA12_0=='\"') ) {
+ int LA12_9 = input.LA(2);
+
+ if ( ((LA12_9>='\u0000' && LA12_9<='\uFFFE')) ) {
+ alt12=8;
+ }
+ else {
+ alt12=12;}
+ }
+ else if ( (LA12_0=='\'') ) {
+ int LA12_10 = input.LA(2);
+
+ if ( ((LA12_10>='\u0000' && LA12_10<='\uFFFE')) ) {
+ alt12=8;
+ }
+ else {
+ alt12=12;}
+ }
+ else if ( (LA12_0=='/') ) {
+ switch ( input.LA(2) ) {
+ case '*':
+ {
+ alt12=9;
+ }
+ break;
+ case '/':
+ {
+ alt12=10;
+ }
+ break;
+ default:
+ alt12=12;}
+
+ }
+ else if ( ((LA12_0>='\t' && LA12_0<='\n')||LA12_0=='\r'||LA12_0==' ') ) {
+ alt12=11;
+ }
+ else if ( ((LA12_0>='\u0000' && LA12_0<='\b')||(LA12_0>='\u000B' && LA12_0<='\f')||(LA12_0>='\u000E' && LA12_0<='\u001F')||LA12_0=='!'||(LA12_0>='#' && LA12_0<='&')||(LA12_0>='(' && LA12_0<='.')||(LA12_0>=':' && LA12_0<='@')||(LA12_0>='[' && LA12_0<=']')||LA12_0=='`'||(LA12_0>='{' && LA12_0<='\uFFFE')) ) {
+ alt12=12;
+ }
+ else {
+ NoViableAltException nvae =
+ new NoViableAltException("1:1: Tokens : ( T11 | T12 | T13 | T14 | T15 | RULE_ID | RULE_INT | RULE_STRING | RULE_ML_COMMENT | RULE_SL_COMMENT | RULE_WS | RULE_ANY_OTHER );", 12, 0, input);
+
+ throw nvae;
+ }
+ switch (alt12) {
+ case 1 :
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:1:10: T11
+ {
+ mT11();
+
+ }
+ break;
+ case 2 :
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:1:14: T12
+ {
+ mT12();
+
+ }
+ break;
+ case 3 :
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:1:18: T13
+ {
+ mT13();
+
+ }
+ break;
+ case 4 :
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:1:22: T14
+ {
+ mT14();
+
+ }
+ break;
+ case 5 :
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:1:26: T15
+ {
+ mT15();
+
+ }
+ break;
+ case 6 :
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:1:30: RULE_ID
+ {
+ mRULE_ID();
+
+ }
+ break;
+ case 7 :
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:1:38: RULE_INT
+ {
+ mRULE_INT();
+
+ }
+ break;
+ case 8 :
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:1:47: RULE_STRING
+ {
+ mRULE_STRING();
+
+ }
+ break;
+ case 9 :
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:1:59: RULE_ML_COMMENT
+ {
+ mRULE_ML_COMMENT();
+
+ }
+ break;
+ case 10 :
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:1:75: RULE_SL_COMMENT
+ {
+ mRULE_SL_COMMENT();
+
+ }
+ break;
+ case 11 :
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:1:91: RULE_WS
+ {
+ mRULE_WS();
+
+ }
+ break;
+ case 12 :
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:1:99: RULE_ANY_OTHER
+ {
+ mRULE_ANY_OTHER();
+
+ }
+ break;
+
+ }
+
+ }
+
+
+
+
+} \ No newline at end of file
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguageParser.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguageParser.java
new file mode 100644
index 0000000..072b9ba
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguageParser.java
@@ -0,0 +1,499 @@
+package org.eclipse.xtext.enumrules.parser.antlr.internal;
+
+import java.io.InputStream;
+import org.eclipse.xtext.*;
+import org.eclipse.xtext.parser.*;
+import org.eclipse.xtext.parser.impl.*;
+import org.eclipse.xtext.parsetree.*;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.common.util.Enumerator;
+import org.eclipse.xtext.parser.antlr.AbstractInternalAntlrParser;
+import org.eclipse.xtext.parser.antlr.XtextTokenStream;
+import org.eclipse.xtext.parser.antlr.XtextTokenStream.HiddenTokens;
+import org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken;
+import org.eclipse.xtext.conversion.ValueConverterException;
+import org.eclipse.xtext.enumrules.services.EnumRulesTestLanguageGrammarAccess;
+
+
+
+import org.antlr.runtime.*;
+import java.util.Stack;
+import java.util.List;
+import java.util.ArrayList;
+
+public class InternalEnumRulesTestLanguageParser extends AbstractInternalAntlrParser {
+ public static final String[] tokenNames = new String[] {
+ "<invalid>", "<EOR>", "<DOWN>", "<UP>", "RULE_ID", "RULE_INT", "RULE_STRING", "RULE_ML_COMMENT", "RULE_SL_COMMENT", "RULE_WS", "RULE_ANY_OTHER", "'existing'", "'generated'", "'SameName'", "'overridden'", "'DifferentLiteral'"
+ };
+ public static final int RULE_ML_COMMENT=7;
+ public static final int RULE_ID=4;
+ public static final int RULE_WS=9;
+ public static final int EOF=-1;
+ public static final int RULE_INT=5;
+ public static final int RULE_STRING=6;
+ public static final int RULE_ANY_OTHER=10;
+ public static final int RULE_SL_COMMENT=8;
+
+ public InternalEnumRulesTestLanguageParser(TokenStream input) {
+ super(input);
+ }
+
+
+ public String[] getTokenNames() { return tokenNames; }
+ public String getGrammarFileName() { return "../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g"; }
+
+
+
+ private EnumRulesTestLanguageGrammarAccess grammarAccess;
+
+ public InternalEnumRulesTestLanguageParser(TokenStream input, IAstFactory factory, EnumRulesTestLanguageGrammarAccess grammarAccess) {
+ super(input, factory, grammarAccess.getGrammar());
+ this.grammarAccess = grammarAccess;
+ }
+
+ @Override
+ protected InputStream getTokenFile() {
+ ClassLoader classLoader = getClass().getClassLoader();
+ return classLoader.getResourceAsStream("org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.tokens");
+ }
+
+ @Override
+ protected String getFirstRuleName() {
+ return "Model";
+ }
+
+
+
+ // $ANTLR start entryRuleModel
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:70:1: entryRuleModel returns [EObject current=null] : iv_ruleModel= ruleModel EOF ;
+ public final EObject entryRuleModel() throws RecognitionException {
+ EObject current = null;
+
+ EObject iv_ruleModel = null;
+
+
+ try {
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:70:47: (iv_ruleModel= ruleModel EOF )
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:71:2: iv_ruleModel= ruleModel EOF
+ {
+ currentNode = createCompositeNode(grammarAccess.getModelRule(), currentNode);
+ pushFollow(FOLLOW_ruleModel_in_entryRuleModel71);
+ iv_ruleModel=ruleModel();
+ _fsp--;
+
+ current =iv_ruleModel;
+ match(input,EOF,FOLLOW_EOF_in_entryRuleModel81);
+
+ }
+
+ }
+
+ catch (RecognitionException re) {
+ recover(input,re);
+ appendSkippedTokens();
+ }
+ finally {
+ }
+ return current;
+ }
+ // $ANTLR end entryRuleModel
+
+
+ // $ANTLR start ruleModel
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:78:1: ruleModel returns [EObject current=null] : ( ( 'existing' (lv_existing_1= ruleExistingEnum ) ( 'generated' (lv_generated_3= ruleGeneratedEnum ) )? ) | ( 'generated' (lv_generated_5= ruleGeneratedEnum ) ) ) ;
+ public final EObject ruleModel() throws RecognitionException {
+ EObject current = null;
+
+ Enumerator lv_existing_1 = null;
+
+ Enumerator lv_generated_3 = null;
+
+ Enumerator lv_generated_5 = null;
+
+
+ EObject temp=null; setCurrentLookahead(); resetLookahead();
+
+ try {
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:83:6: ( ( ( 'existing' (lv_existing_1= ruleExistingEnum ) ( 'generated' (lv_generated_3= ruleGeneratedEnum ) )? ) | ( 'generated' (lv_generated_5= ruleGeneratedEnum ) ) ) )
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:84:1: ( ( 'existing' (lv_existing_1= ruleExistingEnum ) ( 'generated' (lv_generated_3= ruleGeneratedEnum ) )? ) | ( 'generated' (lv_generated_5= ruleGeneratedEnum ) ) )
+ {
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:84:1: ( ( 'existing' (lv_existing_1= ruleExistingEnum ) ( 'generated' (lv_generated_3= ruleGeneratedEnum ) )? ) | ( 'generated' (lv_generated_5= ruleGeneratedEnum ) ) )
+ int alt2=2;
+ int LA2_0 = input.LA(1);
+
+ if ( (LA2_0==11) ) {
+ alt2=1;
+ }
+ else if ( (LA2_0==12) ) {
+ alt2=2;
+ }
+ else {
+ NoViableAltException nvae =
+ new NoViableAltException("84:1: ( ( 'existing' (lv_existing_1= ruleExistingEnum ) ( 'generated' (lv_generated_3= ruleGeneratedEnum ) )? ) | ( 'generated' (lv_generated_5= ruleGeneratedEnum ) ) )", 2, 0, input);
+
+ throw nvae;
+ }
+ switch (alt2) {
+ case 1 :
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:84:2: ( 'existing' (lv_existing_1= ruleExistingEnum ) ( 'generated' (lv_generated_3= ruleGeneratedEnum ) )? )
+ {
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:84:2: ( 'existing' (lv_existing_1= ruleExistingEnum ) ( 'generated' (lv_generated_3= ruleGeneratedEnum ) )? )
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:84:3: 'existing' (lv_existing_1= ruleExistingEnum ) ( 'generated' (lv_generated_3= ruleGeneratedEnum ) )?
+ {
+ match(input,11,FOLLOW_11_in_ruleModel116);
+
+ createLeafNode(grammarAccess.getModelAccess().getExistingKeyword_0_0(), null);
+
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:88:1: (lv_existing_1= ruleExistingEnum )
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:91:6: lv_existing_1= ruleExistingEnum
+ {
+
+ currentNode=createCompositeNode(grammarAccess.getModelAccess().getExistingExistingEnumEnumRuleCall_0_1_0(), currentNode);
+
+ pushFollow(FOLLOW_ruleExistingEnum_in_ruleModel150);
+ lv_existing_1=ruleExistingEnum();
+ _fsp--;
+
+
+ if (current==null) {
+ current = factory.create(grammarAccess.getModelRule().getType().getClassifier());
+ associateNodeWithAstElement(currentNode, current);
+ }
+
+ try {
+ set(current, "existing", lv_existing_1, "ExistingEnum", lastConsumedNode);
+ } catch (ValueConverterException vce) {
+ handleValueConverterException(vce);
+ }
+ currentNode = currentNode.getParent();
+
+
+ }
+
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:109:2: ( 'generated' (lv_generated_3= ruleGeneratedEnum ) )?
+ int alt1=2;
+ int LA1_0 = input.LA(1);
+
+ if ( (LA1_0==12) ) {
+ alt1=1;
+ }
+ switch (alt1) {
+ case 1 :
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:109:3: 'generated' (lv_generated_3= ruleGeneratedEnum )
+ {
+ match(input,12,FOLLOW_12_in_ruleModel164);
+
+ createLeafNode(grammarAccess.getModelAccess().getGeneratedKeyword_0_2_0(), null);
+
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:113:1: (lv_generated_3= ruleGeneratedEnum )
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:116:6: lv_generated_3= ruleGeneratedEnum
+ {
+
+ currentNode=createCompositeNode(grammarAccess.getModelAccess().getGeneratedGeneratedEnumEnumRuleCall_0_2_1_0(), currentNode);
+
+ pushFollow(FOLLOW_ruleGeneratedEnum_in_ruleModel198);
+ lv_generated_3=ruleGeneratedEnum();
+ _fsp--;
+
+
+ if (current==null) {
+ current = factory.create(grammarAccess.getModelRule().getType().getClassifier());
+ associateNodeWithAstElement(currentNode, current);
+ }
+
+ try {
+ set(current, "generated", lv_generated_3, "GeneratedEnum", lastConsumedNode);
+ } catch (ValueConverterException vce) {
+ handleValueConverterException(vce);
+ }
+ currentNode = currentNode.getParent();
+
+
+ }
+
+
+ }
+ break;
+
+ }
+
+
+ }
+
+
+ }
+ break;
+ case 2 :
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:135:6: ( 'generated' (lv_generated_5= ruleGeneratedEnum ) )
+ {
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:135:6: ( 'generated' (lv_generated_5= ruleGeneratedEnum ) )
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:135:7: 'generated' (lv_generated_5= ruleGeneratedEnum )
+ {
+ match(input,12,FOLLOW_12_in_ruleModel221);
+
+ createLeafNode(grammarAccess.getModelAccess().getGeneratedKeyword_1_0(), null);
+
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:139:1: (lv_generated_5= ruleGeneratedEnum )
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:142:6: lv_generated_5= ruleGeneratedEnum
+ {
+
+ currentNode=createCompositeNode(grammarAccess.getModelAccess().getGeneratedGeneratedEnumEnumRuleCall_1_1_0(), currentNode);
+
+ pushFollow(FOLLOW_ruleGeneratedEnum_in_ruleModel255);
+ lv_generated_5=ruleGeneratedEnum();
+ _fsp--;
+
+
+ if (current==null) {
+ current = factory.create(grammarAccess.getModelRule().getType().getClassifier());
+ associateNodeWithAstElement(currentNode, current);
+ }
+
+ try {
+ set(current, "generated", lv_generated_5, "GeneratedEnum", lastConsumedNode);
+ } catch (ValueConverterException vce) {
+ handleValueConverterException(vce);
+ }
+ currentNode = currentNode.getParent();
+
+
+ }
+
+
+ }
+
+
+ }
+ break;
+
+ }
+
+
+ }
+
+ resetLookahead();
+ lastConsumedNode = currentNode;
+
+ }
+
+ catch (RecognitionException re) {
+ recover(input,re);
+ appendSkippedTokens();
+ }
+ finally {
+ }
+ return current;
+ }
+ // $ANTLR end ruleModel
+
+
+ // $ANTLR start ruleExistingEnum
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:167:1: ruleExistingEnum returns [Enumerator current=null] : ( ( 'SameName' ) | ( 'overridden' ) | ( 'DifferentLiteral' ) ) ;
+ public final Enumerator ruleExistingEnum() throws RecognitionException {
+ Enumerator current = null;
+
+ setCurrentLookahead(); resetLookahead();
+ try {
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:171:6: ( ( ( 'SameName' ) | ( 'overridden' ) | ( 'DifferentLiteral' ) ) )
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:172:1: ( ( 'SameName' ) | ( 'overridden' ) | ( 'DifferentLiteral' ) )
+ {
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:172:1: ( ( 'SameName' ) | ( 'overridden' ) | ( 'DifferentLiteral' ) )
+ int alt3=3;
+ switch ( input.LA(1) ) {
+ case 13:
+ {
+ alt3=1;
+ }
+ break;
+ case 14:
+ {
+ alt3=2;
+ }
+ break;
+ case 15:
+ {
+ alt3=3;
+ }
+ break;
+ default:
+ NoViableAltException nvae =
+ new NoViableAltException("172:1: ( ( 'SameName' ) | ( 'overridden' ) | ( 'DifferentLiteral' ) )", 3, 0, input);
+
+ throw nvae;
+ }
+
+ switch (alt3) {
+ case 1 :
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:172:2: ( 'SameName' )
+ {
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:172:2: ( 'SameName' )
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:172:4: 'SameName'
+ {
+ match(input,13,FOLLOW_13_in_ruleExistingEnum307);
+
+ current = grammarAccess.getExistingEnumAccess().getSameNameEnumLiteralDeclaration_0().getEnumLiteral().getInstance();
+ createLeafNode(grammarAccess.getExistingEnumAccess().getSameNameEnumLiteralDeclaration_0(), null);
+
+
+ }
+
+
+ }
+ break;
+ case 2 :
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:178:6: ( 'overridden' )
+ {
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:178:6: ( 'overridden' )
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:178:8: 'overridden'
+ {
+ match(input,14,FOLLOW_14_in_ruleExistingEnum322);
+
+ current = grammarAccess.getExistingEnumAccess().getOverriddenLiteralEnumLiteralDeclaration_1().getEnumLiteral().getInstance();
+ createLeafNode(grammarAccess.getExistingEnumAccess().getOverriddenLiteralEnumLiteralDeclaration_1(), null);
+
+
+ }
+
+
+ }
+ break;
+ case 3 :
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:184:6: ( 'DifferentLiteral' )
+ {
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:184:6: ( 'DifferentLiteral' )
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:184:8: 'DifferentLiteral'
+ {
+ match(input,15,FOLLOW_15_in_ruleExistingEnum337);
+
+ current = grammarAccess.getExistingEnumAccess().getDifferentNameEnumLiteralDeclaration_2().getEnumLiteral().getInstance();
+ createLeafNode(grammarAccess.getExistingEnumAccess().getDifferentNameEnumLiteralDeclaration_2(), null);
+
+
+ }
+
+
+ }
+ break;
+
+ }
+
+
+ }
+
+ resetLookahead();
+ lastConsumedNode = currentNode;
+
+ }
+
+ catch (RecognitionException re) {
+ recover(input,re);
+ appendSkippedTokens();
+ }
+ finally {
+ }
+ return current;
+ }
+ // $ANTLR end ruleExistingEnum
+
+
+ // $ANTLR start ruleGeneratedEnum
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:194:1: ruleGeneratedEnum returns [Enumerator current=null] : ( ( 'SameName' ) | ( 'DifferentLiteral' ) ) ;
+ public final Enumerator ruleGeneratedEnum() throws RecognitionException {
+ Enumerator current = null;
+
+ setCurrentLookahead(); resetLookahead();
+ try {
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:198:6: ( ( ( 'SameName' ) | ( 'DifferentLiteral' ) ) )
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:199:1: ( ( 'SameName' ) | ( 'DifferentLiteral' ) )
+ {
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:199:1: ( ( 'SameName' ) | ( 'DifferentLiteral' ) )
+ int alt4=2;
+ int LA4_0 = input.LA(1);
+
+ if ( (LA4_0==13) ) {
+ alt4=1;
+ }
+ else if ( (LA4_0==15) ) {
+ alt4=2;
+ }
+ else {
+ NoViableAltException nvae =
+ new NoViableAltException("199:1: ( ( 'SameName' ) | ( 'DifferentLiteral' ) )", 4, 0, input);
+
+ throw nvae;
+ }
+ switch (alt4) {
+ case 1 :
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:199:2: ( 'SameName' )
+ {
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:199:2: ( 'SameName' )
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:199:4: 'SameName'
+ {
+ match(input,13,FOLLOW_13_in_ruleGeneratedEnum380);
+
+ current = grammarAccess.getGeneratedEnumAccess().getSameNameEnumLiteralDeclaration_0().getEnumLiteral().getInstance();
+ createLeafNode(grammarAccess.getGeneratedEnumAccess().getSameNameEnumLiteralDeclaration_0(), null);
+
+
+ }
+
+
+ }
+ break;
+ case 2 :
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:205:6: ( 'DifferentLiteral' )
+ {
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:205:6: ( 'DifferentLiteral' )
+ // ../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g:205:8: 'DifferentLiteral'
+ {
+ match(input,15,FOLLOW_15_in_ruleGeneratedEnum395);
+
+ current = grammarAccess.getGeneratedEnumAccess().getDifferentNameEnumLiteralDeclaration_1().getEnumLiteral().getInstance();
+ createLeafNode(grammarAccess.getGeneratedEnumAccess().getDifferentNameEnumLiteralDeclaration_1(), null);
+
+
+ }
+
+
+ }
+ break;
+
+ }
+
+
+ }
+
+ resetLookahead();
+ lastConsumedNode = currentNode;
+
+ }
+
+ catch (RecognitionException re) {
+ recover(input,re);
+ appendSkippedTokens();
+ }
+ finally {
+ }
+ return current;
+ }
+ // $ANTLR end ruleGeneratedEnum
+
+
+
+
+ public static final BitSet FOLLOW_ruleModel_in_entryRuleModel71 = new BitSet(new long[]{0x0000000000000000L});
+ public static final BitSet FOLLOW_EOF_in_entryRuleModel81 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_11_in_ruleModel116 = new BitSet(new long[]{0x000000000000E000L});
+ public static final BitSet FOLLOW_ruleExistingEnum_in_ruleModel150 = new BitSet(new long[]{0x0000000000001002L});
+ public static final BitSet FOLLOW_12_in_ruleModel164 = new BitSet(new long[]{0x000000000000A000L});
+ public static final BitSet FOLLOW_ruleGeneratedEnum_in_ruleModel198 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_12_in_ruleModel221 = new BitSet(new long[]{0x000000000000A000L});
+ public static final BitSet FOLLOW_ruleGeneratedEnum_in_ruleModel255 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_13_in_ruleExistingEnum307 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_14_in_ruleExistingEnum322 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_15_in_ruleExistingEnum337 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_13_in_ruleGeneratedEnum380 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_15_in_ruleGeneratedEnum395 = new BitSet(new long[]{0x0000000000000002L});
+
+} \ No newline at end of file
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage__.g b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage__.g
new file mode 100644
index 0000000..1b3d653
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage__.g
@@ -0,0 +1,37 @@
+lexer grammar InternalEnumRulesTestLanguage;
+@header {
+package org.eclipse.xtext.enumrules.parser.antlr.internal;
+
+// Hack: Use our own Lexer superclass by means of import.
+// Currently there is no other way to specify the superclass for the lexer.
+import org.eclipse.xtext.parser.antlr.Lexer;
+}
+
+T11 : 'existing' ;
+T12 : 'generated' ;
+T13 : 'SameName' ;
+T14 : 'overridden' ;
+T15 : 'DifferentLiteral' ;
+
+// $ANTLR src "../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g" 214
+RULE_ID : '^'? ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'_'|'0'..'9')*;
+
+// $ANTLR src "../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g" 216
+RULE_INT : ('0'..'9')+;
+
+// $ANTLR src "../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g" 218
+RULE_STRING : ('\"' ('\\' ('b'|'t'|'n'|'f'|'r'|'\"'|'\''|'\\')|~(('\\'|'\"')))* '\"'|'\'' ('\\' ('b'|'t'|'n'|'f'|'r'|'\"'|'\''|'\\')|~(('\\'|'\'')))* '\'');
+
+// $ANTLR src "../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g" 220
+RULE_ML_COMMENT : '/*' ( options {greedy=false;} : . )*'*/';
+
+// $ANTLR src "../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g" 222
+RULE_SL_COMMENT : '//' ~(('\n'|'\r'))* ('\r'? '\n')?;
+
+// $ANTLR src "../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g" 224
+RULE_WS : (' '|'\t'|'\r'|'\n')+;
+
+// $ANTLR src "../org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/antlr/internal/InternalEnumRulesTestLanguage.g" 226
+RULE_ANY_OTHER : .;
+
+
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/packrat/EnumRulesTestLanguageDelimiters.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/packrat/EnumRulesTestLanguageDelimiters.java
new file mode 100644
index 0000000..d987acc
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/packrat/EnumRulesTestLanguageDelimiters.java
@@ -0,0 +1,22 @@
+/*
+* generated by Xtext
+*/
+package org.eclipse.xtext.enumrules.parser.packrat;
+
+import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
+
+public final class EnumRulesTestLanguageDelimiters {
+
+ private EnumRulesTestLanguageDelimiters() {
+ throw new UnsupportedOperationException("Utility classes may not be initialized");
+ }
+
+ // TODO: remove hardcoded character class from template
+ public static final ICharacterClass keyword$6$Delimiter = ICharacterClass.Factory.join(
+ ICharacterClass.Factory.createRange('a', 'z'),
+ ICharacterClass.Factory.createRange('A', 'Z'),
+ ICharacterClass.Factory.create('_'),
+ ICharacterClass.Factory.createRange('0', '9')
+ );
+
+}
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/packrat/EnumRulesTestLanguagePackratParser.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/packrat/EnumRulesTestLanguagePackratParser.java
new file mode 100644
index 0000000..74f0692
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/packrat/EnumRulesTestLanguagePackratParser.java
@@ -0,0 +1,31 @@
+/*
+* generated by Xtext
+*/
+package org.eclipse.xtext.enumrules.parser.packrat;
+
+import com.google.inject.Inject;
+
+import org.eclipse.xtext.parser.packrat.AbstractPackratParser;
+import org.eclipse.xtext.parser.packrat.IParseResultFactory;
+import org.eclipse.xtext.parser.packrat.AbstractParserConfiguration.IInternalParserConfiguration;
+
+import org.eclipse.xtext.enumrules.services.EnumRulesTestLanguageGrammarAccess;
+
+public class EnumRulesTestLanguagePackratParser extends AbstractPackratParser {
+
+ @Inject
+ public EnumRulesTestLanguagePackratParser(IParseResultFactory parseResultFactory, EnumRulesTestLanguageGrammarAccess grammarAccess) {
+ super(parseResultFactory, grammarAccess);
+ }
+
+ @Override
+ protected org.eclipse.xtext.enumrules.parser.packrat.EnumRulesTestLanguageParserConfiguration createParserConfiguration(IInternalParserConfiguration configuration) {
+ return new org.eclipse.xtext.enumrules.parser.packrat.EnumRulesTestLanguageParserConfiguration(configuration, getGrammarAccess());
+ }
+
+ @Override
+ protected EnumRulesTestLanguageGrammarAccess getGrammarAccess() {
+ return (EnumRulesTestLanguageGrammarAccess)super.getGrammarAccess();
+ }
+
+}
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/packrat/EnumRulesTestLanguageParserConfiguration.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/packrat/EnumRulesTestLanguageParserConfiguration.java
new file mode 100644
index 0000000..a43b665
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/packrat/EnumRulesTestLanguageParserConfiguration.java
@@ -0,0 +1,128 @@
+/*
+* generated by Xtext
+*/
+package org.eclipse.xtext.enumrules.parser.packrat;
+
+import org.eclipse.xtext.parser.packrat.AbstractParserConfiguration;
+import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
+
+import org.eclipse.xtext.enumrules.services.EnumRulesTestLanguageGrammarAccess;
+
+import org.eclipse.xtext.common.parser.packrat.TerminalsParserConfiguration;
+import org.eclipse.xtext.enumrules.parser.packrat.consumers.EnumRulesTestLanguageModelConsumer;
+import org.eclipse.xtext.enumrules.parser.packrat.consumers.EnumRulesTestLanguageExistingEnumConsumer;
+import org.eclipse.xtext.enumrules.parser.packrat.consumers.EnumRulesTestLanguageGeneratedEnumConsumer;
+import org.eclipse.xtext.common.parser.packrat.consumers.TerminalsIDConsumer;
+import org.eclipse.xtext.common.parser.packrat.consumers.TerminalsINTConsumer;
+import org.eclipse.xtext.common.parser.packrat.consumers.TerminalsSTRINGConsumer;
+import org.eclipse.xtext.common.parser.packrat.consumers.TerminalsML_COMMENTConsumer;
+import org.eclipse.xtext.common.parser.packrat.consumers.TerminalsSL_COMMENTConsumer;
+import org.eclipse.xtext.common.parser.packrat.consumers.TerminalsWSConsumer;
+import org.eclipse.xtext.common.parser.packrat.consumers.TerminalsANY_OTHERConsumer;
+
+public class EnumRulesTestLanguageParserConfiguration extends AbstractParserConfiguration {
+
+ private final TerminalsParserConfiguration terminalsConfiguration;
+ private EnumRulesTestLanguageModelConsumer modelConsumer;
+ private EnumRulesTestLanguageExistingEnumConsumer existingEnumConsumer;
+ private EnumRulesTestLanguageGeneratedEnumConsumer generatedEnumConsumer;
+
+ private EnumRulesTestLanguageGrammarAccess grammarAccess;
+
+ public EnumRulesTestLanguageParserConfiguration(IInternalParserConfiguration configuration, EnumRulesTestLanguageGrammarAccess grammarAccess) {
+ super(configuration);
+ this.grammarAccess = grammarAccess;
+ this.terminalsConfiguration = new TerminalsParserConfiguration(configuration, null);
+ }
+
+ public EnumRulesTestLanguageModelConsumer getRootConsumer() {
+ return modelConsumer;
+ }
+
+ public void createNonTerminalConsumers() {
+ getTerminalsConfiguration().createNonTerminalConsumers();
+ modelConsumer = new EnumRulesTestLanguageModelConsumer(
+ this, null
+ );
+ existingEnumConsumer = new EnumRulesTestLanguageExistingEnumConsumer(this, null);
+ generatedEnumConsumer = new EnumRulesTestLanguageGeneratedEnumConsumer(this, null);
+ }
+
+ public void createTerminalConsumers() {
+ getTerminalsConfiguration().createTerminalConsumers();
+ }
+
+ public void configureConsumers() {
+ if (grammarAccess == null)
+ throw new NullPointerException("grammarAccess may not be null, you call configureConsumers");
+ getModelConsumer().setRule(grammarAccess.getModelAccess());
+ getExistingEnumConsumer().setRule(grammarAccess.getExistingEnumAccess());
+ getGeneratedEnumConsumer().setRule(grammarAccess.getGeneratedEnumAccess());
+ getIdConsumer().setRule(grammarAccess.getIDRule());
+ getIntConsumer().setRule(grammarAccess.getINTRule());
+ getStringConsumer().setRule(grammarAccess.getSTRINGRule());
+ getMlCommentConsumer().setRule(grammarAccess.getML_COMMENTRule());
+ getSlCommentConsumer().setRule(grammarAccess.getSL_COMMENTRule());
+ getWsConsumer().setRule(grammarAccess.getWSRule());
+ getAnyOtherConsumer().setRule(grammarAccess.getANY_OTHERRule());
+
+
+ getModelConsumer().setExistingEnumConsumer(getExistingEnumConsumer());
+ getModelConsumer().setGeneratedEnumConsumer(getGeneratedEnumConsumer());
+
+ getModelConsumer().setKeyword$7$Delimiter(org.eclipse.xtext.enumrules.parser.packrat.EnumRulesTestLanguageDelimiters.keyword$6$Delimiter);
+ getModelConsumer().setKeyword$11$Delimiter(org.eclipse.xtext.enumrules.parser.packrat.EnumRulesTestLanguageDelimiters.keyword$6$Delimiter);
+ getModelConsumer().setKeyword$3$Delimiter(org.eclipse.xtext.enumrules.parser.packrat.EnumRulesTestLanguageDelimiters.keyword$6$Delimiter);
+ }
+
+ public TerminalsParserConfiguration getTerminalsConfiguration() {
+ return terminalsConfiguration;
+ }
+
+ public EnumRulesTestLanguageModelConsumer getModelConsumer() {
+ return modelConsumer;
+ }
+
+ public EnumRulesTestLanguageExistingEnumConsumer getExistingEnumConsumer() {
+ return existingEnumConsumer;
+ }
+
+ public EnumRulesTestLanguageGeneratedEnumConsumer getGeneratedEnumConsumer() {
+ return generatedEnumConsumer;
+ }
+
+ public TerminalsIDConsumer getIdConsumer() {
+ return getTerminalsConfiguration().getIdConsumer();
+ }
+
+ public TerminalsINTConsumer getIntConsumer() {
+ return getTerminalsConfiguration().getIntConsumer();
+ }
+
+ public TerminalsSTRINGConsumer getStringConsumer() {
+ return getTerminalsConfiguration().getStringConsumer();
+ }
+
+ public TerminalsML_COMMENTConsumer getMlCommentConsumer() {
+ return getTerminalsConfiguration().getMlCommentConsumer();
+ }
+
+ public TerminalsSL_COMMENTConsumer getSlCommentConsumer() {
+ return getTerminalsConfiguration().getSlCommentConsumer();
+ }
+
+ public TerminalsWSConsumer getWsConsumer() {
+ return getTerminalsConfiguration().getWsConsumer();
+ }
+
+ public TerminalsANY_OTHERConsumer getAnyOtherConsumer() {
+ return getTerminalsConfiguration().getAnyOtherConsumer();
+ }
+
+
+ @Override
+ public ITerminalConsumer[] getInitialHiddenTerminals() {
+ return getTerminalsConfiguration().getInitialHiddenTerminals();
+ }
+
+}
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/packrat/consumers/EnumRulesTestLanguageExistingEnumConsumer.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/packrat/consumers/EnumRulesTestLanguageExistingEnumConsumer.java
new file mode 100644
index 0000000..1eb152f
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/packrat/consumers/EnumRulesTestLanguageExistingEnumConsumer.java
@@ -0,0 +1,148 @@
+/*
+* generated by Xtext
+*/
+package org.eclipse.xtext.enumrules.parser.packrat.consumers;
+
+import org.eclipse.emf.ecore.EClassifier;
+
+import org.eclipse.xtext.AbstractRule;
+import org.eclipse.xtext.Alternatives;
+import org.eclipse.xtext.EnumLiteralDeclaration;
+import org.eclipse.xtext.Keyword;
+
+import org.eclipse.xtext.parser.packrat.consumers.IElementConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.INonTerminalConsumerConfiguration;
+import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
+
+import org.eclipse.xtext.enumrules.services.EnumRulesTestLanguageGrammarAccess.ExistingEnumElements;
+
+public final class EnumRulesTestLanguageExistingEnumConsumer extends NonTerminalConsumer {
+
+ private ExistingEnumElements rule;
+
+ private IElementConsumer alternatives$1$Consumer;
+
+ private IElementConsumer enumLiteralDeclaration$2$Consumer;
+
+ private IElementConsumer enumLiteralDeclaration$4$Consumer;
+
+ private IElementConsumer enumLiteralDeclaration$6$Consumer;
+
+ private ICharacterClass keyword$3$Delimiter;
+
+ private ICharacterClass keyword$5$Delimiter;
+
+ private ICharacterClass keyword$7$Delimiter;
+
+ protected class Alternatives$1$Consumer extends AlternativesConsumer {
+
+ protected Alternatives$1$Consumer(final Alternatives alternatives) {
+ super(alternatives);
+ }
+
+ @Override
+ protected void doGetConsumers(ConsumerAcceptor acceptor) {
+ acceptor.accept(enumLiteralDeclaration$2$Consumer);
+ acceptor.accept(enumLiteralDeclaration$4$Consumer);
+ acceptor.accept(enumLiteralDeclaration$6$Consumer);
+ }
+ }
+
+ protected class EnumLiteralDeclaration$2$Consumer extends ElementConsumer<EnumLiteralDeclaration> {
+
+ protected EnumLiteralDeclaration$2$Consumer(final EnumLiteralDeclaration enumLiteralDeclaration) {
+ super(enumLiteralDeclaration);
+ }
+
+ @Override
+ protected int doConsume(boolean optional) throws Exception {
+ return consumeEnum(getElement(), getKeyword$3$Delimiter());
+ }
+ }
+
+ protected class EnumLiteralDeclaration$4$Consumer extends ElementConsumer<EnumLiteralDeclaration> {
+
+ protected EnumLiteralDeclaration$4$Consumer(final EnumLiteralDeclaration enumLiteralDeclaration) {
+ super(enumLiteralDeclaration);
+ }
+
+ @Override
+ protected int doConsume(boolean optional) throws Exception {
+ return consumeEnum(getElement(), getKeyword$5$Delimiter());
+ }
+ }
+
+ protected class EnumLiteralDeclaration$6$Consumer extends ElementConsumer<EnumLiteralDeclaration> {
+
+ protected EnumLiteralDeclaration$6$Consumer(final EnumLiteralDeclaration enumLiteralDeclaration) {
+ super(enumLiteralDeclaration);
+ }
+
+ @Override
+ protected int doConsume(boolean optional) throws Exception {
+ return consumeEnum(getElement(), getKeyword$7$Delimiter());
+ }
+ }
+
+ public EnumRulesTestLanguageExistingEnumConsumer(INonTerminalConsumerConfiguration configuration, ITerminalConsumer[] hiddenTokens) {
+ super(configuration, hiddenTokens);
+ keyword$3$Delimiter = ICharacterClass.Factory.nullClass();
+ keyword$5$Delimiter = ICharacterClass.Factory.nullClass();
+ keyword$7$Delimiter = ICharacterClass.Factory.nullClass();
+ }
+
+ @Override
+ protected int doConsume() throws Exception {
+ return alternatives$1$Consumer.consume();
+ }
+
+ public ExistingEnumElements getRule() {
+ return rule;
+ }
+
+ public void setRule(ExistingEnumElements rule) {
+ this.rule = rule;
+
+ alternatives$1$Consumer = new Alternatives$1$Consumer(rule.getAlternatives());
+ enumLiteralDeclaration$2$Consumer = new EnumLiteralDeclaration$2$Consumer(rule.getSameNameEnumLiteralDeclaration_0());
+ enumLiteralDeclaration$4$Consumer = new EnumLiteralDeclaration$4$Consumer(rule.getOverriddenLiteralEnumLiteralDeclaration_1());
+ enumLiteralDeclaration$6$Consumer = new EnumLiteralDeclaration$6$Consumer(rule.getDifferentNameEnumLiteralDeclaration_2());
+ }
+
+ @Override
+ protected AbstractRule getGrammarElement() {
+ return getRule().getRule();
+ }
+
+ @Override
+ protected EClassifier getDefaultType() {
+ return getGrammarElement().getType().getClassifier();
+ }
+
+ public ICharacterClass getKeyword$3$Delimiter() {
+ return keyword$3$Delimiter;
+ }
+
+ public void setKeyword$3$Delimiter(ICharacterClass characterClass) {
+ keyword$3$Delimiter = characterClass != null ? characterClass : ICharacterClass.Factory.nullClass();
+ }
+
+ public ICharacterClass getKeyword$5$Delimiter() {
+ return keyword$5$Delimiter;
+ }
+
+ public void setKeyword$5$Delimiter(ICharacterClass characterClass) {
+ keyword$5$Delimiter = characterClass != null ? characterClass : ICharacterClass.Factory.nullClass();
+ }
+
+ public ICharacterClass getKeyword$7$Delimiter() {
+ return keyword$7$Delimiter;
+ }
+
+ public void setKeyword$7$Delimiter(ICharacterClass characterClass) {
+ keyword$7$Delimiter = characterClass != null ? characterClass : ICharacterClass.Factory.nullClass();
+ }
+
+}
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/packrat/consumers/EnumRulesTestLanguageGeneratedEnumConsumer.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/packrat/consumers/EnumRulesTestLanguageGeneratedEnumConsumer.java
new file mode 100644
index 0000000..0c0352d
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/packrat/consumers/EnumRulesTestLanguageGeneratedEnumConsumer.java
@@ -0,0 +1,121 @@
+/*
+* generated by Xtext
+*/
+package org.eclipse.xtext.enumrules.parser.packrat.consumers;
+
+import org.eclipse.emf.ecore.EClassifier;
+
+import org.eclipse.xtext.AbstractRule;
+import org.eclipse.xtext.Alternatives;
+import org.eclipse.xtext.EnumLiteralDeclaration;
+import org.eclipse.xtext.Keyword;
+
+import org.eclipse.xtext.parser.packrat.consumers.IElementConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.INonTerminalConsumerConfiguration;
+import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
+
+import org.eclipse.xtext.enumrules.services.EnumRulesTestLanguageGrammarAccess.GeneratedEnumElements;
+
+public final class EnumRulesTestLanguageGeneratedEnumConsumer extends NonTerminalConsumer {
+
+ private GeneratedEnumElements rule;
+
+ private IElementConsumer alternatives$1$Consumer;
+
+ private IElementConsumer enumLiteralDeclaration$2$Consumer;
+
+ private IElementConsumer enumLiteralDeclaration$4$Consumer;
+
+ private ICharacterClass keyword$3$Delimiter;
+
+ private ICharacterClass keyword$5$Delimiter;
+
+ protected class Alternatives$1$Consumer extends AlternativesConsumer {
+
+ protected Alternatives$1$Consumer(final Alternatives alternatives) {
+ super(alternatives);
+ }
+
+ @Override
+ protected void doGetConsumers(ConsumerAcceptor acceptor) {
+ acceptor.accept(enumLiteralDeclaration$2$Consumer);
+ acceptor.accept(enumLiteralDeclaration$4$Consumer);
+ }
+ }
+
+ protected class EnumLiteralDeclaration$2$Consumer extends ElementConsumer<EnumLiteralDeclaration> {
+
+ protected EnumLiteralDeclaration$2$Consumer(final EnumLiteralDeclaration enumLiteralDeclaration) {
+ super(enumLiteralDeclaration);
+ }
+
+ @Override
+ protected int doConsume(boolean optional) throws Exception {
+ return consumeEnum(getElement(), getKeyword$3$Delimiter());
+ }
+ }
+
+ protected class EnumLiteralDeclaration$4$Consumer extends ElementConsumer<EnumLiteralDeclaration> {
+
+ protected EnumLiteralDeclaration$4$Consumer(final EnumLiteralDeclaration enumLiteralDeclaration) {
+ super(enumLiteralDeclaration);
+ }
+
+ @Override
+ protected int doConsume(boolean optional) throws Exception {
+ return consumeEnum(getElement(), getKeyword$5$Delimiter());
+ }
+ }
+
+ public EnumRulesTestLanguageGeneratedEnumConsumer(INonTerminalConsumerConfiguration configuration, ITerminalConsumer[] hiddenTokens) {
+ super(configuration, hiddenTokens);
+ keyword$3$Delimiter = ICharacterClass.Factory.nullClass();
+ keyword$5$Delimiter = ICharacterClass.Factory.nullClass();
+ }
+
+ @Override
+ protected int doConsume() throws Exception {
+ return alternatives$1$Consumer.consume();
+ }
+
+ public GeneratedEnumElements getRule() {
+ return rule;
+ }
+
+ public void setRule(GeneratedEnumElements rule) {
+ this.rule = rule;
+
+ alternatives$1$Consumer = new Alternatives$1$Consumer(rule.getAlternatives());
+ enumLiteralDeclaration$2$Consumer = new EnumLiteralDeclaration$2$Consumer(rule.getSameNameEnumLiteralDeclaration_0());
+ enumLiteralDeclaration$4$Consumer = new EnumLiteralDeclaration$4$Consumer(rule.getDifferentNameEnumLiteralDeclaration_1());
+ }
+
+ @Override
+ protected AbstractRule getGrammarElement() {
+ return getRule().getRule();
+ }
+
+ @Override
+ protected EClassifier getDefaultType() {
+ return getGrammarElement().getType().getClassifier();
+ }
+
+ public ICharacterClass getKeyword$3$Delimiter() {
+ return keyword$3$Delimiter;
+ }
+
+ public void setKeyword$3$Delimiter(ICharacterClass characterClass) {
+ keyword$3$Delimiter = characterClass != null ? characterClass : ICharacterClass.Factory.nullClass();
+ }
+
+ public ICharacterClass getKeyword$5$Delimiter() {
+ return keyword$5$Delimiter;
+ }
+
+ public void setKeyword$5$Delimiter(ICharacterClass characterClass) {
+ keyword$5$Delimiter = characterClass != null ? characterClass : ICharacterClass.Factory.nullClass();
+ }
+
+}
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/packrat/consumers/EnumRulesTestLanguageModelConsumer.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/packrat/consumers/EnumRulesTestLanguageModelConsumer.java
new file mode 100644
index 0000000..fc463c3
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/parser/packrat/consumers/EnumRulesTestLanguageModelConsumer.java
@@ -0,0 +1,301 @@
+/*
+* generated by Xtext
+*/
+package org.eclipse.xtext.enumrules.parser.packrat.consumers;
+
+import org.eclipse.emf.ecore.EClassifier;
+
+import org.eclipse.xtext.AbstractRule;
+import org.eclipse.xtext.Alternatives;
+import org.eclipse.xtext.Assignment;
+import org.eclipse.xtext.Group;
+import org.eclipse.xtext.Keyword;
+import org.eclipse.xtext.RuleCall;
+
+import org.eclipse.xtext.parser.packrat.consumers.IElementConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.INonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.INonTerminalConsumerConfiguration;
+import org.eclipse.xtext.parser.packrat.consumers.ITerminalConsumer;
+import org.eclipse.xtext.parser.packrat.consumers.NonTerminalConsumer;
+import org.eclipse.xtext.parser.packrat.matching.ICharacterClass;
+
+import org.eclipse.xtext.enumrules.services.EnumRulesTestLanguageGrammarAccess.ModelElements;
+
+public final class EnumRulesTestLanguageModelConsumer extends NonTerminalConsumer {
+
+ private ModelElements rule;
+
+ private INonTerminalConsumer existingEnumConsumer;
+
+ private INonTerminalConsumer generatedEnumConsumer;
+
+ private IElementConsumer alternatives$1$Consumer;
+
+ private IElementConsumer group$2$Consumer;
+
+ private IElementConsumer keyword$3$Consumer;
+
+ private IElementConsumer assignment$4$Consumer;
+
+ private IElementConsumer ruleCall$5$Consumer;
+
+ private IElementConsumer group$6$Consumer;
+
+ private IElementConsumer keyword$7$Consumer;
+
+ private IElementConsumer assignment$8$Consumer;
+
+ private IElementConsumer ruleCall$9$Consumer;
+
+ private IElementConsumer group$10$Consumer;
+
+ private IElementConsumer keyword$11$Consumer;
+
+ private IElementConsumer assignment$12$Consumer;
+
+ private IElementConsumer ruleCall$13$Consumer;
+
+ private ICharacterClass keyword$7$Delimiter;
+
+ private ICharacterClass keyword$11$Delimiter;
+
+ private ICharacterClass keyword$3$Delimiter;
+
+ protected class Alternatives$1$Consumer extends AlternativesConsumer {
+
+ protected Alternatives$1$Consumer(final Alternatives alternatives) {
+ super(alternatives);
+ }
+
+ @Override
+ protected void doGetConsumers(ConsumerAcceptor acceptor) {
+ acceptor.accept(group$2$Consumer);
+ acceptor.accept(group$10$Consumer);
+ }
+ }
+
+ protected class Group$2$Consumer extends GroupConsumer {
+
+ protected Group$2$Consumer(final Group group) {
+ super(group);
+ }
+
+ @Override
+ protected void doGetConsumers(ConsumerAcceptor acceptor) {
+ acceptor.accept(keyword$3$Consumer);
+ acceptor.accept(assignment$4$Consumer);
+ acceptor.accept(group$6$Consumer);
+ }
+ }
+
+ protected class Keyword$3$Consumer extends ElementConsumer<Keyword> {
+
+ protected Keyword$3$Consumer(final Keyword keyword) {
+ super(keyword);
+ }
+
+ @Override
+ protected int doConsume(boolean optional) throws Exception {
+ return consumeKeyword(getElement(), null, false, false, getKeyword$3$Delimiter(), optional);
+ }
+ }
+
+ protected class Assignment$4$Consumer extends AssignmentConsumer {
+
+ protected Assignment$4$Consumer(final Assignment assignment) {
+ super(assignment);
+ }
+
+ @Override
+ protected IElementConsumer getConsumer() {
+ return ruleCall$5$Consumer;
+ }
+ }
+
+ protected class RuleCall$5$Consumer extends ElementConsumer<RuleCall> {
+
+ protected RuleCall$5$Consumer(final RuleCall ruleCall) {
+ super(ruleCall);
+ }
+
+ @Override
+ protected int doConsume(boolean optional) throws Exception {
+ return consumeNonTerminal(existingEnumConsumer, "existing", false, false, false, getElement(), optional);
+ }
+ }
+
+ protected class Group$6$Consumer extends OptionalGroupConsumer {
+
+ protected Group$6$Consumer(final Group group) {
+ super(group);
+ }
+
+ @Override
+ protected void doGetConsumers(ConsumerAcceptor acceptor) {
+ acceptor.accept(keyword$7$Consumer);
+ acceptor.accept(assignment$8$Consumer);
+ }
+ }
+
+ protected class Keyword$7$Consumer extends ElementConsumer<Keyword> {
+
+ protected Keyword$7$Consumer(final Keyword keyword) {
+ super(keyword);
+ }
+
+ @Override
+ protected int doConsume(boolean optional) throws Exception {
+ return consumeKeyword(getElement(), null, false, false, getKeyword$7$Delimiter(), optional);
+ }
+ }
+
+ protected class Assignment$8$Consumer extends AssignmentConsumer {
+
+ protected Assignment$8$Consumer(final Assignment assignment) {
+ super(assignment);
+ }
+
+ @Override
+ protected IElementConsumer getConsumer() {
+ return ruleCall$9$Consumer;
+ }
+ }
+
+ protected class RuleCall$9$Consumer extends ElementConsumer<RuleCall> {
+
+ protected RuleCall$9$Consumer(final RuleCall ruleCall) {
+ super(ruleCall);
+ }
+
+ @Override
+ protected int doConsume(boolean optional) throws Exception {
+ return consumeNonTerminal(generatedEnumConsumer, "generated", false, false, false, getElement(), optional);
+ }
+ }
+
+ protected class Group$10$Consumer extends GroupConsumer {
+
+ protected Group$10$Consumer(final Group group) {
+ super(group);
+ }
+
+ @Override
+ protected void doGetConsumers(ConsumerAcceptor acceptor) {
+ acceptor.accept(keyword$11$Consumer);
+ acceptor.accept(assignment$12$Consumer);
+ }
+ }
+
+ protected class Keyword$11$Consumer extends ElementConsumer<Keyword> {
+
+ protected Keyword$11$Consumer(final Keyword keyword) {
+ super(keyword);
+ }
+
+ @Override
+ protected int doConsume(boolean optional) throws Exception {
+ return consumeKeyword(getElement(), null, false, false, getKeyword$11$Delimiter(), optional);
+ }
+ }
+
+ protected class Assignment$12$Consumer extends AssignmentConsumer {
+
+ protected Assignment$12$Consumer(final Assignment assignment) {
+ super(assignment);
+ }
+
+ @Override
+ protected IElementConsumer getConsumer() {
+ return ruleCall$13$Consumer;
+ }
+ }
+
+ protected class RuleCall$13$Consumer extends ElementConsumer<RuleCall> {
+
+ protected RuleCall$13$Consumer(final RuleCall ruleCall) {
+ super(ruleCall);
+ }
+
+ @Override
+ protected int doConsume(boolean optional) throws Exception {
+ return consumeNonTerminal(generatedEnumConsumer, "generated", false, false, false, getElement(), optional);
+ }
+ }
+
+ public EnumRulesTestLanguageModelConsumer(INonTerminalConsumerConfiguration configuration, ITerminalConsumer[] hiddenTokens) {
+ super(configuration, hiddenTokens);
+ keyword$7$Delimiter = ICharacterClass.Factory.nullClass();
+ keyword$11$Delimiter = ICharacterClass.Factory.nullClass();
+ keyword$3$Delimiter = ICharacterClass.Factory.nullClass();
+ }
+
+ @Override
+ protected int doConsume() throws Exception {
+ return alternatives$1$Consumer.consume();
+ }
+
+ public ModelElements getRule() {
+ return rule;
+ }
+
+ public void setRule(ModelElements rule) {
+ this.rule = rule;
+
+ alternatives$1$Consumer = new Alternatives$1$Consumer(rule.getAlternatives());
+ group$2$Consumer = new Group$2$Consumer(rule.getGroup_0());
+ keyword$3$Consumer = new Keyword$3$Consumer(rule.getExistingKeyword_0_0());
+ assignment$4$Consumer = new Assignment$4$Consumer(rule.getExistingAssignment_0_1());
+ ruleCall$5$Consumer = new RuleCall$5$Consumer(rule.getExistingExistingEnumEnumRuleCall_0_1_0());
+ group$6$Consumer = new Group$6$Consumer(rule.getGroup_0_2());
+ keyword$7$Consumer = new Keyword$7$Consumer(rule.getGeneratedKeyword_0_2_0());
+ assignment$8$Consumer = new Assignment$8$Consumer(rule.getGeneratedAssignment_0_2_1());
+ ruleCall$9$Consumer = new RuleCall$9$Consumer(rule.getGeneratedGeneratedEnumEnumRuleCall_0_2_1_0());
+ group$10$Consumer = new Group$10$Consumer(rule.getGroup_1());
+ keyword$11$Consumer = new Keyword$11$Consumer(rule.getGeneratedKeyword_1_0());
+ assignment$12$Consumer = new Assignment$12$Consumer(rule.getGeneratedAssignment_1_1());
+ ruleCall$13$Consumer = new RuleCall$13$Consumer(rule.getGeneratedGeneratedEnumEnumRuleCall_1_1_0());
+ }
+
+ @Override
+ protected AbstractRule getGrammarElement() {
+ return getRule().getRule();
+ }
+
+ @Override
+ protected EClassifier getDefaultType() {
+ return getGrammarElement().getType().getClassifier();
+ }
+
+ public void setExistingEnumConsumer(INonTerminalConsumer existingEnumConsumer) {
+ this.existingEnumConsumer = existingEnumConsumer;
+ }
+
+ public void setGeneratedEnumConsumer(INonTerminalConsumer generatedEnumConsumer) {
+ this.generatedEnumConsumer = generatedEnumConsumer;
+ }
+
+ public ICharacterClass getKeyword$7$Delimiter() {
+ return keyword$7$Delimiter;
+ }
+
+ public void setKeyword$7$Delimiter(ICharacterClass characterClass) {
+ keyword$7$Delimiter = characterClass != null ? characterClass : ICharacterClass.Factory.nullClass();
+ }
+
+ public ICharacterClass getKeyword$11$Delimiter() {
+ return keyword$11$Delimiter;
+ }
+
+ public void setKeyword$11$Delimiter(ICharacterClass characterClass) {
+ keyword$11$Delimiter = characterClass != null ? characterClass : ICharacterClass.Factory.nullClass();
+ }
+
+ public ICharacterClass getKeyword$3$Delimiter() {
+ return keyword$3$Delimiter;
+ }
+
+ public void setKeyword$3$Delimiter(ICharacterClass characterClass) {
+ keyword$3$Delimiter = characterClass != null ? characterClass : ICharacterClass.Factory.nullClass();
+ }
+
+}
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/services/EnumRulesTestLanguageGrammarAccess.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/services/EnumRulesTestLanguageGrammarAccess.java
new file mode 100644
index 0000000..c03df87
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/enumrules/services/EnumRulesTestLanguageGrammarAccess.java
@@ -0,0 +1,236 @@
+/*
+* generated by Xtext
+*/
+
+package org.eclipse.xtext.enumrules.services;
+
+import com.google.inject.Singleton;
+import com.google.inject.Inject;
+
+import org.eclipse.xtext.*;
+
+import org.eclipse.xtext.service.GrammarProvider;
+
+import org.eclipse.xtext.common.services.TerminalsGrammarAccess;
+
+@Singleton
+public class EnumRulesTestLanguageGrammarAccess implements IGrammarAccess {
+
+
+ public class ModelElements implements IParserRuleAccess {
+ private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "Model");
+ private final Alternatives cAlternatives = (Alternatives)rule.eContents().get(1);
+ private final Group cGroup_0 = (Group)cAlternatives.eContents().get(0);
+ private final Keyword cExistingKeyword_0_0 = (Keyword)cGroup_0.eContents().get(0);
+ private final Assignment cExistingAssignment_0_1 = (Assignment)cGroup_0.eContents().get(1);
+ private final RuleCall cExistingExistingEnumEnumRuleCall_0_1_0 = (RuleCall)cExistingAssignment_0_1.eContents().get(0);
+ private final Group cGroup_0_2 = (Group)cGroup_0.eContents().get(2);
+ private final Keyword cGeneratedKeyword_0_2_0 = (Keyword)cGroup_0_2.eContents().get(0);
+ private final Assignment cGeneratedAssignment_0_2_1 = (Assignment)cGroup_0_2.eContents().get(1);
+ private final RuleCall cGeneratedGeneratedEnumEnumRuleCall_0_2_1_0 = (RuleCall)cGeneratedAssignment_0_2_1.eContents().get(0);
+ private final Group cGroup_1 = (Group)cAlternatives.eContents().get(1);
+ private final Keyword cGeneratedKeyword_1_0 = (Keyword)cGroup_1.eContents().get(0);
+ private final Assignment cGeneratedAssignment_1_1 = (Assignment)cGroup_1.eContents().get(1);
+ private final RuleCall cGeneratedGeneratedEnumEnumRuleCall_1_1_0 = (RuleCall)cGeneratedAssignment_1_1.eContents().get(0);
+
+ //Model:
+ // "existing" existing=ExistingEnum ("generated" generated=GeneratedEnum)?|"generated" generated=GeneratedEnum;
+ public ParserRule getRule() { return rule; }
+
+ //"existing" existing=ExistingEnum ("generated" generated=GeneratedEnum)?|"generated" generated=GeneratedEnum
+ public Alternatives getAlternatives() { return cAlternatives; }
+
+ //"existing" existing=ExistingEnum ("generated" generated=GeneratedEnum)?
+ public Group getGroup_0() { return cGroup_0; }
+
+ //"existing"
+ public Keyword getExistingKeyword_0_0() { return cExistingKeyword_0_0; }
+
+ //existing=ExistingEnum
+ public Assignment getExistingAssignment_0_1() { return cExistingAssignment_0_1; }
+
+ //ExistingEnum
+ public RuleCall getExistingExistingEnumEnumRuleCall_0_1_0() { return cExistingExistingEnumEnumRuleCall_0_1_0; }
+
+ //("generated" generated=GeneratedEnum)?
+ public Group getGroup_0_2() { return cGroup_0_2; }
+
+ //"generated"
+ public Keyword getGeneratedKeyword_0_2_0() { return cGeneratedKeyword_0_2_0; }
+
+ //generated=GeneratedEnum
+ public Assignment getGeneratedAssignment_0_2_1() { return cGeneratedAssignment_0_2_1; }
+
+ //GeneratedEnum
+ public RuleCall getGeneratedGeneratedEnumEnumRuleCall_0_2_1_0() { return cGeneratedGeneratedEnumEnumRuleCall_0_2_1_0; }
+
+ //"generated" generated=GeneratedEnum
+ public Group getGroup_1() { return cGroup_1; }
+
+ //"generated"
+ public Keyword getGeneratedKeyword_1_0() { return cGeneratedKeyword_1_0; }
+
+ //generated=GeneratedEnum
+ public Assignment getGeneratedAssignment_1_1() { return cGeneratedAssignment_1_1; }
+
+ //GeneratedEnum
+ public RuleCall getGeneratedGeneratedEnumEnumRuleCall_1_1_0() { return cGeneratedGeneratedEnumEnumRuleCall_1_1_0; }
+ }
+
+
+ public class ExistingEnumElements implements IEnumRuleAccess {
+ private final EnumRule rule = (EnumRule) GrammarUtil.findRuleForName(getGrammar(), "ExistingEnum");
+ private final Alternatives cAlternatives = (Alternatives)rule.eContents().get(1);
+ private final EnumLiteralDeclaration cSameNameEnumLiteralDeclaration_0 = (EnumLiteralDeclaration)cAlternatives.eContents().get(0);
+ private final Keyword cSameNameSameNameKeyword_0_0 = (Keyword)cSameNameEnumLiteralDeclaration_0.eContents().get(0);
+ private final EnumLiteralDeclaration cOverriddenLiteralEnumLiteralDeclaration_1 = (EnumLiteralDeclaration)cAlternatives.eContents().get(1);
+ private final Keyword cOverriddenLiteralOverriddenKeyword_1_0 = (Keyword)cOverriddenLiteralEnumLiteralDeclaration_1.eContents().get(0);
+ private final EnumLiteralDeclaration cDifferentNameEnumLiteralDeclaration_2 = (EnumLiteralDeclaration)cAlternatives.eContents().get(2);
+ private final Keyword cDifferentNameDifferentLiteralKeyword_2_0 = (Keyword)cDifferentNameEnumLiteralDeclaration_2.eContents().get(0);
+
+ //enum ExistingEnum returns ExistingEnum : SameName | OverriddenLiteral = "overridden" | DifferentName ;
+ public EnumRule getRule() { return rule; }
+
+ //SameName | OverriddenLiteral = "overridden" | DifferentName
+ public Alternatives getAlternatives() { return cAlternatives; }
+
+ //SameName
+ public EnumLiteralDeclaration getSameNameEnumLiteralDeclaration_0() { return cSameNameEnumLiteralDeclaration_0; }
+
+ //"SameName"
+ public Keyword getSameNameSameNameKeyword_0_0() { return cSameNameSameNameKeyword_0_0; }
+
+ //OverriddenLiteral = "overridden"
+ public EnumLiteralDeclaration getOverriddenLiteralEnumLiteralDeclaration_1() { return cOverriddenLiteralEnumLiteralDeclaration_1; }
+
+ //"overridden"
+ public Keyword getOverriddenLiteralOverriddenKeyword_1_0() { return cOverriddenLiteralOverriddenKeyword_1_0; }
+
+ //DifferentName
+ public EnumLiteralDeclaration getDifferentNameEnumLiteralDeclaration_2() { return cDifferentNameEnumLiteralDeclaration_2; }
+
+ //"DifferentLiteral"
+ public Keyword getDifferentNameDifferentLiteralKeyword_2_0() { return cDifferentNameDifferentLiteralKeyword_2_0; }
+ }
+
+ public class GeneratedEnumElements implements IEnumRuleAccess {
+ private final EnumRule rule = (EnumRule) GrammarUtil.findRuleForName(getGrammar(), "GeneratedEnum");
+ private final Alternatives cAlternatives = (Alternatives)rule.eContents().get(1);
+ private final EnumLiteralDeclaration cSameNameEnumLiteralDeclaration_0 = (EnumLiteralDeclaration)cAlternatives.eContents().get(0);
+ private final Keyword cSameNameSameNameKeyword_0_0 = (Keyword)cSameNameEnumLiteralDeclaration_0.eContents().get(0);
+ private final EnumLiteralDeclaration cDifferentNameEnumLiteralDeclaration_1 = (EnumLiteralDeclaration)cAlternatives.eContents().get(1);
+ private final Keyword cDifferentNameDifferentLiteralKeyword_1_0 = (Keyword)cDifferentNameEnumLiteralDeclaration_1.eContents().get(0);
+
+ //enum GeneratedEnum returns GeneratedEnum : SameName | DifferentName ;
+ public EnumRule getRule() { return rule; }
+
+ //SameName | DifferentName
+ public Alternatives getAlternatives() { return cAlternatives; }
+
+ //SameName
+ public EnumLiteralDeclaration getSameNameEnumLiteralDeclaration_0() { return cSameNameEnumLiteralDeclaration_0; }
+
+ //"SameName"
+ public Keyword getSameNameSameNameKeyword_0_0() { return cSameNameSameNameKeyword_0_0; }
+
+ //DifferentName
+ public EnumLiteralDeclaration getDifferentNameEnumLiteralDeclaration_1() { return cDifferentNameEnumLiteralDeclaration_1; }
+
+ //"DifferentLiteral"
+ public Keyword getDifferentNameDifferentLiteralKeyword_1_0() { return cDifferentNameDifferentLiteralKeyword_1_0; }
+ }
+
+ private ModelElements pModel;
+ private ExistingEnumElements unknownRuleExistingEnum;
+ private GeneratedEnumElements unknownRuleGeneratedEnum;
+
+ private final GrammarProvider grammarProvider;
+
+ private TerminalsGrammarAccess gaTerminals;
+
+ @Inject
+ public EnumRulesTestLanguageGrammarAccess(GrammarProvider grammarProvider,
+ TerminalsGrammarAccess gaTerminals) {
+ this.grammarProvider = grammarProvider;
+ this.gaTerminals = gaTerminals;
+ }
+
+ public Grammar getGrammar() {
+ return grammarProvider.getGrammar(this);
+ }
+
+
+ public TerminalsGrammarAccess getTerminalsGrammarAccess() {
+ return gaTerminals;
+ }
+
+
+ //Model:
+ // "existing" existing=ExistingEnum ("generated" generated=GeneratedEnum)?|"generated" generated=GeneratedEnum;
+ public ModelElements getModelAccess() {
+ return (pModel != null) ? pModel : (pModel = new ModelElements());
+ }
+
+ public ParserRule getModelRule() {
+ return getModelAccess().getRule();
+ }
+
+ //enum ExistingEnum returns ExistingEnum : SameName | OverriddenLiteral = "overridden" | DifferentName ;
+ public ExistingEnumElements getExistingEnumAccess() {
+ return (unknownRuleExistingEnum != null) ? unknownRuleExistingEnum : (unknownRuleExistingEnum = new ExistingEnumElements());
+ }
+
+ public EnumRule getExistingEnumRule() {
+ return getExistingEnumAccess().getRule();
+ }
+
+ //enum GeneratedEnum returns GeneratedEnum : SameName | DifferentName ;
+ public GeneratedEnumElements getGeneratedEnumAccess() {
+ return (unknownRuleGeneratedEnum != null) ? unknownRuleGeneratedEnum : (unknownRuleGeneratedEnum = new GeneratedEnumElements());
+ }
+
+ public EnumRule getGeneratedEnumRule() {
+ return getGeneratedEnumAccess().getRule();
+ }
+
+ //terminal ID:
+ // "^" ? ( "a" .. "z" | "A" .. "Z" | "_" ) ( "a" .. "z" | "A" .. "Z" | "_" | "0" .. "9" ) *;
+ public TerminalRule getIDRule() {
+ return gaTerminals.getIDRule();
+ }
+
+ //terminal INT returns ecore::EInt:
+ // "0" .. "9" +;
+ public TerminalRule getINTRule() {
+ return gaTerminals.getINTRule();
+ }
+
+ //terminal STRING:
+ // "\"" ( "\\" ( "b" | "t" | "n" | "f" | "r" | "\"" | "\'" | "\\" ) | ! ( "\\" | "\"" ) ) * "\"" | "\'" ( "\\" ( "b" | "t" | "n" | "f" | "r" | "\"" | "\'" | "\\" ) | ! ( "\\" | "\'" ) ) * "\'";
+ public TerminalRule getSTRINGRule() {
+ return gaTerminals.getSTRINGRule();
+ }
+
+ //terminal ML_COMMENT:
+ // "/*" -> "*/";
+ public TerminalRule getML_COMMENTRule() {
+ return gaTerminals.getML_COMMENTRule();
+ }
+
+ //terminal SL_COMMENT:
+ // "//" ! ( "\n" | "\r" ) * ( "\r" ? "\n" ) ?;
+ public TerminalRule getSL_COMMENTRule() {
+ return gaTerminals.getSL_COMMENTRule();
+ }
+
+ //terminal WS:
+ // ( " " | "\t" | "\r" | "\n" ) +;
+ public TerminalRule getWSRule() {
+ return gaTerminals.getWSRule();
+ }
+
+ //org.eclipse.xtext.parsetree.reconstr.XtextSerializationException: Serialization of TerminalRule failed.
+ public TerminalRule getANY_OTHERRule() {
+ return gaTerminals.getANY_OTHERRule();
+ }
+}
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/testlanguages/GenReferenceGrammarTestLanguageScopeProvider.ext b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/testlanguages/GenReferenceGrammarTestLanguageScopeProvider.ext
index e112e8f..efbcf20 100644
--- a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/testlanguages/GenReferenceGrammarTestLanguageScopeProvider.ext
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/testlanguages/GenReferenceGrammarTestLanguageScopeProvider.ext
@@ -22,15 +22,15 @@ List[IScopedElement] scope_kinder(Familie this):
List[IScopedElement] scope_kinder(emf::EObject this) :
allElements().collect(x | createScopedElement(x.referenceName(), x));
-List[IScopedElement] scope_mutter(Familie this):
+List[IScopedElement] scope_vater(Familie this):
allElements().typeSelect(Erwachsener).collect(x | createScopedElement(x.referenceName(), x));
-List[IScopedElement] scope_mutter(emf::EObject this) :
+List[IScopedElement] scope_vater(emf::EObject this) :
allElements().collect(x | createScopedElement(x.referenceName(), x));
-List[IScopedElement] scope_vater(Familie this):
+List[IScopedElement] scope_mutter(Familie this):
allElements().typeSelect(Erwachsener).collect(x | createScopedElement(x.referenceName(), x));
-List[IScopedElement] scope_vater(emf::EObject this) :
+List[IScopedElement] scope_mutter(emf::EObject this) :
allElements().collect(x | createScopedElement(x.referenceName(), x));
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/ui/common/tests/Activator.java b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/ui/common/tests/Activator.java
index 161def2..b098380 100644
--- a/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/ui/common/tests/Activator.java
+++ b/tests/org.eclipse.xtext.ui.common.tests/src-gen/org/eclipse/xtext/ui/common/tests/Activator.java
@@ -44,6 +44,8 @@ public class Activator extends AbstractUIPlugin {
injectors.put("org.eclipse.xtext.testlanguages.TreeTestLanguage",Guice.createInjector(new org.eclipse.xtext.testlanguages.TreeTestLanguageRuntimeModule(), new org.eclipse.xtext.testlanguages.TreeTestLanguageUiModule()));
+ injectors.put("org.eclipse.xtext.enumrules.EnumRulesTestLanguage",Guice.createInjector(new org.eclipse.xtext.enumrules.EnumRulesTestLanguageRuntimeModule(), new org.eclipse.xtext.enumrules.EnumRulesTestLanguageUiModule()));
+
}
public static Activator getInstance() {
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/enumrules/EnumRulesTestLanguageChecks.chk b/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/enumrules/EnumRulesTestLanguageChecks.chk
new file mode 100644
index 0000000..2b6fd1e
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/enumrules/EnumRulesTestLanguageChecks.chk
@@ -0,0 +1,13 @@
+
+import enums;
+
+import enumRulesTestLanguage;
+
+import ecore;
+
+/*
+ * this check file is used to specify constraints for the derived metamodels
+ * example:
+ * context Entity WARNING "Entity names should start with a capital" :
+ * name.toFirstUpper() == name;
+ */
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/enumrules/EnumRulesTestLanguageProposalProvider.java b/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/enumrules/EnumRulesTestLanguageProposalProvider.java
new file mode 100644
index 0000000..0f9a102
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/enumrules/EnumRulesTestLanguageProposalProvider.java
@@ -0,0 +1,6 @@
+
+package org.eclipse.xtext.enumrules;
+
+public class EnumRulesTestLanguageProposalProvider extends org.eclipse.xtext.enumrules.GenEnumRulesTestLanguageProposalProvider {
+
+}
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/enumrules/EnumRulesTestLanguageRuntimeModule.java b/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/enumrules/EnumRulesTestLanguageRuntimeModule.java
new file mode 100644
index 0000000..56bd35e
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/enumrules/EnumRulesTestLanguageRuntimeModule.java
@@ -0,0 +1,11 @@
+/*
+ * generated by Xtext
+ */
+package org.eclipse.xtext.enumrules;
+
+/**
+ * Use this class to register components to be used within the IDE.
+ */
+public class EnumRulesTestLanguageRuntimeModule extends org.eclipse.xtext.enumrules.AbstractEnumRulesTestLanguageRuntimeModule {
+
+}
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/enumrules/EnumRulesTestLanguageScopeProvider.ext b/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/enumrules/EnumRulesTestLanguageScopeProvider.ext
new file mode 100644
index 0000000..854ec99
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/enumrules/EnumRulesTestLanguageScopeProvider.ext
@@ -0,0 +1,18 @@
+/*
+* generated by Xtext
+*/
+
+import xtext;
+
+import org::eclipse::jface::text::contentassist;
+import org::eclipse::xtext::crossref;
+
+import enums;
+import enumRulesTestLanguage;
+
+extension org::eclipse::xtext::enumrules::GenEnumRulesTestLanguageScopeProvider reexport;
+
+/**
+ * Customize functions defined in org::eclipse::xtext::enumrules::GenEnumRulesTestLanguageScopeProvider here.
+ */
+
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/enumrules/EnumRulesTestLanguageUiModule.java b/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/enumrules/EnumRulesTestLanguageUiModule.java
new file mode 100644
index 0000000..932930d
--- /dev/null
+++ b/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/enumrules/EnumRulesTestLanguageUiModule.java
@@ -0,0 +1,11 @@
+/*
+ * generated by Xtext
+ */
+package org.eclipse.xtext.enumrules;
+
+/**
+ * Use this class to register components to be used within the IDE.
+ */
+public class EnumRulesTestLanguageUiModule extends org.eclipse.xtext.enumrules.AbstractEnumRulesTestLanguageUiModule {
+
+}
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/ui/common/GenerateTestLanguages.mwe b/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/ui/common/GenerateTestLanguages.mwe
index 4be6fbf..6ca26b3 100644
--- a/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/ui/common/GenerateTestLanguages.mwe
+++ b/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/ui/common/GenerateTestLanguages.mwe
@@ -5,6 +5,8 @@
<bean class="org.eclipse.emf.mwe.utils.StandaloneSetup" platformUri="${runtimeProject}/.."/>
<component class="org.eclipse.emf.mwe.utils.DirectoryCleaner" directory="${runtimeProject}/src-gen"/>
+ <property name="enums.genmodel" value="platform:/resource/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/enumrules/enums.genmodel"/>
+
<component class="org.eclipse.xtext.generator.Generator">
<pathRtProject value="${runtimeProject}"/>
<pathUiProject value="${runtimeProject}"/>
@@ -32,5 +34,8 @@
<language uri="classpath:/org/eclipse/xtext/testlanguages/TreeTestLanguage.xtext">
<fragment file="org/eclipse/xtext/ui/common/TestLanguageSetup.mwe"/>
</language>
+ <language uri="classpath:/org/eclipse/xtext/enumrules/EnumRulesTestLanguage.xtext">
+ <fragment file="org/eclipse/xtext/ui/common/TestLanguageSetup.mwe" genmodels="${enums.genmodel}"/>
+ </language>
</component>
</workflow> \ No newline at end of file
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/ContentAssistProcessorTestBuilder.java b/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/ContentAssistProcessorTestBuilder.java
index 0e128df..39fc74c 100644
--- a/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/ContentAssistProcessorTestBuilder.java
+++ b/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/ContentAssistProcessorTestBuilder.java
@@ -124,8 +124,9 @@ public class ContentAssistProcessorTestBuilder {
for (int i = 0; i < computeCompletionProposals.length; i++) {
ICompletionProposal completionProposal = computeCompletionProposals[i];
- Assert.assertTrue("expect completionProposal text '" + completionProposal.getDisplayString() + "' ", Arrays.asList(expectedText)
- .contains(completionProposal.getDisplayString()));
+ Assert.assertTrue("expect completionProposal text '" + completionProposal.getDisplayString() + "', but got " +
+ Strings.concat(", ", toString(computeCompletionProposals)),
+ Arrays.asList(expectedText).contains(completionProposal.getDisplayString()));
}
return this;
diff --git a/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/DefaultContentAssistProcessorTest.java b/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/DefaultContentAssistProcessorTest.java
index be34e31..644e3c5 100644
--- a/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/DefaultContentAssistProcessorTest.java
+++ b/tests/org.eclipse.xtext.ui.common.tests/src/org/eclipse/xtext/ui/common/editor/contentassist/impl/DefaultContentAssistProcessorTest.java
@@ -18,6 +18,9 @@ import org.eclipse.xtext.ISetup;
import org.eclipse.xtext.XtextGrammarTestLanguageRuntimeModule;
import org.eclipse.xtext.XtextGrammarTestLanguageStandaloneSetup;
import org.eclipse.xtext.XtextGrammarTestLanguageUiModule;
+import org.eclipse.xtext.enumrules.EnumRulesTestLanguageRuntimeModule;
+import org.eclipse.xtext.enumrules.EnumRulesTestLanguageStandaloneSetup;
+import org.eclipse.xtext.enumrules.EnumRulesTestLanguageUiModule;
import org.eclipse.xtext.junit.AbstractXtextTests;
import org.eclipse.xtext.parser.keywords.KeywordsTestLanguageRuntimeModule;
import org.eclipse.xtext.parser.keywords.KeywordsTestLanguageStandaloneSetup;
@@ -77,6 +80,15 @@ public class DefaultContentAssistProcessorTest extends AbstractXtextTests {
}
};
}
+
+ private ISetup getEnumsLangSetup() {
+ return new EnumRulesTestLanguageStandaloneSetup() {
+ @Override
+ public Injector createInjector() {
+ return Guice.createInjector(new EnumRulesTestLanguageRuntimeModule(), new EnumRulesTestLanguageUiModule());
+ }
+ };
+ }
public void testComputePrefix() throws Exception {
String model = "spielplatz 1 \"SpielplatzBeschreibung\" { kind(k1 0) kind(k2 0) erwachsener(e1 0) erwachsener(e2 0) ";
@@ -251,7 +263,31 @@ public class DefaultContentAssistProcessorTest extends AbstractXtextTests {
newBuilder(getKeywordsLangSetup())
.assertText("foo\\bar", "foo\\", "\\bar", "\\");
}
-
+
+ public void testEnumCompletion_01() throws Exception {
+ newBuilder(getEnumsLangSetup()).assertText("existing", "generated");
+ }
+
+ public void testEnumCompletion_02() throws Exception {
+ newBuilder(getEnumsLangSetup()).append("exi").assertText("existing");
+ }
+
+ public void _testEnumCompletion_03() throws Exception {
+ newBuilder(getEnumsLangSetup()).append(" ").assertText("existing", "generated");
+ }
+
+ public void testEnumCompletion_04() throws Exception {
+ newBuilder(getEnumsLangSetup()).append("existing").assertText("SameName", "DifferentLiteral", "overridden");
+ }
+
+ public void _testEnumCompletion_05() throws Exception {
+ newBuilder(getEnumsLangSetup()).append("existing ").assertText("SameName", "DifferentLiteral", "overridden");
+ }
+
+ public void _testEnumCompletion_06() throws Exception {
+ newBuilder(getEnumsLangSetup()).append("existing Same").assertText("SameName");
+ }
+
protected ContentAssistProcessorTestBuilder newBuilder(ISetup standAloneSetup) throws Exception {
with(standAloneSetup);
return new ContentAssistProcessorTestBuilder(standAloneSetup, this);