summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhbehrens2008-11-14 05:26:07 (EST)
committer sefftinge2008-11-14 05:26:07 (EST)
commit25ade5741d614240373dbed3c0fe161951ddb48b (patch)
tree9fc5cc01719517650973ecd21e459e4f54713ad2
parent4326848e260fb4d9e76a7fb98d7f5fac070b4120 (diff)
downloadorg.eclipse.xtext-25ade5741d614240373dbed3c0fe161951ddb48b.zip
org.eclipse.xtext-25ade5741d614240373dbed3c0fe161951ddb48b.tar.gz
org.eclipse.xtext-25ade5741d614240373dbed3c0fe161951ddb48b.tar.bz2
Fixed NPE in AbstractParser (Bug 254841) with Sebastian's patch
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/AbstractFowlerDslRuntimeConfig.java70
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/FowlerDsl.xmi110
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/FowlerDslStandaloneSetup.java53
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/IFowlerDsl.java23
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/fowlerdsl.ecore38
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/FowlerDslAntlrTokenFileProvider.java15
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/FowlerDslParser.java44
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g405
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.tokens16
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDslLexer.java1159
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDslParser.java960
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl__.g41
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parsetree/reconstr/FowlerDslParseTreeConstructor.java1048
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/services/FowlerDslGrammarAccess.java77
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/services/FowlerDslMetamodelAccess.java51
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/services/FowlerDslResourceFactory.java28
-rwxr-xr-xtests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/GenerateAllTestGrammars.java3
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/generator/AutoTestSuite.java1
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parser/XtextParserBugsTest.java26
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parser/XtextParserTest.java8
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/testlanguages/FowlerDsl.java15
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/testlanguages/FowlerDsl.xtext26
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/testlanguages/FowlerDslRuntimeConfig.java23
-rw-r--r--tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/testlanguages/FowlerdslChecks.chk7
24 files changed, 4246 insertions, 1 deletions
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/AbstractFowlerDslRuntimeConfig.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/AbstractFowlerDslRuntimeConfig.java
new file mode 100644
index 0000000..3d08167
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/AbstractFowlerDslRuntimeConfig.java
@@ -0,0 +1,70 @@
+package org.eclipse.xtext.testlanguages;
+
+import java.util.Set;
+
+import org.eclipse.xtext.service.AbstractServiceRegistrationFactory;
+
+/**
+ * used to register components to be used at runtime.
+ */
+public abstract class AbstractFowlerDslRuntimeConfig extends AbstractServiceRegistrationFactory {
+
+ protected Class<? extends org.eclipse.xtext.IGrammarAccess> getIGrammarAccess() {
+ return org.eclipse.xtext.testlanguages.services.FowlerDslGrammarAccess.class;
+ }
+
+ protected Class<? extends org.eclipse.xtext.IMetamodelAccess> getIMetamodelAccess() {
+ return org.eclipse.xtext.testlanguages.services.FowlerDslMetamodelAccess.class;
+ }
+
+ protected Class<? extends org.eclipse.xtext.parser.IAstFactory> getIAstFactory() {
+ return org.eclipse.xtext.parser.GenericEcoreElementFactory.class;
+ }
+
+ protected Class<? extends org.eclipse.xtext.parser.IParser> getIParser() {
+ return org.eclipse.xtext.testlanguages.parser.FowlerDslParser.class;
+ }
+
+ protected Class<? extends org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider> getIAntlrTokenFileProvider() {
+ return org.eclipse.xtext.testlanguages.parser.FowlerDslAntlrTokenFileProvider.class;
+ }
+
+ protected Class<? extends org.eclipse.xtext.resource.IResourceFactory> getIResourceFactory() {
+ return org.eclipse.xtext.testlanguages.services.FowlerDslResourceFactory.class;
+ }
+
+ protected Class<? extends org.eclipse.xtext.parsetree.reconstr.IParseTreeConstructor> getIParseTreeConstructor() {
+ return org.eclipse.xtext.testlanguages.parsetree.reconstr.FowlerDslParseTreeConstructor.class;
+ }
+
+ protected Class<? extends org.eclipse.xtext.parsetree.reconstr.ITokenSerializer> getITokenSerializer() {
+ return org.eclipse.xtext.parsetree.reconstr.impl.WhitespacePreservingTokenSerializer.class;
+ }
+
+ protected Class<? extends org.eclipse.xtext.parsetree.reconstr.ICrossReferenceSerializer> getICrossReferenceSerializer() {
+ return org.eclipse.xtext.parsetree.reconstr.impl.SimpleCrossReferenceSerializer.class;
+ }
+
+ protected Class<? extends org.eclipse.xtext.parser.antlr.Lexer> getLexer() {
+ return org.eclipse.xtext.testlanguages.parser.internal.InternalFowlerDslLexer.class;
+ }
+
+
+ public Set<IServiceRegistration> registrations() {
+ return scope(org.eclipse.xtext.testlanguages.IFowlerDsl.SCOPE)
+ .with(org.eclipse.xtext.IGrammarAccess.class, getIGrammarAccess())
+ .with(org.eclipse.xtext.IMetamodelAccess.class, getIMetamodelAccess())
+ .with(org.eclipse.xtext.parser.IAstFactory.class, getIAstFactory())
+ .with(org.eclipse.xtext.parser.IParser.class, getIParser())
+ .with(org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider.class, getIAntlrTokenFileProvider())
+ .with(org.eclipse.xtext.resource.IResourceFactory.class, getIResourceFactory())
+ .with(org.eclipse.xtext.parsetree.reconstr.IParseTreeConstructor.class, getIParseTreeConstructor())
+ .with(org.eclipse.xtext.parsetree.reconstr.ITokenSerializer.class, getITokenSerializer())
+ .with(org.eclipse.xtext.parsetree.reconstr.ICrossReferenceSerializer.class, getICrossReferenceSerializer())
+ .with(org.eclipse.xtext.parser.antlr.Lexer.class, getLexer())
+
+ .registrations();
+ }
+
+}
+
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/FowlerDsl.xmi b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/FowlerDsl.xmi
new file mode 100644
index 0000000..8504be3
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/FowlerDsl.xmi
@@ -0,0 +1,110 @@
+<?xml version="1.0" encoding="ASCII"?>
+<xtext:Grammar xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xtext="http://www.eclipse.org/2008/Xtext">
+ <metamodelDeclarations xsi:type="xtext:GeneratedMetamodel" name="fowlerdsl" nsURI="http://example.xtext.org/FowlerDsl"/>
+ <idElements>org</idElements>
+ <idElements>eclipse</idElements>
+ <idElements>xtext</idElements>
+ <idElements>testlanguages</idElements>
+ <idElements>FowlerDsl</idElements>
+ <rules xsi:type="xtext:ParserRule" name="Statemachine">
+ <alternatives xsi:type="xtext:Group">
+ <abstractTokens xsi:type="xtext:Group">
+ <abstractTokens xsi:type="xtext:Group">
+ <abstractTokens xsi:type="xtext:Group">
+ <abstractTokens xsi:type="xtext:Group">
+ <abstractTokens xsi:type="xtext:Group">
+ <abstractTokens xsi:type="xtext:Keyword" value="events"/>
+ <abstractTokens xsi:type="xtext:Assignment" cardinality="*" operator="+=" feature="events">
+ <terminal xsi:type="xtext:RuleCall" name="Event"/>
+ </abstractTokens>
+ </abstractTokens>
+ <abstractTokens xsi:type="xtext:Keyword" value="end"/>
+ </abstractTokens>
+ <abstractTokens xsi:type="xtext:Keyword" value="commands"/>
+ </abstractTokens>
+ <abstractTokens xsi:type="xtext:Assignment" cardinality="*" operator="+=" feature="commands">
+ <terminal xsi:type="xtext:RuleCall" name="Command"/>
+ </abstractTokens>
+ </abstractTokens>
+ <abstractTokens xsi:type="xtext:Keyword" value="end"/>
+ </abstractTokens>
+ <abstractTokens xsi:type="xtext:Assignment" cardinality="*" operator="+=" feature="states">
+ <terminal xsi:type="xtext:RuleCall" name="State"/>
+ </abstractTokens>
+ </alternatives>
+ </rules>
+ <rules xsi:type="xtext:ParserRule" name="Event">
+ <alternatives xsi:type="xtext:Group">
+ <abstractTokens xsi:type="xtext:Group">
+ <abstractTokens xsi:type="xtext:Assignment" cardinality="?" operator="?=" feature="resetting">
+ <terminal xsi:type="xtext:Keyword" value="resetting"/>
+ </abstractTokens>
+ <abstractTokens xsi:type="xtext:Assignment" operator="=" feature="name">
+ <terminal xsi:type="xtext:RuleCall" name="ID"/>
+ </abstractTokens>
+ </abstractTokens>
+ <abstractTokens xsi:type="xtext:Assignment" operator="=" feature="code">
+ <terminal xsi:type="xtext:RuleCall" name="ID"/>
+ </abstractTokens>
+ </alternatives>
+ </rules>
+ <rules xsi:type="xtext:ParserRule" name="Command">
+ <alternatives xsi:type="xtext:Group">
+ <abstractTokens xsi:type="xtext:Assignment" operator="=" feature="name">
+ <terminal xsi:type="xtext:RuleCall" name="ID"/>
+ </abstractTokens>
+ <abstractTokens xsi:type="xtext:Assignment" operator="=" feature="code">
+ <terminal xsi:type="xtext:RuleCall" name="ID"/>
+ </abstractTokens>
+ </alternatives>
+ </rules>
+ <rules xsi:type="xtext:ParserRule" name="State">
+ <alternatives xsi:type="xtext:Group">
+ <abstractTokens xsi:type="xtext:Group">
+ <abstractTokens xsi:type="xtext:Group">
+ <abstractTokens xsi:type="xtext:Group">
+ <abstractTokens xsi:type="xtext:Keyword" value="state"/>
+ <abstractTokens xsi:type="xtext:Assignment" operator="=" feature="name">
+ <terminal xsi:type="xtext:RuleCall" name="ID"/>
+ </abstractTokens>
+ </abstractTokens>
+ <abstractTokens xsi:type="xtext:Group" cardinality="?">
+ <abstractTokens xsi:type="xtext:Group">
+ <abstractTokens xsi:type="xtext:Group">
+ <abstractTokens xsi:type="xtext:Keyword" value="actions"/>
+ <abstractTokens xsi:type="xtext:Keyword" value="{"/>
+ </abstractTokens>
+ <abstractTokens xsi:type="xtext:Assignment" cardinality="+" operator="+=" feature="actions">
+ <terminal xsi:type="xtext:CrossReference">
+ <type name="Command"/>
+ </terminal>
+ </abstractTokens>
+ </abstractTokens>
+ <abstractTokens xsi:type="xtext:Keyword" value="}"/>
+ </abstractTokens>
+ </abstractTokens>
+ <abstractTokens xsi:type="xtext:Assignment" cardinality="*" operator="+=" feature="transitions">
+ <terminal xsi:type="xtext:RuleCall" name="Transition"/>
+ </abstractTokens>
+ </abstractTokens>
+ <abstractTokens xsi:type="xtext:Keyword" value="end"/>
+ </alternatives>
+ </rules>
+ <rules xsi:type="xtext:ParserRule" name="Transition">
+ <alternatives xsi:type="xtext:Group">
+ <abstractTokens xsi:type="xtext:Group">
+ <abstractTokens xsi:type="xtext:Assignment" operator="=" feature="event">
+ <terminal xsi:type="xtext:CrossReference">
+ <type name="Event"/>
+ </terminal>
+ </abstractTokens>
+ <abstractTokens xsi:type="xtext:Keyword" value="=>"/>
+ </abstractTokens>
+ <abstractTokens xsi:type="xtext:Assignment" operator="=" feature="state">
+ <terminal xsi:type="xtext:CrossReference">
+ <type name="State"/>
+ </terminal>
+ </abstractTokens>
+ </alternatives>
+ </rules>
+</xtext:Grammar>
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/FowlerDslStandaloneSetup.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/FowlerDslStandaloneSetup.java
new file mode 100644
index 0000000..968bba5
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/FowlerDslStandaloneSetup.java
@@ -0,0 +1,53 @@
+/*
+Generated with Xtext
+*/
+package org.eclipse.xtext.testlanguages;
+
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.xtext.EcoreUtil2;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.xtext.resource.IResourceFactory;
+import org.eclipse.xtext.service.IServiceScope;
+import org.eclipse.xtext.service.ServiceRegistry;
+import org.eclipse.xtext.service.IServiceRegistrationFactory.IServiceRegistration;
+
+import org.eclipse.xtext.testlanguages.IFowlerDsl;
+
+public abstract class FowlerDslStandaloneSetup {
+
+ private static boolean isInitialized = false;
+
+ public synchronized static void doSetup() {
+ if(!isInitialized) {
+ // setup super language first
+ org.eclipse.xtext.builtin.XtextBuiltinStandaloneSetup.doSetup();
+
+ for (IServiceRegistration reg : new org.eclipse.xtext.testlanguages.FowlerDslRuntimeConfig().registrations()) {
+ ServiceRegistry.registerFactory(reg.scope(), reg.serviceFactory(), reg.priority());
+ }
+
+ // register resource factory to EMF
+ IResourceFactory resourceFactory = new org.eclipse.xtext.testlanguages.services.FowlerDslResourceFactory();
+ Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("fowlerdsl", resourceFactory);
+
+
+ // initialize EPackages
+
+ if (!EPackage.Registry.INSTANCE.containsKey("http://example.xtext.org/FowlerDsl")) {
+ EPackage fowlerdsl = EcoreUtil2.loadEPackage(
+ "classpath:/org/eclipse/xtext/testlanguages/fowlerdsl.ecore",
+ FowlerDslStandaloneSetup.class.getClassLoader());
+ if (fowlerdsl == null)
+ throw new IllegalStateException(
+ "Couldn't load EPackage from 'classpath:/org/eclipse/xtext/testlanguages/fowlerdsl.ecore'");
+ EPackage.Registry.INSTANCE.put("http://example.xtext.org/FowlerDsl", fowlerdsl);
+ }
+
+ isInitialized = true;
+ }
+ }
+
+ public static IServiceScope getServiceScope() {
+ return org.eclipse.xtext.testlanguages.IFowlerDsl.SCOPE;
+ }
+}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/IFowlerDsl.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/IFowlerDsl.java
new file mode 100644
index 0000000..de9d8f9
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/IFowlerDsl.java
@@ -0,0 +1,23 @@
+/*
+Generated with Xtext
+*/
+package org.eclipse.xtext.testlanguages;
+
+import org.eclipse.xtext.service.IServiceScope;
+import org.eclipse.xtext.service.ServiceScopeFactory;
+
+public interface IFowlerDsl {
+
+ /**
+ * the unique identifier of this language.
+ * To be used to get the language descriptor and related services from the registry.
+ * Within ILanguageServices it is encouraged to use dependency injection instead
+ * of directly accessing the ServiceRegistry
+ */
+ public static final String ID = "org.eclipse.xtext.testlanguages.FowlerDsl";
+ public static final String NAME = "FowlerDsl";
+ public static final String NAMESPACE = "org.eclipse.xtext.testlanguages";
+ public static final String[] FILE_EXTENSIONS = new String[]{"fowlerdsl"};
+ public static final IServiceScope SCOPE = ServiceScopeFactory.createScope(ID, org.eclipse.xtext.builtin.IXtextBuiltin.SCOPE);
+
+}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/fowlerdsl.ecore b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/fowlerdsl.ecore
new file mode 100644
index 0000000..33f7f5c
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/fowlerdsl.ecore
@@ -0,0 +1,38 @@
+<?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="fowlerdsl" nsURI="http://example.xtext.org/FowlerDsl" nsPrefix="fowlerdsl">
+ <eClassifiers xsi:type="ecore:EClass" name="Statemachine">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="events" upperBound="-1" eType="//Event" containment="true"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="commands" upperBound="-1" eType="//Command" containment="true"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="states" upperBound="-1" eType="//State" containment="true"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Event">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="resetting">
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name">
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="code">
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Command">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name">
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="code">
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="State">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name">
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="actions" upperBound="-1" eType="//Command"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="transitions" upperBound="-1" eType="//Transition" containment="true"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Transition">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="event" eType="//Event"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="state" eType="//State"/>
+ </eClassifiers>
+</ecore:EPackage>
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/FowlerDslAntlrTokenFileProvider.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/FowlerDslAntlrTokenFileProvider.java
new file mode 100644
index 0000000..317aba7
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/FowlerDslAntlrTokenFileProvider.java
@@ -0,0 +1,15 @@
+/*
+Generated with Xtext
+*/
+package org.eclipse.xtext.testlanguages.parser;
+
+import java.io.InputStream;
+import org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider;
+
+public class FowlerDslAntlrTokenFileProvider implements IAntlrTokenFileProvider {
+
+ public InputStream getAntlrTokenFile() {
+ ClassLoader classLoader = FowlerDslAntlrTokenFileProvider.class.getClassLoader();
+ return classLoader.getResourceAsStream("org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.tokens");
+ }
+}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/FowlerDslParser.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/FowlerDslParser.java
new file mode 100644
index 0000000..b1e532c
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/FowlerDslParser.java
@@ -0,0 +1,44 @@
+/*
+Generated with Xtext
+*/
+package org.eclipse.xtext.testlanguages.parser;
+
+import org.antlr.runtime.ANTLRInputStream;
+import org.eclipse.xtext.parser.antlr.AntlrTokenDefProvider;
+import org.eclipse.xtext.parser.IAstFactory;
+import org.eclipse.xtext.parser.IParseResult;
+import org.eclipse.xtext.parser.ParseException;
+import org.eclipse.xtext.parser.antlr.XtextTokenStream;
+import org.eclipse.xtext.service.Inject;
+
+import org.eclipse.xtext.testlanguages.parser.internal.InternalFowlerDslLexer;
+import org.eclipse.xtext.testlanguages.parser.internal.InternalFowlerDslParser;
+
+public class FowlerDslParser extends org.eclipse.xtext.parser.AbstractParser {
+
+ @Inject
+ protected AntlrTokenDefProvider antlrTokenDefProvider;
+
+ @Override
+ protected IParseResult parse(String ruleName, ANTLRInputStream in, IAstFactory factory) {
+ InternalFowlerDslLexer lexer = new InternalFowlerDslLexer(in);
+ XtextTokenStream stream = new XtextTokenStream(lexer);
+ InternalFowlerDslParser parser = new InternalFowlerDslParser(
+ stream, factory, grammarAccess.getGrammar());
+ parser.setTokenTypeMap(antlrTokenDefProvider.getTokenDefMap());
+ try {
+ if(ruleName != null) {
+ return parser.parse(ruleName);
+ } else {
+ return parser.parse();
+ }
+ } catch (Exception re) {
+ throw new ParseException(re.getMessage(),re);
+ }
+ }
+
+ @Override
+ protected String getDefaultRuleName() {
+ return "Statemachine";
+ }
+}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g
new file mode 100644
index 0000000..670c31a
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g
@@ -0,0 +1,405 @@
+/*
+Generated with Xtext
+*/
+grammar InternalFowlerDsl;
+
+options {
+ superClass=AbstractAntlrParser;
+}
+
+@lexer::header {
+package org.eclipse.xtext.testlanguages.parser.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.testlanguages.parser.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.xtext.parser.antlr.AbstractAntlrParser;
+import org.eclipse.xtext.parser.antlr.XtextTokenStream;
+}
+
+@parser::members {
+
+ public InternalFowlerDslParser(TokenStream input, IAstFactory factory, Grammar g) {
+ this(input);
+ this.factory = factory;
+ grammar = g;
+ }
+
+ @Override
+ protected InputStream getTokenFile() {
+ ClassLoader classLoader = InternalFowlerDslParser.class.getClassLoader();
+ return classLoader.getResourceAsStream("org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.tokens");
+ }
+
+ @Override
+ protected String getFirstRuleName() {
+ return "Statemachine";
+ }
+}
+
+@rulecatch {
+ catch (RecognitionException re) {
+ recover(input,re);
+ appendSkippedTokens();
+ }
+}
+
+
+
+// Entry rule entryRuleStatemachine
+entryRuleStatemachine returns [EObject current=null] :
+ { currentNode = createCompositeNode("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.0" /* xtext::ParserRule */, currentNode); }
+ iv_ruleStatemachine=ruleStatemachine
+ { $current=$iv_ruleStatemachine.current; }
+ EOF
+;
+
+// Rule Statemachine
+ruleStatemachine returns [EObject current=null]
+ @init { EObject temp=null; setCurrentLookahead(); resetLookahead(); }
+ @after { resetLookahead(); }:
+(((((('events'
+ {
+ createLeafNode("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.0/@alternatives/@abstractTokens.0/@abstractTokens.0/@abstractTokens.0/@abstractTokens.0/@abstractTokens.0/@abstractTokens.0" /* xtext::Keyword */, null);
+ }
+(
+
+
+ {
+ currentNode=createCompositeNode("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.0/@alternatives/@abstractTokens.0/@abstractTokens.0/@abstractTokens.0/@abstractTokens.0/@abstractTokens.0/@abstractTokens.1/@terminal" /* xtext::RuleCall */, currentNode);
+ }
+ lv_events=ruleEvent
+ {
+ currentNode = currentNode.getParent();
+ if ($current==null) {
+ $current = factory.create("Statemachine");
+ associateNodeWithAstElement(currentNode, $current);
+ }
+
+ factory.add($current, "events", lv_events,null);
+ }
+
+)*)'end'
+ {
+ createLeafNode("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.0/@alternatives/@abstractTokens.0/@abstractTokens.0/@abstractTokens.0/@abstractTokens.0/@abstractTokens.1" /* xtext::Keyword */, null);
+ }
+)'commands'
+ {
+ createLeafNode("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.0/@alternatives/@abstractTokens.0/@abstractTokens.0/@abstractTokens.0/@abstractTokens.1" /* xtext::Keyword */, null);
+ }
+)(
+
+
+ {
+ currentNode=createCompositeNode("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.0/@alternatives/@abstractTokens.0/@abstractTokens.0/@abstractTokens.1/@terminal" /* xtext::RuleCall */, currentNode);
+ }
+ lv_commands=ruleCommand
+ {
+ currentNode = currentNode.getParent();
+ if ($current==null) {
+ $current = factory.create("Statemachine");
+ associateNodeWithAstElement(currentNode, $current);
+ }
+
+ factory.add($current, "commands", lv_commands,null);
+ }
+
+)*)'end'
+ {
+ createLeafNode("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.0/@alternatives/@abstractTokens.0/@abstractTokens.1" /* xtext::Keyword */, null);
+ }
+)(
+
+
+ {
+ currentNode=createCompositeNode("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.0/@alternatives/@abstractTokens.1/@terminal" /* xtext::RuleCall */, currentNode);
+ }
+ lv_states=ruleState
+ {
+ currentNode = currentNode.getParent();
+ if ($current==null) {
+ $current = factory.create("Statemachine");
+ associateNodeWithAstElement(currentNode, $current);
+ }
+
+ factory.add($current, "states", lv_states,null);
+ }
+
+)*);
+
+
+
+// Entry rule entryRuleEvent
+entryRuleEvent returns [EObject current=null] :
+ { currentNode = createCompositeNode("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.1" /* xtext::ParserRule */, currentNode); }
+ iv_ruleEvent=ruleEvent
+ { $current=$iv_ruleEvent.current; }
+ EOF
+;
+
+// Rule Event
+ruleEvent returns [EObject current=null]
+ @init { EObject temp=null; setCurrentLookahead(); resetLookahead(); }
+ @after { resetLookahead(); }:
+(((
+
+ lv_resetting='resetting'
+ {
+ createLeafNode("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.1/@alternatives/@abstractTokens.0/@abstractTokens.0/@terminal" /* xtext::Keyword */, "resetting");
+ }
+
+ {
+ if ($current==null) {
+ $current = factory.create("Event");
+ associateNodeWithAstElement(currentNode, $current);
+ }
+
+ factory.set($current, "resetting", true,"resetting");
+ }
+
+)?(
+
+ lv_name=RULE_ID
+ {
+ createLeafNode("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.1/@alternatives/@abstractTokens.0/@abstractTokens.1/@terminal" /* xtext::RuleCall */, "name");
+ }
+
+ {
+ if ($current==null) {
+ $current = factory.create("Event");
+ associateNodeWithAstElement(currentNode, $current);
+ }
+
+ factory.set($current, "name", lv_name,"ID");
+ }
+
+))(
+
+ lv_code=RULE_ID
+ {
+ createLeafNode("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.1/@alternatives/@abstractTokens.1/@terminal" /* xtext::RuleCall */, "code");
+ }
+
+ {
+ if ($current==null) {
+ $current = factory.create("Event");
+ associateNodeWithAstElement(currentNode, $current);
+ }
+
+ factory.set($current, "code", lv_code,"ID");
+ }
+
+));
+
+
+
+// Entry rule entryRuleCommand
+entryRuleCommand returns [EObject current=null] :
+ { currentNode = createCompositeNode("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.2" /* xtext::ParserRule */, currentNode); }
+ iv_ruleCommand=ruleCommand
+ { $current=$iv_ruleCommand.current; }
+ EOF
+;
+
+// Rule Command
+ruleCommand returns [EObject current=null]
+ @init { EObject temp=null; setCurrentLookahead(); resetLookahead(); }
+ @after { resetLookahead(); }:
+((
+
+ lv_name=RULE_ID
+ {
+ createLeafNode("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.2/@alternatives/@abstractTokens.0/@terminal" /* xtext::RuleCall */, "name");
+ }
+
+ {
+ if ($current==null) {
+ $current = factory.create("Command");
+ associateNodeWithAstElement(currentNode, $current);
+ }
+
+ factory.set($current, "name", lv_name,"ID");
+ }
+
+)(
+
+ lv_code=RULE_ID
+ {
+ createLeafNode("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.2/@alternatives/@abstractTokens.1/@terminal" /* xtext::RuleCall */, "code");
+ }
+
+ {
+ if ($current==null) {
+ $current = factory.create("Command");
+ associateNodeWithAstElement(currentNode, $current);
+ }
+
+ factory.set($current, "code", lv_code,"ID");
+ }
+
+));
+
+
+
+// Entry rule entryRuleState
+entryRuleState returns [EObject current=null] :
+ { currentNode = createCompositeNode("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.3" /* xtext::ParserRule */, currentNode); }
+ iv_ruleState=ruleState
+ { $current=$iv_ruleState.current; }
+ EOF
+;
+
+// Rule State
+ruleState returns [EObject current=null]
+ @init { EObject temp=null; setCurrentLookahead(); resetLookahead(); }
+ @after { resetLookahead(); }:
+(((('state'
+ {
+ createLeafNode("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.3/@alternatives/@abstractTokens.0/@abstractTokens.0/@abstractTokens.0/@abstractTokens.0" /* xtext::Keyword */, null);
+ }
+(
+
+ lv_name=RULE_ID
+ {
+ createLeafNode("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.3/@alternatives/@abstractTokens.0/@abstractTokens.0/@abstractTokens.0/@abstractTokens.1/@terminal" /* xtext::RuleCall */, "name");
+ }
+
+ {
+ if ($current==null) {
+ $current = factory.create("State");
+ associateNodeWithAstElement(currentNode, $current);
+ }
+
+ factory.set($current, "name", lv_name,"ID");
+ }
+
+))((('actions'
+ {
+ createLeafNode("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.3/@alternatives/@abstractTokens.0/@abstractTokens.0/@abstractTokens.1/@abstractTokens.0/@abstractTokens.0/@abstractTokens.0" /* xtext::Keyword */, null);
+ }
+'{'
+ {
+ createLeafNode("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.3/@alternatives/@abstractTokens.0/@abstractTokens.0/@abstractTokens.1/@abstractTokens.0/@abstractTokens.0/@abstractTokens.1" /* xtext::Keyword */, null);
+ }
+)(
+
+
+ {
+ if ($current==null) {
+ $current = factory.create("State");
+ associateNodeWithAstElement(currentNode, $current);
+ }
+ }
+(
+ RULE_ID {
+ createLeafNode("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.3/@alternatives/@abstractTokens.0/@abstractTokens.0/@abstractTokens.1/@abstractTokens.0/@abstractTokens.1/@terminal" /* xtext::CrossReference */, "actions");
+ }
+)
+
+)+)'}'
+ {
+ createLeafNode("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.3/@alternatives/@abstractTokens.0/@abstractTokens.0/@abstractTokens.1/@abstractTokens.1" /* xtext::Keyword */, null);
+ }
+)?)(
+
+
+ {
+ currentNode=createCompositeNode("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.3/@alternatives/@abstractTokens.0/@abstractTokens.1/@terminal" /* xtext::RuleCall */, currentNode);
+ }
+ lv_transitions=ruleTransition
+ {
+ currentNode = currentNode.getParent();
+ if ($current==null) {
+ $current = factory.create("State");
+ associateNodeWithAstElement(currentNode, $current);
+ }
+
+ factory.add($current, "transitions", lv_transitions,null);
+ }
+
+)*)'end'
+ {
+ createLeafNode("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.3/@alternatives/@abstractTokens.1" /* xtext::Keyword */, null);
+ }
+);
+
+
+
+// Entry rule entryRuleTransition
+entryRuleTransition returns [EObject current=null] :
+ { currentNode = createCompositeNode("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.4" /* xtext::ParserRule */, currentNode); }
+ iv_ruleTransition=ruleTransition
+ { $current=$iv_ruleTransition.current; }
+ EOF
+;
+
+// Rule Transition
+ruleTransition returns [EObject current=null]
+ @init { EObject temp=null; setCurrentLookahead(); resetLookahead(); }
+ @after { resetLookahead(); }:
+(((
+
+
+ {
+ if ($current==null) {
+ $current = factory.create("Transition");
+ associateNodeWithAstElement(currentNode, $current);
+ }
+ }
+(
+ RULE_ID {
+ createLeafNode("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.4/@alternatives/@abstractTokens.0/@abstractTokens.0/@terminal" /* xtext::CrossReference */, "event");
+ }
+)
+
+)'=>'
+ {
+ createLeafNode("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.4/@alternatives/@abstractTokens.0/@abstractTokens.1" /* xtext::Keyword */, null);
+ }
+)(
+
+
+ {
+ if ($current==null) {
+ $current = factory.create("Transition");
+ associateNodeWithAstElement(currentNode, $current);
+ }
+ }
+(
+ RULE_ID {
+ createLeafNode("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.4/@alternatives/@abstractTokens.1/@terminal" /* xtext::CrossReference */, "state");
+ }
+)
+
+));
+
+
+
+
+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;} : . )* '*/' {$channel=HIDDEN;};
+
+RULE_SL_COMMENT : '//' ~('\n'|'\r')* ('\r'? '\n')? {$channel=HIDDEN;};
+
+RULE_WS : (' '|'\t'|'\r'|'\n')+ {$channel=HIDDEN;};
+
+RULE_ANY_OTHER : .;
+
+
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.tokens b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.tokens
new file mode 100644
index 0000000..96a5666
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.tokens
@@ -0,0 +1,16 @@
+RULE_ML_COMMENT=7
+RULE_ID=4
+RULE_WS=9
+RULE_INT=5
+RULE_STRING=6
+RULE_ANY_OTHER=10
+RULE_SL_COMMENT=8
+'commands'=13
+'resetting'=14
+'events'=11
+'=>'=19
+'state'=15
+'end'=12
+'actions'=16
+'}'=18
+'{'=17
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDslLexer.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDslLexer.java
new file mode 100644
index 0000000..2a69919
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDslLexer.java
@@ -0,0 +1,1159 @@
+// $ANTLR 3.0.1 ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g 2008-11-13 12:18:28
+
+package org.eclipse.xtext.testlanguages.parser.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 InternalFowlerDslLexer 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 T11=11;
+ public static final int RULE_STRING=6;
+ public static final int T12=12;
+ public static final int T13=13;
+ public static final int T18=18;
+ public static final int RULE_WS=9;
+ public static final int T15=15;
+ public static final int RULE_INT=5;
+ public static final int EOF=-1;
+ public static final int T17=17;
+ public static final int Tokens=20;
+ public static final int RULE_ANY_OTHER=10;
+ public static final int T16=16;
+ public static final int RULE_SL_COMMENT=8;
+ public static final int T19=19;
+ public InternalFowlerDslLexer() {;}
+ public InternalFowlerDslLexer(CharStream input) {
+ super(input);
+ }
+ public String getGrammarFileName() { return "./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g"; }
+
+ // $ANTLR start T11
+ public final void mT11() throws RecognitionException {
+ try {
+ int _type = T11;
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:10:5: ( 'events' )
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:10:7: 'events'
+ {
+ match("events");
+
+
+ }
+
+ this.type = _type;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end T11
+
+ // $ANTLR start T12
+ public final void mT12() throws RecognitionException {
+ try {
+ int _type = T12;
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:11:5: ( 'end' )
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:11:7: 'end'
+ {
+ match("end");
+
+
+ }
+
+ this.type = _type;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end T12
+
+ // $ANTLR start T13
+ public final void mT13() throws RecognitionException {
+ try {
+ int _type = T13;
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:12:5: ( 'commands' )
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:12:7: 'commands'
+ {
+ match("commands");
+
+
+ }
+
+ this.type = _type;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end T13
+
+ // $ANTLR start T14
+ public final void mT14() throws RecognitionException {
+ try {
+ int _type = T14;
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:13:5: ( 'resetting' )
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:13:7: 'resetting'
+ {
+ match("resetting");
+
+
+ }
+
+ this.type = _type;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end T14
+
+ // $ANTLR start T15
+ public final void mT15() throws RecognitionException {
+ try {
+ int _type = T15;
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:14:5: ( 'state' )
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:14:7: 'state'
+ {
+ match("state");
+
+
+ }
+
+ this.type = _type;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end T15
+
+ // $ANTLR start T16
+ public final void mT16() throws RecognitionException {
+ try {
+ int _type = T16;
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:15:5: ( 'actions' )
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:15:7: 'actions'
+ {
+ match("actions");
+
+
+ }
+
+ this.type = _type;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end T16
+
+ // $ANTLR start T17
+ public final void mT17() throws RecognitionException {
+ try {
+ int _type = T17;
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:16:5: ( '{' )
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:16:7: '{'
+ {
+ match('{');
+
+ }
+
+ this.type = _type;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end T17
+
+ // $ANTLR start T18
+ public final void mT18() throws RecognitionException {
+ try {
+ int _type = T18;
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:17:5: ( '}' )
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:17:7: '}'
+ {
+ match('}');
+
+ }
+
+ this.type = _type;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end T18
+
+ // $ANTLR start T19
+ public final void mT19() throws RecognitionException {
+ try {
+ int _type = T19;
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:18:5: ( '=>' )
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:18:7: '=>'
+ {
+ match("=>");
+
+
+ }
+
+ this.type = _type;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end T19
+
+ // $ANTLR start RULE_ID
+ public final void mRULE_ID() throws RecognitionException {
+ try {
+ int _type = RULE_ID;
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:391:9: ( ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* )
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:391:11: ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )*
+ {
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:391:11: ( '^' )?
+ int alt1=2;
+ int LA1_0 = input.LA(1);
+
+ if ( (LA1_0=='^') ) {
+ alt1=1;
+ }
+ switch (alt1) {
+ case 1 :
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:391:12: '^'
+ {
+ 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;
+ }
+
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:391:41: ( '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 :
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.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;
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:393:10: ( ( '0' .. '9' )+ )
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:393:12: ( '0' .. '9' )+
+ {
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:393: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 :
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:393: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;
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:395:13: ( '\"' ( '\\\\' ( '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("395:1: RULE_STRING : ( '\"' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | ~ ( '\\\\' | '\"' ) )* '\"' | '\\'' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | ~ ( '\\\\' | '\\'' ) )* '\\'' );", 6, 0, input);
+
+ throw nvae;
+ }
+ switch (alt6) {
+ case 1 :
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:395:15: '\"' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | ~ ( '\\\\' | '\"' ) )* '\"'
+ {
+ match('\"');
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:395:19: ( '\\\\' ( '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 :
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:395:21: '\\\\' ( '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 :
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:395:65: ~ ( '\\\\' | '\"' )
+ {
+ 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 :
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:395:101: '\\'' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | ~ ( '\\\\' | '\\'' ) )* '\\''
+ {
+ match('\'');
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:395:106: ( '\\\\' ( '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 :
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:395:108: '\\\\' ( '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 :
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:395:152: ~ ( '\\\\' | '\\'' )
+ {
+ 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;
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:397:17: ( '/*' ( options {greedy=false; } : . )* '*/' )
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:397:19: '/*' ( options {greedy=false; } : . )* '*/'
+ {
+ match("/*");
+
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:397: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 :
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:397:52: .
+ {
+ matchAny();
+
+ }
+ break;
+
+ default :
+ break loop7;
+ }
+ } while (true);
+
+ match("*/");
+
+ channel=HIDDEN;
+
+ }
+
+ 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;
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:399:17: ( '//' (~ ( '\\n' | '\\r' ) )* ( ( '\\r' )? '\\n' )? )
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:399:19: '//' (~ ( '\\n' | '\\r' ) )* ( ( '\\r' )? '\\n' )?
+ {
+ match("//");
+
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:399: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 :
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:399: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);
+
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:399:38: ( ( '\\r' )? '\\n' )?
+ int alt10=2;
+ int LA10_0 = input.LA(1);
+
+ if ( (LA10_0=='\n'||LA10_0=='\r') ) {
+ alt10=1;
+ }
+ switch (alt10) {
+ case 1 :
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:399:39: ( '\\r' )? '\\n'
+ {
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:399:39: ( '\\r' )?
+ int alt9=2;
+ int LA9_0 = input.LA(1);
+
+ if ( (LA9_0=='\r') ) {
+ alt9=1;
+ }
+ switch (alt9) {
+ case 1 :
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:399:39: '\\r'
+ {
+ match('\r');
+
+ }
+ break;
+
+ }
+
+ match('\n');
+
+ }
+ break;
+
+ }
+
+ channel=HIDDEN;
+
+ }
+
+ 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;
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:401:9: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ )
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:401:11: ( ' ' | '\\t' | '\\r' | '\\n' )+
+ {
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:401: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 :
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.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);
+
+ channel=HIDDEN;
+
+ }
+
+ 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;
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:403:16: ( . )
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:403:18: .
+ {
+ matchAny();
+
+ }
+
+ this.type = _type;
+ }
+ finally {
+ }
+ }
+ // $ANTLR end RULE_ANY_OTHER
+
+ public void mTokens() throws RecognitionException {
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:1:8: ( T11 | T12 | T13 | T14 | T15 | T16 | T17 | T18 | T19 | RULE_ID | RULE_INT | RULE_STRING | RULE_ML_COMMENT | RULE_SL_COMMENT | RULE_WS | RULE_ANY_OTHER )
+ int alt12=16;
+ int LA12_0 = input.LA(1);
+
+ if ( (LA12_0=='e') ) {
+ switch ( input.LA(2) ) {
+ case 'v':
+ {
+ int LA12_17 = input.LA(3);
+
+ if ( (LA12_17=='e') ) {
+ int LA12_32 = input.LA(4);
+
+ if ( (LA12_32=='n') ) {
+ int LA12_38 = input.LA(5);
+
+ if ( (LA12_38=='t') ) {
+ int LA12_44 = input.LA(6);
+
+ if ( (LA12_44=='s') ) {
+ int LA12_49 = input.LA(7);
+
+ if ( ((LA12_49>='0' && LA12_49<='9')||(LA12_49>='A' && LA12_49<='Z')||LA12_49=='_'||(LA12_49>='a' && LA12_49<='z')) ) {
+ alt12=10;
+ }
+ else {
+ alt12=1;}
+ }
+ else {
+ alt12=10;}
+ }
+ else {
+ alt12=10;}
+ }
+ else {
+ alt12=10;}
+ }
+ else {
+ alt12=10;}
+ }
+ break;
+ case 'n':
+ {
+ int LA12_18 = input.LA(3);
+
+ if ( (LA12_18=='d') ) {
+ int LA12_33 = input.LA(4);
+
+ if ( ((LA12_33>='0' && LA12_33<='9')||(LA12_33>='A' && LA12_33<='Z')||LA12_33=='_'||(LA12_33>='a' && LA12_33<='z')) ) {
+ alt12=10;
+ }
+ else {
+ alt12=2;}
+ }
+ else {
+ alt12=10;}
+ }
+ break;
+ default:
+ alt12=10;}
+
+ }
+ else if ( (LA12_0=='c') ) {
+ int LA12_2 = input.LA(2);
+
+ if ( (LA12_2=='o') ) {
+ int LA12_20 = input.LA(3);
+
+ if ( (LA12_20=='m') ) {
+ int LA12_34 = input.LA(4);
+
+ if ( (LA12_34=='m') ) {
+ int LA12_40 = input.LA(5);
+
+ if ( (LA12_40=='a') ) {
+ int LA12_45 = input.LA(6);
+
+ if ( (LA12_45=='n') ) {
+ int LA12_50 = input.LA(7);
+
+ if ( (LA12_50=='d') ) {
+ int LA12_55 = input.LA(8);
+
+ if ( (LA12_55=='s') ) {
+ int LA12_58 = input.LA(9);
+
+ if ( ((LA12_58>='0' && LA12_58<='9')||(LA12_58>='A' && LA12_58<='Z')||LA12_58=='_'||(LA12_58>='a' && LA12_58<='z')) ) {
+ alt12=10;
+ }
+ else {
+ alt12=3;}
+ }
+ else {
+ alt12=10;}
+ }
+ else {
+ alt12=10;}
+ }
+ else {
+ alt12=10;}
+ }
+ else {
+ alt12=10;}
+ }
+ else {
+ alt12=10;}
+ }
+ else {
+ alt12=10;}
+ }
+ else {
+ alt12=10;}
+ }
+ else if ( (LA12_0=='r') ) {
+ int LA12_3 = input.LA(2);
+
+ if ( (LA12_3=='e') ) {
+ int LA12_21 = input.LA(3);
+
+ if ( (LA12_21=='s') ) {
+ int LA12_35 = input.LA(4);
+
+ if ( (LA12_35=='e') ) {
+ int LA12_41 = input.LA(5);
+
+ if ( (LA12_41=='t') ) {
+ int LA12_46 = input.LA(6);
+
+ if ( (LA12_46=='t') ) {
+ int LA12_51 = input.LA(7);
+
+ if ( (LA12_51=='i') ) {
+ int LA12_56 = input.LA(8);
+
+ if ( (LA12_56=='n') ) {
+ int LA12_59 = input.LA(9);
+
+ if ( (LA12_59=='g') ) {
+ int LA12_62 = input.LA(10);
+
+ if ( ((LA12_62>='0' && LA12_62<='9')||(LA12_62>='A' && LA12_62<='Z')||LA12_62=='_'||(LA12_62>='a' && LA12_62<='z')) ) {
+ alt12=10;
+ }
+ else {
+ alt12=4;}
+ }
+ else {
+ alt12=10;}
+ }
+ else {
+ alt12=10;}
+ }
+ else {
+ alt12=10;}
+ }
+ else {
+ alt12=10;}
+ }
+ else {
+ alt12=10;}
+ }
+ else {
+ alt12=10;}
+ }
+ else {
+ alt12=10;}
+ }
+ else {
+ alt12=10;}
+ }
+ else if ( (LA12_0=='s') ) {
+ int LA12_4 = input.LA(2);
+
+ if ( (LA12_4=='t') ) {
+ int LA12_22 = input.LA(3);
+
+ if ( (LA12_22=='a') ) {
+ int LA12_36 = input.LA(4);
+
+ if ( (LA12_36=='t') ) {
+ int LA12_42 = input.LA(5);
+
+ if ( (LA12_42=='e') ) {
+ int LA12_47 = input.LA(6);
+
+ if ( ((LA12_47>='0' && LA12_47<='9')||(LA12_47>='A' && LA12_47<='Z')||LA12_47=='_'||(LA12_47>='a' && LA12_47<='z')) ) {
+ alt12=10;
+ }
+ else {
+ alt12=5;}
+ }
+ else {
+ alt12=10;}
+ }
+ else {
+ alt12=10;}
+ }
+ else {
+ alt12=10;}
+ }
+ else {
+ alt12=10;}
+ }
+ else if ( (LA12_0=='a') ) {
+ int LA12_5 = input.LA(2);
+
+ if ( (LA12_5=='c') ) {
+ int LA12_23 = input.LA(3);
+
+ if ( (LA12_23=='t') ) {
+ int LA12_37 = input.LA(4);
+
+ if ( (LA12_37=='i') ) {
+ int LA12_43 = input.LA(5);
+
+ if ( (LA12_43=='o') ) {
+ int LA12_48 = input.LA(6);
+
+ if ( (LA12_48=='n') ) {
+ int LA12_53 = input.LA(7);
+
+ if ( (LA12_53=='s') ) {
+ int LA12_57 = input.LA(8);
+
+ if ( ((LA12_57>='0' && LA12_57<='9')||(LA12_57>='A' && LA12_57<='Z')||LA12_57=='_'||(LA12_57>='a' && LA12_57<='z')) ) {
+ alt12=10;
+ }
+ else {
+ alt12=6;}
+ }
+ else {
+ alt12=10;}
+ }
+ else {
+ alt12=10;}
+ }
+ else {
+ alt12=10;}
+ }
+ else {
+ alt12=10;}
+ }
+ else {
+ alt12=10;}
+ }
+ else {
+ alt12=10;}
+ }
+ else if ( (LA12_0=='{') ) {
+ alt12=7;
+ }
+ else if ( (LA12_0=='}') ) {
+ alt12=8;
+ }
+ else if ( (LA12_0=='=') ) {
+ int LA12_8 = input.LA(2);
+
+ if ( (LA12_8=='>') ) {
+ alt12=9;
+ }
+ else {
+ alt12=16;}
+ }
+ else if ( (LA12_0=='^') ) {
+ int LA12_9 = input.LA(2);
+
+ if ( ((LA12_9>='A' && LA12_9<='Z')||LA12_9=='_'||(LA12_9>='a' && LA12_9<='z')) ) {
+ alt12=10;
+ }
+ else {
+ alt12=16;}
+ }
+ else if ( ((LA12_0>='A' && LA12_0<='Z')||LA12_0=='_'||LA12_0=='b'||LA12_0=='d'||(LA12_0>='f' && LA12_0<='q')||(LA12_0>='t' && LA12_0<='z')) ) {
+ alt12=10;
+ }
+ else if ( ((LA12_0>='0' && LA12_0<='9')) ) {
+ alt12=11;
+ }
+ else if ( (LA12_0=='\"') ) {
+ int LA12_12 = input.LA(2);
+
+ if ( ((LA12_12>='\u0000' && LA12_12<='\uFFFE')) ) {
+ alt12=12;
+ }
+ else {
+ alt12=16;}
+ }
+ else if ( (LA12_0=='\'') ) {
+ int LA12_13 = input.LA(2);
+
+ if ( ((LA12_13>='\u0000' && LA12_13<='\uFFFE')) ) {
+ alt12=12;
+ }
+ else {
+ alt12=16;}
+ }
+ else if ( (LA12_0=='/') ) {
+ switch ( input.LA(2) ) {
+ case '*':
+ {
+ alt12=13;
+ }
+ break;
+ case '/':
+ {
+ alt12=14;
+ }
+ break;
+ default:
+ alt12=16;}
+
+ }
+ else if ( ((LA12_0>='\t' && LA12_0<='\n')||LA12_0=='\r'||LA12_0==' ') ) {
+ alt12=15;
+ }
+ 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=='`'||LA12_0=='|'||(LA12_0>='~' && LA12_0<='\uFFFE')) ) {
+ alt12=16;
+ }
+ else {
+ NoViableAltException nvae =
+ new NoViableAltException("1:1: Tokens : ( T11 | T12 | T13 | T14 | T15 | T16 | T17 | T18 | T19 | 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 :
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:1:10: T11
+ {
+ mT11();
+
+ }
+ break;
+ case 2 :
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:1:14: T12
+ {
+ mT12();
+
+ }
+ break;
+ case 3 :
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:1:18: T13
+ {
+ mT13();
+
+ }
+ break;
+ case 4 :
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:1:22: T14
+ {
+ mT14();
+
+ }
+ break;
+ case 5 :
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:1:26: T15
+ {
+ mT15();
+
+ }
+ break;
+ case 6 :
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:1:30: T16
+ {
+ mT16();
+
+ }
+ break;
+ case 7 :
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:1:34: T17
+ {
+ mT17();
+
+ }
+ break;
+ case 8 :
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:1:38: T18
+ {
+ mT18();
+
+ }
+ break;
+ case 9 :
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:1:42: T19
+ {
+ mT19();
+
+ }
+ break;
+ case 10 :
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:1:46: RULE_ID
+ {
+ mRULE_ID();
+
+ }
+ break;
+ case 11 :
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:1:54: RULE_INT
+ {
+ mRULE_INT();
+
+ }
+ break;
+ case 12 :
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:1:63: RULE_STRING
+ {
+ mRULE_STRING();
+
+ }
+ break;
+ case 13 :
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:1:75: RULE_ML_COMMENT
+ {
+ mRULE_ML_COMMENT();
+
+ }
+ break;
+ case 14 :
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:1:91: RULE_SL_COMMENT
+ {
+ mRULE_SL_COMMENT();
+
+ }
+ break;
+ case 15 :
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:1:107: RULE_WS
+ {
+ mRULE_WS();
+
+ }
+ break;
+ case 16 :
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:1:115: RULE_ANY_OTHER
+ {
+ mRULE_ANY_OTHER();
+
+ }
+ break;
+
+ }
+
+ }
+
+
+
+
+}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDslParser.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDslParser.java
new file mode 100644
index 0000000..744e442
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDslParser.java
@@ -0,0 +1,960 @@
+// $ANTLR 3.0.1 ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g 2008-11-13 12:18:28
+
+package org.eclipse.xtext.testlanguages.parser.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.xtext.parser.antlr.AbstractAntlrParser;
+import org.eclipse.xtext.parser.antlr.XtextTokenStream;
+
+
+import org.antlr.runtime.*;
+import java.util.Stack;
+import java.util.List;
+import java.util.ArrayList;
+
+public class InternalFowlerDslParser extends AbstractAntlrParser {
+ 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", "'events'", "'end'", "'commands'", "'resetting'", "'state'", "'actions'", "'{'", "'}'", "'=>'"
+ };
+ 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 InternalFowlerDslParser(TokenStream input) {
+ super(input);
+ }
+
+
+ public String[] getTokenNames() { return tokenNames; }
+ public String getGrammarFileName() { return "./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g"; }
+
+
+
+ public InternalFowlerDslParser(TokenStream input, IAstFactory factory, Grammar g) {
+ this(input);
+ this.factory = factory;
+ grammar = g;
+ }
+
+ @Override
+ protected InputStream getTokenFile() {
+ ClassLoader classLoader = InternalFowlerDslParser.class.getClassLoader();
+ return classLoader.getResourceAsStream("org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.tokens");
+ }
+
+ @Override
+ protected String getFirstRuleName() {
+ return "Statemachine";
+ }
+
+
+
+ // $ANTLR start entryRuleStatemachine
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:62:1: entryRuleStatemachine returns [EObject current=null] : iv_ruleStatemachine= ruleStatemachine EOF ;
+ public final EObject entryRuleStatemachine() throws RecognitionException {
+ EObject current = null;
+
+ EObject iv_ruleStatemachine = null;
+
+
+ try {
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:62:54: (iv_ruleStatemachine= ruleStatemachine EOF )
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:63:2: iv_ruleStatemachine= ruleStatemachine EOF
+ {
+ currentNode = createCompositeNode("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.0" /* xtext::ParserRule */, currentNode);
+ pushFollow(FOLLOW_ruleStatemachine_in_entryRuleStatemachine70);
+ iv_ruleStatemachine=ruleStatemachine();
+ _fsp--;
+
+ current =iv_ruleStatemachine;
+ match(input,EOF,FOLLOW_EOF_in_entryRuleStatemachine80);
+
+ }
+
+ }
+
+ catch (RecognitionException re) {
+ recover(input,re);
+ appendSkippedTokens();
+ }
+ finally {
+ }
+ return current;
+ }
+ // $ANTLR end entryRuleStatemachine
+
+
+ // $ANTLR start ruleStatemachine
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:70:1: ruleStatemachine returns [EObject current=null] : ( ( ( ( ( ( 'events' (lv_events= ruleEvent )* ) 'end' ) 'commands' ) (lv_commands= ruleCommand )* ) 'end' ) (lv_states= ruleState )* ) ;
+ public final EObject ruleStatemachine() throws RecognitionException {
+ EObject current = null;
+
+ EObject lv_events = null;
+
+ EObject lv_commands = null;
+
+ EObject lv_states = null;
+
+
+ EObject temp=null; setCurrentLookahead(); resetLookahead();
+ try {
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:72:33: ( ( ( ( ( ( ( 'events' (lv_events= ruleEvent )* ) 'end' ) 'commands' ) (lv_commands= ruleCommand )* ) 'end' ) (lv_states= ruleState )* ) )
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:73:1: ( ( ( ( ( ( 'events' (lv_events= ruleEvent )* ) 'end' ) 'commands' ) (lv_commands= ruleCommand )* ) 'end' ) (lv_states= ruleState )* )
+ {
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:73:1: ( ( ( ( ( ( 'events' (lv_events= ruleEvent )* ) 'end' ) 'commands' ) (lv_commands= ruleCommand )* ) 'end' ) (lv_states= ruleState )* )
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:73:2: ( ( ( ( ( 'events' (lv_events= ruleEvent )* ) 'end' ) 'commands' ) (lv_commands= ruleCommand )* ) 'end' ) (lv_states= ruleState )*
+ {
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:73:2: ( ( ( ( ( 'events' (lv_events= ruleEvent )* ) 'end' ) 'commands' ) (lv_commands= ruleCommand )* ) 'end' )
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:73:3: ( ( ( ( 'events' (lv_events= ruleEvent )* ) 'end' ) 'commands' ) (lv_commands= ruleCommand )* ) 'end'
+ {
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:73:3: ( ( ( ( 'events' (lv_events= ruleEvent )* ) 'end' ) 'commands' ) (lv_commands= ruleCommand )* )
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:73:4: ( ( ( 'events' (lv_events= ruleEvent )* ) 'end' ) 'commands' ) (lv_commands= ruleCommand )*
+ {
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:73:4: ( ( ( 'events' (lv_events= ruleEvent )* ) 'end' ) 'commands' )
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:73:5: ( ( 'events' (lv_events= ruleEvent )* ) 'end' ) 'commands'
+ {
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:73:5: ( ( 'events' (lv_events= ruleEvent )* ) 'end' )
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:73:6: ( 'events' (lv_events= ruleEvent )* ) 'end'
+ {
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:73:6: ( 'events' (lv_events= ruleEvent )* )
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:73:7: 'events' (lv_events= ruleEvent )*
+ {
+ match(input,11,FOLLOW_11_in_ruleStatemachine119);
+
+ createLeafNode("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.0/@alternatives/@abstractTokens.0/@abstractTokens.0/@abstractTokens.0/@abstractTokens.0/@abstractTokens.0/@abstractTokens.0" /* xtext::Keyword */, null);
+
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:77:1: (lv_events= ruleEvent )*
+ loop1:
+ do {
+ int alt1=2;
+ int LA1_0 = input.LA(1);
+
+ if ( (LA1_0==RULE_ID||LA1_0==14) ) {
+ alt1=1;
+ }
+
+
+ switch (alt1) {
+ case 1 :
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:80:6: lv_events= ruleEvent
+ {
+
+ currentNode=createCompositeNode("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.0/@alternatives/@abstractTokens.0/@abstractTokens.0/@abstractTokens.0/@abstractTokens.0/@abstractTokens.0/@abstractTokens.1/@terminal" /* xtext::RuleCall */, currentNode);
+
+ pushFollow(FOLLOW_ruleEvent_in_ruleStatemachine153);
+ lv_events=ruleEvent();
+ _fsp--;
+
+
+ currentNode = currentNode.getParent();
+ if (current==null) {
+ current = factory.create("Statemachine");
+ associateNodeWithAstElement(currentNode, current);
+ }
+
+ factory.add(current, "events", lv_events,null);
+
+
+ }
+ break;
+
+ default :
+ break loop1;
+ }
+ } while (true);
+
+
+ }
+
+ match(input,12,FOLLOW_12_in_ruleStatemachine168);
+
+ createLeafNode("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.0/@alternatives/@abstractTokens.0/@abstractTokens.0/@abstractTokens.0/@abstractTokens.0/@abstractTokens.1" /* xtext::Keyword */, null);
+
+
+ }
+
+ match(input,13,FOLLOW_13_in_ruleStatemachine178);
+
+ createLeafNode("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.0/@alternatives/@abstractTokens.0/@abstractTokens.0/@abstractTokens.0/@abstractTokens.1" /* xtext::Keyword */, null);
+
+
+ }
+
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:102:2: (lv_commands= ruleCommand )*
+ loop2:
+ do {
+ int alt2=2;
+ int LA2_0 = input.LA(1);
+
+ if ( (LA2_0==RULE_ID) ) {
+ alt2=1;
+ }
+
+
+ switch (alt2) {
+ case 1 :
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:105:6: lv_commands= ruleCommand
+ {
+
+ currentNode=createCompositeNode("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.0/@alternatives/@abstractTokens.0/@abstractTokens.0/@abstractTokens.1/@terminal" /* xtext::RuleCall */, currentNode);
+
+ pushFollow(FOLLOW_ruleCommand_in_ruleStatemachine213);
+ lv_commands=ruleCommand();
+ _fsp--;
+
+
+ currentNode = currentNode.getParent();
+ if (current==null) {
+ current = factory.create("Statemachine");
+ associateNodeWithAstElement(currentNode, current);
+ }
+
+ factory.add(current, "commands", lv_commands,null);
+
+
+ }
+ break;
+
+ default :
+ break loop2;
+ }
+ } while (true);
+
+
+ }
+
+ match(input,12,FOLLOW_12_in_ruleStatemachine228);
+
+ createLeafNode("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.0/@alternatives/@abstractTokens.0/@abstractTokens.1" /* xtext::Keyword */, null);
+
+
+ }
+
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:123:2: (lv_states= ruleState )*
+ loop3:
+ do {
+ int alt3=2;
+ int LA3_0 = input.LA(1);
+
+ if ( (LA3_0==15) ) {
+ alt3=1;
+ }
+
+
+ switch (alt3) {
+ case 1 :
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:126:6: lv_states= ruleState
+ {
+
+ currentNode=createCompositeNode("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.0/@alternatives/@abstractTokens.1/@terminal" /* xtext::RuleCall */, currentNode);
+
+ pushFollow(FOLLOW_ruleState_in_ruleStatemachine263);
+ lv_states=ruleState();
+ _fsp--;
+
+
+ currentNode = currentNode.getParent();
+ if (current==null) {
+ current = factory.create("Statemachine");
+ associateNodeWithAstElement(currentNode, current);
+ }
+
+ factory.add(current, "states", lv_states,null);
+
+
+ }
+ break;
+
+ default :
+ break loop3;
+ }
+ } while (true);
+
+
+ }
+
+
+ }
+
+ resetLookahead();
+ }
+
+ catch (RecognitionException re) {
+ recover(input,re);
+ appendSkippedTokens();
+ }
+ finally {
+ }
+ return current;
+ }
+ // $ANTLR end ruleStatemachine
+
+
+ // $ANTLR start entryRuleEvent
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:145:1: entryRuleEvent returns [EObject current=null] : iv_ruleEvent= ruleEvent EOF ;
+ public final EObject entryRuleEvent() throws RecognitionException {
+ EObject current = null;
+
+ EObject iv_ruleEvent = null;
+
+
+ try {
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:145:47: (iv_ruleEvent= ruleEvent EOF )
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:146:2: iv_ruleEvent= ruleEvent EOF
+ {
+ currentNode = createCompositeNode("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.1" /* xtext::ParserRule */, currentNode);
+ pushFollow(FOLLOW_ruleEvent_in_entryRuleEvent303);
+ iv_ruleEvent=ruleEvent();
+ _fsp--;
+
+ current =iv_ruleEvent;
+ match(input,EOF,FOLLOW_EOF_in_entryRuleEvent313);
+
+ }
+
+ }
+
+ catch (RecognitionException re) {
+ recover(input,re);
+ appendSkippedTokens();
+ }
+ finally {
+ }
+ return current;
+ }
+ // $ANTLR end entryRuleEvent
+
+
+ // $ANTLR start ruleEvent
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:153:1: ruleEvent returns [EObject current=null] : ( ( (lv_resetting= 'resetting' )? (lv_name= RULE_ID ) ) (lv_code= RULE_ID ) ) ;
+ public final EObject ruleEvent() throws RecognitionException {
+ EObject current = null;
+
+ Token lv_resetting=null;
+ Token lv_name=null;
+ Token lv_code=null;
+
+ EObject temp=null; setCurrentLookahead(); resetLookahead();
+ try {
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:155:33: ( ( ( (lv_resetting= 'resetting' )? (lv_name= RULE_ID ) ) (lv_code= RULE_ID ) ) )
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:156:1: ( ( (lv_resetting= 'resetting' )? (lv_name= RULE_ID ) ) (lv_code= RULE_ID ) )
+ {
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:156:1: ( ( (lv_resetting= 'resetting' )? (lv_name= RULE_ID ) ) (lv_code= RULE_ID ) )
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:156:2: ( (lv_resetting= 'resetting' )? (lv_name= RULE_ID ) ) (lv_code= RULE_ID )
+ {
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:156:2: ( (lv_resetting= 'resetting' )? (lv_name= RULE_ID ) )
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:156:3: (lv_resetting= 'resetting' )? (lv_name= RULE_ID )
+ {
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:156:3: (lv_resetting= 'resetting' )?
+ int alt4=2;
+ int LA4_0 = input.LA(1);
+
+ if ( (LA4_0==14) ) {
+ alt4=1;
+ }
+ switch (alt4) {
+ case 1 :
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:158:6: lv_resetting= 'resetting'
+ {
+ lv_resetting=(Token)input.LT(1);
+ match(input,14,FOLLOW_14_in_ruleEvent360);
+
+ createLeafNode("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.1/@alternatives/@abstractTokens.0/@abstractTokens.0/@terminal" /* xtext::Keyword */, "resetting");
+
+
+ if (current==null) {
+ current = factory.create("Event");
+ associateNodeWithAstElement(currentNode, current);
+ }
+
+ factory.set(current, "resetting", true,"resetting");
+
+
+ }
+ break;
+
+ }
+
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:172:3: (lv_name= RULE_ID )
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:174:6: lv_name= RULE_ID
+ {
+ lv_name=(Token)input.LT(1);
+ match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleEvent394);
+
+ createLeafNode("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.1/@alternatives/@abstractTokens.0/@abstractTokens.1/@terminal" /* xtext::RuleCall */, "name");
+
+
+ if (current==null) {
+ current = factory.create("Event");
+ associateNodeWithAstElement(currentNode, current);
+ }
+
+ factory.set(current, "name", lv_name,"ID");
+
+
+ }
+
+
+ }
+
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:188:3: (lv_code= RULE_ID )
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:190:6: lv_code= RULE_ID
+ {
+ lv_code=(Token)input.LT(1);
+ match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleEvent427);
+
+ createLeafNode("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.1/@alternatives/@abstractTokens.1/@terminal" /* xtext::RuleCall */, "code");
+
+
+ if (current==null) {
+ current = factory.create("Event");
+ associateNodeWithAstElement(currentNode, current);
+ }
+
+ factory.set(current, "code", lv_code,"ID");
+
+
+ }
+
+
+ }
+
+
+ }
+
+ resetLookahead();
+ }
+
+ catch (RecognitionException re) {
+ recover(input,re);
+ appendSkippedTokens();
+ }
+ finally {
+ }
+ return current;
+ }
+ // $ANTLR end ruleEvent
+
+
+ // $ANTLR start entryRuleCommand
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:209:1: entryRuleCommand returns [EObject current=null] : iv_ruleCommand= ruleCommand EOF ;
+ public final EObject entryRuleCommand() throws RecognitionException {
+ EObject current = null;
+
+ EObject iv_ruleCommand = null;
+
+
+ try {
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:209:49: (iv_ruleCommand= ruleCommand EOF )
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:210:2: iv_ruleCommand= ruleCommand EOF
+ {
+ currentNode = createCompositeNode("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.2" /* xtext::ParserRule */, currentNode);
+ pushFollow(FOLLOW_ruleCommand_in_entryRuleCommand473);
+ iv_ruleCommand=ruleCommand();
+ _fsp--;
+
+ current =iv_ruleCommand;
+ match(input,EOF,FOLLOW_EOF_in_entryRuleCommand483);
+
+ }
+
+ }
+
+ catch (RecognitionException re) {
+ recover(input,re);
+ appendSkippedTokens();
+ }
+ finally {
+ }
+ return current;
+ }
+ // $ANTLR end entryRuleCommand
+
+
+ // $ANTLR start ruleCommand
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:217:1: ruleCommand returns [EObject current=null] : ( (lv_name= RULE_ID ) (lv_code= RULE_ID ) ) ;
+ public final EObject ruleCommand() throws RecognitionException {
+ EObject current = null;
+
+ Token lv_name=null;
+ Token lv_code=null;
+
+ EObject temp=null; setCurrentLookahead(); resetLookahead();
+ try {
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:219:33: ( ( (lv_name= RULE_ID ) (lv_code= RULE_ID ) ) )
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:220:1: ( (lv_name= RULE_ID ) (lv_code= RULE_ID ) )
+ {
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:220:1: ( (lv_name= RULE_ID ) (lv_code= RULE_ID ) )
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:220:2: (lv_name= RULE_ID ) (lv_code= RULE_ID )
+ {
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:220:2: (lv_name= RULE_ID )
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:222:6: lv_name= RULE_ID
+ {
+ lv_name=(Token)input.LT(1);
+ match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleCommand529);
+
+ createLeafNode("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.2/@alternatives/@abstractTokens.0/@terminal" /* xtext::RuleCall */, "name");
+
+
+ if (current==null) {
+ current = factory.create("Command");
+ associateNodeWithAstElement(currentNode, current);
+ }
+
+ factory.set(current, "name", lv_name,"ID");
+
+
+ }
+
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:236:2: (lv_code= RULE_ID )
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:238:6: lv_code= RULE_ID
+ {
+ lv_code=(Token)input.LT(1);
+ match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleCommand561);
+
+ createLeafNode("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.2/@alternatives/@abstractTokens.1/@terminal" /* xtext::RuleCall */, "code");
+
+
+ if (current==null) {
+ current = factory.create("Command");
+ associateNodeWithAstElement(currentNode, current);
+ }
+
+ factory.set(current, "code", lv_code,"ID");
+
+
+ }
+
+
+ }
+
+
+ }
+
+ resetLookahead();
+ }
+
+ catch (RecognitionException re) {
+ recover(input,re);
+ appendSkippedTokens();
+ }
+ finally {
+ }
+ return current;
+ }
+ // $ANTLR end ruleCommand
+
+
+ // $ANTLR start entryRuleState
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:257:1: entryRuleState returns [EObject current=null] : iv_ruleState= ruleState EOF ;
+ public final EObject entryRuleState() throws RecognitionException {
+ EObject current = null;
+
+ EObject iv_ruleState = null;
+
+
+ try {
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:257:47: (iv_ruleState= ruleState EOF )
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:258:2: iv_ruleState= ruleState EOF
+ {
+ currentNode = createCompositeNode("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.3" /* xtext::ParserRule */, currentNode);
+ pushFollow(FOLLOW_ruleState_in_entryRuleState607);
+ iv_ruleState=ruleState();
+ _fsp--;
+
+ current =iv_ruleState;
+ match(input,EOF,FOLLOW_EOF_in_entryRuleState617);
+
+ }
+
+ }
+
+ catch (RecognitionException re) {
+ recover(input,re);
+ appendSkippedTokens();
+ }
+ finally {
+ }
+ return current;
+ }
+ // $ANTLR end entryRuleState
+
+
+ // $ANTLR start ruleState
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:265:1: ruleState returns [EObject current=null] : ( ( ( ( 'state' (lv_name= RULE_ID ) ) ( ( ( 'actions' '{' ) ( ( RULE_ID ) )+ ) '}' )? ) (lv_transitions= ruleTransition )* ) 'end' ) ;
+ public final EObject ruleState() throws RecognitionException {
+ EObject current = null;
+
+ Token lv_name=null;
+ EObject lv_transitions = null;
+
+
+ EObject temp=null; setCurrentLookahead(); resetLookahead();
+ try {
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:267:33: ( ( ( ( ( 'state' (lv_name= RULE_ID ) ) ( ( ( 'actions' '{' ) ( ( RULE_ID ) )+ ) '}' )? ) (lv_transitions= ruleTransition )* ) 'end' ) )
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:268:1: ( ( ( ( 'state' (lv_name= RULE_ID ) ) ( ( ( 'actions' '{' ) ( ( RULE_ID ) )+ ) '}' )? ) (lv_transitions= ruleTransition )* ) 'end' )
+ {
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:268:1: ( ( ( ( 'state' (lv_name= RULE_ID ) ) ( ( ( 'actions' '{' ) ( ( RULE_ID ) )+ ) '}' )? ) (lv_transitions= ruleTransition )* ) 'end' )
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:268:2: ( ( ( 'state' (lv_name= RULE_ID ) ) ( ( ( 'actions' '{' ) ( ( RULE_ID ) )+ ) '}' )? ) (lv_transitions= ruleTransition )* ) 'end'
+ {
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:268:2: ( ( ( 'state' (lv_name= RULE_ID ) ) ( ( ( 'actions' '{' ) ( ( RULE_ID ) )+ ) '}' )? ) (lv_transitions= ruleTransition )* )
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:268:3: ( ( 'state' (lv_name= RULE_ID ) ) ( ( ( 'actions' '{' ) ( ( RULE_ID ) )+ ) '}' )? ) (lv_transitions= ruleTransition )*
+ {
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:268:3: ( ( 'state' (lv_name= RULE_ID ) ) ( ( ( 'actions' '{' ) ( ( RULE_ID ) )+ ) '}' )? )
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:268:4: ( 'state' (lv_name= RULE_ID ) ) ( ( ( 'actions' '{' ) ( ( RULE_ID ) )+ ) '}' )?
+ {
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:268:4: ( 'state' (lv_name= RULE_ID ) )
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:268:5: 'state' (lv_name= RULE_ID )
+ {
+ match(input,15,FOLLOW_15_in_ruleState654);
+
+ createLeafNode("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.3/@alternatives/@abstractTokens.0/@abstractTokens.0/@abstractTokens.0/@abstractTokens.0" /* xtext::Keyword */, null);
+
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:272:1: (lv_name= RULE_ID )
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:274:6: lv_name= RULE_ID
+ {
+ lv_name=(Token)input.LT(1);
+ match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleState675);
+
+ createLeafNode("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.3/@alternatives/@abstractTokens.0/@abstractTokens.0/@abstractTokens.0/@abstractTokens.1/@terminal" /* xtext::RuleCall */, "name");
+
+
+ if (current==null) {
+ current = factory.create("State");
+ associateNodeWithAstElement(currentNode, current);
+ }
+
+ factory.set(current, "name", lv_name,"ID");
+
+
+ }
+
+
+ }
+
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:288:3: ( ( ( 'actions' '{' ) ( ( RULE_ID ) )+ ) '}' )?
+ int alt6=2;
+ int LA6_0 = input.LA(1);
+
+ if ( (LA6_0==16) ) {
+ alt6=1;
+ }
+ switch (alt6) {
+ case 1 :
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:288:4: ( ( 'actions' '{' ) ( ( RULE_ID ) )+ ) '}'
+ {
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:288:4: ( ( 'actions' '{' ) ( ( RULE_ID ) )+ )
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:288:5: ( 'actions' '{' ) ( ( RULE_ID ) )+
+ {
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:288:5: ( 'actions' '{' )
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:288:6: 'actions' '{'
+ {
+ match(input,16,FOLLOW_16_in_ruleState699);
+
+ createLeafNode("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.3/@alternatives/@abstractTokens.0/@abstractTokens.0/@abstractTokens.1/@abstractTokens.0/@abstractTokens.0/@abstractTokens.0" /* xtext::Keyword */, null);
+
+ match(input,17,FOLLOW_17_in_ruleState708);
+
+ createLeafNode("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.3/@alternatives/@abstractTokens.0/@abstractTokens.0/@abstractTokens.1/@abstractTokens.0/@abstractTokens.0/@abstractTokens.1" /* xtext::Keyword */, null);
+
+
+ }
+
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:296:2: ( ( RULE_ID ) )+
+ int cnt5=0;
+ loop5:
+ do {
+ int alt5=2;
+ int LA5_0 = input.LA(1);
+
+ if ( (LA5_0==RULE_ID) ) {
+ alt5=1;
+ }
+
+
+ switch (alt5) {
+ case 1 :
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:299:3: ( RULE_ID )
+ {
+
+ if (current==null) {
+ current = factory.create("State");
+ associateNodeWithAstElement(currentNode, current);
+ }
+
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:305:1: ( RULE_ID )
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:306:2: RULE_ID
+ {
+ match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleState733);
+
+ createLeafNode("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.3/@alternatives/@abstractTokens.0/@abstractTokens.0/@abstractTokens.1/@abstractTokens.0/@abstractTokens.1/@terminal" /* xtext::CrossReference */, "actions");
+
+
+ }
+
+
+ }
+ break;
+
+ default :
+ if ( cnt5 >= 1 ) break loop5;
+ EarlyExitException eee =
+ new EarlyExitException(5, input);
+ throw eee;
+ }
+ cnt5++;
+ } while (true);
+
+
+ }
+
+ match(input,18,FOLLOW_18_in_ruleState748);
+
+ createLeafNode("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.3/@alternatives/@abstractTokens.0/@abstractTokens.0/@abstractTokens.1/@abstractTokens.1" /* xtext::Keyword */, null);
+
+
+ }
+ break;
+
+ }
+
+
+ }
+
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:315:4: (lv_transitions= ruleTransition )*
+ loop7:
+ do {
+ int alt7=2;
+ int LA7_0 = input.LA(1);
+
+ if ( (LA7_0==RULE_ID) ) {
+ alt7=1;
+ }
+
+
+ switch (alt7) {
+ case 1 :
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:318:6: lv_transitions= ruleTransition
+ {
+
+ currentNode=createCompositeNode("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.3/@alternatives/@abstractTokens.0/@abstractTokens.1/@terminal" /* xtext::RuleCall */, currentNode);
+
+ pushFollow(FOLLOW_ruleTransition_in_ruleState785);
+ lv_transitions=ruleTransition();
+ _fsp--;
+
+
+ currentNode = currentNode.getParent();
+ if (current==null) {
+ current = factory.create("State");
+ associateNodeWithAstElement(currentNode, current);
+ }
+
+ factory.add(current, "transitions", lv_transitions,null);
+
+
+ }
+ break;
+
+ default :
+ break loop7;
+ }
+ } while (true);
+
+
+ }
+
+ match(input,12,FOLLOW_12_in_ruleState800);
+
+ createLeafNode("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.3/@alternatives/@abstractTokens.1" /* xtext::Keyword */, null);
+
+
+ }
+
+
+ }
+
+ resetLookahead();
+ }
+
+ catch (RecognitionException re) {
+ recover(input,re);
+ appendSkippedTokens();
+ }
+ finally {
+ }
+ return current;
+ }
+ // $ANTLR end ruleState
+
+
+ // $ANTLR start entryRuleTransition
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:341:1: entryRuleTransition returns [EObject current=null] : iv_ruleTransition= ruleTransition EOF ;
+ public final EObject entryRuleTransition() throws RecognitionException {
+ EObject current = null;
+
+ EObject iv_ruleTransition = null;
+
+
+ try {
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:341:52: (iv_ruleTransition= ruleTransition EOF )
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:342:2: iv_ruleTransition= ruleTransition EOF
+ {
+ currentNode = createCompositeNode("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.4" /* xtext::ParserRule */, currentNode);
+ pushFollow(FOLLOW_ruleTransition_in_entryRuleTransition835);
+ iv_ruleTransition=ruleTransition();
+ _fsp--;
+
+ current =iv_ruleTransition;
+ match(input,EOF,FOLLOW_EOF_in_entryRuleTransition845);
+
+ }
+
+ }
+
+ catch (RecognitionException re) {
+ recover(input,re);
+ appendSkippedTokens();
+ }
+ finally {
+ }
+ return current;
+ }
+ // $ANTLR end entryRuleTransition
+
+
+ // $ANTLR start ruleTransition
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:349:1: ruleTransition returns [EObject current=null] : ( ( ( ( RULE_ID ) ) '=>' ) ( ( RULE_ID ) ) ) ;
+ public final EObject ruleTransition() throws RecognitionException {
+ EObject current = null;
+
+ EObject temp=null; setCurrentLookahead(); resetLookahead();
+ try {
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:351:33: ( ( ( ( ( RULE_ID ) ) '=>' ) ( ( RULE_ID ) ) ) )
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:352:1: ( ( ( ( RULE_ID ) ) '=>' ) ( ( RULE_ID ) ) )
+ {
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:352:1: ( ( ( ( RULE_ID ) ) '=>' ) ( ( RULE_ID ) ) )
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:352:2: ( ( ( RULE_ID ) ) '=>' ) ( ( RULE_ID ) )
+ {
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:352:2: ( ( ( RULE_ID ) ) '=>' )
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:352:3: ( ( RULE_ID ) ) '=>'
+ {
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:352:3: ( ( RULE_ID ) )
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:355:3: ( RULE_ID )
+ {
+
+ if (current==null) {
+ current = factory.create("Transition");
+ associateNodeWithAstElement(currentNode, current);
+ }
+
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:361:1: ( RULE_ID )
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:362:2: RULE_ID
+ {
+ match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleTransition895);
+
+ createLeafNode("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.4/@alternatives/@abstractTokens.0/@abstractTokens.0/@terminal" /* xtext::CrossReference */, "event");
+
+
+ }
+
+
+ }
+
+ match(input,19,FOLLOW_19_in_ruleTransition908);
+
+ createLeafNode("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.4/@alternatives/@abstractTokens.0/@abstractTokens.1" /* xtext::Keyword */, null);
+
+
+ }
+
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:371:2: ( ( RULE_ID ) )
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:374:3: ( RULE_ID )
+ {
+
+ if (current==null) {
+ current = factory.create("Transition");
+ associateNodeWithAstElement(currentNode, current);
+ }
+
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:380:1: ( RULE_ID )
+ // ./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g:381:2: RULE_ID
+ {
+ match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleTransition933);
+
+ createLeafNode("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.4/@alternatives/@abstractTokens.1/@terminal" /* xtext::CrossReference */, "state");
+
+
+ }
+
+
+ }
+
+
+ }
+
+
+ }
+
+ resetLookahead();
+ }
+
+ catch (RecognitionException re) {
+ recover(input,re);
+ appendSkippedTokens();
+ }
+ finally {
+ }
+ return current;
+ }
+ // $ANTLR end ruleTransition
+
+
+
+
+ public static final BitSet FOLLOW_ruleStatemachine_in_entryRuleStatemachine70 = new BitSet(new long[]{0x0000000000000000L});
+ public static final BitSet FOLLOW_EOF_in_entryRuleStatemachine80 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_11_in_ruleStatemachine119 = new BitSet(new long[]{0x0000000000005010L});
+ public static final BitSet FOLLOW_ruleEvent_in_ruleStatemachine153 = new BitSet(new long[]{0x0000000000005010L});
+ public static final BitSet FOLLOW_12_in_ruleStatemachine168 = new BitSet(new long[]{0x0000000000002000L});
+ public static final BitSet FOLLOW_13_in_ruleStatemachine178 = new BitSet(new long[]{0x0000000000001010L});
+ public static final BitSet FOLLOW_ruleCommand_in_ruleStatemachine213 = new BitSet(new long[]{0x0000000000001010L});
+ public static final BitSet FOLLOW_12_in_ruleStatemachine228 = new BitSet(new long[]{0x0000000000008002L});
+ public static final BitSet FOLLOW_ruleState_in_ruleStatemachine263 = new BitSet(new long[]{0x0000000000008002L});
+ public static final BitSet FOLLOW_ruleEvent_in_entryRuleEvent303 = new BitSet(new long[]{0x0000000000000000L});
+ public static final BitSet FOLLOW_EOF_in_entryRuleEvent313 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_14_in_ruleEvent360 = new BitSet(new long[]{0x0000000000000010L});
+ public static final BitSet FOLLOW_RULE_ID_in_ruleEvent394 = new BitSet(new long[]{0x0000000000000010L});
+ public static final BitSet FOLLOW_RULE_ID_in_ruleEvent427 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_ruleCommand_in_entryRuleCommand473 = new BitSet(new long[]{0x0000000000000000L});
+ public static final BitSet FOLLOW_EOF_in_entryRuleCommand483 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_RULE_ID_in_ruleCommand529 = new BitSet(new long[]{0x0000000000000010L});
+ public static final BitSet FOLLOW_RULE_ID_in_ruleCommand561 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_ruleState_in_entryRuleState607 = new BitSet(new long[]{0x0000000000000000L});
+ public static final BitSet FOLLOW_EOF_in_entryRuleState617 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_15_in_ruleState654 = new BitSet(new long[]{0x0000000000000010L});
+ public static final BitSet FOLLOW_RULE_ID_in_ruleState675 = new BitSet(new long[]{0x0000000000011010L});
+ public static final BitSet FOLLOW_16_in_ruleState699 = new BitSet(new long[]{0x0000000000020000L});
+ public static final BitSet FOLLOW_17_in_ruleState708 = new BitSet(new long[]{0x0000000000000010L});
+ public static final BitSet FOLLOW_RULE_ID_in_ruleState733 = new BitSet(new long[]{0x0000000000040010L});
+ public static final BitSet FOLLOW_18_in_ruleState748 = new BitSet(new long[]{0x0000000000001010L});
+ public static final BitSet FOLLOW_ruleTransition_in_ruleState785 = new BitSet(new long[]{0x0000000000001010L});
+ public static final BitSet FOLLOW_12_in_ruleState800 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_ruleTransition_in_entryRuleTransition835 = new BitSet(new long[]{0x0000000000000000L});
+ public static final BitSet FOLLOW_EOF_in_entryRuleTransition845 = new BitSet(new long[]{0x0000000000000002L});
+ public static final BitSet FOLLOW_RULE_ID_in_ruleTransition895 = new BitSet(new long[]{0x0000000000080000L});
+ public static final BitSet FOLLOW_19_in_ruleTransition908 = new BitSet(new long[]{0x0000000000000010L});
+ public static final BitSet FOLLOW_RULE_ID_in_ruleTransition933 = new BitSet(new long[]{0x0000000000000002L});
+
+}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl__.g b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl__.g
new file mode 100644
index 0000000..2f1294a
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl__.g
@@ -0,0 +1,41 @@
+lexer grammar InternalFowlerDsl;
+@header {
+package org.eclipse.xtext.testlanguages.parser.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 : 'events' ;
+T12 : 'end' ;
+T13 : 'commands' ;
+T14 : 'resetting' ;
+T15 : 'state' ;
+T16 : 'actions' ;
+T17 : '{' ;
+T18 : '}' ;
+T19 : '=>' ;
+
+// $ANTLR src "./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g" 391
+RULE_ID : ('^')?('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'_'|'0'..'9')*;
+
+// $ANTLR src "./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g" 393
+RULE_INT : ('0'..'9')+;
+
+// $ANTLR src "./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g" 395
+RULE_STRING : '"' ( '\\' ('b'|'t'|'n'|'f'|'r'|'\"'|'\''|'\\') | ~('\\'|'"') )* '"' | '\'' ( '\\' ('b'|'t'|'n'|'f'|'r'|'\"'|'\''|'\\') | ~('\\'|'\'') )* '\'';
+
+// $ANTLR src "./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g" 397
+RULE_ML_COMMENT : '/*' ( options {greedy=false;} : . )* '*/' {$channel=HIDDEN;};
+
+// $ANTLR src "./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g" 399
+RULE_SL_COMMENT : '//' ~('\n'|'\r')* ('\r'? '\n')? {$channel=HIDDEN;};
+
+// $ANTLR src "./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g" 401
+RULE_WS : (' '|'\t'|'\r'|'\n')+ {$channel=HIDDEN;};
+
+// $ANTLR src "./src-gen/org/eclipse/xtext/testlanguages/parser/internal/InternalFowlerDsl.g" 403
+RULE_ANY_OTHER : .;
+
+
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parsetree/reconstr/FowlerDslParseTreeConstructor.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parsetree/reconstr/FowlerDslParseTreeConstructor.java
new file mode 100644
index 0000000..b97e9c5
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/parsetree/reconstr/FowlerDslParseTreeConstructor.java
@@ -0,0 +1,1048 @@
+/*
+Generated with Xtext
+*/
+package org.eclipse.xtext.testlanguages.parsetree.reconstr;
+
+//import org.apache.log4j.Logger;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.xtext.*;
+import org.eclipse.xtext.parsetree.reconstr.*;
+import org.eclipse.xtext.parsetree.reconstr.impl.*;
+import org.eclipse.xtext.parsetree.reconstr.impl.AbstractParseTreeConstructor.AbstractToken.Solution;
+
+
+public class FowlerDslParseTreeConstructor extends AbstractParseTreeConstructor {
+
+ public IAbstractToken serialize(EObject object) {
+ Solution t = internalSerialize(object);
+ if(t == null) throw new XtextSerializationException(getDescr(object), "No rule found for serialization");
+ return t.getPredecessor();
+ }
+
+ protected Solution internalSerialize(EObject obj) {
+ IInstanceDescription inst = getDescr(obj);
+ Solution s;
+ if(inst.isInstanceOf("Statemachine") && (s = new Statemachine_Group(inst, null).firstSolution()) != null) return s;
+ if(inst.isInstanceOf("Event") && (s = new Event_Group(inst, null).firstSolution()) != null) return s;
+ if(inst.isInstanceOf("Command") && (s = new Command_Group(inst, null).firstSolution()) != null) return s;
+ if(inst.isInstanceOf("State") && (s = new State_Group(inst, null).firstSolution()) != null) return s;
+ if(inst.isInstanceOf("Transition") && (s = new Transition_Group(inst, null).firstSolution()) != null) return s;
+ return null;
+ }
+
+/************ begin Rule Statemachine ****************
+ *
+ * Statemachine : 'events' ( events += Event ) * 'end' 'commands' ( commands += Command ) * 'end' ( states += State ) * ;
+ *
+ **/
+
+
+// 'events' ( events += Event ) * 'end' 'commands' ( commands += Command ) * 'end' ( states += State ) *
+protected class Statemachine_Group extends GroupToken {
+
+ public Statemachine_Group(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ public Group getGrammarElement() {
+ return (Group)getGrammarEle("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.0/@alternatives");
+ }
+
+ protected Solution createSolution() {
+ Solution s1 = new Statemachine_1_Assignment_states(current, this).firstSolution();
+ while(s1 != null) {
+ Solution s2 = new Statemachine_0_Group(s1.getCurrent(), s1.getPredecessor()).firstSolution();
+ if(s2 == null) {
+ s1 = s1.getPredecessor().nextSolution(this);
+ if(s1 == null) return null;
+ } else {
+ last = s2.getPredecessor();
+ return s2;
+ }
+ }
+ return null;
+
+ }
+}
+
+// 'events' ( events += Event ) * 'end' 'commands' ( commands += Command ) * 'end'
+protected class Statemachine_0_Group extends GroupToken {
+
+ public Statemachine_0_Group(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ public Group getGrammarElement() {
+ return (Group)getGrammarEle("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.0/@alternatives/@abstractTokens.0");
+ }
+
+ protected Solution createSolution() {
+ Solution s1 = new Statemachine_0_1_Keyword_end(current, this).firstSolution();
+ while(s1 != null) {
+ Solution s2 = new Statemachine_0_0_Group(s1.getCurrent(), s1.getPredecessor()).firstSolution();
+ if(s2 == null) {
+ s1 = s1.getPredecessor().nextSolution(this);
+ if(s1 == null) return null;
+ } else {
+ last = s2.getPredecessor();
+ return s2;
+ }
+ }
+ return null;
+
+ }
+}
+
+// 'events' ( events += Event ) * 'end' 'commands' ( commands += Command ) *
+protected class Statemachine_0_0_Group extends GroupToken {
+
+ public Statemachine_0_0_Group(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ public Group getGrammarElement() {
+ return (Group)getGrammarEle("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.0/@alternatives/@abstractTokens.0/@abstractTokens.0");
+ }
+
+ protected Solution createSolution() {
+ Solution s1 = new Statemachine_0_0_1_Assignment_commands(current, this).firstSolution();
+ while(s1 != null) {
+ Solution s2 = new Statemachine_0_0_0_Group(s1.getCurrent(), s1.getPredecessor()).firstSolution();
+ if(s2 == null) {
+ s1 = s1.getPredecessor().nextSolution(this);
+ if(s1 == null) return null;
+ } else {
+ last = s2.getPredecessor();
+ return s2;
+ }
+ }
+ return null;
+
+ }
+}
+
+// 'events' ( events += Event ) * 'end' 'commands'
+protected class Statemachine_0_0_0_Group extends GroupToken {
+
+ public Statemachine_0_0_0_Group(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ public Group getGrammarElement() {
+ return (Group)getGrammarEle("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.0/@alternatives/@abstractTokens.0/@abstractTokens.0/@abstractTokens.0");
+ }
+
+ protected Solution createSolution() {
+ Solution s1 = new Statemachine_0_0_0_1_Keyword_commands(current, this).firstSolution();
+ while(s1 != null) {
+ Solution s2 = new Statemachine_0_0_0_0_Group(s1.getCurrent(), s1.getPredecessor()).firstSolution();
+ if(s2 == null) {
+ s1 = s1.getPredecessor().nextSolution(this);
+ if(s1 == null) return null;
+ } else {
+ last = s2.getPredecessor();
+ return s2;
+ }
+ }
+ return null;
+
+ }
+}
+
+// 'events' ( events += Event ) * 'end'
+protected class Statemachine_0_0_0_0_Group extends GroupToken {
+
+ public Statemachine_0_0_0_0_Group(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ public Group getGrammarElement() {
+ return (Group)getGrammarEle("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.0/@alternatives/@abstractTokens.0/@abstractTokens.0/@abstractTokens.0/@abstractTokens.0");
+ }
+
+ protected Solution createSolution() {
+ Solution s1 = new Statemachine_0_0_0_0_1_Keyword_end(current, this).firstSolution();
+ while(s1 != null) {
+ Solution s2 = new Statemachine_0_0_0_0_0_Group(s1.getCurrent(), s1.getPredecessor()).firstSolution();
+ if(s2 == null) {
+ s1 = s1.getPredecessor().nextSolution(this);
+ if(s1 == null) return null;
+ } else {
+ last = s2.getPredecessor();
+ return s2;
+ }
+ }
+ return null;
+
+ }
+}
+
+// 'events' ( events += Event ) *
+protected class Statemachine_0_0_0_0_0_Group extends GroupToken {
+
+ public Statemachine_0_0_0_0_0_Group(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ public Group getGrammarElement() {
+ return (Group)getGrammarEle("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.0/@alternatives/@abstractTokens.0/@abstractTokens.0/@abstractTokens.0/@abstractTokens.0/@abstractTokens.0");
+ }
+
+ protected Solution createSolution() {
+ Solution s1 = new Statemachine_0_0_0_0_0_1_Assignment_events(current, this).firstSolution();
+ while(s1 != null) {
+ Solution s2 = new Statemachine_0_0_0_0_0_0_Keyword_events(s1.getCurrent(), s1.getPredecessor()).firstSolution();
+ if(s2 == null) {
+ s1 = s1.getPredecessor().nextSolution(this);
+ if(s1 == null) return null;
+ } else {
+ last = s2.getPredecessor();
+ return s2;
+ }
+ }
+ return null;
+
+ }
+}
+
+// 'events'
+protected class Statemachine_0_0_0_0_0_0_Keyword_events extends KeywordToken {
+
+ public Statemachine_0_0_0_0_0_0_Keyword_events(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ public Keyword getGrammarElement() {
+ return (Keyword)getGrammarEle("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.0/@alternatives/@abstractTokens.0/@abstractTokens.0/@abstractTokens.0/@abstractTokens.0/@abstractTokens.0/@abstractTokens.0");
+ }
+}
+
+// ( events += Event ) *
+protected class Statemachine_0_0_0_0_0_1_Assignment_events extends AssignmentToken {
+
+ public Statemachine_0_0_0_0_0_1_Assignment_events(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, IS_MANY, !IS_REQUIRED);
+ }
+
+ public Assignment getGrammarElement() {
+ return (Assignment)getGrammarEle("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.0/@alternatives/@abstractTokens.0/@abstractTokens.0/@abstractTokens.0/@abstractTokens.0/@abstractTokens.0/@abstractTokens.1");
+ }
+
+ protected Solution createSolution() {
+ if((value = current.getConsumable("events",required)) == null) return null;
+ IInstanceDescription obj = current.cloneAndConsume("events");
+ if(value instanceof EObject) { // xtext::RuleCall
+ IInstanceDescription param = getDescr((EObject)value);
+ if(param.isInstanceOf("Event")) {
+ Solution s = new Event_Group(param, this).firstSolution();
+ if(s != null) {
+ type = AssignmentType.PRC;
+ return new Solution(obj,s.getPredecessor());
+ }
+ }
+ }
+ return null;
+ }
+}
+
+
+// 'end'
+protected class Statemachine_0_0_0_0_1_Keyword_end extends KeywordToken {
+
+ public Statemachine_0_0_0_0_1_Keyword_end(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ public Keyword getGrammarElement() {
+ return (Keyword)getGrammarEle("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.0/@alternatives/@abstractTokens.0/@abstractTokens.0/@abstractTokens.0/@abstractTokens.0/@abstractTokens.1");
+ }
+}
+
+
+// 'commands'
+protected class Statemachine_0_0_0_1_Keyword_commands extends KeywordToken {
+
+ public Statemachine_0_0_0_1_Keyword_commands(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ public Keyword getGrammarElement() {
+ return (Keyword)getGrammarEle("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.0/@alternatives/@abstractTokens.0/@abstractTokens.0/@abstractTokens.0/@abstractTokens.1");
+ }
+}
+
+
+// ( commands += Command ) *
+protected class Statemachine_0_0_1_Assignment_commands extends AssignmentToken {
+
+ public Statemachine_0_0_1_Assignment_commands(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, IS_MANY, !IS_REQUIRED);
+ }
+
+ public Assignment getGrammarElement() {
+ return (Assignment)getGrammarEle("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.0/@alternatives/@abstractTokens.0/@abstractTokens.0/@abstractTokens.1");
+ }
+
+ protected Solution createSolution() {
+ if((value = current.getConsumable("commands",required)) == null) return null;
+ IInstanceDescription obj = current.cloneAndConsume("commands");
+ if(value instanceof EObject) { // xtext::RuleCall
+ IInstanceDescription param = getDescr((EObject)value);
+ if(param.isInstanceOf("Command")) {
+ Solution s = new Command_Group(param, this).firstSolution();
+ if(s != null) {
+ type = AssignmentType.PRC;
+ return new Solution(obj,s.getPredecessor());
+ }
+ }
+ }
+ return null;
+ }
+}
+
+
+// 'end'
+protected class Statemachine_0_1_Keyword_end extends KeywordToken {
+
+ public Statemachine_0_1_Keyword_end(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ public Keyword getGrammarElement() {
+ return (Keyword)getGrammarEle("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.0/@alternatives/@abstractTokens.0/@abstractTokens.1");
+ }
+}
+
+
+// ( states += State ) *
+protected class Statemachine_1_Assignment_states extends AssignmentToken {
+
+ public Statemachine_1_Assignment_states(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, IS_MANY, !IS_REQUIRED);
+ }
+
+ public Assignment getGrammarElement() {
+ return (Assignment)getGrammarEle("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.0/@alternatives/@abstractTokens.1");
+ }
+
+ protected Solution createSolution() {
+ if((value = current.getConsumable("states",required)) == null) return null;
+ IInstanceDescription obj = current.cloneAndConsume("states");
+ if(value instanceof EObject) { // xtext::RuleCall
+ IInstanceDescription param = getDescr((EObject)value);
+ if(param.isInstanceOf("State")) {
+ Solution s = new State_Group(param, this).firstSolution();
+ if(s != null) {
+ type = AssignmentType.PRC;
+ return new Solution(obj,s.getPredecessor());
+ }
+ }
+ }
+ return null;
+ }
+}
+
+
+/************ end Rule Statemachine ****************/
+
+/************ begin Rule Event ****************
+ *
+ * Event : ( resetting ?= 'resetting' ) ? name = ID code = ID ;
+ *
+ **/
+
+
+// ( resetting ?= 'resetting' ) ? name = ID code = ID
+protected class Event_Group extends GroupToken {
+
+ public Event_Group(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ public Group getGrammarElement() {
+ return (Group)getGrammarEle("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.1/@alternatives");
+ }
+
+ protected Solution createSolution() {
+ Solution s1 = new Event_1_Assignment_code(current, this).firstSolution();
+ while(s1 != null) {
+ Solution s2 = new Event_0_Group(s1.getCurrent(), s1.getPredecessor()).firstSolution();
+ if(s2 == null) {
+ s1 = s1.getPredecessor().nextSolution(this);
+ if(s1 == null) return null;
+ } else {
+ last = s2.getPredecessor();
+ return s2;
+ }
+ }
+ return null;
+
+ }
+}
+
+// ( resetting ?= 'resetting' ) ? name = ID
+protected class Event_0_Group extends GroupToken {
+
+ public Event_0_Group(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ public Group getGrammarElement() {
+ return (Group)getGrammarEle("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.1/@alternatives/@abstractTokens.0");
+ }
+
+ protected Solution createSolution() {
+ Solution s1 = new Event_0_1_Assignment_name(current, this).firstSolution();
+ while(s1 != null) {
+ Solution s2 = new Event_0_0_Assignment_resetting(s1.getCurrent(), s1.getPredecessor()).firstSolution();
+ if(s2 == null) {
+ s1 = s1.getPredecessor().nextSolution(this);
+ if(s1 == null) return null;
+ } else {
+ last = s2.getPredecessor();
+ return s2;
+ }
+ }
+ return null;
+
+ }
+}
+
+// ( resetting ?= 'resetting' ) ?
+protected class Event_0_0_Assignment_resetting extends AssignmentToken {
+
+ public Event_0_0_Assignment_resetting(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, !IS_REQUIRED);
+ }
+
+ public Assignment getGrammarElement() {
+ return (Assignment)getGrammarEle("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.1/@alternatives/@abstractTokens.0/@abstractTokens.0");
+ }
+
+ protected Solution createSolution() {
+ if((value = current.getConsumable("resetting",required)) == null) return null;
+ IInstanceDescription obj = current.cloneAndConsume("resetting");
+ if("resetting".equals(value)) { // xtext::Keyword
+ type = AssignmentType.KW;
+ element = (AbstractElement)getGrammarEle("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.1/@alternatives/@abstractTokens.0/@abstractTokens.0/@terminal");
+ return new Solution(obj);
+ }
+ return null;
+ }
+}
+
+// name = ID
+protected class Event_0_1_Assignment_name extends AssignmentToken {
+
+ public Event_0_1_Assignment_name(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ public Assignment getGrammarElement() {
+ return (Assignment)getGrammarEle("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.1/@alternatives/@abstractTokens.0/@abstractTokens.1");
+ }
+
+ protected Solution createSolution() {
+ if((value = current.getConsumable("name",required)) == null) return null;
+ IInstanceDescription obj = current.cloneAndConsume("name");
+ if(true) { // xtext::RuleCall FIXME: check if value is valid for lexer rule
+ type = AssignmentType.LRC;
+ element = (AbstractElement)getGrammarEle("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.1/@alternatives/@abstractTokens.0/@abstractTokens.1/@terminal");
+ return new Solution(obj);
+ }
+ return null;
+ }
+}
+
+
+// code = ID
+protected class Event_1_Assignment_code extends AssignmentToken {
+
+ public Event_1_Assignment_code(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ public Assignment getGrammarElement() {
+ return (Assignment)getGrammarEle("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.1/@alternatives/@abstractTokens.1");
+ }
+
+ protected Solution createSolution() {
+ if((value = current.getConsumable("code",required)) == null) return null;
+ IInstanceDescription obj = current.cloneAndConsume("code");
+ if(true) { // xtext::RuleCall FIXME: check if value is valid for lexer rule
+ type = AssignmentType.LRC;
+ element = (AbstractElement)getGrammarEle("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.1/@alternatives/@abstractTokens.1/@terminal");
+ return new Solution(obj);
+ }
+ return null;
+ }
+}
+
+
+/************ end Rule Event ****************/
+
+/************ begin Rule Command ****************
+ *
+ * Command : name = ID code = ID ;
+ *
+ **/
+
+
+// name = ID code = ID
+protected class Command_Group extends GroupToken {
+
+ public Command_Group(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ public Group getGrammarElement() {
+ return (Group)getGrammarEle("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.2/@alternatives");
+ }
+
+ protected Solution createSolution() {
+ Solution s1 = new Command_1_Assignment_code(current, this).firstSolution();
+ while(s1 != null) {
+ Solution s2 = new Command_0_Assignment_name(s1.getCurrent(), s1.getPredecessor()).firstSolution();
+ if(s2 == null) {
+ s1 = s1.getPredecessor().nextSolution(this);
+ if(s1 == null) return null;
+ } else {
+ last = s2.getPredecessor();
+ return s2;
+ }
+ }
+ return null;
+
+ }
+}
+
+// name = ID
+protected class Command_0_Assignment_name extends AssignmentToken {
+
+ public Command_0_Assignment_name(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ public Assignment getGrammarElement() {
+ return (Assignment)getGrammarEle("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.2/@alternatives/@abstractTokens.0");
+ }
+
+ protected Solution createSolution() {
+ if((value = current.getConsumable("name",required)) == null) return null;
+ IInstanceDescription obj = current.cloneAndConsume("name");
+ if(true) { // xtext::RuleCall FIXME: check if value is valid for lexer rule
+ type = AssignmentType.LRC;
+ element = (AbstractElement)getGrammarEle("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.2/@alternatives/@abstractTokens.0/@terminal");
+ return new Solution(obj);
+ }
+ return null;
+ }
+}
+
+// code = ID
+protected class Command_1_Assignment_code extends AssignmentToken {
+
+ public Command_1_Assignment_code(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ public Assignment getGrammarElement() {
+ return (Assignment)getGrammarEle("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.2/@alternatives/@abstractTokens.1");
+ }
+
+ protected Solution createSolution() {
+ if((value = current.getConsumable("code",required)) == null) return null;
+ IInstanceDescription obj = current.cloneAndConsume("code");
+ if(true) { // xtext::RuleCall FIXME: check if value is valid for lexer rule
+ type = AssignmentType.LRC;
+ element = (AbstractElement)getGrammarEle("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.2/@alternatives/@abstractTokens.1/@terminal");
+ return new Solution(obj);
+ }
+ return null;
+ }
+}
+
+
+/************ end Rule Command ****************/
+
+/************ begin Rule State ****************
+ *
+ * State : 'state' name = ID ( 'actions' '{' ( actions += [ Command ] ) + '}' ) ? ( transitions += Transition ) * 'end' ;
+ *
+ **/
+
+
+// 'state' name = ID ( 'actions' '{' ( actions += [ Command ] ) + '}' ) ? ( transitions += Transition ) * 'end'
+protected class State_Group extends GroupToken {
+
+ public State_Group(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ public Group getGrammarElement() {
+ return (Group)getGrammarEle("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.3/@alternatives");
+ }
+
+ protected Solution createSolution() {
+ Solution s1 = new State_1_Keyword_end(current, this).firstSolution();
+ while(s1 != null) {
+ Solution s2 = new State_0_Group(s1.getCurrent(), s1.getPredecessor()).firstSolution();
+ if(s2 == null) {
+ s1 = s1.getPredecessor().nextSolution(this);
+ if(s1 == null) return null;
+ } else {
+ last = s2.getPredecessor();
+ return s2;
+ }
+ }
+ return null;
+
+ }
+}
+
+// 'state' name = ID ( 'actions' '{' ( actions += [ Command ] ) + '}' ) ? ( transitions += Transition ) *
+protected class State_0_Group extends GroupToken {
+
+ public State_0_Group(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ public Group getGrammarElement() {
+ return (Group)getGrammarEle("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.3/@alternatives/@abstractTokens.0");
+ }
+
+ protected Solution createSolution() {
+ Solution s1 = new State_0_1_Assignment_transitions(current, this).firstSolution();
+ while(s1 != null) {
+ Solution s2 = new State_0_0_Group(s1.getCurrent(), s1.getPredecessor()).firstSolution();
+ if(s2 == null) {
+ s1 = s1.getPredecessor().nextSolution(this);
+ if(s1 == null) return null;
+ } else {
+ last = s2.getPredecessor();
+ return s2;
+ }
+ }
+ return null;
+
+ }
+}
+
+// 'state' name = ID ( 'actions' '{' ( actions += [ Command ] ) + '}' ) ?
+protected class State_0_0_Group extends GroupToken {
+
+ public State_0_0_Group(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ public Group getGrammarElement() {
+ return (Group)getGrammarEle("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.3/@alternatives/@abstractTokens.0/@abstractTokens.0");
+ }
+
+ protected Solution createSolution() {
+ Solution s1 = new State_0_0_1_Group(current, this).firstSolution();
+ while(s1 != null) {
+ Solution s2 = new State_0_0_0_Group(s1.getCurrent(), s1.getPredecessor()).firstSolution();
+ if(s2 == null) {
+ s1 = s1.getPredecessor().nextSolution(this);
+ if(s1 == null) return null;
+ } else {
+ last = s2.getPredecessor();
+ return s2;
+ }
+ }
+ return null;
+
+ }
+}
+
+// 'state' name = ID
+protected class State_0_0_0_Group extends GroupToken {
+
+ public State_0_0_0_Group(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ public Group getGrammarElement() {
+ return (Group)getGrammarEle("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.3/@alternatives/@abstractTokens.0/@abstractTokens.0/@abstractTokens.0");
+ }
+
+ protected Solution createSolution() {
+ Solution s1 = new State_0_0_0_1_Assignment_name(current, this).firstSolution();
+ while(s1 != null) {
+ Solution s2 = new State_0_0_0_0_Keyword_state(s1.getCurrent(), s1.getPredecessor()).firstSolution();
+ if(s2 == null) {
+ s1 = s1.getPredecessor().nextSolution(this);
+ if(s1 == null) return null;
+ } else {
+ last = s2.getPredecessor();
+ return s2;
+ }
+ }
+ return null;
+
+ }
+}
+
+// 'state'
+protected class State_0_0_0_0_Keyword_state extends KeywordToken {
+
+ public State_0_0_0_0_Keyword_state(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ public Keyword getGrammarElement() {
+ return (Keyword)getGrammarEle("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.3/@alternatives/@abstractTokens.0/@abstractTokens.0/@abstractTokens.0/@abstractTokens.0");
+ }
+}
+
+// name = ID
+protected class State_0_0_0_1_Assignment_name extends AssignmentToken {
+
+ public State_0_0_0_1_Assignment_name(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ public Assignment getGrammarElement() {
+ return (Assignment)getGrammarEle("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.3/@alternatives/@abstractTokens.0/@abstractTokens.0/@abstractTokens.0/@abstractTokens.1");
+ }
+
+ protected Solution createSolution() {
+ if((value = current.getConsumable("name",required)) == null) return null;
+ IInstanceDescription obj = current.cloneAndConsume("name");
+ if(true) { // xtext::RuleCall FIXME: check if value is valid for lexer rule
+ type = AssignmentType.LRC;
+ element = (AbstractElement)getGrammarEle("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.3/@alternatives/@abstractTokens.0/@abstractTokens.0/@abstractTokens.0/@abstractTokens.1/@terminal");
+ return new Solution(obj);
+ }
+ return null;
+ }
+}
+
+
+// ( 'actions' '{' ( actions += [ Command ] ) + '}' ) ?
+protected class State_0_0_1_Group extends GroupToken {
+
+ public State_0_0_1_Group(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, !IS_REQUIRED);
+ }
+
+ public Group getGrammarElement() {
+ return (Group)getGrammarEle("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.3/@alternatives/@abstractTokens.0/@abstractTokens.0/@abstractTokens.1");
+ }
+
+ protected Solution createSolution() {
+ Solution s1 = new State_0_0_1_1_Keyword(current, this).firstSolution();
+ while(s1 != null) {
+ Solution s2 = new State_0_0_1_0_Group(s1.getCurrent(), s1.getPredecessor()).firstSolution();
+ if(s2 == null) {
+ s1 = s1.getPredecessor().nextSolution(this);
+ if(s1 == null) return null;
+ } else {
+ last = s2.getPredecessor();
+ return s2;
+ }
+ }
+ return null;
+
+ }
+}
+
+// 'actions' '{' ( actions += [ Command ] ) +
+protected class State_0_0_1_0_Group extends GroupToken {
+
+ public State_0_0_1_0_Group(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ public Group getGrammarElement() {
+ return (Group)getGrammarEle("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.3/@alternatives/@abstractTokens.0/@abstractTokens.0/@abstractTokens.1/@abstractTokens.0");
+ }
+
+ protected Solution createSolution() {
+ Solution s1 = new State_0_0_1_0_1_Assignment_actions(current, this).firstSolution();
+ while(s1 != null) {
+ Solution s2 = new State_0_0_1_0_0_Group(s1.getCurrent(), s1.getPredecessor()).firstSolution();
+ if(s2 == null) {
+ s1 = s1.getPredecessor().nextSolution(this);
+ if(s1 == null) return null;
+ } else {
+ last = s2.getPredecessor();
+ return s2;
+ }
+ }
+ return null;
+
+ }
+}
+
+// 'actions' '{'
+protected class State_0_0_1_0_0_Group extends GroupToken {
+
+ public State_0_0_1_0_0_Group(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ public Group getGrammarElement() {
+ return (Group)getGrammarEle("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.3/@alternatives/@abstractTokens.0/@abstractTokens.0/@abstractTokens.1/@abstractTokens.0/@abstractTokens.0");
+ }
+
+ protected Solution createSolution() {
+ Solution s1 = new State_0_0_1_0_0_1_Keyword(current, this).firstSolution();
+ while(s1 != null) {
+ Solution s2 = new State_0_0_1_0_0_0_Keyword_actions(s1.getCurrent(), s1.getPredecessor()).firstSolution();
+ if(s2 == null) {
+ s1 = s1.getPredecessor().nextSolution(this);
+ if(s1 == null) return null;
+ } else {
+ last = s2.getPredecessor();
+ return s2;
+ }
+ }
+ return null;
+
+ }
+}
+
+// 'actions'
+protected class State_0_0_1_0_0_0_Keyword_actions extends KeywordToken {
+
+ public State_0_0_1_0_0_0_Keyword_actions(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ public Keyword getGrammarElement() {
+ return (Keyword)getGrammarEle("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.3/@alternatives/@abstractTokens.0/@abstractTokens.0/@abstractTokens.1/@abstractTokens.0/@abstractTokens.0/@abstractTokens.0");
+ }
+}
+
+// '{'
+protected class State_0_0_1_0_0_1_Keyword extends KeywordToken {
+
+ public State_0_0_1_0_0_1_Keyword(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ public Keyword getGrammarElement() {
+ return (Keyword)getGrammarEle("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.3/@alternatives/@abstractTokens.0/@abstractTokens.0/@abstractTokens.1/@abstractTokens.0/@abstractTokens.0/@abstractTokens.1");
+ }
+}
+
+
+// ( actions += [ Command ] ) +
+protected class State_0_0_1_0_1_Assignment_actions extends AssignmentToken {
+
+ public State_0_0_1_0_1_Assignment_actions(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, IS_MANY, IS_REQUIRED);
+ }
+
+ public Assignment getGrammarElement() {
+ return (Assignment)getGrammarEle("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.3/@alternatives/@abstractTokens.0/@abstractTokens.0/@abstractTokens.1/@abstractTokens.0/@abstractTokens.1");
+ }
+
+ protected Solution createSolution() {
+ if((value = current.getConsumable("actions",required)) == null) return null;
+ IInstanceDescription obj = current.cloneAndConsume("actions");
+ if(value instanceof EObject) { // xtext::CrossReference
+ IInstanceDescription param = getDescr((EObject)value);
+ if(param.isInstanceOf("Command")) {
+ type = AssignmentType.CR;
+ element = (AbstractElement)getGrammarEle("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.3/@alternatives/@abstractTokens.0/@abstractTokens.0/@abstractTokens.1/@abstractTokens.0/@abstractTokens.1/@terminal");
+ return new Solution(obj);
+ }
+ }
+ return null;
+ }
+}
+
+
+// '}'
+protected class State_0_0_1_1_Keyword extends KeywordToken {
+
+ public State_0_0_1_1_Keyword(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ public Keyword getGrammarElement() {
+ return (Keyword)getGrammarEle("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.3/@alternatives/@abstractTokens.0/@abstractTokens.0/@abstractTokens.1/@abstractTokens.1");
+ }
+}
+
+
+
+// ( transitions += Transition ) *
+protected class State_0_1_Assignment_transitions extends AssignmentToken {
+
+ public State_0_1_Assignment_transitions(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, IS_MANY, !IS_REQUIRED);
+ }
+
+ public Assignment getGrammarElement() {
+ return (Assignment)getGrammarEle("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.3/@alternatives/@abstractTokens.0/@abstractTokens.1");
+ }
+
+ protected Solution createSolution() {
+ if((value = current.getConsumable("transitions",required)) == null) return null;
+ IInstanceDescription obj = current.cloneAndConsume("transitions");
+ if(value instanceof EObject) { // xtext::RuleCall
+ IInstanceDescription param = getDescr((EObject)value);
+ if(param.isInstanceOf("Transition")) {
+ Solution s = new Transition_Group(param, this).firstSolution();
+ if(s != null) {
+ type = AssignmentType.PRC;
+ return new Solution(obj,s.getPredecessor());
+ }
+ }
+ }
+ return null;
+ }
+}
+
+
+// 'end'
+protected class State_1_Keyword_end extends KeywordToken {
+
+ public State_1_Keyword_end(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ public Keyword getGrammarElement() {
+ return (Keyword)getGrammarEle("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.3/@alternatives/@abstractTokens.1");
+ }
+}
+
+
+/************ end Rule State ****************/
+
+/************ begin Rule Transition ****************
+ *
+ * Transition : event = [ Event ] '=>' state = [ State ] ;
+ *
+ **/
+
+
+// event = [ Event ] '=>' state = [ State ]
+protected class Transition_Group extends GroupToken {
+
+ public Transition_Group(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ public Group getGrammarElement() {
+ return (Group)getGrammarEle("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.4/@alternatives");
+ }
+
+ protected Solution createSolution() {
+ Solution s1 = new Transition_1_Assignment_state(current, this).firstSolution();
+ while(s1 != null) {
+ Solution s2 = new Transition_0_Group(s1.getCurrent(), s1.getPredecessor()).firstSolution();
+ if(s2 == null) {
+ s1 = s1.getPredecessor().nextSolution(this);
+ if(s1 == null) return null;
+ } else {
+ last = s2.getPredecessor();
+ return s2;
+ }
+ }
+ return null;
+
+ }
+}
+
+// event = [ Event ] '=>'
+protected class Transition_0_Group extends GroupToken {
+
+ public Transition_0_Group(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ public Group getGrammarElement() {
+ return (Group)getGrammarEle("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.4/@alternatives/@abstractTokens.0");
+ }
+
+ protected Solution createSolution() {
+ Solution s1 = new Transition_0_1_Keyword(current, this).firstSolution();
+ while(s1 != null) {
+ Solution s2 = new Transition_0_0_Assignment_event(s1.getCurrent(), s1.getPredecessor()).firstSolution();
+ if(s2 == null) {
+ s1 = s1.getPredecessor().nextSolution(this);
+ if(s1 == null) return null;
+ } else {
+ last = s2.getPredecessor();
+ return s2;
+ }
+ }
+ return null;
+
+ }
+}
+
+// event = [ Event ]
+protected class Transition_0_0_Assignment_event extends AssignmentToken {
+
+ public Transition_0_0_Assignment_event(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ public Assignment getGrammarElement() {
+ return (Assignment)getGrammarEle("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.4/@alternatives/@abstractTokens.0/@abstractTokens.0");
+ }
+
+ protected Solution createSolution() {
+ if((value = current.getConsumable("event",required)) == null) return null;
+ IInstanceDescription obj = current.cloneAndConsume("event");
+ if(value instanceof EObject) { // xtext::CrossReference
+ IInstanceDescription param = getDescr((EObject)value);
+ if(param.isInstanceOf("Event")) {
+ type = AssignmentType.CR;
+ element = (AbstractElement)getGrammarEle("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.4/@alternatives/@abstractTokens.0/@abstractTokens.0/@terminal");
+ return new Solution(obj);
+ }
+ }
+ return null;
+ }
+}
+
+// '=>'
+protected class Transition_0_1_Keyword extends KeywordToken {
+
+ public Transition_0_1_Keyword(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ public Keyword getGrammarElement() {
+ return (Keyword)getGrammarEle("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.4/@alternatives/@abstractTokens.0/@abstractTokens.1");
+ }
+}
+
+
+// state = [ State ]
+protected class Transition_1_Assignment_state extends AssignmentToken {
+
+ public Transition_1_Assignment_state(IInstanceDescription curr, AbstractToken pred) {
+ super(curr, pred, !IS_MANY, IS_REQUIRED);
+ }
+
+ public Assignment getGrammarElement() {
+ return (Assignment)getGrammarEle("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.4/@alternatives/@abstractTokens.1");
+ }
+
+ protected Solution createSolution() {
+ if((value = current.getConsumable("state",required)) == null) return null;
+ IInstanceDescription obj = current.cloneAndConsume("state");
+ if(value instanceof EObject) { // xtext::CrossReference
+ IInstanceDescription param = getDescr((EObject)value);
+ if(param.isInstanceOf("State")) {
+ type = AssignmentType.CR;
+ element = (AbstractElement)getGrammarEle("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.4/@alternatives/@abstractTokens.1/@terminal");
+ return new Solution(obj);
+ }
+ }
+ return null;
+ }
+}
+
+
+/************ end Rule Transition ****************/
+
+}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/services/FowlerDslGrammarAccess.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/services/FowlerDslGrammarAccess.java
new file mode 100644
index 0000000..eaa66a2
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/services/FowlerDslGrammarAccess.java
@@ -0,0 +1,77 @@
+/*
+Generated with Xtext
+*/
+
+package org.eclipse.xtext.testlanguages.services;
+
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.xtext.*;
+import org.eclipse.xtext.parser.BaseEPackageAccess;
+
+public class FowlerDslGrammarAccess extends BaseEPackageAccess implements IGrammarAccess {
+
+ private static final String FOWLERDSL_GRAMMAR_CP_URI = "classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi";
+ private static Grammar GRAMMAR = null;
+
+ @SuppressWarnings("unused")
+ public synchronized Grammar getGrammar() {
+ if (GRAMMAR==null) {
+ // assert the XtextPackage implementation is loaded
+ XtextPackage xtextPackage = XtextPackage.eINSTANCE;
+ GRAMMAR = (Grammar) loadGrammarFile(FowlerDslGrammarAccess.class.getClassLoader(),FOWLERDSL_GRAMMAR_CP_URI);
+ }
+ return GRAMMAR;
+ }
+
+
+ public ParserRule pr_Statemachine() {
+ return (ParserRule) getGrammar().eResource().getResourceSet().getEObject(URI.createURI("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.0"),true);
+ }
+
+ public ParserRule pr_Event() {
+ return (ParserRule) getGrammar().eResource().getResourceSet().getEObject(URI.createURI("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.1"),true);
+ }
+
+ public ParserRule pr_Command() {
+ return (ParserRule) getGrammar().eResource().getResourceSet().getEObject(URI.createURI("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.2"),true);
+ }
+
+ public ParserRule pr_State() {
+ return (ParserRule) getGrammar().eResource().getResourceSet().getEObject(URI.createURI("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.3"),true);
+ }
+
+ public ParserRule pr_Transition() {
+ return (ParserRule) getGrammar().eResource().getResourceSet().getEObject(URI.createURI("classpath:/org/eclipse/xtext/testlanguages/FowlerDsl.xmi#//@rules.4"),true);
+ }
+
+
+ public LexerRule lr_ID() {
+ return (LexerRule) getGrammar().eResource().getResourceSet().getEObject(URI.createURI("classpath:/org/eclipse/xtext/builtin/XtextBuiltin.xmi#//@rules.0"),true);
+ }
+
+ public LexerRule lr_INT() {
+ return (LexerRule) getGrammar().eResource().getResourceSet().getEObject(URI.createURI("classpath:/org/eclipse/xtext/builtin/XtextBuiltin.xmi#//@rules.1"),true);
+ }
+
+ public LexerRule lr_STRING() {
+ return (LexerRule) getGrammar().eResource().getResourceSet().getEObject(URI.createURI("classpath:/org/eclipse/xtext/builtin/XtextBuiltin.xmi#//@rules.2"),true);
+ }
+
+ public LexerRule lr_ML_COMMENT() {
+ return (LexerRule) getGrammar().eResource().getResourceSet().getEObject(URI.createURI("classpath:/org/eclipse/xtext/builtin/XtextBuiltin.xmi#//@rules.3"),true);
+ }
+
+ public LexerRule lr_SL_COMMENT() {
+ return (LexerRule) getGrammar().eResource().getResourceSet().getEObject(URI.createURI("classpath:/org/eclipse/xtext/builtin/XtextBuiltin.xmi#//@rules.4"),true);
+ }
+
+ public LexerRule lr_WS() {
+ return (LexerRule) getGrammar().eResource().getResourceSet().getEObject(URI.createURI("classpath:/org/eclipse/xtext/builtin/XtextBuiltin.xmi#//@rules.5"),true);
+ }
+
+ public LexerRule lr_ANY_OTHER() {
+ return (LexerRule) getGrammar().eResource().getResourceSet().getEObject(URI.createURI("classpath:/org/eclipse/xtext/builtin/XtextBuiltin.xmi#//@rules.6"),true);
+ }
+
+
+}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/services/FowlerDslMetamodelAccess.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/services/FowlerDslMetamodelAccess.java
new file mode 100644
index 0000000..432cdeb
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/services/FowlerDslMetamodelAccess.java
@@ -0,0 +1,51 @@
+/*
+Generated with Xtext
+*/
+package org.eclipse.xtext.testlanguages.services;
+
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.xtext.IMetamodelAccess;
+import org.eclipse.xtext.parser.BaseEPackageAccess;
+
+public class FowlerDslMetamodelAccess extends BaseEPackageAccess implements IMetamodelAccess {
+
+{
+
+ if (!EPackage.Registry.INSTANCE.containsKey(FOWLERDSL_NS_URI))
+ EPackage.Registry.INSTANCE.put(FOWLERDSL_NS_URI, loadEcoreFile(getClass().getClassLoader(), "classpath:/org/eclipse/xtext/testlanguages/fowlerdsl.ecore"));
+
+}
+
+ private EPackage[] generated = new EPackage[] {
+
+ getFowlerdslEPackage()
+
+ };
+
+ public EPackage[] getGeneratedEPackages() {
+ return generated;
+ }
+
+ private EPackage[] referenced = new EPackage[] {
+
+ };
+ public EPackage[] getReferencedEPackages() {
+ return referenced;
+ }
+
+ private EPackage[] all = new EPackage[] {
+ getFowlerdslEPackage()
+ };
+
+ public EPackage[] getAllEPackages() {
+ return all;
+ }
+
+
+ protected static final String FOWLERDSL_NS_URI = "http://example.xtext.org/FowlerDsl";
+
+ protected EPackage getFowlerdslEPackage() {
+ return EPackage.Registry.INSTANCE.getEPackage(FOWLERDSL_NS_URI);
+ }
+
+}
diff --git a/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/services/FowlerDslResourceFactory.java b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/services/FowlerDslResourceFactory.java
new file mode 100644
index 0000000..34e0c6e
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src-gen/org/eclipse/xtext/testlanguages/services/FowlerDslResourceFactory.java
@@ -0,0 +1,28 @@
+/*
+Generated with Xtext
+*/
+package org.eclipse.xtext.testlanguages.services;
+
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.xtext.resource.IResourceFactory;
+import org.eclipse.xtext.resource.XtextResource;
+import org.eclipse.xtext.service.ServiceRegistry;
+import org.eclipse.xtext.service.ServiceScopeFactory;
+
+public class FowlerDslResourceFactory implements IResourceFactory {
+
+ public String[] getModelFileExtensions() {
+ return new String[] { "fowlerdsl" };
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.emf.ecore.resource.Resource.Factory#createResource(org.eclipse.emf.common.util.URI)
+ */
+ public Resource createResource(URI uri) {
+ XtextResource resource = new XtextResource(uri);
+ ServiceRegistry.injectServices(ServiceScopeFactory.get("org.eclipse.xtext.testlanguages.FowlerDsl"), resource);
+ return resource;
+ }
+
+}
diff --git a/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/GenerateAllTestGrammars.java b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/GenerateAllTestGrammars.java
index f0f3b84..5fe50da 100755
--- a/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/GenerateAllTestGrammars.java
+++ b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/GenerateAllTestGrammars.java
@@ -21,6 +21,7 @@ import org.eclipse.xtext.parsetree.reconstr.ComplexReconstrTest;
import org.eclipse.xtext.parsetree.reconstr.SimpleReconstrTest;
import org.eclipse.xtext.resource.XtextResourceSet;
import org.eclipse.xtext.testlanguages.ActionTestLanguage;
+import org.eclipse.xtext.testlanguages.FowlerDsl;
import org.eclipse.xtext.testlanguages.LexerLanguage;
import org.eclipse.xtext.testlanguages.LookaheadLanguage;
import org.eclipse.xtext.testlanguages.OptionalEmptyLanguage;
@@ -42,7 +43,7 @@ public class GenerateAllTestGrammars {
ConcreteTestLanguage.class, XtextGrammarTest.class, MetamodelRefTest.class, DummyLanguage.class,
TestLanguage.class, SimpleReconstrTest.class, ComplexReconstrTest.class, LexerLanguage.class,
SimpleExpressions.class, ActionTestLanguage.class, OptionalEmptyLanguage.class, ReferenceGrammar.class,
- LookaheadLanguage.class, Bug250313.class };
+ LookaheadLanguage.class, Bug250313.class, FowlerDsl.class };
public static void main(String[] args) throws Exception {
try {
diff --git a/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/generator/AutoTestSuite.java b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/generator/AutoTestSuite.java
index 1227d21..233ddbb 100644
--- a/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/generator/AutoTestSuite.java
+++ b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/generator/AutoTestSuite.java
@@ -47,6 +47,7 @@ public class AutoTestSuite {
suite.addTestSuite(org.eclipse.xtext.crossrefs.CrossRefTest.class);
suite.addTestSuite(org.eclipse.xtext.crossrefs.LinkingErrorTest.class);
suite.addTestSuite(org.eclipse.xtext.util.SimpleCacheTest.class);
+ suite.addTestSuite(org.eclipse.xtext.parser.XtextParserBugsTest.class);
return suite;
}
}
diff --git a/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parser/XtextParserBugsTest.java b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parser/XtextParserBugsTest.java
new file mode 100644
index 0000000..8f7720a
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parser/XtextParserBugsTest.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2008 itemis AG (http://www.itemis.eu) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.xtext.parser;
+
+import org.eclipse.xtext.parsetree.CompositeNode;
+import org.eclipse.xtext.testlanguages.FowlerDslStandaloneSetup;
+import org.eclipse.xtext.tests.AbstractGeneratorTest;
+
+/**
+ * @author Sebastian Zarnekow - Initial contribution and API
+ */
+public class XtextParserBugsTest extends AbstractGeneratorTest {
+
+ public void testFirstTokenIsIllegal_254841() throws Exception {
+ with(FowlerDslStandaloneSetup.class);
+ String model = "firstToken";
+ CompositeNode rootNode = getRootNode(model);
+ assertNotNull(rootNode);
+ }
+
+}
diff --git a/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parser/XtextParserTest.java b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parser/XtextParserTest.java
index e66ba11..46f5e30 100644
--- a/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parser/XtextParserTest.java
+++ b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/parser/XtextParserTest.java
@@ -1,3 +1,11 @@
+/*******************************************************************************
+ * Copyright (c) 2008 itemis AG (http://www.itemis.eu) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ *******************************************************************************/
package org.eclipse.xtext.parser;
import org.eclipse.xtext.Grammar;
diff --git a/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/testlanguages/FowlerDsl.java b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/testlanguages/FowlerDsl.java
new file mode 100644
index 0000000..3449ea3
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/testlanguages/FowlerDsl.java
@@ -0,0 +1,15 @@
+/*******************************************************************************
+ * Copyright (c) 2008 itemis AG (http://www.itemis.eu) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.xtext.testlanguages;
+
+/**
+ * @author Sebastian Zarnekow - Initial contribution and API
+ */
+public class FowlerDsl {
+
+}
diff --git a/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/testlanguages/FowlerDsl.xtext b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/testlanguages/FowlerDsl.xtext
new file mode 100644
index 0000000..a4c0a03
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/testlanguages/FowlerDsl.xtext
@@ -0,0 +1,26 @@
+language org.eclipse.xtext.testlanguages.FowlerDsl
+generate fowlerdsl "http://example.xtext.org/FowlerDsl"
+
+Statemachine :
+ 'events'
+ (events+=Event)*
+ 'end'
+ 'commands'
+ (commands+=Command)*
+ 'end'
+ (states+=State)*;
+
+Event :
+ (resetting?='resetting')? name=ID code=ID;
+
+Command :
+ name=ID code=ID;
+
+State :
+ 'state' name=ID
+ ('actions' '{' (actions+=[Command])+ '}')?
+ (transitions+=Transition)*
+ 'end';
+
+Transition :
+ event=[Event] '=>' state=[State];
diff --git a/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/testlanguages/FowlerDslRuntimeConfig.java b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/testlanguages/FowlerDslRuntimeConfig.java
new file mode 100644
index 0000000..93cb906
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/testlanguages/FowlerDslRuntimeConfig.java
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2008 itemis AG (http://www.itemis.eu) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.xtext.testlanguages;
+
+import java.util.Set;
+
+/**
+ * @author Sebastian Zarnekow - Initial contribution and API
+ */
+public class FowlerDslRuntimeConfig extends AbstractFowlerDslRuntimeConfig {
+
+ public Set<IServiceRegistration> registrations() {
+ Set<IServiceRegistration> generated = super.registrations();
+ // do stuff
+ return generated;
+ }
+
+}
diff --git a/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/testlanguages/FowlerdslChecks.chk b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/testlanguages/FowlerdslChecks.chk
new file mode 100644
index 0000000..99a6e35
--- /dev/null
+++ b/tests/org.eclipse.xtext.generator.tests/src/org/eclipse/xtext/testlanguages/FowlerdslChecks.chk
@@ -0,0 +1,7 @@
+import fowlerdsl;
+/*
+ * 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;
+ */