mirror of
https://github.com/sigmasternchen/xtext-core
synced 2025-03-16 08:48:55 +00:00
[xtext tests] re-generated BacktrackingLexerTestLanguage with new generator
Signed-off-by: Christian Schneider <christian.schneider@itemis.de>
This commit is contained in:
parent
85db706fa2
commit
c3274abb11
31 changed files with 5959 additions and 9 deletions
|
@ -0,0 +1,31 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<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="backtrackingTestLanguage" nsURI="http://www.eclipse.org/2008/tmf/xtext/BacktrackingLexerTest"
|
||||
nsPrefix="backtrackingTestLanguage">
|
||||
<eClassifiers xsi:type="ecore:EClass" name="Model">
|
||||
<eStructuralFeatures xsi:type="ecore:EAttribute" name="enums" unique="false" upperBound="-1"
|
||||
eType="#//EnumName"/>
|
||||
<eStructuralFeatures xsi:type="ecore:EAttribute" name="ycs" unique="false" upperBound="-1"
|
||||
eType="ecore:EDataType platform:/resource/org.eclipse.emf.ecore/model/Ecore.ecore#//EString"/>
|
||||
<eStructuralFeatures xsi:type="ecore:EReference" name="abs" upperBound="-1" eType="#//Ab"
|
||||
containment="true"/>
|
||||
<eStructuralFeatures xsi:type="ecore:EReference" name="xbs" upperBound="-1" eType="#//Xb"
|
||||
containment="true"/>
|
||||
<eStructuralFeatures xsi:type="ecore:EAttribute" name="ys" unique="false" upperBound="-1"
|
||||
eType="ecore:EDataType platform:/resource/org.eclipse.emf.ecore/model/Ecore.ecore#//EString"/>
|
||||
<eStructuralFeatures xsi:type="ecore:EAttribute" name="as" unique="false" upperBound="-1"
|
||||
eType="ecore:EDataType platform:/resource/org.eclipse.emf.ecore/model/Ecore.ecore#//EString"/>
|
||||
</eClassifiers>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="Ab">
|
||||
<eStructuralFeatures xsi:type="ecore:EAttribute" name="x" eType="ecore:EDataType platform:/resource/org.eclipse.emf.ecore/model/Ecore.ecore#//EString"/>
|
||||
<eStructuralFeatures xsi:type="ecore:EAttribute" name="y" eType="ecore:EDataType platform:/resource/org.eclipse.emf.ecore/model/Ecore.ecore#//EString"/>
|
||||
</eClassifiers>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="Xb">
|
||||
<eStructuralFeatures xsi:type="ecore:EAttribute" name="x" eType="ecore:EDataType platform:/resource/org.eclipse.emf.ecore/model/Ecore.ecore#//EString"/>
|
||||
<eStructuralFeatures xsi:type="ecore:EAttribute" name="y" eType="ecore:EDataType platform:/resource/org.eclipse.emf.ecore/model/Ecore.ecore#//EString"/>
|
||||
</eClassifiers>
|
||||
<eClassifiers xsi:type="ecore:EEnum" name="EnumName">
|
||||
<eLiterals name="abc" literal="Abc"/>
|
||||
<eLiterals name="efg" value="1" literal="Efg"/>
|
||||
</eClassifiers>
|
||||
</ecore:EPackage>
|
|
@ -0,0 +1,31 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<genmodel:GenModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
|
||||
xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" copyrightText="generated by Xtext" modelDirectory="/org.eclipse.xtext.tests/src-gen2"
|
||||
modelPluginID="org.eclipse.xtext.tests" forceOverwrite="true" modelName="BacktrackingLexerTestLanguage"
|
||||
updateClasspath="false" rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container"
|
||||
complianceLevel="6.0" copyrightFields="false" runtimeVersion="2.11" usedGenPackages="platform:/resource/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore">
|
||||
<genPackages prefix="BacktrackingTestLanguage" basePackage="org.eclipse.xtext.lexer"
|
||||
disposableProviderFactory="true" fileExtensions="backtrackinglexertestlanguage"
|
||||
ecorePackage="BacktrackingLexerTestLanguage.ecore#/">
|
||||
<genEnums typeSafeEnumCompatible="false" ecoreEnum="BacktrackingLexerTestLanguage.ecore#//EnumName">
|
||||
<genEnumLiterals ecoreEnumLiteral="BacktrackingLexerTestLanguage.ecore#//EnumName/abc"/>
|
||||
<genEnumLiterals ecoreEnumLiteral="BacktrackingLexerTestLanguage.ecore#//EnumName/efg"/>
|
||||
</genEnums>
|
||||
<genClasses ecoreClass="BacktrackingLexerTestLanguage.ecore#//Model">
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute BacktrackingLexerTestLanguage.ecore#//Model/enums"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute BacktrackingLexerTestLanguage.ecore#//Model/ycs"/>
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference BacktrackingLexerTestLanguage.ecore#//Model/abs"/>
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference BacktrackingLexerTestLanguage.ecore#//Model/xbs"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute BacktrackingLexerTestLanguage.ecore#//Model/ys"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute BacktrackingLexerTestLanguage.ecore#//Model/as"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="BacktrackingLexerTestLanguage.ecore#//Ab">
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute BacktrackingLexerTestLanguage.ecore#//Ab/x"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute BacktrackingLexerTestLanguage.ecore#//Ab/y"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="BacktrackingLexerTestLanguage.ecore#//Xb">
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute BacktrackingLexerTestLanguage.ecore#//Xb/x"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute BacktrackingLexerTestLanguage.ecore#//Xb/y"/>
|
||||
</genClasses>
|
||||
</genPackages>
|
||||
</genmodel:GenModel>
|
|
@ -12,15 +12,6 @@
|
|||
</extension>
|
||||
|
||||
|
||||
<extension point="org.eclipse.emf.ecore.generated_package">
|
||||
<package
|
||||
uri = "http://www.eclipse.org/2008/tmf/xtext/BacktrackingLexerTest"
|
||||
class = "org.eclipse.xtext.lexer.backtrackingTestLanguage.BacktrackingTestLanguagePackage"
|
||||
genModel = "org/eclipse/xtext/lexer/BacktrackingLexerTestLanguage.genmodel" />
|
||||
|
||||
</extension>
|
||||
|
||||
|
||||
<extension point="org.eclipse.emf.ecore.generated_package">
|
||||
<package
|
||||
uri = "http://www.eclipse.org/2008/tmf/xtext/IgnoreCaseLexerTest"
|
||||
|
|
|
@ -0,0 +1,118 @@
|
|||
/*
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.lexer;
|
||||
|
||||
import com.google.inject.Binder;
|
||||
import com.google.inject.Provider;
|
||||
import com.google.inject.name.Names;
|
||||
import java.util.Properties;
|
||||
import org.eclipse.xtext.Constants;
|
||||
import org.eclipse.xtext.IGrammarAccess;
|
||||
import org.eclipse.xtext.lexer.parser.antlr.BacktrackingLexerTestLanguageAntlrTokenFileProvider;
|
||||
import org.eclipse.xtext.lexer.parser.antlr.BacktrackingLexerTestLanguageParser;
|
||||
import org.eclipse.xtext.lexer.parser.antlr.lexer.InternalBacktrackingLexerTestLanguageLexer;
|
||||
import org.eclipse.xtext.lexer.serializer.BacktrackingLexerTestLanguageSemanticSequencer;
|
||||
import org.eclipse.xtext.lexer.serializer.BacktrackingLexerTestLanguageSyntacticSequencer;
|
||||
import org.eclipse.xtext.lexer.services.BacktrackingLexerTestLanguageGrammarAccess;
|
||||
import org.eclipse.xtext.parser.IParser;
|
||||
import org.eclipse.xtext.parser.ITokenToStringConverter;
|
||||
import org.eclipse.xtext.parser.antlr.AntlrTokenDefProvider;
|
||||
import org.eclipse.xtext.parser.antlr.AntlrTokenToStringConverter;
|
||||
import org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider;
|
||||
import org.eclipse.xtext.parser.antlr.ITokenDefProvider;
|
||||
import org.eclipse.xtext.parser.antlr.Lexer;
|
||||
import org.eclipse.xtext.parser.antlr.LexerBindings;
|
||||
import org.eclipse.xtext.parser.antlr.LexerProvider;
|
||||
import org.eclipse.xtext.serializer.ISerializer;
|
||||
import org.eclipse.xtext.serializer.impl.Serializer;
|
||||
import org.eclipse.xtext.serializer.sequencer.ISemanticSequencer;
|
||||
import org.eclipse.xtext.serializer.sequencer.ISyntacticSequencer;
|
||||
import org.eclipse.xtext.service.DefaultRuntimeModule;
|
||||
|
||||
/**
|
||||
* Manual modifications go to {@link BacktrackingLexerTestLanguageRuntimeModule}.
|
||||
*/
|
||||
@SuppressWarnings("all")
|
||||
public abstract class AbstractBacktrackingLexerTestLanguageRuntimeModule extends DefaultRuntimeModule {
|
||||
|
||||
protected Properties properties = null;
|
||||
|
||||
@Override
|
||||
public void configure(Binder binder) {
|
||||
properties = tryBindProperties(binder, "org/eclipse/xtext/lexer/BacktrackingLexerTestLanguage.properties");
|
||||
super.configure(binder);
|
||||
}
|
||||
|
||||
public void configureLanguageName(Binder binder) {
|
||||
binder.bind(String.class).annotatedWith(Names.named(Constants.LANGUAGE_NAME)).toInstance("org.eclipse.xtext.lexer.BacktrackingLexerTestLanguage");
|
||||
}
|
||||
|
||||
public void configureFileExtensions(Binder binder) {
|
||||
if (properties == null || properties.getProperty(Constants.FILE_EXTENSIONS) == null)
|
||||
binder.bind(String.class).annotatedWith(Names.named(Constants.FILE_EXTENSIONS)).toInstance("backtrackinglexertestlanguage");
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2
|
||||
public Class<? extends IParser> bindIParser() {
|
||||
return BacktrackingLexerTestLanguageParser.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2
|
||||
public Class<? extends ITokenToStringConverter> bindITokenToStringConverter() {
|
||||
return AntlrTokenToStringConverter.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2
|
||||
public Class<? extends IAntlrTokenFileProvider> bindIAntlrTokenFileProvider() {
|
||||
return BacktrackingLexerTestLanguageAntlrTokenFileProvider.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2
|
||||
public Class<? extends Lexer> bindLexer() {
|
||||
return InternalBacktrackingLexerTestLanguageLexer.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2
|
||||
public Class<? extends ITokenDefProvider> bindITokenDefProvider() {
|
||||
return AntlrTokenDefProvider.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2
|
||||
public Provider<InternalBacktrackingLexerTestLanguageLexer> provideInternalBacktrackingLexerTestLanguageLexer() {
|
||||
return LexerProvider.create(InternalBacktrackingLexerTestLanguageLexer.class);
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2
|
||||
public void configureRuntimeLexer(Binder binder) {
|
||||
binder.bind(Lexer.class)
|
||||
.annotatedWith(Names.named(LexerBindings.RUNTIME))
|
||||
.to(InternalBacktrackingLexerTestLanguageLexer.class);
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.grammarAccess.GrammarAccessFragment2
|
||||
public ClassLoader bindClassLoaderToInstance() {
|
||||
return getClass().getClassLoader();
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.grammarAccess.GrammarAccessFragment2
|
||||
public Class<? extends IGrammarAccess> bindIGrammarAccess() {
|
||||
return BacktrackingLexerTestLanguageGrammarAccess.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.serializer.SerializerFragment2
|
||||
public Class<? extends ISemanticSequencer> bindISemanticSequencer() {
|
||||
return BacktrackingLexerTestLanguageSemanticSequencer.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.serializer.SerializerFragment2
|
||||
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
|
||||
return BacktrackingLexerTestLanguageSyntacticSequencer.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.serializer.SerializerFragment2
|
||||
public Class<? extends ISerializer> bindISerializer() {
|
||||
return Serializer.class;
|
||||
}
|
||||
|
||||
}
|
Binary file not shown.
|
@ -0,0 +1,56 @@
|
|||
/*
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.lexer;
|
||||
|
||||
import com.google.inject.Guice;
|
||||
import com.google.inject.Injector;
|
||||
import org.eclipse.emf.ecore.EPackage;
|
||||
import org.eclipse.emf.ecore.resource.Resource;
|
||||
import org.eclipse.emf.ecore.xmi.impl.EcoreResourceFactoryImpl;
|
||||
import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl;
|
||||
import org.eclipse.xtext.ISetup;
|
||||
import org.eclipse.xtext.XtextPackage;
|
||||
import org.eclipse.xtext.lexer.backtrackingTestLanguage.BacktrackingTestLanguagePackage;
|
||||
import org.eclipse.xtext.resource.IResourceFactory;
|
||||
import org.eclipse.xtext.resource.IResourceServiceProvider;
|
||||
import org.eclipse.xtext.resource.impl.BinaryGrammarResourceFactoryImpl;
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public class BacktrackingLexerTestLanguageStandaloneSetupGenerated implements ISetup {
|
||||
|
||||
@Override
|
||||
public Injector createInjectorAndDoEMFRegistration() {
|
||||
// register default ePackages
|
||||
if (!Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().containsKey("ecore"))
|
||||
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put(
|
||||
"ecore", new EcoreResourceFactoryImpl());
|
||||
if (!Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().containsKey("xmi"))
|
||||
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put(
|
||||
"xmi", new XMIResourceFactoryImpl());
|
||||
if (!Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().containsKey("xtextbin"))
|
||||
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put(
|
||||
"xtextbin", new BinaryGrammarResourceFactoryImpl());
|
||||
if (!EPackage.Registry.INSTANCE.containsKey(XtextPackage.eNS_URI))
|
||||
EPackage.Registry.INSTANCE.put(XtextPackage.eNS_URI, XtextPackage.eINSTANCE);
|
||||
|
||||
Injector injector = createInjector();
|
||||
register(injector);
|
||||
return injector;
|
||||
}
|
||||
|
||||
public Injector createInjector() {
|
||||
return Guice.createInjector(new BacktrackingLexerTestLanguageRuntimeModule());
|
||||
}
|
||||
|
||||
public void register(Injector injector) {
|
||||
if (!EPackage.Registry.INSTANCE.containsKey("http://www.eclipse.org/2008/tmf/xtext/BacktrackingLexerTest")) {
|
||||
EPackage.Registry.INSTANCE.put("http://www.eclipse.org/2008/tmf/xtext/BacktrackingLexerTest", BacktrackingTestLanguagePackage.eINSTANCE);
|
||||
}
|
||||
IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class);
|
||||
IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class);
|
||||
|
||||
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("backtrackinglexertestlanguage", resourceFactory);
|
||||
IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("backtrackinglexertestlanguage", serviceProvider);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,79 @@
|
|||
/**
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.lexer.backtrackingTestLanguage;
|
||||
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* A representation of the model object '<em><b>Ab</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
*
|
||||
* <p>
|
||||
* The following features are supported:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>{@link org.eclipse.xtext.lexer.backtrackingTestLanguage.Ab#getX <em>X</em>}</li>
|
||||
* <li>{@link org.eclipse.xtext.lexer.backtrackingTestLanguage.Ab#getY <em>Y</em>}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @see org.eclipse.xtext.lexer.backtrackingTestLanguage.BacktrackingTestLanguagePackage#getAb()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
public interface Ab extends EObject
|
||||
{
|
||||
/**
|
||||
* Returns the value of the '<em><b>X</b></em>' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>X</em>' attribute isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>X</em>' attribute.
|
||||
* @see #setX(String)
|
||||
* @see org.eclipse.xtext.lexer.backtrackingTestLanguage.BacktrackingTestLanguagePackage#getAb_X()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
String getX();
|
||||
|
||||
/**
|
||||
* Sets the value of the '{@link org.eclipse.xtext.lexer.backtrackingTestLanguage.Ab#getX <em>X</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param value the new value of the '<em>X</em>' attribute.
|
||||
* @see #getX()
|
||||
* @generated
|
||||
*/
|
||||
void setX(String value);
|
||||
|
||||
/**
|
||||
* Returns the value of the '<em><b>Y</b></em>' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>Y</em>' attribute isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Y</em>' attribute.
|
||||
* @see #setY(String)
|
||||
* @see org.eclipse.xtext.lexer.backtrackingTestLanguage.BacktrackingTestLanguagePackage#getAb_Y()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
String getY();
|
||||
|
||||
/**
|
||||
* Sets the value of the '{@link org.eclipse.xtext.lexer.backtrackingTestLanguage.Ab#getY <em>Y</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param value the new value of the '<em>Y</em>' attribute.
|
||||
* @see #getY()
|
||||
* @generated
|
||||
*/
|
||||
void setY(String value);
|
||||
|
||||
} // Ab
|
|
@ -0,0 +1,62 @@
|
|||
/**
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.lexer.backtrackingTestLanguage;
|
||||
|
||||
import org.eclipse.emf.ecore.EFactory;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* The <b>Factory</b> for the model.
|
||||
* It provides a create method for each non-abstract class of the model.
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.xtext.lexer.backtrackingTestLanguage.BacktrackingTestLanguagePackage
|
||||
* @generated
|
||||
*/
|
||||
public interface BacktrackingTestLanguageFactory extends EFactory
|
||||
{
|
||||
/**
|
||||
* The singleton instance of the factory.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
BacktrackingTestLanguageFactory eINSTANCE = org.eclipse.xtext.lexer.backtrackingTestLanguage.impl.BacktrackingTestLanguageFactoryImpl.init();
|
||||
|
||||
/**
|
||||
* Returns a new object of class '<em>Model</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return a new object of class '<em>Model</em>'.
|
||||
* @generated
|
||||
*/
|
||||
Model createModel();
|
||||
|
||||
/**
|
||||
* Returns a new object of class '<em>Ab</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return a new object of class '<em>Ab</em>'.
|
||||
* @generated
|
||||
*/
|
||||
Ab createAb();
|
||||
|
||||
/**
|
||||
* Returns a new object of class '<em>Xb</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return a new object of class '<em>Xb</em>'.
|
||||
* @generated
|
||||
*/
|
||||
Xb createXb();
|
||||
|
||||
/**
|
||||
* Returns the package supported by this factory.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the package supported by this factory.
|
||||
* @generated
|
||||
*/
|
||||
BacktrackingTestLanguagePackage getBacktrackingTestLanguagePackage();
|
||||
|
||||
} //BacktrackingTestLanguageFactory
|
|
@ -0,0 +1,514 @@
|
|||
/**
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.lexer.backtrackingTestLanguage;
|
||||
|
||||
import org.eclipse.emf.ecore.EAttribute;
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
import org.eclipse.emf.ecore.EEnum;
|
||||
import org.eclipse.emf.ecore.EPackage;
|
||||
import org.eclipse.emf.ecore.EReference;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* The <b>Package</b> for the model.
|
||||
* It contains accessors for the meta objects to represent
|
||||
* <ul>
|
||||
* <li>each class,</li>
|
||||
* <li>each feature of each class,</li>
|
||||
* <li>each enum,</li>
|
||||
* <li>and each data type</li>
|
||||
* </ul>
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.xtext.lexer.backtrackingTestLanguage.BacktrackingTestLanguageFactory
|
||||
* @model kind="package"
|
||||
* @generated
|
||||
*/
|
||||
public interface BacktrackingTestLanguagePackage extends EPackage
|
||||
{
|
||||
/**
|
||||
* The package name.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
String eNAME = "backtrackingTestLanguage";
|
||||
|
||||
/**
|
||||
* The package namespace URI.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
String eNS_URI = "http://www.eclipse.org/2008/tmf/xtext/BacktrackingLexerTest";
|
||||
|
||||
/**
|
||||
* The package namespace name.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
String eNS_PREFIX = "backtrackingTestLanguage";
|
||||
|
||||
/**
|
||||
* The singleton instance of the package.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
BacktrackingTestLanguagePackage eINSTANCE = org.eclipse.xtext.lexer.backtrackingTestLanguage.impl.BacktrackingTestLanguagePackageImpl.init();
|
||||
|
||||
/**
|
||||
* The meta object id for the '{@link org.eclipse.xtext.lexer.backtrackingTestLanguage.impl.ModelImpl <em>Model</em>}' class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.xtext.lexer.backtrackingTestLanguage.impl.ModelImpl
|
||||
* @see org.eclipse.xtext.lexer.backtrackingTestLanguage.impl.BacktrackingTestLanguagePackageImpl#getModel()
|
||||
* @generated
|
||||
*/
|
||||
int MODEL = 0;
|
||||
|
||||
/**
|
||||
* The feature id for the '<em><b>Enums</b></em>' attribute list.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
int MODEL__ENUMS = 0;
|
||||
|
||||
/**
|
||||
* The feature id for the '<em><b>Ycs</b></em>' attribute list.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
int MODEL__YCS = 1;
|
||||
|
||||
/**
|
||||
* The feature id for the '<em><b>Abs</b></em>' containment reference list.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
int MODEL__ABS = 2;
|
||||
|
||||
/**
|
||||
* The feature id for the '<em><b>Xbs</b></em>' containment reference list.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
int MODEL__XBS = 3;
|
||||
|
||||
/**
|
||||
* The feature id for the '<em><b>Ys</b></em>' attribute list.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
int MODEL__YS = 4;
|
||||
|
||||
/**
|
||||
* The feature id for the '<em><b>As</b></em>' attribute list.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
int MODEL__AS = 5;
|
||||
|
||||
/**
|
||||
* The number of structural features of the '<em>Model</em>' class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
int MODEL_FEATURE_COUNT = 6;
|
||||
|
||||
/**
|
||||
* The meta object id for the '{@link org.eclipse.xtext.lexer.backtrackingTestLanguage.impl.AbImpl <em>Ab</em>}' class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.xtext.lexer.backtrackingTestLanguage.impl.AbImpl
|
||||
* @see org.eclipse.xtext.lexer.backtrackingTestLanguage.impl.BacktrackingTestLanguagePackageImpl#getAb()
|
||||
* @generated
|
||||
*/
|
||||
int AB = 1;
|
||||
|
||||
/**
|
||||
* The feature id for the '<em><b>X</b></em>' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
int AB__X = 0;
|
||||
|
||||
/**
|
||||
* The feature id for the '<em><b>Y</b></em>' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
int AB__Y = 1;
|
||||
|
||||
/**
|
||||
* The number of structural features of the '<em>Ab</em>' class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
int AB_FEATURE_COUNT = 2;
|
||||
|
||||
/**
|
||||
* The meta object id for the '{@link org.eclipse.xtext.lexer.backtrackingTestLanguage.impl.XbImpl <em>Xb</em>}' class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.xtext.lexer.backtrackingTestLanguage.impl.XbImpl
|
||||
* @see org.eclipse.xtext.lexer.backtrackingTestLanguage.impl.BacktrackingTestLanguagePackageImpl#getXb()
|
||||
* @generated
|
||||
*/
|
||||
int XB = 2;
|
||||
|
||||
/**
|
||||
* The feature id for the '<em><b>X</b></em>' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
int XB__X = 0;
|
||||
|
||||
/**
|
||||
* The feature id for the '<em><b>Y</b></em>' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
int XB__Y = 1;
|
||||
|
||||
/**
|
||||
* The number of structural features of the '<em>Xb</em>' class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
int XB_FEATURE_COUNT = 2;
|
||||
|
||||
/**
|
||||
* The meta object id for the '{@link org.eclipse.xtext.lexer.backtrackingTestLanguage.EnumName <em>Enum Name</em>}' enum.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.xtext.lexer.backtrackingTestLanguage.EnumName
|
||||
* @see org.eclipse.xtext.lexer.backtrackingTestLanguage.impl.BacktrackingTestLanguagePackageImpl#getEnumName()
|
||||
* @generated
|
||||
*/
|
||||
int ENUM_NAME = 3;
|
||||
|
||||
|
||||
/**
|
||||
* Returns the meta object for class '{@link org.eclipse.xtext.lexer.backtrackingTestLanguage.Model <em>Model</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the meta object for class '<em>Model</em>'.
|
||||
* @see org.eclipse.xtext.lexer.backtrackingTestLanguage.Model
|
||||
* @generated
|
||||
*/
|
||||
EClass getModel();
|
||||
|
||||
/**
|
||||
* Returns the meta object for the attribute list '{@link org.eclipse.xtext.lexer.backtrackingTestLanguage.Model#getEnums <em>Enums</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the meta object for the attribute list '<em>Enums</em>'.
|
||||
* @see org.eclipse.xtext.lexer.backtrackingTestLanguage.Model#getEnums()
|
||||
* @see #getModel()
|
||||
* @generated
|
||||
*/
|
||||
EAttribute getModel_Enums();
|
||||
|
||||
/**
|
||||
* Returns the meta object for the attribute list '{@link org.eclipse.xtext.lexer.backtrackingTestLanguage.Model#getYcs <em>Ycs</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the meta object for the attribute list '<em>Ycs</em>'.
|
||||
* @see org.eclipse.xtext.lexer.backtrackingTestLanguage.Model#getYcs()
|
||||
* @see #getModel()
|
||||
* @generated
|
||||
*/
|
||||
EAttribute getModel_Ycs();
|
||||
|
||||
/**
|
||||
* Returns the meta object for the containment reference list '{@link org.eclipse.xtext.lexer.backtrackingTestLanguage.Model#getAbs <em>Abs</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the meta object for the containment reference list '<em>Abs</em>'.
|
||||
* @see org.eclipse.xtext.lexer.backtrackingTestLanguage.Model#getAbs()
|
||||
* @see #getModel()
|
||||
* @generated
|
||||
*/
|
||||
EReference getModel_Abs();
|
||||
|
||||
/**
|
||||
* Returns the meta object for the containment reference list '{@link org.eclipse.xtext.lexer.backtrackingTestLanguage.Model#getXbs <em>Xbs</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the meta object for the containment reference list '<em>Xbs</em>'.
|
||||
* @see org.eclipse.xtext.lexer.backtrackingTestLanguage.Model#getXbs()
|
||||
* @see #getModel()
|
||||
* @generated
|
||||
*/
|
||||
EReference getModel_Xbs();
|
||||
|
||||
/**
|
||||
* Returns the meta object for the attribute list '{@link org.eclipse.xtext.lexer.backtrackingTestLanguage.Model#getYs <em>Ys</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the meta object for the attribute list '<em>Ys</em>'.
|
||||
* @see org.eclipse.xtext.lexer.backtrackingTestLanguage.Model#getYs()
|
||||
* @see #getModel()
|
||||
* @generated
|
||||
*/
|
||||
EAttribute getModel_Ys();
|
||||
|
||||
/**
|
||||
* Returns the meta object for the attribute list '{@link org.eclipse.xtext.lexer.backtrackingTestLanguage.Model#getAs <em>As</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the meta object for the attribute list '<em>As</em>'.
|
||||
* @see org.eclipse.xtext.lexer.backtrackingTestLanguage.Model#getAs()
|
||||
* @see #getModel()
|
||||
* @generated
|
||||
*/
|
||||
EAttribute getModel_As();
|
||||
|
||||
/**
|
||||
* Returns the meta object for class '{@link org.eclipse.xtext.lexer.backtrackingTestLanguage.Ab <em>Ab</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the meta object for class '<em>Ab</em>'.
|
||||
* @see org.eclipse.xtext.lexer.backtrackingTestLanguage.Ab
|
||||
* @generated
|
||||
*/
|
||||
EClass getAb();
|
||||
|
||||
/**
|
||||
* Returns the meta object for the attribute '{@link org.eclipse.xtext.lexer.backtrackingTestLanguage.Ab#getX <em>X</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the meta object for the attribute '<em>X</em>'.
|
||||
* @see org.eclipse.xtext.lexer.backtrackingTestLanguage.Ab#getX()
|
||||
* @see #getAb()
|
||||
* @generated
|
||||
*/
|
||||
EAttribute getAb_X();
|
||||
|
||||
/**
|
||||
* Returns the meta object for the attribute '{@link org.eclipse.xtext.lexer.backtrackingTestLanguage.Ab#getY <em>Y</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the meta object for the attribute '<em>Y</em>'.
|
||||
* @see org.eclipse.xtext.lexer.backtrackingTestLanguage.Ab#getY()
|
||||
* @see #getAb()
|
||||
* @generated
|
||||
*/
|
||||
EAttribute getAb_Y();
|
||||
|
||||
/**
|
||||
* Returns the meta object for class '{@link org.eclipse.xtext.lexer.backtrackingTestLanguage.Xb <em>Xb</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the meta object for class '<em>Xb</em>'.
|
||||
* @see org.eclipse.xtext.lexer.backtrackingTestLanguage.Xb
|
||||
* @generated
|
||||
*/
|
||||
EClass getXb();
|
||||
|
||||
/**
|
||||
* Returns the meta object for the attribute '{@link org.eclipse.xtext.lexer.backtrackingTestLanguage.Xb#getX <em>X</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the meta object for the attribute '<em>X</em>'.
|
||||
* @see org.eclipse.xtext.lexer.backtrackingTestLanguage.Xb#getX()
|
||||
* @see #getXb()
|
||||
* @generated
|
||||
*/
|
||||
EAttribute getXb_X();
|
||||
|
||||
/**
|
||||
* Returns the meta object for the attribute '{@link org.eclipse.xtext.lexer.backtrackingTestLanguage.Xb#getY <em>Y</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the meta object for the attribute '<em>Y</em>'.
|
||||
* @see org.eclipse.xtext.lexer.backtrackingTestLanguage.Xb#getY()
|
||||
* @see #getXb()
|
||||
* @generated
|
||||
*/
|
||||
EAttribute getXb_Y();
|
||||
|
||||
/**
|
||||
* Returns the meta object for enum '{@link org.eclipse.xtext.lexer.backtrackingTestLanguage.EnumName <em>Enum Name</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the meta object for enum '<em>Enum Name</em>'.
|
||||
* @see org.eclipse.xtext.lexer.backtrackingTestLanguage.EnumName
|
||||
* @generated
|
||||
*/
|
||||
EEnum getEnumName();
|
||||
|
||||
/**
|
||||
* Returns the factory that creates the instances of the model.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the factory that creates the instances of the model.
|
||||
* @generated
|
||||
*/
|
||||
BacktrackingTestLanguageFactory getBacktrackingTestLanguageFactory();
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* Defines literals for the meta objects that represent
|
||||
* <ul>
|
||||
* <li>each class,</li>
|
||||
* <li>each feature of each class,</li>
|
||||
* <li>each enum,</li>
|
||||
* <li>and each data type</li>
|
||||
* </ul>
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
interface Literals
|
||||
{
|
||||
/**
|
||||
* The meta object literal for the '{@link org.eclipse.xtext.lexer.backtrackingTestLanguage.impl.ModelImpl <em>Model</em>}' class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.xtext.lexer.backtrackingTestLanguage.impl.ModelImpl
|
||||
* @see org.eclipse.xtext.lexer.backtrackingTestLanguage.impl.BacktrackingTestLanguagePackageImpl#getModel()
|
||||
* @generated
|
||||
*/
|
||||
EClass MODEL = eINSTANCE.getModel();
|
||||
|
||||
/**
|
||||
* The meta object literal for the '<em><b>Enums</b></em>' attribute list feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
EAttribute MODEL__ENUMS = eINSTANCE.getModel_Enums();
|
||||
|
||||
/**
|
||||
* The meta object literal for the '<em><b>Ycs</b></em>' attribute list feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
EAttribute MODEL__YCS = eINSTANCE.getModel_Ycs();
|
||||
|
||||
/**
|
||||
* The meta object literal for the '<em><b>Abs</b></em>' containment reference list feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
EReference MODEL__ABS = eINSTANCE.getModel_Abs();
|
||||
|
||||
/**
|
||||
* The meta object literal for the '<em><b>Xbs</b></em>' containment reference list feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
EReference MODEL__XBS = eINSTANCE.getModel_Xbs();
|
||||
|
||||
/**
|
||||
* The meta object literal for the '<em><b>Ys</b></em>' attribute list feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
EAttribute MODEL__YS = eINSTANCE.getModel_Ys();
|
||||
|
||||
/**
|
||||
* The meta object literal for the '<em><b>As</b></em>' attribute list feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
EAttribute MODEL__AS = eINSTANCE.getModel_As();
|
||||
|
||||
/**
|
||||
* The meta object literal for the '{@link org.eclipse.xtext.lexer.backtrackingTestLanguage.impl.AbImpl <em>Ab</em>}' class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.xtext.lexer.backtrackingTestLanguage.impl.AbImpl
|
||||
* @see org.eclipse.xtext.lexer.backtrackingTestLanguage.impl.BacktrackingTestLanguagePackageImpl#getAb()
|
||||
* @generated
|
||||
*/
|
||||
EClass AB = eINSTANCE.getAb();
|
||||
|
||||
/**
|
||||
* The meta object literal for the '<em><b>X</b></em>' attribute feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
EAttribute AB__X = eINSTANCE.getAb_X();
|
||||
|
||||
/**
|
||||
* The meta object literal for the '<em><b>Y</b></em>' attribute feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
EAttribute AB__Y = eINSTANCE.getAb_Y();
|
||||
|
||||
/**
|
||||
* The meta object literal for the '{@link org.eclipse.xtext.lexer.backtrackingTestLanguage.impl.XbImpl <em>Xb</em>}' class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.xtext.lexer.backtrackingTestLanguage.impl.XbImpl
|
||||
* @see org.eclipse.xtext.lexer.backtrackingTestLanguage.impl.BacktrackingTestLanguagePackageImpl#getXb()
|
||||
* @generated
|
||||
*/
|
||||
EClass XB = eINSTANCE.getXb();
|
||||
|
||||
/**
|
||||
* The meta object literal for the '<em><b>X</b></em>' attribute feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
EAttribute XB__X = eINSTANCE.getXb_X();
|
||||
|
||||
/**
|
||||
* The meta object literal for the '<em><b>Y</b></em>' attribute feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
EAttribute XB__Y = eINSTANCE.getXb_Y();
|
||||
|
||||
/**
|
||||
* The meta object literal for the '{@link org.eclipse.xtext.lexer.backtrackingTestLanguage.EnumName <em>Enum Name</em>}' enum.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.xtext.lexer.backtrackingTestLanguage.EnumName
|
||||
* @see org.eclipse.xtext.lexer.backtrackingTestLanguage.impl.BacktrackingTestLanguagePackageImpl#getEnumName()
|
||||
* @generated
|
||||
*/
|
||||
EEnum ENUM_NAME = eINSTANCE.getEnumName();
|
||||
|
||||
}
|
||||
|
||||
} //BacktrackingTestLanguagePackage
|
|
@ -0,0 +1,230 @@
|
|||
/**
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.lexer.backtrackingTestLanguage;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.emf.common.util.Enumerator;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* A representation of the literals of the enumeration '<em><b>Enum Name</b></em>',
|
||||
* and utility methods for working with them.
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.xtext.lexer.backtrackingTestLanguage.BacktrackingTestLanguagePackage#getEnumName()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
public enum EnumName implements Enumerator
|
||||
{
|
||||
/**
|
||||
* The '<em><b>Abc</b></em>' literal object.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #ABC_VALUE
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
ABC(0, "abc", "Abc"),
|
||||
|
||||
/**
|
||||
* The '<em><b>Efg</b></em>' literal object.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #EFG_VALUE
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
EFG(1, "efg", "Efg");
|
||||
|
||||
/**
|
||||
* The '<em><b>Abc</b></em>' literal value.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of '<em><b>Abc</b></em>' literal object isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @see #ABC
|
||||
* @model name="abc" literal="Abc"
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
public static final int ABC_VALUE = 0;
|
||||
|
||||
/**
|
||||
* The '<em><b>Efg</b></em>' literal value.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of '<em><b>Efg</b></em>' literal object isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @see #EFG
|
||||
* @model name="efg" literal="Efg"
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
public static final int EFG_VALUE = 1;
|
||||
|
||||
/**
|
||||
* An array of all the '<em><b>Enum Name</b></em>' enumerators.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private static final EnumName[] VALUES_ARRAY =
|
||||
new EnumName[]
|
||||
{
|
||||
ABC,
|
||||
EFG,
|
||||
};
|
||||
|
||||
/**
|
||||
* A public read-only list of all the '<em><b>Enum Name</b></em>' enumerators.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public static final List<EnumName> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
|
||||
|
||||
/**
|
||||
* Returns the '<em><b>Enum Name</b></em>' literal with the specified literal value.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param literal the literal.
|
||||
* @return the matching enumerator or <code>null</code>.
|
||||
* @generated
|
||||
*/
|
||||
public static EnumName get(String literal)
|
||||
{
|
||||
for (int i = 0; i < VALUES_ARRAY.length; ++i)
|
||||
{
|
||||
EnumName result = VALUES_ARRAY[i];
|
||||
if (result.toString().equals(literal))
|
||||
{
|
||||
return result;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the '<em><b>Enum Name</b></em>' literal with the specified name.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param name the name.
|
||||
* @return the matching enumerator or <code>null</code>.
|
||||
* @generated
|
||||
*/
|
||||
public static EnumName getByName(String name)
|
||||
{
|
||||
for (int i = 0; i < VALUES_ARRAY.length; ++i)
|
||||
{
|
||||
EnumName result = VALUES_ARRAY[i];
|
||||
if (result.getName().equals(name))
|
||||
{
|
||||
return result;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the '<em><b>Enum Name</b></em>' literal with the specified integer value.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param value the integer value.
|
||||
* @return the matching enumerator or <code>null</code>.
|
||||
* @generated
|
||||
*/
|
||||
public static EnumName get(int value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case ABC_VALUE: return ABC;
|
||||
case EFG_VALUE: return EFG;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private final int value;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private final String name;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private final String literal;
|
||||
|
||||
/**
|
||||
* Only this class can construct instances.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EnumName(int value, String name, String literal)
|
||||
{
|
||||
this.value = value;
|
||||
this.name = name;
|
||||
this.literal = literal;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public int getValue()
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getLiteral()
|
||||
{
|
||||
return literal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the literal value of the enumerator, which is its string representation.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return literal;
|
||||
}
|
||||
|
||||
} //EnumName
|
|
@ -0,0 +1,131 @@
|
|||
/**
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.lexer.backtrackingTestLanguage;
|
||||
|
||||
import org.eclipse.emf.common.util.EList;
|
||||
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* A representation of the model object '<em><b>Model</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
*
|
||||
* <p>
|
||||
* The following features are supported:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>{@link org.eclipse.xtext.lexer.backtrackingTestLanguage.Model#getEnums <em>Enums</em>}</li>
|
||||
* <li>{@link org.eclipse.xtext.lexer.backtrackingTestLanguage.Model#getYcs <em>Ycs</em>}</li>
|
||||
* <li>{@link org.eclipse.xtext.lexer.backtrackingTestLanguage.Model#getAbs <em>Abs</em>}</li>
|
||||
* <li>{@link org.eclipse.xtext.lexer.backtrackingTestLanguage.Model#getXbs <em>Xbs</em>}</li>
|
||||
* <li>{@link org.eclipse.xtext.lexer.backtrackingTestLanguage.Model#getYs <em>Ys</em>}</li>
|
||||
* <li>{@link org.eclipse.xtext.lexer.backtrackingTestLanguage.Model#getAs <em>As</em>}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @see org.eclipse.xtext.lexer.backtrackingTestLanguage.BacktrackingTestLanguagePackage#getModel()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
public interface Model extends EObject
|
||||
{
|
||||
/**
|
||||
* Returns the value of the '<em><b>Enums</b></em>' attribute list.
|
||||
* The list contents are of type {@link org.eclipse.xtext.lexer.backtrackingTestLanguage.EnumName}.
|
||||
* The literals are from the enumeration {@link org.eclipse.xtext.lexer.backtrackingTestLanguage.EnumName}.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>Enums</em>' attribute list isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Enums</em>' attribute list.
|
||||
* @see org.eclipse.xtext.lexer.backtrackingTestLanguage.EnumName
|
||||
* @see org.eclipse.xtext.lexer.backtrackingTestLanguage.BacktrackingTestLanguagePackage#getModel_Enums()
|
||||
* @model unique="false"
|
||||
* @generated
|
||||
*/
|
||||
EList<EnumName> getEnums();
|
||||
|
||||
/**
|
||||
* Returns the value of the '<em><b>Ycs</b></em>' attribute list.
|
||||
* The list contents are of type {@link java.lang.String}.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>Ycs</em>' attribute list isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Ycs</em>' attribute list.
|
||||
* @see org.eclipse.xtext.lexer.backtrackingTestLanguage.BacktrackingTestLanguagePackage#getModel_Ycs()
|
||||
* @model unique="false"
|
||||
* @generated
|
||||
*/
|
||||
EList<String> getYcs();
|
||||
|
||||
/**
|
||||
* Returns the value of the '<em><b>Abs</b></em>' containment reference list.
|
||||
* The list contents are of type {@link org.eclipse.xtext.lexer.backtrackingTestLanguage.Ab}.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>Abs</em>' containment reference list isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Abs</em>' containment reference list.
|
||||
* @see org.eclipse.xtext.lexer.backtrackingTestLanguage.BacktrackingTestLanguagePackage#getModel_Abs()
|
||||
* @model containment="true"
|
||||
* @generated
|
||||
*/
|
||||
EList<Ab> getAbs();
|
||||
|
||||
/**
|
||||
* Returns the value of the '<em><b>Xbs</b></em>' containment reference list.
|
||||
* The list contents are of type {@link org.eclipse.xtext.lexer.backtrackingTestLanguage.Xb}.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>Xbs</em>' containment reference list isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Xbs</em>' containment reference list.
|
||||
* @see org.eclipse.xtext.lexer.backtrackingTestLanguage.BacktrackingTestLanguagePackage#getModel_Xbs()
|
||||
* @model containment="true"
|
||||
* @generated
|
||||
*/
|
||||
EList<Xb> getXbs();
|
||||
|
||||
/**
|
||||
* Returns the value of the '<em><b>Ys</b></em>' attribute list.
|
||||
* The list contents are of type {@link java.lang.String}.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>Ys</em>' attribute list isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Ys</em>' attribute list.
|
||||
* @see org.eclipse.xtext.lexer.backtrackingTestLanguage.BacktrackingTestLanguagePackage#getModel_Ys()
|
||||
* @model unique="false"
|
||||
* @generated
|
||||
*/
|
||||
EList<String> getYs();
|
||||
|
||||
/**
|
||||
* Returns the value of the '<em><b>As</b></em>' attribute list.
|
||||
* The list contents are of type {@link java.lang.String}.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>As</em>' attribute list isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>As</em>' attribute list.
|
||||
* @see org.eclipse.xtext.lexer.backtrackingTestLanguage.BacktrackingTestLanguagePackage#getModel_As()
|
||||
* @model unique="false"
|
||||
* @generated
|
||||
*/
|
||||
EList<String> getAs();
|
||||
|
||||
} // Model
|
|
@ -0,0 +1,79 @@
|
|||
/**
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.lexer.backtrackingTestLanguage;
|
||||
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* A representation of the model object '<em><b>Xb</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
*
|
||||
* <p>
|
||||
* The following features are supported:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>{@link org.eclipse.xtext.lexer.backtrackingTestLanguage.Xb#getX <em>X</em>}</li>
|
||||
* <li>{@link org.eclipse.xtext.lexer.backtrackingTestLanguage.Xb#getY <em>Y</em>}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @see org.eclipse.xtext.lexer.backtrackingTestLanguage.BacktrackingTestLanguagePackage#getXb()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
public interface Xb extends EObject
|
||||
{
|
||||
/**
|
||||
* Returns the value of the '<em><b>X</b></em>' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>X</em>' attribute isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>X</em>' attribute.
|
||||
* @see #setX(String)
|
||||
* @see org.eclipse.xtext.lexer.backtrackingTestLanguage.BacktrackingTestLanguagePackage#getXb_X()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
String getX();
|
||||
|
||||
/**
|
||||
* Sets the value of the '{@link org.eclipse.xtext.lexer.backtrackingTestLanguage.Xb#getX <em>X</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param value the new value of the '<em>X</em>' attribute.
|
||||
* @see #getX()
|
||||
* @generated
|
||||
*/
|
||||
void setX(String value);
|
||||
|
||||
/**
|
||||
* Returns the value of the '<em><b>Y</b></em>' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>Y</em>' attribute isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Y</em>' attribute.
|
||||
* @see #setY(String)
|
||||
* @see org.eclipse.xtext.lexer.backtrackingTestLanguage.BacktrackingTestLanguagePackage#getXb_Y()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
String getY();
|
||||
|
||||
/**
|
||||
* Sets the value of the '{@link org.eclipse.xtext.lexer.backtrackingTestLanguage.Xb#getY <em>Y</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param value the new value of the '<em>Y</em>' attribute.
|
||||
* @see #getY()
|
||||
* @generated
|
||||
*/
|
||||
void setY(String value);
|
||||
|
||||
} // Xb
|
|
@ -0,0 +1,234 @@
|
|||
/**
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.lexer.backtrackingTestLanguage.impl;
|
||||
|
||||
import org.eclipse.emf.common.notify.Notification;
|
||||
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
|
||||
import org.eclipse.emf.ecore.impl.ENotificationImpl;
|
||||
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
|
||||
|
||||
import org.eclipse.xtext.lexer.backtrackingTestLanguage.Ab;
|
||||
import org.eclipse.xtext.lexer.backtrackingTestLanguage.BacktrackingTestLanguagePackage;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model object '<em><b>Ab</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
* <p>
|
||||
* The following features are implemented:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>{@link org.eclipse.xtext.lexer.backtrackingTestLanguage.impl.AbImpl#getX <em>X</em>}</li>
|
||||
* <li>{@link org.eclipse.xtext.lexer.backtrackingTestLanguage.impl.AbImpl#getY <em>Y</em>}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @generated
|
||||
*/
|
||||
public class AbImpl extends MinimalEObjectImpl.Container implements Ab
|
||||
{
|
||||
/**
|
||||
* The default value of the '{@link #getX() <em>X</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getX()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final String X_EDEFAULT = null;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getX() <em>X</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getX()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected String x = X_EDEFAULT;
|
||||
|
||||
/**
|
||||
* The default value of the '{@link #getY() <em>Y</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getY()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final String Y_EDEFAULT = null;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getY() <em>Y</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getY()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected String y = Y_EDEFAULT;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected AbImpl()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
protected EClass eStaticClass()
|
||||
{
|
||||
return BacktrackingTestLanguagePackage.Literals.AB;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getX()
|
||||
{
|
||||
return x;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setX(String newX)
|
||||
{
|
||||
String oldX = x;
|
||||
x = newX;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, BacktrackingTestLanguagePackage.AB__X, oldX, x));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getY()
|
||||
{
|
||||
return y;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setY(String newY)
|
||||
{
|
||||
String oldY = y;
|
||||
y = newY;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, BacktrackingTestLanguagePackage.AB__Y, oldY, y));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Object eGet(int featureID, boolean resolve, boolean coreType)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case BacktrackingTestLanguagePackage.AB__X:
|
||||
return getX();
|
||||
case BacktrackingTestLanguagePackage.AB__Y:
|
||||
return getY();
|
||||
}
|
||||
return super.eGet(featureID, resolve, coreType);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eSet(int featureID, Object newValue)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case BacktrackingTestLanguagePackage.AB__X:
|
||||
setX((String)newValue);
|
||||
return;
|
||||
case BacktrackingTestLanguagePackage.AB__Y:
|
||||
setY((String)newValue);
|
||||
return;
|
||||
}
|
||||
super.eSet(featureID, newValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eUnset(int featureID)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case BacktrackingTestLanguagePackage.AB__X:
|
||||
setX(X_EDEFAULT);
|
||||
return;
|
||||
case BacktrackingTestLanguagePackage.AB__Y:
|
||||
setY(Y_EDEFAULT);
|
||||
return;
|
||||
}
|
||||
super.eUnset(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public boolean eIsSet(int featureID)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case BacktrackingTestLanguagePackage.AB__X:
|
||||
return X_EDEFAULT == null ? x != null : !X_EDEFAULT.equals(x);
|
||||
case BacktrackingTestLanguagePackage.AB__Y:
|
||||
return Y_EDEFAULT == null ? y != null : !Y_EDEFAULT.equals(y);
|
||||
}
|
||||
return super.eIsSet(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
if (eIsProxy()) return super.toString();
|
||||
|
||||
StringBuffer result = new StringBuffer(super.toString());
|
||||
result.append(" (x: ");
|
||||
result.append(x);
|
||||
result.append(", y: ");
|
||||
result.append(y);
|
||||
result.append(')');
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
} //AbImpl
|
|
@ -0,0 +1,188 @@
|
|||
/**
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.lexer.backtrackingTestLanguage.impl;
|
||||
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
import org.eclipse.emf.ecore.EDataType;
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
import org.eclipse.emf.ecore.EPackage;
|
||||
|
||||
import org.eclipse.emf.ecore.impl.EFactoryImpl;
|
||||
|
||||
import org.eclipse.emf.ecore.plugin.EcorePlugin;
|
||||
|
||||
import org.eclipse.xtext.lexer.backtrackingTestLanguage.*;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model <b>Factory</b>.
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public class BacktrackingTestLanguageFactoryImpl extends EFactoryImpl implements BacktrackingTestLanguageFactory
|
||||
{
|
||||
/**
|
||||
* Creates the default factory implementation.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public static BacktrackingTestLanguageFactory init()
|
||||
{
|
||||
try
|
||||
{
|
||||
BacktrackingTestLanguageFactory theBacktrackingTestLanguageFactory = (BacktrackingTestLanguageFactory)EPackage.Registry.INSTANCE.getEFactory(BacktrackingTestLanguagePackage.eNS_URI);
|
||||
if (theBacktrackingTestLanguageFactory != null)
|
||||
{
|
||||
return theBacktrackingTestLanguageFactory;
|
||||
}
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
EcorePlugin.INSTANCE.log(exception);
|
||||
}
|
||||
return new BacktrackingTestLanguageFactoryImpl();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an instance of the factory.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public BacktrackingTestLanguageFactoryImpl()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public EObject create(EClass eClass)
|
||||
{
|
||||
switch (eClass.getClassifierID())
|
||||
{
|
||||
case BacktrackingTestLanguagePackage.MODEL: return createModel();
|
||||
case BacktrackingTestLanguagePackage.AB: return createAb();
|
||||
case BacktrackingTestLanguagePackage.XB: return createXb();
|
||||
default:
|
||||
throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Object createFromString(EDataType eDataType, String initialValue)
|
||||
{
|
||||
switch (eDataType.getClassifierID())
|
||||
{
|
||||
case BacktrackingTestLanguagePackage.ENUM_NAME:
|
||||
return createEnumNameFromString(eDataType, initialValue);
|
||||
default:
|
||||
throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public String convertToString(EDataType eDataType, Object instanceValue)
|
||||
{
|
||||
switch (eDataType.getClassifierID())
|
||||
{
|
||||
case BacktrackingTestLanguagePackage.ENUM_NAME:
|
||||
return convertEnumNameToString(eDataType, instanceValue);
|
||||
default:
|
||||
throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public Model createModel()
|
||||
{
|
||||
ModelImpl model = new ModelImpl();
|
||||
return model;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public Ab createAb()
|
||||
{
|
||||
AbImpl ab = new AbImpl();
|
||||
return ab;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public Xb createXb()
|
||||
{
|
||||
XbImpl xb = new XbImpl();
|
||||
return xb;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EnumName createEnumNameFromString(EDataType eDataType, String initialValue)
|
||||
{
|
||||
EnumName result = EnumName.get(initialValue);
|
||||
if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String convertEnumNameToString(EDataType eDataType, Object instanceValue)
|
||||
{
|
||||
return instanceValue == null ? null : instanceValue.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public BacktrackingTestLanguagePackage getBacktrackingTestLanguagePackage()
|
||||
{
|
||||
return (BacktrackingTestLanguagePackage)getEPackage();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @deprecated
|
||||
* @generated
|
||||
*/
|
||||
@Deprecated
|
||||
public static BacktrackingTestLanguagePackage getPackage()
|
||||
{
|
||||
return BacktrackingTestLanguagePackage.eINSTANCE;
|
||||
}
|
||||
|
||||
} //BacktrackingTestLanguageFactoryImpl
|
|
@ -0,0 +1,373 @@
|
|||
/**
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.lexer.backtrackingTestLanguage.impl;
|
||||
|
||||
import org.eclipse.emf.ecore.EAttribute;
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
import org.eclipse.emf.ecore.EEnum;
|
||||
import org.eclipse.emf.ecore.EPackage;
|
||||
import org.eclipse.emf.ecore.EReference;
|
||||
import org.eclipse.emf.ecore.EcorePackage;
|
||||
|
||||
import org.eclipse.emf.ecore.impl.EPackageImpl;
|
||||
|
||||
import org.eclipse.xtext.lexer.backtrackingTestLanguage.Ab;
|
||||
import org.eclipse.xtext.lexer.backtrackingTestLanguage.BacktrackingTestLanguageFactory;
|
||||
import org.eclipse.xtext.lexer.backtrackingTestLanguage.BacktrackingTestLanguagePackage;
|
||||
import org.eclipse.xtext.lexer.backtrackingTestLanguage.EnumName;
|
||||
import org.eclipse.xtext.lexer.backtrackingTestLanguage.Model;
|
||||
import org.eclipse.xtext.lexer.backtrackingTestLanguage.Xb;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model <b>Package</b>.
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public class BacktrackingTestLanguagePackageImpl extends EPackageImpl implements BacktrackingTestLanguagePackage
|
||||
{
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EClass modelEClass = null;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EClass abEClass = null;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EClass xbEClass = null;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EEnum enumNameEEnum = null;
|
||||
|
||||
/**
|
||||
* Creates an instance of the model <b>Package</b>, registered with
|
||||
* {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
|
||||
* package URI value.
|
||||
* <p>Note: the correct way to create the package is via the static
|
||||
* factory method {@link #init init()}, which also performs
|
||||
* initialization of the package, or returns the registered package,
|
||||
* if one already exists.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.emf.ecore.EPackage.Registry
|
||||
* @see org.eclipse.xtext.lexer.backtrackingTestLanguage.BacktrackingTestLanguagePackage#eNS_URI
|
||||
* @see #init()
|
||||
* @generated
|
||||
*/
|
||||
private BacktrackingTestLanguagePackageImpl()
|
||||
{
|
||||
super(eNS_URI, BacktrackingTestLanguageFactory.eINSTANCE);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private static boolean isInited = false;
|
||||
|
||||
/**
|
||||
* Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
|
||||
*
|
||||
* <p>This method is used to initialize {@link BacktrackingTestLanguagePackage#eINSTANCE} when that field is accessed.
|
||||
* Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #eNS_URI
|
||||
* @see #createPackageContents()
|
||||
* @see #initializePackageContents()
|
||||
* @generated
|
||||
*/
|
||||
public static BacktrackingTestLanguagePackage init()
|
||||
{
|
||||
if (isInited) return (BacktrackingTestLanguagePackage)EPackage.Registry.INSTANCE.getEPackage(BacktrackingTestLanguagePackage.eNS_URI);
|
||||
|
||||
// Obtain or create and register package
|
||||
BacktrackingTestLanguagePackageImpl theBacktrackingTestLanguagePackage = (BacktrackingTestLanguagePackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof BacktrackingTestLanguagePackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new BacktrackingTestLanguagePackageImpl());
|
||||
|
||||
isInited = true;
|
||||
|
||||
// Initialize simple dependencies
|
||||
EcorePackage.eINSTANCE.eClass();
|
||||
|
||||
// Create package meta-data objects
|
||||
theBacktrackingTestLanguagePackage.createPackageContents();
|
||||
|
||||
// Initialize created meta-data
|
||||
theBacktrackingTestLanguagePackage.initializePackageContents();
|
||||
|
||||
// Mark meta-data to indicate it can't be changed
|
||||
theBacktrackingTestLanguagePackage.freeze();
|
||||
|
||||
|
||||
// Update the registry and return the package
|
||||
EPackage.Registry.INSTANCE.put(BacktrackingTestLanguagePackage.eNS_URI, theBacktrackingTestLanguagePackage);
|
||||
return theBacktrackingTestLanguagePackage;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EClass getModel()
|
||||
{
|
||||
return modelEClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EAttribute getModel_Enums()
|
||||
{
|
||||
return (EAttribute)modelEClass.getEStructuralFeatures().get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EAttribute getModel_Ycs()
|
||||
{
|
||||
return (EAttribute)modelEClass.getEStructuralFeatures().get(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EReference getModel_Abs()
|
||||
{
|
||||
return (EReference)modelEClass.getEStructuralFeatures().get(2);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EReference getModel_Xbs()
|
||||
{
|
||||
return (EReference)modelEClass.getEStructuralFeatures().get(3);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EAttribute getModel_Ys()
|
||||
{
|
||||
return (EAttribute)modelEClass.getEStructuralFeatures().get(4);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EAttribute getModel_As()
|
||||
{
|
||||
return (EAttribute)modelEClass.getEStructuralFeatures().get(5);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EClass getAb()
|
||||
{
|
||||
return abEClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EAttribute getAb_X()
|
||||
{
|
||||
return (EAttribute)abEClass.getEStructuralFeatures().get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EAttribute getAb_Y()
|
||||
{
|
||||
return (EAttribute)abEClass.getEStructuralFeatures().get(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EClass getXb()
|
||||
{
|
||||
return xbEClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EAttribute getXb_X()
|
||||
{
|
||||
return (EAttribute)xbEClass.getEStructuralFeatures().get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EAttribute getXb_Y()
|
||||
{
|
||||
return (EAttribute)xbEClass.getEStructuralFeatures().get(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EEnum getEnumName()
|
||||
{
|
||||
return enumNameEEnum;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public BacktrackingTestLanguageFactory getBacktrackingTestLanguageFactory()
|
||||
{
|
||||
return (BacktrackingTestLanguageFactory)getEFactoryInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private boolean isCreated = false;
|
||||
|
||||
/**
|
||||
* Creates the meta-model objects for the package. This method is
|
||||
* guarded to have no affect on any invocation but its first.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void createPackageContents()
|
||||
{
|
||||
if (isCreated) return;
|
||||
isCreated = true;
|
||||
|
||||
// Create classes and their features
|
||||
modelEClass = createEClass(MODEL);
|
||||
createEAttribute(modelEClass, MODEL__ENUMS);
|
||||
createEAttribute(modelEClass, MODEL__YCS);
|
||||
createEReference(modelEClass, MODEL__ABS);
|
||||
createEReference(modelEClass, MODEL__XBS);
|
||||
createEAttribute(modelEClass, MODEL__YS);
|
||||
createEAttribute(modelEClass, MODEL__AS);
|
||||
|
||||
abEClass = createEClass(AB);
|
||||
createEAttribute(abEClass, AB__X);
|
||||
createEAttribute(abEClass, AB__Y);
|
||||
|
||||
xbEClass = createEClass(XB);
|
||||
createEAttribute(xbEClass, XB__X);
|
||||
createEAttribute(xbEClass, XB__Y);
|
||||
|
||||
// Create enums
|
||||
enumNameEEnum = createEEnum(ENUM_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private boolean isInitialized = false;
|
||||
|
||||
/**
|
||||
* Complete the initialization of the package and its meta-model. This
|
||||
* method is guarded to have no affect on any invocation but its first.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void initializePackageContents()
|
||||
{
|
||||
if (isInitialized) return;
|
||||
isInitialized = true;
|
||||
|
||||
// Initialize package
|
||||
setName(eNAME);
|
||||
setNsPrefix(eNS_PREFIX);
|
||||
setNsURI(eNS_URI);
|
||||
|
||||
// Obtain other dependent packages
|
||||
EcorePackage theEcorePackage = (EcorePackage)EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI);
|
||||
|
||||
// Create type parameters
|
||||
|
||||
// Set bounds for type parameters
|
||||
|
||||
// Add supertypes to classes
|
||||
|
||||
// Initialize classes and features; add operations and parameters
|
||||
initEClass(modelEClass, Model.class, "Model", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
|
||||
initEAttribute(getModel_Enums(), this.getEnumName(), "enums", null, 0, -1, Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
initEAttribute(getModel_Ycs(), theEcorePackage.getEString(), "ycs", null, 0, -1, Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
initEReference(getModel_Abs(), this.getAb(), null, "abs", null, 0, -1, Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
initEReference(getModel_Xbs(), this.getXb(), null, "xbs", null, 0, -1, Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
initEAttribute(getModel_Ys(), theEcorePackage.getEString(), "ys", null, 0, -1, Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
initEAttribute(getModel_As(), theEcorePackage.getEString(), "as", null, 0, -1, Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
|
||||
initEClass(abEClass, Ab.class, "Ab", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
|
||||
initEAttribute(getAb_X(), theEcorePackage.getEString(), "x", null, 0, 1, Ab.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
initEAttribute(getAb_Y(), theEcorePackage.getEString(), "y", null, 0, 1, Ab.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
|
||||
initEClass(xbEClass, Xb.class, "Xb", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
|
||||
initEAttribute(getXb_X(), theEcorePackage.getEString(), "x", null, 0, 1, Xb.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
initEAttribute(getXb_Y(), theEcorePackage.getEString(), "y", null, 0, 1, Xb.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
|
||||
// Initialize enums and add enum literals
|
||||
initEEnum(enumNameEEnum, EnumName.class, "EnumName");
|
||||
addEEnumLiteral(enumNameEEnum, EnumName.ABC);
|
||||
addEEnumLiteral(enumNameEEnum, EnumName.EFG);
|
||||
|
||||
// Create resource
|
||||
createResource(eNS_URI);
|
||||
}
|
||||
|
||||
} //BacktrackingTestLanguagePackageImpl
|
|
@ -0,0 +1,376 @@
|
|||
/**
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.lexer.backtrackingTestLanguage.impl;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import org.eclipse.emf.common.notify.NotificationChain;
|
||||
|
||||
import org.eclipse.emf.common.util.EList;
|
||||
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
import org.eclipse.emf.ecore.InternalEObject;
|
||||
|
||||
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
|
||||
|
||||
import org.eclipse.emf.ecore.util.EDataTypeEList;
|
||||
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
|
||||
import org.eclipse.emf.ecore.util.InternalEList;
|
||||
|
||||
import org.eclipse.xtext.lexer.backtrackingTestLanguage.Ab;
|
||||
import org.eclipse.xtext.lexer.backtrackingTestLanguage.BacktrackingTestLanguagePackage;
|
||||
import org.eclipse.xtext.lexer.backtrackingTestLanguage.EnumName;
|
||||
import org.eclipse.xtext.lexer.backtrackingTestLanguage.Model;
|
||||
import org.eclipse.xtext.lexer.backtrackingTestLanguage.Xb;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model object '<em><b>Model</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
* <p>
|
||||
* The following features are implemented:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>{@link org.eclipse.xtext.lexer.backtrackingTestLanguage.impl.ModelImpl#getEnums <em>Enums</em>}</li>
|
||||
* <li>{@link org.eclipse.xtext.lexer.backtrackingTestLanguage.impl.ModelImpl#getYcs <em>Ycs</em>}</li>
|
||||
* <li>{@link org.eclipse.xtext.lexer.backtrackingTestLanguage.impl.ModelImpl#getAbs <em>Abs</em>}</li>
|
||||
* <li>{@link org.eclipse.xtext.lexer.backtrackingTestLanguage.impl.ModelImpl#getXbs <em>Xbs</em>}</li>
|
||||
* <li>{@link org.eclipse.xtext.lexer.backtrackingTestLanguage.impl.ModelImpl#getYs <em>Ys</em>}</li>
|
||||
* <li>{@link org.eclipse.xtext.lexer.backtrackingTestLanguage.impl.ModelImpl#getAs <em>As</em>}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @generated
|
||||
*/
|
||||
public class ModelImpl extends MinimalEObjectImpl.Container implements Model
|
||||
{
|
||||
/**
|
||||
* The cached value of the '{@link #getEnums() <em>Enums</em>}' attribute list.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getEnums()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected EList<EnumName> enums;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getYcs() <em>Ycs</em>}' attribute list.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getYcs()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected EList<String> ycs;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getAbs() <em>Abs</em>}' containment reference list.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getAbs()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected EList<Ab> abs;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getXbs() <em>Xbs</em>}' containment reference list.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getXbs()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected EList<Xb> xbs;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getYs() <em>Ys</em>}' attribute list.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getYs()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected EList<String> ys;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getAs() <em>As</em>}' attribute list.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getAs()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected EList<String> as;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected ModelImpl()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
protected EClass eStaticClass()
|
||||
{
|
||||
return BacktrackingTestLanguagePackage.Literals.MODEL;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EList<EnumName> getEnums()
|
||||
{
|
||||
if (enums == null)
|
||||
{
|
||||
enums = new EDataTypeEList<EnumName>(EnumName.class, this, BacktrackingTestLanguagePackage.MODEL__ENUMS);
|
||||
}
|
||||
return enums;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EList<String> getYcs()
|
||||
{
|
||||
if (ycs == null)
|
||||
{
|
||||
ycs = new EDataTypeEList<String>(String.class, this, BacktrackingTestLanguagePackage.MODEL__YCS);
|
||||
}
|
||||
return ycs;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EList<Ab> getAbs()
|
||||
{
|
||||
if (abs == null)
|
||||
{
|
||||
abs = new EObjectContainmentEList<Ab>(Ab.class, this, BacktrackingTestLanguagePackage.MODEL__ABS);
|
||||
}
|
||||
return abs;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EList<Xb> getXbs()
|
||||
{
|
||||
if (xbs == null)
|
||||
{
|
||||
xbs = new EObjectContainmentEList<Xb>(Xb.class, this, BacktrackingTestLanguagePackage.MODEL__XBS);
|
||||
}
|
||||
return xbs;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EList<String> getYs()
|
||||
{
|
||||
if (ys == null)
|
||||
{
|
||||
ys = new EDataTypeEList<String>(String.class, this, BacktrackingTestLanguagePackage.MODEL__YS);
|
||||
}
|
||||
return ys;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EList<String> getAs()
|
||||
{
|
||||
if (as == null)
|
||||
{
|
||||
as = new EDataTypeEList<String>(String.class, this, BacktrackingTestLanguagePackage.MODEL__AS);
|
||||
}
|
||||
return as;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case BacktrackingTestLanguagePackage.MODEL__ABS:
|
||||
return ((InternalEList<?>)getAbs()).basicRemove(otherEnd, msgs);
|
||||
case BacktrackingTestLanguagePackage.MODEL__XBS:
|
||||
return ((InternalEList<?>)getXbs()).basicRemove(otherEnd, msgs);
|
||||
}
|
||||
return super.eInverseRemove(otherEnd, featureID, msgs);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Object eGet(int featureID, boolean resolve, boolean coreType)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case BacktrackingTestLanguagePackage.MODEL__ENUMS:
|
||||
return getEnums();
|
||||
case BacktrackingTestLanguagePackage.MODEL__YCS:
|
||||
return getYcs();
|
||||
case BacktrackingTestLanguagePackage.MODEL__ABS:
|
||||
return getAbs();
|
||||
case BacktrackingTestLanguagePackage.MODEL__XBS:
|
||||
return getXbs();
|
||||
case BacktrackingTestLanguagePackage.MODEL__YS:
|
||||
return getYs();
|
||||
case BacktrackingTestLanguagePackage.MODEL__AS:
|
||||
return getAs();
|
||||
}
|
||||
return super.eGet(featureID, resolve, coreType);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void eSet(int featureID, Object newValue)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case BacktrackingTestLanguagePackage.MODEL__ENUMS:
|
||||
getEnums().clear();
|
||||
getEnums().addAll((Collection<? extends EnumName>)newValue);
|
||||
return;
|
||||
case BacktrackingTestLanguagePackage.MODEL__YCS:
|
||||
getYcs().clear();
|
||||
getYcs().addAll((Collection<? extends String>)newValue);
|
||||
return;
|
||||
case BacktrackingTestLanguagePackage.MODEL__ABS:
|
||||
getAbs().clear();
|
||||
getAbs().addAll((Collection<? extends Ab>)newValue);
|
||||
return;
|
||||
case BacktrackingTestLanguagePackage.MODEL__XBS:
|
||||
getXbs().clear();
|
||||
getXbs().addAll((Collection<? extends Xb>)newValue);
|
||||
return;
|
||||
case BacktrackingTestLanguagePackage.MODEL__YS:
|
||||
getYs().clear();
|
||||
getYs().addAll((Collection<? extends String>)newValue);
|
||||
return;
|
||||
case BacktrackingTestLanguagePackage.MODEL__AS:
|
||||
getAs().clear();
|
||||
getAs().addAll((Collection<? extends String>)newValue);
|
||||
return;
|
||||
}
|
||||
super.eSet(featureID, newValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eUnset(int featureID)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case BacktrackingTestLanguagePackage.MODEL__ENUMS:
|
||||
getEnums().clear();
|
||||
return;
|
||||
case BacktrackingTestLanguagePackage.MODEL__YCS:
|
||||
getYcs().clear();
|
||||
return;
|
||||
case BacktrackingTestLanguagePackage.MODEL__ABS:
|
||||
getAbs().clear();
|
||||
return;
|
||||
case BacktrackingTestLanguagePackage.MODEL__XBS:
|
||||
getXbs().clear();
|
||||
return;
|
||||
case BacktrackingTestLanguagePackage.MODEL__YS:
|
||||
getYs().clear();
|
||||
return;
|
||||
case BacktrackingTestLanguagePackage.MODEL__AS:
|
||||
getAs().clear();
|
||||
return;
|
||||
}
|
||||
super.eUnset(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public boolean eIsSet(int featureID)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case BacktrackingTestLanguagePackage.MODEL__ENUMS:
|
||||
return enums != null && !enums.isEmpty();
|
||||
case BacktrackingTestLanguagePackage.MODEL__YCS:
|
||||
return ycs != null && !ycs.isEmpty();
|
||||
case BacktrackingTestLanguagePackage.MODEL__ABS:
|
||||
return abs != null && !abs.isEmpty();
|
||||
case BacktrackingTestLanguagePackage.MODEL__XBS:
|
||||
return xbs != null && !xbs.isEmpty();
|
||||
case BacktrackingTestLanguagePackage.MODEL__YS:
|
||||
return ys != null && !ys.isEmpty();
|
||||
case BacktrackingTestLanguagePackage.MODEL__AS:
|
||||
return as != null && !as.isEmpty();
|
||||
}
|
||||
return super.eIsSet(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
if (eIsProxy()) return super.toString();
|
||||
|
||||
StringBuffer result = new StringBuffer(super.toString());
|
||||
result.append(" (enums: ");
|
||||
result.append(enums);
|
||||
result.append(", ycs: ");
|
||||
result.append(ycs);
|
||||
result.append(", ys: ");
|
||||
result.append(ys);
|
||||
result.append(", as: ");
|
||||
result.append(as);
|
||||
result.append(')');
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
} //ModelImpl
|
|
@ -0,0 +1,234 @@
|
|||
/**
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.lexer.backtrackingTestLanguage.impl;
|
||||
|
||||
import org.eclipse.emf.common.notify.Notification;
|
||||
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
|
||||
import org.eclipse.emf.ecore.impl.ENotificationImpl;
|
||||
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
|
||||
|
||||
import org.eclipse.xtext.lexer.backtrackingTestLanguage.BacktrackingTestLanguagePackage;
|
||||
import org.eclipse.xtext.lexer.backtrackingTestLanguage.Xb;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model object '<em><b>Xb</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
* <p>
|
||||
* The following features are implemented:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>{@link org.eclipse.xtext.lexer.backtrackingTestLanguage.impl.XbImpl#getX <em>X</em>}</li>
|
||||
* <li>{@link org.eclipse.xtext.lexer.backtrackingTestLanguage.impl.XbImpl#getY <em>Y</em>}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @generated
|
||||
*/
|
||||
public class XbImpl extends MinimalEObjectImpl.Container implements Xb
|
||||
{
|
||||
/**
|
||||
* The default value of the '{@link #getX() <em>X</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getX()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final String X_EDEFAULT = null;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getX() <em>X</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getX()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected String x = X_EDEFAULT;
|
||||
|
||||
/**
|
||||
* The default value of the '{@link #getY() <em>Y</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getY()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final String Y_EDEFAULT = null;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getY() <em>Y</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getY()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected String y = Y_EDEFAULT;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected XbImpl()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
protected EClass eStaticClass()
|
||||
{
|
||||
return BacktrackingTestLanguagePackage.Literals.XB;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getX()
|
||||
{
|
||||
return x;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setX(String newX)
|
||||
{
|
||||
String oldX = x;
|
||||
x = newX;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, BacktrackingTestLanguagePackage.XB__X, oldX, x));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getY()
|
||||
{
|
||||
return y;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setY(String newY)
|
||||
{
|
||||
String oldY = y;
|
||||
y = newY;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, BacktrackingTestLanguagePackage.XB__Y, oldY, y));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Object eGet(int featureID, boolean resolve, boolean coreType)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case BacktrackingTestLanguagePackage.XB__X:
|
||||
return getX();
|
||||
case BacktrackingTestLanguagePackage.XB__Y:
|
||||
return getY();
|
||||
}
|
||||
return super.eGet(featureID, resolve, coreType);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eSet(int featureID, Object newValue)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case BacktrackingTestLanguagePackage.XB__X:
|
||||
setX((String)newValue);
|
||||
return;
|
||||
case BacktrackingTestLanguagePackage.XB__Y:
|
||||
setY((String)newValue);
|
||||
return;
|
||||
}
|
||||
super.eSet(featureID, newValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eUnset(int featureID)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case BacktrackingTestLanguagePackage.XB__X:
|
||||
setX(X_EDEFAULT);
|
||||
return;
|
||||
case BacktrackingTestLanguagePackage.XB__Y:
|
||||
setY(Y_EDEFAULT);
|
||||
return;
|
||||
}
|
||||
super.eUnset(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public boolean eIsSet(int featureID)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case BacktrackingTestLanguagePackage.XB__X:
|
||||
return X_EDEFAULT == null ? x != null : !X_EDEFAULT.equals(x);
|
||||
case BacktrackingTestLanguagePackage.XB__Y:
|
||||
return Y_EDEFAULT == null ? y != null : !Y_EDEFAULT.equals(y);
|
||||
}
|
||||
return super.eIsSet(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
if (eIsProxy()) return super.toString();
|
||||
|
||||
StringBuffer result = new StringBuffer(super.toString());
|
||||
result.append(" (x: ");
|
||||
result.append(x);
|
||||
result.append(", y: ");
|
||||
result.append(y);
|
||||
result.append(')');
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
} //XbImpl
|
|
@ -0,0 +1,173 @@
|
|||
/**
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.lexer.backtrackingTestLanguage.util;
|
||||
|
||||
import org.eclipse.emf.common.notify.Adapter;
|
||||
import org.eclipse.emf.common.notify.Notifier;
|
||||
|
||||
import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
|
||||
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
|
||||
import org.eclipse.xtext.lexer.backtrackingTestLanguage.*;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* The <b>Adapter Factory</b> for the model.
|
||||
* It provides an adapter <code>createXXX</code> method for each class of the model.
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.xtext.lexer.backtrackingTestLanguage.BacktrackingTestLanguagePackage
|
||||
* @generated
|
||||
*/
|
||||
public class BacktrackingTestLanguageAdapterFactory extends AdapterFactoryImpl
|
||||
{
|
||||
/**
|
||||
* The cached model package.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected static BacktrackingTestLanguagePackage modelPackage;
|
||||
|
||||
/**
|
||||
* Creates an instance of the adapter factory.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public BacktrackingTestLanguageAdapterFactory()
|
||||
{
|
||||
if (modelPackage == null)
|
||||
{
|
||||
modelPackage = BacktrackingTestLanguagePackage.eINSTANCE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether this factory is applicable for the type of the object.
|
||||
* <!-- begin-user-doc -->
|
||||
* This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model.
|
||||
* <!-- end-user-doc -->
|
||||
* @return whether this factory is applicable for the type of the object.
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public boolean isFactoryForType(Object object)
|
||||
{
|
||||
if (object == modelPackage)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (object instanceof EObject)
|
||||
{
|
||||
return ((EObject)object).eClass().getEPackage() == modelPackage;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* The switch that delegates to the <code>createXXX</code> methods.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected BacktrackingTestLanguageSwitch<Adapter> modelSwitch =
|
||||
new BacktrackingTestLanguageSwitch<Adapter>()
|
||||
{
|
||||
@Override
|
||||
public Adapter caseModel(Model object)
|
||||
{
|
||||
return createModelAdapter();
|
||||
}
|
||||
@Override
|
||||
public Adapter caseAb(Ab object)
|
||||
{
|
||||
return createAbAdapter();
|
||||
}
|
||||
@Override
|
||||
public Adapter caseXb(Xb object)
|
||||
{
|
||||
return createXbAdapter();
|
||||
}
|
||||
@Override
|
||||
public Adapter defaultCase(EObject object)
|
||||
{
|
||||
return createEObjectAdapter();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates an adapter for the <code>target</code>.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param target the object to adapt.
|
||||
* @return the adapter for the <code>target</code>.
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Adapter createAdapter(Notifier target)
|
||||
{
|
||||
return modelSwitch.doSwitch((EObject)target);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates a new adapter for an object of class '{@link org.eclipse.xtext.lexer.backtrackingTestLanguage.Model <em>Model</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* This default implementation returns null so that we can easily ignore cases;
|
||||
* it's useful to ignore a case when inheritance will catch all the cases anyway.
|
||||
* <!-- end-user-doc -->
|
||||
* @return the new adapter.
|
||||
* @see org.eclipse.xtext.lexer.backtrackingTestLanguage.Model
|
||||
* @generated
|
||||
*/
|
||||
public Adapter createModelAdapter()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new adapter for an object of class '{@link org.eclipse.xtext.lexer.backtrackingTestLanguage.Ab <em>Ab</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* This default implementation returns null so that we can easily ignore cases;
|
||||
* it's useful to ignore a case when inheritance will catch all the cases anyway.
|
||||
* <!-- end-user-doc -->
|
||||
* @return the new adapter.
|
||||
* @see org.eclipse.xtext.lexer.backtrackingTestLanguage.Ab
|
||||
* @generated
|
||||
*/
|
||||
public Adapter createAbAdapter()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new adapter for an object of class '{@link org.eclipse.xtext.lexer.backtrackingTestLanguage.Xb <em>Xb</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* This default implementation returns null so that we can easily ignore cases;
|
||||
* it's useful to ignore a case when inheritance will catch all the cases anyway.
|
||||
* <!-- end-user-doc -->
|
||||
* @return the new adapter.
|
||||
* @see org.eclipse.xtext.lexer.backtrackingTestLanguage.Xb
|
||||
* @generated
|
||||
*/
|
||||
public Adapter createXbAdapter()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new adapter for the default case.
|
||||
* <!-- begin-user-doc -->
|
||||
* This default implementation returns null.
|
||||
* <!-- end-user-doc -->
|
||||
* @return the new adapter.
|
||||
* @generated
|
||||
*/
|
||||
public Adapter createEObjectAdapter()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
} //BacktrackingTestLanguageAdapterFactory
|
|
@ -0,0 +1,166 @@
|
|||
/**
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.lexer.backtrackingTestLanguage.util;
|
||||
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
import org.eclipse.emf.ecore.EPackage;
|
||||
|
||||
import org.eclipse.emf.ecore.util.Switch;
|
||||
|
||||
import org.eclipse.xtext.lexer.backtrackingTestLanguage.*;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* The <b>Switch</b> for the model's inheritance hierarchy.
|
||||
* It supports the call {@link #doSwitch(EObject) doSwitch(object)}
|
||||
* to invoke the <code>caseXXX</code> method for each class of the model,
|
||||
* starting with the actual class of the object
|
||||
* and proceeding up the inheritance hierarchy
|
||||
* until a non-null result is returned,
|
||||
* which is the result of the switch.
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.xtext.lexer.backtrackingTestLanguage.BacktrackingTestLanguagePackage
|
||||
* @generated
|
||||
*/
|
||||
public class BacktrackingTestLanguageSwitch<T> extends Switch<T>
|
||||
{
|
||||
/**
|
||||
* The cached model package
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected static BacktrackingTestLanguagePackage modelPackage;
|
||||
|
||||
/**
|
||||
* Creates an instance of the switch.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public BacktrackingTestLanguageSwitch()
|
||||
{
|
||||
if (modelPackage == null)
|
||||
{
|
||||
modelPackage = BacktrackingTestLanguagePackage.eINSTANCE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether this is a switch for the given package.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param ePackage the package in question.
|
||||
* @return whether this is a switch for the given package.
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
protected boolean isSwitchFor(EPackage ePackage)
|
||||
{
|
||||
return ePackage == modelPackage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the first non-null result returned by a <code>caseXXX</code> call.
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
protected T doSwitch(int classifierID, EObject theEObject)
|
||||
{
|
||||
switch (classifierID)
|
||||
{
|
||||
case BacktrackingTestLanguagePackage.MODEL:
|
||||
{
|
||||
Model model = (Model)theEObject;
|
||||
T result = caseModel(model);
|
||||
if (result == null) result = defaultCase(theEObject);
|
||||
return result;
|
||||
}
|
||||
case BacktrackingTestLanguagePackage.AB:
|
||||
{
|
||||
Ab ab = (Ab)theEObject;
|
||||
T result = caseAb(ab);
|
||||
if (result == null) result = defaultCase(theEObject);
|
||||
return result;
|
||||
}
|
||||
case BacktrackingTestLanguagePackage.XB:
|
||||
{
|
||||
Xb xb = (Xb)theEObject;
|
||||
T result = caseXb(xb);
|
||||
if (result == null) result = defaultCase(theEObject);
|
||||
return result;
|
||||
}
|
||||
default: return defaultCase(theEObject);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result of interpreting the object as an instance of '<em>Model</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* This implementation returns null;
|
||||
* returning a non-null result will terminate the switch.
|
||||
* <!-- end-user-doc -->
|
||||
* @param object the target of the switch.
|
||||
* @return the result of interpreting the object as an instance of '<em>Model</em>'.
|
||||
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
|
||||
* @generated
|
||||
*/
|
||||
public T caseModel(Model object)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result of interpreting the object as an instance of '<em>Ab</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* This implementation returns null;
|
||||
* returning a non-null result will terminate the switch.
|
||||
* <!-- end-user-doc -->
|
||||
* @param object the target of the switch.
|
||||
* @return the result of interpreting the object as an instance of '<em>Ab</em>'.
|
||||
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
|
||||
* @generated
|
||||
*/
|
||||
public T caseAb(Ab object)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result of interpreting the object as an instance of '<em>Xb</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* This implementation returns null;
|
||||
* returning a non-null result will terminate the switch.
|
||||
* <!-- end-user-doc -->
|
||||
* @param object the target of the switch.
|
||||
* @return the result of interpreting the object as an instance of '<em>Xb</em>'.
|
||||
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
|
||||
* @generated
|
||||
*/
|
||||
public T caseXb(Xb object)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* This implementation returns null;
|
||||
* returning a non-null result will terminate the switch, but this is the last case anyway.
|
||||
* <!-- end-user-doc -->
|
||||
* @param object the target of the switch.
|
||||
* @return the result of interpreting the object as an instance of '<em>EObject</em>'.
|
||||
* @see #doSwitch(org.eclipse.emf.ecore.EObject)
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public T defaultCase(EObject object)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
} //BacktrackingTestLanguageSwitch
|
|
@ -0,0 +1,16 @@
|
|||
/*
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.lexer.parser.antlr;
|
||||
|
||||
import java.io.InputStream;
|
||||
import org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider;
|
||||
|
||||
public class BacktrackingLexerTestLanguageAntlrTokenFileProvider implements IAntlrTokenFileProvider {
|
||||
|
||||
@Override
|
||||
public InputStream getAntlrTokenFile() {
|
||||
ClassLoader classLoader = getClass().getClassLoader();
|
||||
return classLoader.getResourceAsStream("org/eclipse/xtext/lexer/parser/antlr/internal/InternalBacktrackingLexerTestLanguageParser.tokens");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.lexer.parser.antlr;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import org.eclipse.xtext.lexer.parser.antlr.internal.InternalBacktrackingLexerTestLanguageParser;
|
||||
import org.eclipse.xtext.lexer.services.BacktrackingLexerTestLanguageGrammarAccess;
|
||||
import org.eclipse.xtext.parser.antlr.AbstractAntlrParser;
|
||||
import org.eclipse.xtext.parser.antlr.XtextTokenStream;
|
||||
|
||||
public class BacktrackingLexerTestLanguageParser extends AbstractAntlrParser {
|
||||
|
||||
@Inject
|
||||
private BacktrackingLexerTestLanguageGrammarAccess grammarAccess;
|
||||
|
||||
@Override
|
||||
protected void setInitialHiddenTokens(XtextTokenStream tokenStream) {
|
||||
tokenStream.setInitialHiddenTokens("RULE_WS", "RULE_SL_COMMENT");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected InternalBacktrackingLexerTestLanguageParser createParser(XtextTokenStream stream) {
|
||||
return new InternalBacktrackingLexerTestLanguageParser(stream, getGrammarAccess());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getDefaultRuleName() {
|
||||
return "Model";
|
||||
}
|
||||
|
||||
public BacktrackingLexerTestLanguageGrammarAccess getGrammarAccess() {
|
||||
return this.grammarAccess;
|
||||
}
|
||||
|
||||
public void setGrammarAccess(BacktrackingLexerTestLanguageGrammarAccess grammarAccess) {
|
||||
this.grammarAccess = grammarAccess;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
/*
|
||||
* generated by Xtext
|
||||
*/
|
||||
grammar DebugInternalBacktrackingLexerTestLanguage;
|
||||
tokens {
|
||||
Abc;
|
||||
Efg;
|
||||
RULE_CHARA;
|
||||
RULE_CHARB;
|
||||
RULE_CHARX;
|
||||
RULE_YC;
|
||||
RULE_CHARY;
|
||||
RULE_CHARC;
|
||||
RULE_WS;
|
||||
RULE_SL_COMMENT;
|
||||
}
|
||||
|
||||
// Rule Model
|
||||
ruleModel:
|
||||
ruleEnumName
|
||||
*
|
||||
RULE_YC
|
||||
*
|
||||
ruleAb
|
||||
*
|
||||
ruleXb
|
||||
*
|
||||
RULE_CHARY
|
||||
*
|
||||
RULE_CHARA
|
||||
*
|
||||
;
|
||||
|
||||
// Rule Ab
|
||||
ruleAb:
|
||||
RULE_CHARA
|
||||
RULE_CHARB
|
||||
;
|
||||
|
||||
// Rule Xb
|
||||
ruleXb:
|
||||
RULE_CHARX
|
||||
RULE_CHARB
|
||||
;
|
||||
|
||||
// Rule EnumName
|
||||
ruleEnumName:
|
||||
'Abc'
|
||||
|
|
||||
'Efg'
|
||||
;
|
||||
|
||||
fragment RULE_CHARA : FRAGMENT_RULE_CHARA;
|
||||
fragment FRAGMENT_RULE_CHARA : 'A';
|
||||
|
||||
fragment RULE_CHARB : FRAGMENT_RULE_CHARB;
|
||||
fragment FRAGMENT_RULE_CHARB : 'b';
|
||||
|
||||
fragment RULE_CHARX : FRAGMENT_RULE_CHARX;
|
||||
fragment FRAGMENT_RULE_CHARX : 'X';
|
||||
|
||||
fragment RULE_YC : FRAGMENT_RULE_YC;
|
||||
fragment FRAGMENT_RULE_YC : RULE_CHARY RULE_CHARC;
|
||||
|
||||
fragment RULE_CHARY : FRAGMENT_RULE_CHARY;
|
||||
fragment FRAGMENT_RULE_CHARY : 'Y';
|
||||
|
||||
fragment RULE_CHARC : 'c';
|
||||
|
||||
fragment RULE_WS : FRAGMENT_RULE_WS;
|
||||
fragment FRAGMENT_RULE_WS : (' '|'\t'|'\r'|'\n')+;
|
||||
|
||||
fragment RULE_SL_COMMENT : FRAGMENT_RULE_SL_COMMENT;
|
||||
fragment FRAGMENT_RULE_SL_COMMENT : '//' ~(('\n'|'\r'))* ('\r'? '\n')?;
|
|
@ -0,0 +1,329 @@
|
|||
/*
|
||||
* generated by Xtext
|
||||
*/
|
||||
parser grammar InternalBacktrackingLexerTestLanguageParser;
|
||||
|
||||
options {
|
||||
tokenVocab=InternalBacktrackingLexerTestLanguageLexer;
|
||||
superClass=AbstractInternalAntlrParser;
|
||||
backtrack=true;
|
||||
memoize=true;
|
||||
}
|
||||
|
||||
@header {
|
||||
package org.eclipse.xtext.lexer.parser.antlr.internal;
|
||||
|
||||
import org.eclipse.xtext.*;
|
||||
import org.eclipse.xtext.parser.*;
|
||||
import org.eclipse.xtext.parser.impl.*;
|
||||
import org.eclipse.emf.ecore.util.EcoreUtil;
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
import org.eclipse.emf.common.util.Enumerator;
|
||||
import org.eclipse.xtext.parser.antlr.AbstractInternalAntlrParser;
|
||||
import org.eclipse.xtext.parser.antlr.XtextTokenStream;
|
||||
import org.eclipse.xtext.parser.antlr.XtextTokenStream.HiddenTokens;
|
||||
import org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken;
|
||||
import org.eclipse.xtext.lexer.services.BacktrackingLexerTestLanguageGrammarAccess;
|
||||
|
||||
}
|
||||
|
||||
@members {
|
||||
|
||||
/*
|
||||
This grammar contains a lot of empty actions to work around a bug in ANTLR.
|
||||
Otherwise the ANTLR tool will create synpreds that cannot be compiled in some rare cases.
|
||||
*/
|
||||
|
||||
private BacktrackingLexerTestLanguageGrammarAccess grammarAccess;
|
||||
|
||||
public InternalBacktrackingLexerTestLanguageParser(TokenStream input, BacktrackingLexerTestLanguageGrammarAccess grammarAccess) {
|
||||
this(input);
|
||||
this.grammarAccess = grammarAccess;
|
||||
registerRules(grammarAccess.getGrammar());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getFirstRuleName() {
|
||||
return "Model";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BacktrackingLexerTestLanguageGrammarAccess getGrammarAccess() {
|
||||
return grammarAccess;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@rulecatch {
|
||||
catch (RecognitionException re) {
|
||||
recover(input,re);
|
||||
appendSkippedTokens();
|
||||
}
|
||||
}
|
||||
|
||||
// Entry rule entryRuleModel
|
||||
entryRuleModel returns [EObject current=null]:
|
||||
{ newCompositeNode(grammarAccess.getModelRule()); }
|
||||
iv_ruleModel=ruleModel
|
||||
{ $current=$iv_ruleModel.current; }
|
||||
EOF;
|
||||
|
||||
// Rule Model
|
||||
ruleModel returns [EObject current=null]
|
||||
@init {
|
||||
enterRule();
|
||||
}
|
||||
@after {
|
||||
leaveRule();
|
||||
}:
|
||||
(
|
||||
(
|
||||
(
|
||||
{
|
||||
newCompositeNode(grammarAccess.getModelAccess().getEnumsEnumNameEnumRuleCall_0_0());
|
||||
}
|
||||
lv_enums_0_0=ruleEnumName
|
||||
{
|
||||
if ($current==null) {
|
||||
$current = createModelElementForParent(grammarAccess.getModelRule());
|
||||
}
|
||||
add(
|
||||
$current,
|
||||
"enums",
|
||||
lv_enums_0_0,
|
||||
"org.eclipse.xtext.lexer.BacktrackingLexerTestLanguage.EnumName");
|
||||
afterParserOrEnumRuleCall();
|
||||
}
|
||||
)
|
||||
)*
|
||||
(
|
||||
(
|
||||
lv_ycs_1_0=RULE_YC
|
||||
{
|
||||
newLeafNode(lv_ycs_1_0, grammarAccess.getModelAccess().getYcsYcTerminalRuleCall_1_0());
|
||||
}
|
||||
{
|
||||
if ($current==null) {
|
||||
$current = createModelElement(grammarAccess.getModelRule());
|
||||
}
|
||||
addWithLastConsumed(
|
||||
$current,
|
||||
"ycs",
|
||||
lv_ycs_1_0,
|
||||
"org.eclipse.xtext.lexer.BacktrackingLexerTestLanguage.Yc");
|
||||
}
|
||||
)
|
||||
)*
|
||||
(
|
||||
(
|
||||
{
|
||||
newCompositeNode(grammarAccess.getModelAccess().getAbsAbParserRuleCall_2_0());
|
||||
}
|
||||
lv_abs_2_0=ruleAb
|
||||
{
|
||||
if ($current==null) {
|
||||
$current = createModelElementForParent(grammarAccess.getModelRule());
|
||||
}
|
||||
add(
|
||||
$current,
|
||||
"abs",
|
||||
lv_abs_2_0,
|
||||
"org.eclipse.xtext.lexer.BacktrackingLexerTestLanguage.Ab");
|
||||
afterParserOrEnumRuleCall();
|
||||
}
|
||||
)
|
||||
)*
|
||||
(
|
||||
(
|
||||
{
|
||||
newCompositeNode(grammarAccess.getModelAccess().getXbsXbParserRuleCall_3_0());
|
||||
}
|
||||
lv_xbs_3_0=ruleXb
|
||||
{
|
||||
if ($current==null) {
|
||||
$current = createModelElementForParent(grammarAccess.getModelRule());
|
||||
}
|
||||
add(
|
||||
$current,
|
||||
"xbs",
|
||||
lv_xbs_3_0,
|
||||
"org.eclipse.xtext.lexer.BacktrackingLexerTestLanguage.Xb");
|
||||
afterParserOrEnumRuleCall();
|
||||
}
|
||||
)
|
||||
)*
|
||||
(
|
||||
(
|
||||
lv_ys_4_0=RULE_CHARY
|
||||
{
|
||||
newLeafNode(lv_ys_4_0, grammarAccess.getModelAccess().getYsCharYTerminalRuleCall_4_0());
|
||||
}
|
||||
{
|
||||
if ($current==null) {
|
||||
$current = createModelElement(grammarAccess.getModelRule());
|
||||
}
|
||||
addWithLastConsumed(
|
||||
$current,
|
||||
"ys",
|
||||
lv_ys_4_0,
|
||||
"org.eclipse.xtext.lexer.BacktrackingLexerTestLanguage.CharY");
|
||||
}
|
||||
)
|
||||
)*
|
||||
(
|
||||
(
|
||||
lv_as_5_0=RULE_CHARA
|
||||
{
|
||||
newLeafNode(lv_as_5_0, grammarAccess.getModelAccess().getAsCharATerminalRuleCall_5_0());
|
||||
}
|
||||
{
|
||||
if ($current==null) {
|
||||
$current = createModelElement(grammarAccess.getModelRule());
|
||||
}
|
||||
addWithLastConsumed(
|
||||
$current,
|
||||
"as",
|
||||
lv_as_5_0,
|
||||
"org.eclipse.xtext.lexer.BacktrackingLexerTestLanguage.CharA");
|
||||
}
|
||||
)
|
||||
)*
|
||||
)
|
||||
;
|
||||
|
||||
// Entry rule entryRuleAb
|
||||
entryRuleAb returns [EObject current=null]:
|
||||
{ newCompositeNode(grammarAccess.getAbRule()); }
|
||||
iv_ruleAb=ruleAb
|
||||
{ $current=$iv_ruleAb.current; }
|
||||
EOF;
|
||||
|
||||
// Rule Ab
|
||||
ruleAb returns [EObject current=null]
|
||||
@init {
|
||||
enterRule();
|
||||
}
|
||||
@after {
|
||||
leaveRule();
|
||||
}:
|
||||
(
|
||||
(
|
||||
(
|
||||
lv_x_0_0=RULE_CHARA
|
||||
{
|
||||
newLeafNode(lv_x_0_0, grammarAccess.getAbAccess().getXCharATerminalRuleCall_0_0());
|
||||
}
|
||||
{
|
||||
if ($current==null) {
|
||||
$current = createModelElement(grammarAccess.getAbRule());
|
||||
}
|
||||
setWithLastConsumed(
|
||||
$current,
|
||||
"x",
|
||||
lv_x_0_0,
|
||||
"org.eclipse.xtext.lexer.BacktrackingLexerTestLanguage.CharA");
|
||||
}
|
||||
)
|
||||
)
|
||||
(
|
||||
(
|
||||
lv_y_1_0=RULE_CHARB
|
||||
{
|
||||
newLeafNode(lv_y_1_0, grammarAccess.getAbAccess().getYCharbTerminalRuleCall_1_0());
|
||||
}
|
||||
{
|
||||
if ($current==null) {
|
||||
$current = createModelElement(grammarAccess.getAbRule());
|
||||
}
|
||||
setWithLastConsumed(
|
||||
$current,
|
||||
"y",
|
||||
lv_y_1_0,
|
||||
"org.eclipse.xtext.lexer.BacktrackingLexerTestLanguage.Charb");
|
||||
}
|
||||
)
|
||||
)
|
||||
)
|
||||
;
|
||||
|
||||
// Entry rule entryRuleXb
|
||||
entryRuleXb returns [EObject current=null]:
|
||||
{ newCompositeNode(grammarAccess.getXbRule()); }
|
||||
iv_ruleXb=ruleXb
|
||||
{ $current=$iv_ruleXb.current; }
|
||||
EOF;
|
||||
|
||||
// Rule Xb
|
||||
ruleXb returns [EObject current=null]
|
||||
@init {
|
||||
enterRule();
|
||||
}
|
||||
@after {
|
||||
leaveRule();
|
||||
}:
|
||||
(
|
||||
(
|
||||
(
|
||||
lv_x_0_0=RULE_CHARX
|
||||
{
|
||||
newLeafNode(lv_x_0_0, grammarAccess.getXbAccess().getXCharXTerminalRuleCall_0_0());
|
||||
}
|
||||
{
|
||||
if ($current==null) {
|
||||
$current = createModelElement(grammarAccess.getXbRule());
|
||||
}
|
||||
setWithLastConsumed(
|
||||
$current,
|
||||
"x",
|
||||
lv_x_0_0,
|
||||
"org.eclipse.xtext.lexer.BacktrackingLexerTestLanguage.CharX");
|
||||
}
|
||||
)
|
||||
)
|
||||
(
|
||||
(
|
||||
lv_y_1_0=RULE_CHARB
|
||||
{
|
||||
newLeafNode(lv_y_1_0, grammarAccess.getXbAccess().getYCharbTerminalRuleCall_1_0());
|
||||
}
|
||||
{
|
||||
if ($current==null) {
|
||||
$current = createModelElement(grammarAccess.getXbRule());
|
||||
}
|
||||
setWithLastConsumed(
|
||||
$current,
|
||||
"y",
|
||||
lv_y_1_0,
|
||||
"org.eclipse.xtext.lexer.BacktrackingLexerTestLanguage.Charb");
|
||||
}
|
||||
)
|
||||
)
|
||||
)
|
||||
;
|
||||
|
||||
// Rule EnumName
|
||||
ruleEnumName returns [Enumerator current=null]
|
||||
@init {
|
||||
enterRule();
|
||||
}
|
||||
@after {
|
||||
leaveRule();
|
||||
}:
|
||||
(
|
||||
(
|
||||
enumLiteral_0=Abc
|
||||
{
|
||||
$current = grammarAccess.getEnumNameAccess().getAbcEnumLiteralDeclaration_0().getEnumLiteral().getInstance();
|
||||
newLeafNode(enumLiteral_0, grammarAccess.getEnumNameAccess().getAbcEnumLiteralDeclaration_0());
|
||||
}
|
||||
)
|
||||
|
|
||||
(
|
||||
enumLiteral_1=Efg
|
||||
{
|
||||
$current = grammarAccess.getEnumNameAccess().getEfgEnumLiteralDeclaration_1().getEnumLiteral().getInstance();
|
||||
newLeafNode(enumLiteral_1, grammarAccess.getEnumNameAccess().getEfgEnumLiteralDeclaration_1());
|
||||
}
|
||||
)
|
||||
)
|
||||
;
|
|
@ -0,0 +1,894 @@
|
|||
package org.eclipse.xtext.lexer.parser.antlr.internal;
|
||||
|
||||
import org.eclipse.xtext.*;
|
||||
import org.eclipse.xtext.parser.*;
|
||||
import org.eclipse.xtext.parser.impl.*;
|
||||
import org.eclipse.emf.ecore.util.EcoreUtil;
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
import org.eclipse.emf.common.util.Enumerator;
|
||||
import org.eclipse.xtext.parser.antlr.AbstractInternalAntlrParser;
|
||||
import org.eclipse.xtext.parser.antlr.XtextTokenStream;
|
||||
import org.eclipse.xtext.parser.antlr.XtextTokenStream.HiddenTokens;
|
||||
import org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken;
|
||||
import org.eclipse.xtext.lexer.services.BacktrackingLexerTestLanguageGrammarAccess;
|
||||
|
||||
|
||||
|
||||
import org.antlr.runtime.*;
|
||||
import java.util.Stack;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
@SuppressWarnings("all")
|
||||
public class InternalBacktrackingLexerTestLanguageParser extends AbstractInternalAntlrParser {
|
||||
public static final String[] tokenNames = new String[] {
|
||||
"<invalid>", "<EOR>", "<DOWN>", "<UP>", "Abc", "Efg", "RULE_CHARA", "RULE_CHARB", "RULE_CHARX", "RULE_YC", "RULE_CHARY", "RULE_CHARC", "RULE_WS", "RULE_SL_COMMENT"
|
||||
};
|
||||
public static final int RULE_CHARX=8;
|
||||
public static final int RULE_YC=9;
|
||||
public static final int Efg=5;
|
||||
public static final int RULE_CHARY=10;
|
||||
public static final int Abc=4;
|
||||
public static final int RULE_WS=12;
|
||||
public static final int RULE_CHARA=6;
|
||||
public static final int RULE_SL_COMMENT=13;
|
||||
public static final int EOF=-1;
|
||||
public static final int RULE_CHARB=7;
|
||||
public static final int RULE_CHARC=11;
|
||||
|
||||
// delegates
|
||||
// delegators
|
||||
|
||||
|
||||
public InternalBacktrackingLexerTestLanguageParser(TokenStream input) {
|
||||
this(input, new RecognizerSharedState());
|
||||
}
|
||||
public InternalBacktrackingLexerTestLanguageParser(TokenStream input, RecognizerSharedState state) {
|
||||
super(input, state);
|
||||
this.state.ruleMemo = new HashMap[14+1];
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public String[] getTokenNames() { return InternalBacktrackingLexerTestLanguageParser.tokenNames; }
|
||||
public String getGrammarFileName() { return "InternalBacktrackingLexerTestLanguageParser.g"; }
|
||||
|
||||
|
||||
|
||||
/*
|
||||
This grammar contains a lot of empty actions to work around a bug in ANTLR.
|
||||
Otherwise the ANTLR tool will create synpreds that cannot be compiled in some rare cases.
|
||||
*/
|
||||
|
||||
private BacktrackingLexerTestLanguageGrammarAccess grammarAccess;
|
||||
|
||||
public InternalBacktrackingLexerTestLanguageParser(TokenStream input, BacktrackingLexerTestLanguageGrammarAccess grammarAccess) {
|
||||
this(input);
|
||||
this.grammarAccess = grammarAccess;
|
||||
registerRules(grammarAccess.getGrammar());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getFirstRuleName() {
|
||||
return "Model";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BacktrackingLexerTestLanguageGrammarAccess getGrammarAccess() {
|
||||
return grammarAccess;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// $ANTLR start "entryRuleModel"
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:65:1: entryRuleModel returns [EObject current=null] : iv_ruleModel= ruleModel EOF ;
|
||||
public final EObject entryRuleModel() throws RecognitionException {
|
||||
EObject current = null;
|
||||
int entryRuleModel_StartIndex = input.index();
|
||||
EObject iv_ruleModel = null;
|
||||
|
||||
|
||||
try {
|
||||
if ( state.backtracking>0 && alreadyParsedRule(input, 1) ) { return current; }
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:65:46: (iv_ruleModel= ruleModel EOF )
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:66:2: iv_ruleModel= ruleModel EOF
|
||||
{
|
||||
if ( state.backtracking==0 ) {
|
||||
newCompositeNode(grammarAccess.getModelRule());
|
||||
}
|
||||
pushFollow(FollowSets000.FOLLOW_1);
|
||||
iv_ruleModel=ruleModel();
|
||||
|
||||
state._fsp--;
|
||||
if (state.failed) return current;
|
||||
if ( state.backtracking==0 ) {
|
||||
current =iv_ruleModel;
|
||||
}
|
||||
match(input,EOF,FollowSets000.FOLLOW_2); if (state.failed) return current;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
catch (RecognitionException re) {
|
||||
recover(input,re);
|
||||
appendSkippedTokens();
|
||||
}
|
||||
finally {
|
||||
if ( state.backtracking>0 ) { memoize(input, 1, entryRuleModel_StartIndex); }
|
||||
}
|
||||
return current;
|
||||
}
|
||||
// $ANTLR end "entryRuleModel"
|
||||
|
||||
|
||||
// $ANTLR start "ruleModel"
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:72:1: ruleModel returns [EObject current=null] : ( ( (lv_enums_0_0= ruleEnumName ) )* ( (lv_ycs_1_0= RULE_YC ) )* ( (lv_abs_2_0= ruleAb ) )* ( (lv_xbs_3_0= ruleXb ) )* ( (lv_ys_4_0= RULE_CHARY ) )* ( (lv_as_5_0= RULE_CHARA ) )* ) ;
|
||||
public final EObject ruleModel() throws RecognitionException {
|
||||
EObject current = null;
|
||||
int ruleModel_StartIndex = input.index();
|
||||
Token lv_ycs_1_0=null;
|
||||
Token lv_ys_4_0=null;
|
||||
Token lv_as_5_0=null;
|
||||
Enumerator lv_enums_0_0 = null;
|
||||
|
||||
EObject lv_abs_2_0 = null;
|
||||
|
||||
EObject lv_xbs_3_0 = null;
|
||||
|
||||
|
||||
|
||||
enterRule();
|
||||
|
||||
try {
|
||||
if ( state.backtracking>0 && alreadyParsedRule(input, 2) ) { return current; }
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:78:2: ( ( ( (lv_enums_0_0= ruleEnumName ) )* ( (lv_ycs_1_0= RULE_YC ) )* ( (lv_abs_2_0= ruleAb ) )* ( (lv_xbs_3_0= ruleXb ) )* ( (lv_ys_4_0= RULE_CHARY ) )* ( (lv_as_5_0= RULE_CHARA ) )* ) )
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:79:2: ( ( (lv_enums_0_0= ruleEnumName ) )* ( (lv_ycs_1_0= RULE_YC ) )* ( (lv_abs_2_0= ruleAb ) )* ( (lv_xbs_3_0= ruleXb ) )* ( (lv_ys_4_0= RULE_CHARY ) )* ( (lv_as_5_0= RULE_CHARA ) )* )
|
||||
{
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:79:2: ( ( (lv_enums_0_0= ruleEnumName ) )* ( (lv_ycs_1_0= RULE_YC ) )* ( (lv_abs_2_0= ruleAb ) )* ( (lv_xbs_3_0= ruleXb ) )* ( (lv_ys_4_0= RULE_CHARY ) )* ( (lv_as_5_0= RULE_CHARA ) )* )
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:80:3: ( (lv_enums_0_0= ruleEnumName ) )* ( (lv_ycs_1_0= RULE_YC ) )* ( (lv_abs_2_0= ruleAb ) )* ( (lv_xbs_3_0= ruleXb ) )* ( (lv_ys_4_0= RULE_CHARY ) )* ( (lv_as_5_0= RULE_CHARA ) )*
|
||||
{
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:80:3: ( (lv_enums_0_0= ruleEnumName ) )*
|
||||
loop1:
|
||||
do {
|
||||
int alt1=2;
|
||||
int LA1_0 = input.LA(1);
|
||||
|
||||
if ( ((LA1_0>=Abc && LA1_0<=Efg)) ) {
|
||||
alt1=1;
|
||||
}
|
||||
|
||||
|
||||
switch (alt1) {
|
||||
case 1 :
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:81:4: (lv_enums_0_0= ruleEnumName )
|
||||
{
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:81:4: (lv_enums_0_0= ruleEnumName )
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:82:5: lv_enums_0_0= ruleEnumName
|
||||
{
|
||||
if ( state.backtracking==0 ) {
|
||||
|
||||
newCompositeNode(grammarAccess.getModelAccess().getEnumsEnumNameEnumRuleCall_0_0());
|
||||
|
||||
}
|
||||
pushFollow(FollowSets000.FOLLOW_3);
|
||||
lv_enums_0_0=ruleEnumName();
|
||||
|
||||
state._fsp--;
|
||||
if (state.failed) return current;
|
||||
if ( state.backtracking==0 ) {
|
||||
|
||||
if (current==null) {
|
||||
current = createModelElementForParent(grammarAccess.getModelRule());
|
||||
}
|
||||
add(
|
||||
current,
|
||||
"enums",
|
||||
lv_enums_0_0,
|
||||
"org.eclipse.xtext.lexer.BacktrackingLexerTestLanguage.EnumName");
|
||||
afterParserOrEnumRuleCall();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
break loop1;
|
||||
}
|
||||
} while (true);
|
||||
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:99:3: ( (lv_ycs_1_0= RULE_YC ) )*
|
||||
loop2:
|
||||
do {
|
||||
int alt2=2;
|
||||
int LA2_0 = input.LA(1);
|
||||
|
||||
if ( (LA2_0==RULE_YC) ) {
|
||||
alt2=1;
|
||||
}
|
||||
|
||||
|
||||
switch (alt2) {
|
||||
case 1 :
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:100:4: (lv_ycs_1_0= RULE_YC )
|
||||
{
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:100:4: (lv_ycs_1_0= RULE_YC )
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:101:5: lv_ycs_1_0= RULE_YC
|
||||
{
|
||||
lv_ycs_1_0=(Token)match(input,RULE_YC,FollowSets000.FOLLOW_4); if (state.failed) return current;
|
||||
if ( state.backtracking==0 ) {
|
||||
|
||||
newLeafNode(lv_ycs_1_0, grammarAccess.getModelAccess().getYcsYcTerminalRuleCall_1_0());
|
||||
|
||||
}
|
||||
if ( state.backtracking==0 ) {
|
||||
|
||||
if (current==null) {
|
||||
current = createModelElement(grammarAccess.getModelRule());
|
||||
}
|
||||
addWithLastConsumed(
|
||||
current,
|
||||
"ycs",
|
||||
lv_ycs_1_0,
|
||||
"org.eclipse.xtext.lexer.BacktrackingLexerTestLanguage.Yc");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
break loop2;
|
||||
}
|
||||
} while (true);
|
||||
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:117:3: ( (lv_abs_2_0= ruleAb ) )*
|
||||
loop3:
|
||||
do {
|
||||
int alt3=2;
|
||||
int LA3_0 = input.LA(1);
|
||||
|
||||
if ( (LA3_0==RULE_CHARA) ) {
|
||||
int LA3_2 = input.LA(2);
|
||||
|
||||
if ( (LA3_2==RULE_CHARB) ) {
|
||||
alt3=1;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
switch (alt3) {
|
||||
case 1 :
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:118:4: (lv_abs_2_0= ruleAb )
|
||||
{
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:118:4: (lv_abs_2_0= ruleAb )
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:119:5: lv_abs_2_0= ruleAb
|
||||
{
|
||||
if ( state.backtracking==0 ) {
|
||||
|
||||
newCompositeNode(grammarAccess.getModelAccess().getAbsAbParserRuleCall_2_0());
|
||||
|
||||
}
|
||||
pushFollow(FollowSets000.FOLLOW_5);
|
||||
lv_abs_2_0=ruleAb();
|
||||
|
||||
state._fsp--;
|
||||
if (state.failed) return current;
|
||||
if ( state.backtracking==0 ) {
|
||||
|
||||
if (current==null) {
|
||||
current = createModelElementForParent(grammarAccess.getModelRule());
|
||||
}
|
||||
add(
|
||||
current,
|
||||
"abs",
|
||||
lv_abs_2_0,
|
||||
"org.eclipse.xtext.lexer.BacktrackingLexerTestLanguage.Ab");
|
||||
afterParserOrEnumRuleCall();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
break loop3;
|
||||
}
|
||||
} while (true);
|
||||
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:136:3: ( (lv_xbs_3_0= ruleXb ) )*
|
||||
loop4:
|
||||
do {
|
||||
int alt4=2;
|
||||
int LA4_0 = input.LA(1);
|
||||
|
||||
if ( (LA4_0==RULE_CHARX) ) {
|
||||
alt4=1;
|
||||
}
|
||||
|
||||
|
||||
switch (alt4) {
|
||||
case 1 :
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:137:4: (lv_xbs_3_0= ruleXb )
|
||||
{
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:137:4: (lv_xbs_3_0= ruleXb )
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:138:5: lv_xbs_3_0= ruleXb
|
||||
{
|
||||
if ( state.backtracking==0 ) {
|
||||
|
||||
newCompositeNode(grammarAccess.getModelAccess().getXbsXbParserRuleCall_3_0());
|
||||
|
||||
}
|
||||
pushFollow(FollowSets000.FOLLOW_5);
|
||||
lv_xbs_3_0=ruleXb();
|
||||
|
||||
state._fsp--;
|
||||
if (state.failed) return current;
|
||||
if ( state.backtracking==0 ) {
|
||||
|
||||
if (current==null) {
|
||||
current = createModelElementForParent(grammarAccess.getModelRule());
|
||||
}
|
||||
add(
|
||||
current,
|
||||
"xbs",
|
||||
lv_xbs_3_0,
|
||||
"org.eclipse.xtext.lexer.BacktrackingLexerTestLanguage.Xb");
|
||||
afterParserOrEnumRuleCall();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
break loop4;
|
||||
}
|
||||
} while (true);
|
||||
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:155:3: ( (lv_ys_4_0= RULE_CHARY ) )*
|
||||
loop5:
|
||||
do {
|
||||
int alt5=2;
|
||||
int LA5_0 = input.LA(1);
|
||||
|
||||
if ( (LA5_0==RULE_CHARY) ) {
|
||||
alt5=1;
|
||||
}
|
||||
|
||||
|
||||
switch (alt5) {
|
||||
case 1 :
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:156:4: (lv_ys_4_0= RULE_CHARY )
|
||||
{
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:156:4: (lv_ys_4_0= RULE_CHARY )
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:157:5: lv_ys_4_0= RULE_CHARY
|
||||
{
|
||||
lv_ys_4_0=(Token)match(input,RULE_CHARY,FollowSets000.FOLLOW_6); if (state.failed) return current;
|
||||
if ( state.backtracking==0 ) {
|
||||
|
||||
newLeafNode(lv_ys_4_0, grammarAccess.getModelAccess().getYsCharYTerminalRuleCall_4_0());
|
||||
|
||||
}
|
||||
if ( state.backtracking==0 ) {
|
||||
|
||||
if (current==null) {
|
||||
current = createModelElement(grammarAccess.getModelRule());
|
||||
}
|
||||
addWithLastConsumed(
|
||||
current,
|
||||
"ys",
|
||||
lv_ys_4_0,
|
||||
"org.eclipse.xtext.lexer.BacktrackingLexerTestLanguage.CharY");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
break loop5;
|
||||
}
|
||||
} while (true);
|
||||
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:173:3: ( (lv_as_5_0= RULE_CHARA ) )*
|
||||
loop6:
|
||||
do {
|
||||
int alt6=2;
|
||||
int LA6_0 = input.LA(1);
|
||||
|
||||
if ( (LA6_0==RULE_CHARA) ) {
|
||||
alt6=1;
|
||||
}
|
||||
|
||||
|
||||
switch (alt6) {
|
||||
case 1 :
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:174:4: (lv_as_5_0= RULE_CHARA )
|
||||
{
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:174:4: (lv_as_5_0= RULE_CHARA )
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:175:5: lv_as_5_0= RULE_CHARA
|
||||
{
|
||||
lv_as_5_0=(Token)match(input,RULE_CHARA,FollowSets000.FOLLOW_7); if (state.failed) return current;
|
||||
if ( state.backtracking==0 ) {
|
||||
|
||||
newLeafNode(lv_as_5_0, grammarAccess.getModelAccess().getAsCharATerminalRuleCall_5_0());
|
||||
|
||||
}
|
||||
if ( state.backtracking==0 ) {
|
||||
|
||||
if (current==null) {
|
||||
current = createModelElement(grammarAccess.getModelRule());
|
||||
}
|
||||
addWithLastConsumed(
|
||||
current,
|
||||
"as",
|
||||
lv_as_5_0,
|
||||
"org.eclipse.xtext.lexer.BacktrackingLexerTestLanguage.CharA");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
break loop6;
|
||||
}
|
||||
} while (true);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if ( state.backtracking==0 ) {
|
||||
|
||||
leaveRule();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
catch (RecognitionException re) {
|
||||
recover(input,re);
|
||||
appendSkippedTokens();
|
||||
}
|
||||
finally {
|
||||
if ( state.backtracking>0 ) { memoize(input, 2, ruleModel_StartIndex); }
|
||||
}
|
||||
return current;
|
||||
}
|
||||
// $ANTLR end "ruleModel"
|
||||
|
||||
|
||||
// $ANTLR start "entryRuleAb"
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:195:1: entryRuleAb returns [EObject current=null] : iv_ruleAb= ruleAb EOF ;
|
||||
public final EObject entryRuleAb() throws RecognitionException {
|
||||
EObject current = null;
|
||||
int entryRuleAb_StartIndex = input.index();
|
||||
EObject iv_ruleAb = null;
|
||||
|
||||
|
||||
try {
|
||||
if ( state.backtracking>0 && alreadyParsedRule(input, 3) ) { return current; }
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:195:43: (iv_ruleAb= ruleAb EOF )
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:196:2: iv_ruleAb= ruleAb EOF
|
||||
{
|
||||
if ( state.backtracking==0 ) {
|
||||
newCompositeNode(grammarAccess.getAbRule());
|
||||
}
|
||||
pushFollow(FollowSets000.FOLLOW_1);
|
||||
iv_ruleAb=ruleAb();
|
||||
|
||||
state._fsp--;
|
||||
if (state.failed) return current;
|
||||
if ( state.backtracking==0 ) {
|
||||
current =iv_ruleAb;
|
||||
}
|
||||
match(input,EOF,FollowSets000.FOLLOW_2); if (state.failed) return current;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
catch (RecognitionException re) {
|
||||
recover(input,re);
|
||||
appendSkippedTokens();
|
||||
}
|
||||
finally {
|
||||
if ( state.backtracking>0 ) { memoize(input, 3, entryRuleAb_StartIndex); }
|
||||
}
|
||||
return current;
|
||||
}
|
||||
// $ANTLR end "entryRuleAb"
|
||||
|
||||
|
||||
// $ANTLR start "ruleAb"
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:202:1: ruleAb returns [EObject current=null] : ( ( (lv_x_0_0= RULE_CHARA ) ) ( (lv_y_1_0= RULE_CHARB ) ) ) ;
|
||||
public final EObject ruleAb() throws RecognitionException {
|
||||
EObject current = null;
|
||||
int ruleAb_StartIndex = input.index();
|
||||
Token lv_x_0_0=null;
|
||||
Token lv_y_1_0=null;
|
||||
|
||||
|
||||
enterRule();
|
||||
|
||||
try {
|
||||
if ( state.backtracking>0 && alreadyParsedRule(input, 4) ) { return current; }
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:208:2: ( ( ( (lv_x_0_0= RULE_CHARA ) ) ( (lv_y_1_0= RULE_CHARB ) ) ) )
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:209:2: ( ( (lv_x_0_0= RULE_CHARA ) ) ( (lv_y_1_0= RULE_CHARB ) ) )
|
||||
{
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:209:2: ( ( (lv_x_0_0= RULE_CHARA ) ) ( (lv_y_1_0= RULE_CHARB ) ) )
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:210:3: ( (lv_x_0_0= RULE_CHARA ) ) ( (lv_y_1_0= RULE_CHARB ) )
|
||||
{
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:210:3: ( (lv_x_0_0= RULE_CHARA ) )
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:211:4: (lv_x_0_0= RULE_CHARA )
|
||||
{
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:211:4: (lv_x_0_0= RULE_CHARA )
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:212:5: lv_x_0_0= RULE_CHARA
|
||||
{
|
||||
lv_x_0_0=(Token)match(input,RULE_CHARA,FollowSets000.FOLLOW_8); if (state.failed) return current;
|
||||
if ( state.backtracking==0 ) {
|
||||
|
||||
newLeafNode(lv_x_0_0, grammarAccess.getAbAccess().getXCharATerminalRuleCall_0_0());
|
||||
|
||||
}
|
||||
if ( state.backtracking==0 ) {
|
||||
|
||||
if (current==null) {
|
||||
current = createModelElement(grammarAccess.getAbRule());
|
||||
}
|
||||
setWithLastConsumed(
|
||||
current,
|
||||
"x",
|
||||
lv_x_0_0,
|
||||
"org.eclipse.xtext.lexer.BacktrackingLexerTestLanguage.CharA");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:228:3: ( (lv_y_1_0= RULE_CHARB ) )
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:229:4: (lv_y_1_0= RULE_CHARB )
|
||||
{
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:229:4: (lv_y_1_0= RULE_CHARB )
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:230:5: lv_y_1_0= RULE_CHARB
|
||||
{
|
||||
lv_y_1_0=(Token)match(input,RULE_CHARB,FollowSets000.FOLLOW_2); if (state.failed) return current;
|
||||
if ( state.backtracking==0 ) {
|
||||
|
||||
newLeafNode(lv_y_1_0, grammarAccess.getAbAccess().getYCharbTerminalRuleCall_1_0());
|
||||
|
||||
}
|
||||
if ( state.backtracking==0 ) {
|
||||
|
||||
if (current==null) {
|
||||
current = createModelElement(grammarAccess.getAbRule());
|
||||
}
|
||||
setWithLastConsumed(
|
||||
current,
|
||||
"y",
|
||||
lv_y_1_0,
|
||||
"org.eclipse.xtext.lexer.BacktrackingLexerTestLanguage.Charb");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if ( state.backtracking==0 ) {
|
||||
|
||||
leaveRule();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
catch (RecognitionException re) {
|
||||
recover(input,re);
|
||||
appendSkippedTokens();
|
||||
}
|
||||
finally {
|
||||
if ( state.backtracking>0 ) { memoize(input, 4, ruleAb_StartIndex); }
|
||||
}
|
||||
return current;
|
||||
}
|
||||
// $ANTLR end "ruleAb"
|
||||
|
||||
|
||||
// $ANTLR start "entryRuleXb"
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:250:1: entryRuleXb returns [EObject current=null] : iv_ruleXb= ruleXb EOF ;
|
||||
public final EObject entryRuleXb() throws RecognitionException {
|
||||
EObject current = null;
|
||||
int entryRuleXb_StartIndex = input.index();
|
||||
EObject iv_ruleXb = null;
|
||||
|
||||
|
||||
try {
|
||||
if ( state.backtracking>0 && alreadyParsedRule(input, 5) ) { return current; }
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:250:43: (iv_ruleXb= ruleXb EOF )
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:251:2: iv_ruleXb= ruleXb EOF
|
||||
{
|
||||
if ( state.backtracking==0 ) {
|
||||
newCompositeNode(grammarAccess.getXbRule());
|
||||
}
|
||||
pushFollow(FollowSets000.FOLLOW_1);
|
||||
iv_ruleXb=ruleXb();
|
||||
|
||||
state._fsp--;
|
||||
if (state.failed) return current;
|
||||
if ( state.backtracking==0 ) {
|
||||
current =iv_ruleXb;
|
||||
}
|
||||
match(input,EOF,FollowSets000.FOLLOW_2); if (state.failed) return current;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
catch (RecognitionException re) {
|
||||
recover(input,re);
|
||||
appendSkippedTokens();
|
||||
}
|
||||
finally {
|
||||
if ( state.backtracking>0 ) { memoize(input, 5, entryRuleXb_StartIndex); }
|
||||
}
|
||||
return current;
|
||||
}
|
||||
// $ANTLR end "entryRuleXb"
|
||||
|
||||
|
||||
// $ANTLR start "ruleXb"
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:257:1: ruleXb returns [EObject current=null] : ( ( (lv_x_0_0= RULE_CHARX ) ) ( (lv_y_1_0= RULE_CHARB ) ) ) ;
|
||||
public final EObject ruleXb() throws RecognitionException {
|
||||
EObject current = null;
|
||||
int ruleXb_StartIndex = input.index();
|
||||
Token lv_x_0_0=null;
|
||||
Token lv_y_1_0=null;
|
||||
|
||||
|
||||
enterRule();
|
||||
|
||||
try {
|
||||
if ( state.backtracking>0 && alreadyParsedRule(input, 6) ) { return current; }
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:263:2: ( ( ( (lv_x_0_0= RULE_CHARX ) ) ( (lv_y_1_0= RULE_CHARB ) ) ) )
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:264:2: ( ( (lv_x_0_0= RULE_CHARX ) ) ( (lv_y_1_0= RULE_CHARB ) ) )
|
||||
{
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:264:2: ( ( (lv_x_0_0= RULE_CHARX ) ) ( (lv_y_1_0= RULE_CHARB ) ) )
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:265:3: ( (lv_x_0_0= RULE_CHARX ) ) ( (lv_y_1_0= RULE_CHARB ) )
|
||||
{
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:265:3: ( (lv_x_0_0= RULE_CHARX ) )
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:266:4: (lv_x_0_0= RULE_CHARX )
|
||||
{
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:266:4: (lv_x_0_0= RULE_CHARX )
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:267:5: lv_x_0_0= RULE_CHARX
|
||||
{
|
||||
lv_x_0_0=(Token)match(input,RULE_CHARX,FollowSets000.FOLLOW_8); if (state.failed) return current;
|
||||
if ( state.backtracking==0 ) {
|
||||
|
||||
newLeafNode(lv_x_0_0, grammarAccess.getXbAccess().getXCharXTerminalRuleCall_0_0());
|
||||
|
||||
}
|
||||
if ( state.backtracking==0 ) {
|
||||
|
||||
if (current==null) {
|
||||
current = createModelElement(grammarAccess.getXbRule());
|
||||
}
|
||||
setWithLastConsumed(
|
||||
current,
|
||||
"x",
|
||||
lv_x_0_0,
|
||||
"org.eclipse.xtext.lexer.BacktrackingLexerTestLanguage.CharX");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:283:3: ( (lv_y_1_0= RULE_CHARB ) )
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:284:4: (lv_y_1_0= RULE_CHARB )
|
||||
{
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:284:4: (lv_y_1_0= RULE_CHARB )
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:285:5: lv_y_1_0= RULE_CHARB
|
||||
{
|
||||
lv_y_1_0=(Token)match(input,RULE_CHARB,FollowSets000.FOLLOW_2); if (state.failed) return current;
|
||||
if ( state.backtracking==0 ) {
|
||||
|
||||
newLeafNode(lv_y_1_0, grammarAccess.getXbAccess().getYCharbTerminalRuleCall_1_0());
|
||||
|
||||
}
|
||||
if ( state.backtracking==0 ) {
|
||||
|
||||
if (current==null) {
|
||||
current = createModelElement(grammarAccess.getXbRule());
|
||||
}
|
||||
setWithLastConsumed(
|
||||
current,
|
||||
"y",
|
||||
lv_y_1_0,
|
||||
"org.eclipse.xtext.lexer.BacktrackingLexerTestLanguage.Charb");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if ( state.backtracking==0 ) {
|
||||
|
||||
leaveRule();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
catch (RecognitionException re) {
|
||||
recover(input,re);
|
||||
appendSkippedTokens();
|
||||
}
|
||||
finally {
|
||||
if ( state.backtracking>0 ) { memoize(input, 6, ruleXb_StartIndex); }
|
||||
}
|
||||
return current;
|
||||
}
|
||||
// $ANTLR end "ruleXb"
|
||||
|
||||
|
||||
// $ANTLR start "ruleEnumName"
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:305:1: ruleEnumName returns [Enumerator current=null] : ( (enumLiteral_0= Abc ) | (enumLiteral_1= Efg ) ) ;
|
||||
public final Enumerator ruleEnumName() throws RecognitionException {
|
||||
Enumerator current = null;
|
||||
int ruleEnumName_StartIndex = input.index();
|
||||
Token enumLiteral_0=null;
|
||||
Token enumLiteral_1=null;
|
||||
|
||||
|
||||
enterRule();
|
||||
|
||||
try {
|
||||
if ( state.backtracking>0 && alreadyParsedRule(input, 7) ) { return current; }
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:311:2: ( ( (enumLiteral_0= Abc ) | (enumLiteral_1= Efg ) ) )
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:312:2: ( (enumLiteral_0= Abc ) | (enumLiteral_1= Efg ) )
|
||||
{
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:312:2: ( (enumLiteral_0= Abc ) | (enumLiteral_1= Efg ) )
|
||||
int alt7=2;
|
||||
int LA7_0 = input.LA(1);
|
||||
|
||||
if ( (LA7_0==Abc) ) {
|
||||
alt7=1;
|
||||
}
|
||||
else if ( (LA7_0==Efg) ) {
|
||||
alt7=2;
|
||||
}
|
||||
else {
|
||||
if (state.backtracking>0) {state.failed=true; return current;}
|
||||
NoViableAltException nvae =
|
||||
new NoViableAltException("", 7, 0, input);
|
||||
|
||||
throw nvae;
|
||||
}
|
||||
switch (alt7) {
|
||||
case 1 :
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:313:3: (enumLiteral_0= Abc )
|
||||
{
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:313:3: (enumLiteral_0= Abc )
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:314:4: enumLiteral_0= Abc
|
||||
{
|
||||
enumLiteral_0=(Token)match(input,Abc,FollowSets000.FOLLOW_2); if (state.failed) return current;
|
||||
if ( state.backtracking==0 ) {
|
||||
|
||||
current = grammarAccess.getEnumNameAccess().getAbcEnumLiteralDeclaration_0().getEnumLiteral().getInstance();
|
||||
newLeafNode(enumLiteral_0, grammarAccess.getEnumNameAccess().getAbcEnumLiteralDeclaration_0());
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
case 2 :
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:321:3: (enumLiteral_1= Efg )
|
||||
{
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:321:3: (enumLiteral_1= Efg )
|
||||
// InternalBacktrackingLexerTestLanguageParser.g:322:4: enumLiteral_1= Efg
|
||||
{
|
||||
enumLiteral_1=(Token)match(input,Efg,FollowSets000.FOLLOW_2); if (state.failed) return current;
|
||||
if ( state.backtracking==0 ) {
|
||||
|
||||
current = grammarAccess.getEnumNameAccess().getEfgEnumLiteralDeclaration_1().getEnumLiteral().getInstance();
|
||||
newLeafNode(enumLiteral_1, grammarAccess.getEnumNameAccess().getEfgEnumLiteralDeclaration_1());
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if ( state.backtracking==0 ) {
|
||||
|
||||
leaveRule();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
catch (RecognitionException re) {
|
||||
recover(input,re);
|
||||
appendSkippedTokens();
|
||||
}
|
||||
finally {
|
||||
if ( state.backtracking>0 ) { memoize(input, 7, ruleEnumName_StartIndex); }
|
||||
}
|
||||
return current;
|
||||
}
|
||||
// $ANTLR end "ruleEnumName"
|
||||
|
||||
// Delegated rules
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private static class FollowSets000 {
|
||||
public static final BitSet FOLLOW_1 = new BitSet(new long[]{0x0000000000000000L});
|
||||
public static final BitSet FOLLOW_2 = new BitSet(new long[]{0x0000000000000002L});
|
||||
public static final BitSet FOLLOW_3 = new BitSet(new long[]{0x0000000000000772L});
|
||||
public static final BitSet FOLLOW_4 = new BitSet(new long[]{0x0000000000000742L});
|
||||
public static final BitSet FOLLOW_5 = new BitSet(new long[]{0x0000000000000542L});
|
||||
public static final BitSet FOLLOW_6 = new BitSet(new long[]{0x0000000000000442L});
|
||||
public static final BitSet FOLLOW_7 = new BitSet(new long[]{0x0000000000000042L});
|
||||
public static final BitSet FOLLOW_8 = new BitSet(new long[]{0x0000000000000080L});
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
'Abc'=4
|
||||
'Efg'=5
|
||||
RULE_CHARA=6
|
||||
RULE_CHARB=7
|
||||
RULE_CHARC=11
|
||||
RULE_CHARX=8
|
||||
RULE_CHARY=10
|
||||
RULE_SL_COMMENT=13
|
||||
RULE_WS=12
|
||||
RULE_YC=9
|
|
@ -0,0 +1,70 @@
|
|||
/*
|
||||
* generated by Xtext
|
||||
*/
|
||||
lexer grammar InternalBacktrackingLexerTestLanguageLexer;
|
||||
|
||||
options {
|
||||
backtrack=true;
|
||||
memoize=true;
|
||||
}
|
||||
tokens {
|
||||
Abc;
|
||||
Efg;
|
||||
RULE_CHARA;
|
||||
RULE_CHARB;
|
||||
RULE_CHARX;
|
||||
RULE_YC;
|
||||
RULE_CHARY;
|
||||
RULE_CHARC;
|
||||
RULE_WS;
|
||||
RULE_SL_COMMENT;
|
||||
}
|
||||
|
||||
@header {
|
||||
package org.eclipse.xtext.lexer.parser.antlr.lexer;
|
||||
|
||||
// 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;
|
||||
}
|
||||
SYNTHETIC_ALL_KEYWORDS :
|
||||
(FRAGMENT_Abc)=> FRAGMENT_Abc {$type = Abc; } |
|
||||
(FRAGMENT_Efg)=> FRAGMENT_Efg {$type = Efg; } |
|
||||
(FRAGMENT_RULE_CHARA)=> FRAGMENT_RULE_CHARA {$type = RULE_CHARA; } |
|
||||
(FRAGMENT_RULE_CHARB)=> FRAGMENT_RULE_CHARB {$type = RULE_CHARB; } |
|
||||
(FRAGMENT_RULE_CHARX)=> FRAGMENT_RULE_CHARX {$type = RULE_CHARX; } |
|
||||
(FRAGMENT_RULE_YC)=> FRAGMENT_RULE_YC {$type = RULE_YC; } |
|
||||
(FRAGMENT_RULE_CHARY)=> FRAGMENT_RULE_CHARY {$type = RULE_CHARY; } |
|
||||
(FRAGMENT_RULE_WS)=> FRAGMENT_RULE_WS {$type = RULE_WS; } |
|
||||
(FRAGMENT_RULE_SL_COMMENT)=> FRAGMENT_RULE_SL_COMMENT {$type = RULE_SL_COMMENT; }
|
||||
;
|
||||
|
||||
fragment FRAGMENT_Abc : 'Abc';
|
||||
|
||||
fragment FRAGMENT_Efg : 'Efg';
|
||||
|
||||
|
||||
// Rules duplicated to allow inter-rule references
|
||||
|
||||
fragment RULE_CHARA : FRAGMENT_RULE_CHARA;
|
||||
fragment FRAGMENT_RULE_CHARA : 'A';
|
||||
|
||||
fragment RULE_CHARB : FRAGMENT_RULE_CHARB;
|
||||
fragment FRAGMENT_RULE_CHARB : 'b';
|
||||
|
||||
fragment RULE_CHARX : FRAGMENT_RULE_CHARX;
|
||||
fragment FRAGMENT_RULE_CHARX : 'X';
|
||||
|
||||
fragment RULE_YC : FRAGMENT_RULE_YC;
|
||||
fragment FRAGMENT_RULE_YC : RULE_CHARY RULE_CHARC;
|
||||
|
||||
fragment RULE_CHARY : FRAGMENT_RULE_CHARY;
|
||||
fragment FRAGMENT_RULE_CHARY : 'Y';
|
||||
|
||||
fragment RULE_CHARC : 'c';
|
||||
|
||||
fragment RULE_WS : FRAGMENT_RULE_WS;
|
||||
fragment FRAGMENT_RULE_WS : (' '|'\t'|'\r'|'\n')+;
|
||||
|
||||
fragment RULE_SL_COMMENT : FRAGMENT_RULE_SL_COMMENT;
|
||||
fragment FRAGMENT_RULE_SL_COMMENT : '//' ~(('\n'|'\r'))* ('\r'? '\n')?;
|
|
@ -0,0 +1,967 @@
|
|||
package org.eclipse.xtext.lexer.parser.antlr.lexer;
|
||||
|
||||
// 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;
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
@SuppressWarnings("all")
|
||||
public class InternalBacktrackingLexerTestLanguageLexer extends Lexer {
|
||||
public static final int FRAGMENT_Abc=14;
|
||||
public static final int FRAGMENT_RULE_CHARY=20;
|
||||
public static final int FRAGMENT_RULE_CHARA=16;
|
||||
public static final int FRAGMENT_RULE_CHARX=18;
|
||||
public static final int RULE_CHARY=10;
|
||||
public static final int Abc=4;
|
||||
public static final int EOF=-1;
|
||||
public static final int RULE_SL_COMMENT=13;
|
||||
public static final int FRAGMENT_RULE_YC=19;
|
||||
public static final int FRAGMENT_RULE_CHARB=17;
|
||||
public static final int FRAGMENT_Efg=15;
|
||||
public static final int SYNTHETIC_ALL_KEYWORDS=23;
|
||||
public static final int RULE_CHARX=8;
|
||||
public static final int FRAGMENT_RULE_SL_COMMENT=22;
|
||||
public static final int Efg=5;
|
||||
public static final int RULE_YC=9;
|
||||
public static final int FRAGMENT_RULE_WS=21;
|
||||
public static final int RULE_CHARA=6;
|
||||
public static final int RULE_WS=12;
|
||||
public static final int RULE_CHARB=7;
|
||||
public static final int RULE_CHARC=11;
|
||||
|
||||
// delegates
|
||||
// delegators
|
||||
|
||||
public InternalBacktrackingLexerTestLanguageLexer() {;}
|
||||
public InternalBacktrackingLexerTestLanguageLexer(CharStream input) {
|
||||
this(input, new RecognizerSharedState());
|
||||
}
|
||||
public InternalBacktrackingLexerTestLanguageLexer(CharStream input, RecognizerSharedState state) {
|
||||
super(input,state);
|
||||
state.ruleMemo = new HashMap[37+1];
|
||||
|
||||
}
|
||||
public String getGrammarFileName() { return "InternalBacktrackingLexerTestLanguageLexer.g"; }
|
||||
|
||||
// $ANTLR start "SYNTHETIC_ALL_KEYWORDS"
|
||||
public final void mSYNTHETIC_ALL_KEYWORDS() throws RecognitionException {
|
||||
int SYNTHETIC_ALL_KEYWORDS_StartIndex = input.index();
|
||||
try {
|
||||
int _type = SYNTHETIC_ALL_KEYWORDS;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
if ( state.backtracking>0 && alreadyParsedRule(input, 1) ) { return ; }
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:30:24: ( ( FRAGMENT_Abc )=> FRAGMENT_Abc | ( FRAGMENT_Efg )=> FRAGMENT_Efg | ( FRAGMENT_RULE_CHARA )=> FRAGMENT_RULE_CHARA | ( FRAGMENT_RULE_CHARB )=> FRAGMENT_RULE_CHARB | ( FRAGMENT_RULE_CHARX )=> FRAGMENT_RULE_CHARX | ( FRAGMENT_RULE_YC )=> FRAGMENT_RULE_YC | ( FRAGMENT_RULE_CHARY )=> FRAGMENT_RULE_CHARY | ( FRAGMENT_RULE_WS )=> FRAGMENT_RULE_WS | ( FRAGMENT_RULE_SL_COMMENT )=> FRAGMENT_RULE_SL_COMMENT )
|
||||
int alt1=9;
|
||||
alt1 = dfa1.predict(input);
|
||||
switch (alt1) {
|
||||
case 1 :
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:31:2: ( FRAGMENT_Abc )=> FRAGMENT_Abc
|
||||
{
|
||||
mFRAGMENT_Abc(); if (state.failed) return ;
|
||||
if ( state.backtracking==0 ) {
|
||||
_type = Abc;
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
case 2 :
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:32:2: ( FRAGMENT_Efg )=> FRAGMENT_Efg
|
||||
{
|
||||
mFRAGMENT_Efg(); if (state.failed) return ;
|
||||
if ( state.backtracking==0 ) {
|
||||
_type = Efg;
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
case 3 :
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:33:2: ( FRAGMENT_RULE_CHARA )=> FRAGMENT_RULE_CHARA
|
||||
{
|
||||
mFRAGMENT_RULE_CHARA(); if (state.failed) return ;
|
||||
if ( state.backtracking==0 ) {
|
||||
_type = RULE_CHARA;
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
case 4 :
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:34:2: ( FRAGMENT_RULE_CHARB )=> FRAGMENT_RULE_CHARB
|
||||
{
|
||||
mFRAGMENT_RULE_CHARB(); if (state.failed) return ;
|
||||
if ( state.backtracking==0 ) {
|
||||
_type = RULE_CHARB;
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
case 5 :
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:35:2: ( FRAGMENT_RULE_CHARX )=> FRAGMENT_RULE_CHARX
|
||||
{
|
||||
mFRAGMENT_RULE_CHARX(); if (state.failed) return ;
|
||||
if ( state.backtracking==0 ) {
|
||||
_type = RULE_CHARX;
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
case 6 :
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:36:2: ( FRAGMENT_RULE_YC )=> FRAGMENT_RULE_YC
|
||||
{
|
||||
mFRAGMENT_RULE_YC(); if (state.failed) return ;
|
||||
if ( state.backtracking==0 ) {
|
||||
_type = RULE_YC;
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
case 7 :
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:37:2: ( FRAGMENT_RULE_CHARY )=> FRAGMENT_RULE_CHARY
|
||||
{
|
||||
mFRAGMENT_RULE_CHARY(); if (state.failed) return ;
|
||||
if ( state.backtracking==0 ) {
|
||||
_type = RULE_CHARY;
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
case 8 :
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:38:2: ( FRAGMENT_RULE_WS )=> FRAGMENT_RULE_WS
|
||||
{
|
||||
mFRAGMENT_RULE_WS(); if (state.failed) return ;
|
||||
if ( state.backtracking==0 ) {
|
||||
_type = RULE_WS;
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
case 9 :
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:39:2: ( FRAGMENT_RULE_SL_COMMENT )=> FRAGMENT_RULE_SL_COMMENT
|
||||
{
|
||||
mFRAGMENT_RULE_SL_COMMENT(); if (state.failed) return ;
|
||||
if ( state.backtracking==0 ) {
|
||||
_type = RULE_SL_COMMENT;
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
if ( state.backtracking>0 ) { memoize(input, 1, SYNTHETIC_ALL_KEYWORDS_StartIndex); }
|
||||
}
|
||||
}
|
||||
// $ANTLR end "SYNTHETIC_ALL_KEYWORDS"
|
||||
|
||||
// $ANTLR start "FRAGMENT_Abc"
|
||||
public final void mFRAGMENT_Abc() throws RecognitionException {
|
||||
int FRAGMENT_Abc_StartIndex = input.index();
|
||||
try {
|
||||
if ( state.backtracking>0 && alreadyParsedRule(input, 2) ) { return ; }
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:42:23: ( 'Abc' )
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:42:25: 'Abc'
|
||||
{
|
||||
match("Abc"); if (state.failed) return ;
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
finally {
|
||||
if ( state.backtracking>0 ) { memoize(input, 2, FRAGMENT_Abc_StartIndex); }
|
||||
}
|
||||
}
|
||||
// $ANTLR end "FRAGMENT_Abc"
|
||||
|
||||
// $ANTLR start "FRAGMENT_Efg"
|
||||
public final void mFRAGMENT_Efg() throws RecognitionException {
|
||||
int FRAGMENT_Efg_StartIndex = input.index();
|
||||
try {
|
||||
if ( state.backtracking>0 && alreadyParsedRule(input, 3) ) { return ; }
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:44:23: ( 'Efg' )
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:44:25: 'Efg'
|
||||
{
|
||||
match("Efg"); if (state.failed) return ;
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
finally {
|
||||
if ( state.backtracking>0 ) { memoize(input, 3, FRAGMENT_Efg_StartIndex); }
|
||||
}
|
||||
}
|
||||
// $ANTLR end "FRAGMENT_Efg"
|
||||
|
||||
// $ANTLR start "RULE_CHARA"
|
||||
public final void mRULE_CHARA() throws RecognitionException {
|
||||
int RULE_CHARA_StartIndex = input.index();
|
||||
try {
|
||||
if ( state.backtracking>0 && alreadyParsedRule(input, 4) ) { return ; }
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:49:21: ( FRAGMENT_RULE_CHARA )
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:49:23: FRAGMENT_RULE_CHARA
|
||||
{
|
||||
mFRAGMENT_RULE_CHARA(); if (state.failed) return ;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
finally {
|
||||
if ( state.backtracking>0 ) { memoize(input, 4, RULE_CHARA_StartIndex); }
|
||||
}
|
||||
}
|
||||
// $ANTLR end "RULE_CHARA"
|
||||
|
||||
// $ANTLR start "FRAGMENT_RULE_CHARA"
|
||||
public final void mFRAGMENT_RULE_CHARA() throws RecognitionException {
|
||||
int FRAGMENT_RULE_CHARA_StartIndex = input.index();
|
||||
try {
|
||||
if ( state.backtracking>0 && alreadyParsedRule(input, 5) ) { return ; }
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:50:30: ( 'A' )
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:50:32: 'A'
|
||||
{
|
||||
match('A'); if (state.failed) return ;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
finally {
|
||||
if ( state.backtracking>0 ) { memoize(input, 5, FRAGMENT_RULE_CHARA_StartIndex); }
|
||||
}
|
||||
}
|
||||
// $ANTLR end "FRAGMENT_RULE_CHARA"
|
||||
|
||||
// $ANTLR start "RULE_CHARB"
|
||||
public final void mRULE_CHARB() throws RecognitionException {
|
||||
int RULE_CHARB_StartIndex = input.index();
|
||||
try {
|
||||
if ( state.backtracking>0 && alreadyParsedRule(input, 6) ) { return ; }
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:52:21: ( FRAGMENT_RULE_CHARB )
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:52:23: FRAGMENT_RULE_CHARB
|
||||
{
|
||||
mFRAGMENT_RULE_CHARB(); if (state.failed) return ;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
finally {
|
||||
if ( state.backtracking>0 ) { memoize(input, 6, RULE_CHARB_StartIndex); }
|
||||
}
|
||||
}
|
||||
// $ANTLR end "RULE_CHARB"
|
||||
|
||||
// $ANTLR start "FRAGMENT_RULE_CHARB"
|
||||
public final void mFRAGMENT_RULE_CHARB() throws RecognitionException {
|
||||
int FRAGMENT_RULE_CHARB_StartIndex = input.index();
|
||||
try {
|
||||
if ( state.backtracking>0 && alreadyParsedRule(input, 7) ) { return ; }
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:53:30: ( 'b' )
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:53:32: 'b'
|
||||
{
|
||||
match('b'); if (state.failed) return ;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
finally {
|
||||
if ( state.backtracking>0 ) { memoize(input, 7, FRAGMENT_RULE_CHARB_StartIndex); }
|
||||
}
|
||||
}
|
||||
// $ANTLR end "FRAGMENT_RULE_CHARB"
|
||||
|
||||
// $ANTLR start "RULE_CHARX"
|
||||
public final void mRULE_CHARX() throws RecognitionException {
|
||||
int RULE_CHARX_StartIndex = input.index();
|
||||
try {
|
||||
if ( state.backtracking>0 && alreadyParsedRule(input, 8) ) { return ; }
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:55:21: ( FRAGMENT_RULE_CHARX )
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:55:23: FRAGMENT_RULE_CHARX
|
||||
{
|
||||
mFRAGMENT_RULE_CHARX(); if (state.failed) return ;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
finally {
|
||||
if ( state.backtracking>0 ) { memoize(input, 8, RULE_CHARX_StartIndex); }
|
||||
}
|
||||
}
|
||||
// $ANTLR end "RULE_CHARX"
|
||||
|
||||
// $ANTLR start "FRAGMENT_RULE_CHARX"
|
||||
public final void mFRAGMENT_RULE_CHARX() throws RecognitionException {
|
||||
int FRAGMENT_RULE_CHARX_StartIndex = input.index();
|
||||
try {
|
||||
if ( state.backtracking>0 && alreadyParsedRule(input, 9) ) { return ; }
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:56:30: ( 'X' )
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:56:32: 'X'
|
||||
{
|
||||
match('X'); if (state.failed) return ;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
finally {
|
||||
if ( state.backtracking>0 ) { memoize(input, 9, FRAGMENT_RULE_CHARX_StartIndex); }
|
||||
}
|
||||
}
|
||||
// $ANTLR end "FRAGMENT_RULE_CHARX"
|
||||
|
||||
// $ANTLR start "RULE_YC"
|
||||
public final void mRULE_YC() throws RecognitionException {
|
||||
int RULE_YC_StartIndex = input.index();
|
||||
try {
|
||||
if ( state.backtracking>0 && alreadyParsedRule(input, 10) ) { return ; }
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:58:18: ( FRAGMENT_RULE_YC )
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:58:20: FRAGMENT_RULE_YC
|
||||
{
|
||||
mFRAGMENT_RULE_YC(); if (state.failed) return ;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
finally {
|
||||
if ( state.backtracking>0 ) { memoize(input, 10, RULE_YC_StartIndex); }
|
||||
}
|
||||
}
|
||||
// $ANTLR end "RULE_YC"
|
||||
|
||||
// $ANTLR start "FRAGMENT_RULE_YC"
|
||||
public final void mFRAGMENT_RULE_YC() throws RecognitionException {
|
||||
int FRAGMENT_RULE_YC_StartIndex = input.index();
|
||||
try {
|
||||
if ( state.backtracking>0 && alreadyParsedRule(input, 11) ) { return ; }
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:59:27: ( RULE_CHARY RULE_CHARC )
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:59:29: RULE_CHARY RULE_CHARC
|
||||
{
|
||||
mRULE_CHARY(); if (state.failed) return ;
|
||||
mRULE_CHARC(); if (state.failed) return ;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
finally {
|
||||
if ( state.backtracking>0 ) { memoize(input, 11, FRAGMENT_RULE_YC_StartIndex); }
|
||||
}
|
||||
}
|
||||
// $ANTLR end "FRAGMENT_RULE_YC"
|
||||
|
||||
// $ANTLR start "RULE_CHARY"
|
||||
public final void mRULE_CHARY() throws RecognitionException {
|
||||
int RULE_CHARY_StartIndex = input.index();
|
||||
try {
|
||||
if ( state.backtracking>0 && alreadyParsedRule(input, 12) ) { return ; }
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:61:21: ( FRAGMENT_RULE_CHARY )
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:61:23: FRAGMENT_RULE_CHARY
|
||||
{
|
||||
mFRAGMENT_RULE_CHARY(); if (state.failed) return ;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
finally {
|
||||
if ( state.backtracking>0 ) { memoize(input, 12, RULE_CHARY_StartIndex); }
|
||||
}
|
||||
}
|
||||
// $ANTLR end "RULE_CHARY"
|
||||
|
||||
// $ANTLR start "FRAGMENT_RULE_CHARY"
|
||||
public final void mFRAGMENT_RULE_CHARY() throws RecognitionException {
|
||||
int FRAGMENT_RULE_CHARY_StartIndex = input.index();
|
||||
try {
|
||||
if ( state.backtracking>0 && alreadyParsedRule(input, 13) ) { return ; }
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:62:30: ( 'Y' )
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:62:32: 'Y'
|
||||
{
|
||||
match('Y'); if (state.failed) return ;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
finally {
|
||||
if ( state.backtracking>0 ) { memoize(input, 13, FRAGMENT_RULE_CHARY_StartIndex); }
|
||||
}
|
||||
}
|
||||
// $ANTLR end "FRAGMENT_RULE_CHARY"
|
||||
|
||||
// $ANTLR start "RULE_CHARC"
|
||||
public final void mRULE_CHARC() throws RecognitionException {
|
||||
int RULE_CHARC_StartIndex = input.index();
|
||||
try {
|
||||
if ( state.backtracking>0 && alreadyParsedRule(input, 14) ) { return ; }
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:64:21: ( 'c' )
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:64:23: 'c'
|
||||
{
|
||||
match('c'); if (state.failed) return ;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
finally {
|
||||
if ( state.backtracking>0 ) { memoize(input, 14, RULE_CHARC_StartIndex); }
|
||||
}
|
||||
}
|
||||
// $ANTLR end "RULE_CHARC"
|
||||
|
||||
// $ANTLR start "RULE_WS"
|
||||
public final void mRULE_WS() throws RecognitionException {
|
||||
int RULE_WS_StartIndex = input.index();
|
||||
try {
|
||||
if ( state.backtracking>0 && alreadyParsedRule(input, 15) ) { return ; }
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:66:18: ( FRAGMENT_RULE_WS )
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:66:20: FRAGMENT_RULE_WS
|
||||
{
|
||||
mFRAGMENT_RULE_WS(); if (state.failed) return ;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
finally {
|
||||
if ( state.backtracking>0 ) { memoize(input, 15, RULE_WS_StartIndex); }
|
||||
}
|
||||
}
|
||||
// $ANTLR end "RULE_WS"
|
||||
|
||||
// $ANTLR start "FRAGMENT_RULE_WS"
|
||||
public final void mFRAGMENT_RULE_WS() throws RecognitionException {
|
||||
int FRAGMENT_RULE_WS_StartIndex = input.index();
|
||||
try {
|
||||
if ( state.backtracking>0 && alreadyParsedRule(input, 16) ) { return ; }
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:67:27: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ )
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:67:29: ( ' ' | '\\t' | '\\r' | '\\n' )+
|
||||
{
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:67:29: ( ' ' | '\\t' | '\\r' | '\\n' )+
|
||||
int cnt2=0;
|
||||
loop2:
|
||||
do {
|
||||
int alt2=2;
|
||||
int LA2_0 = input.LA(1);
|
||||
|
||||
if ( ((LA2_0>='\t' && LA2_0<='\n')||LA2_0=='\r'||LA2_0==' ') ) {
|
||||
alt2=1;
|
||||
}
|
||||
|
||||
|
||||
switch (alt2) {
|
||||
case 1 :
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:
|
||||
{
|
||||
if ( (input.LA(1)>='\t' && input.LA(1)<='\n')||input.LA(1)=='\r'||input.LA(1)==' ' ) {
|
||||
input.consume();
|
||||
state.failed=false;
|
||||
}
|
||||
else {
|
||||
if (state.backtracking>0) {state.failed=true; return ;}
|
||||
MismatchedSetException mse = new MismatchedSetException(null,input);
|
||||
recover(mse);
|
||||
throw mse;}
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
if ( cnt2 >= 1 ) break loop2;
|
||||
if (state.backtracking>0) {state.failed=true; return ;}
|
||||
EarlyExitException eee =
|
||||
new EarlyExitException(2, input);
|
||||
throw eee;
|
||||
}
|
||||
cnt2++;
|
||||
} while (true);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
finally {
|
||||
if ( state.backtracking>0 ) { memoize(input, 16, FRAGMENT_RULE_WS_StartIndex); }
|
||||
}
|
||||
}
|
||||
// $ANTLR end "FRAGMENT_RULE_WS"
|
||||
|
||||
// $ANTLR start "RULE_SL_COMMENT"
|
||||
public final void mRULE_SL_COMMENT() throws RecognitionException {
|
||||
int RULE_SL_COMMENT_StartIndex = input.index();
|
||||
try {
|
||||
if ( state.backtracking>0 && alreadyParsedRule(input, 17) ) { return ; }
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:69:26: ( FRAGMENT_RULE_SL_COMMENT )
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:69:28: FRAGMENT_RULE_SL_COMMENT
|
||||
{
|
||||
mFRAGMENT_RULE_SL_COMMENT(); if (state.failed) return ;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
finally {
|
||||
if ( state.backtracking>0 ) { memoize(input, 17, RULE_SL_COMMENT_StartIndex); }
|
||||
}
|
||||
}
|
||||
// $ANTLR end "RULE_SL_COMMENT"
|
||||
|
||||
// $ANTLR start "FRAGMENT_RULE_SL_COMMENT"
|
||||
public final void mFRAGMENT_RULE_SL_COMMENT() throws RecognitionException {
|
||||
int FRAGMENT_RULE_SL_COMMENT_StartIndex = input.index();
|
||||
try {
|
||||
if ( state.backtracking>0 && alreadyParsedRule(input, 18) ) { return ; }
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:70:35: ( '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? )
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:70:37: '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )?
|
||||
{
|
||||
match("//"); if (state.failed) return ;
|
||||
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:70:42: (~ ( ( '\\n' | '\\r' ) ) )*
|
||||
loop3:
|
||||
do {
|
||||
int alt3=2;
|
||||
int LA3_0 = input.LA(1);
|
||||
|
||||
if ( ((LA3_0>='\u0000' && LA3_0<='\t')||(LA3_0>='\u000B' && LA3_0<='\f')||(LA3_0>='\u000E' && LA3_0<='\uFFFF')) ) {
|
||||
alt3=1;
|
||||
}
|
||||
|
||||
|
||||
switch (alt3) {
|
||||
case 1 :
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:0:0: ~ ( ( '\\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)<='\uFFFF') ) {
|
||||
input.consume();
|
||||
state.failed=false;
|
||||
}
|
||||
else {
|
||||
if (state.backtracking>0) {state.failed=true; return ;}
|
||||
MismatchedSetException mse = new MismatchedSetException(null,input);
|
||||
recover(mse);
|
||||
throw mse;}
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
break loop3;
|
||||
}
|
||||
} while (true);
|
||||
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:70:58: ( ( '\\r' )? '\\n' )?
|
||||
int alt5=2;
|
||||
int LA5_0 = input.LA(1);
|
||||
|
||||
if ( (LA5_0=='\n'||LA5_0=='\r') ) {
|
||||
alt5=1;
|
||||
}
|
||||
switch (alt5) {
|
||||
case 1 :
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:70:59: ( '\\r' )? '\\n'
|
||||
{
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:70:59: ( '\\r' )?
|
||||
int alt4=2;
|
||||
int LA4_0 = input.LA(1);
|
||||
|
||||
if ( (LA4_0=='\r') ) {
|
||||
alt4=1;
|
||||
}
|
||||
switch (alt4) {
|
||||
case 1 :
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:0:0: '\\r'
|
||||
{
|
||||
match('\r'); if (state.failed) return ;
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
match('\n'); if (state.failed) return ;
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
finally {
|
||||
if ( state.backtracking>0 ) { memoize(input, 18, FRAGMENT_RULE_SL_COMMENT_StartIndex); }
|
||||
}
|
||||
}
|
||||
// $ANTLR end "FRAGMENT_RULE_SL_COMMENT"
|
||||
|
||||
public void mTokens() throws RecognitionException {
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:1:8: ( SYNTHETIC_ALL_KEYWORDS )
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:1:10: SYNTHETIC_ALL_KEYWORDS
|
||||
{
|
||||
mSYNTHETIC_ALL_KEYWORDS(); if (state.failed) return ;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// $ANTLR start synpred1_InternalBacktrackingLexerTestLanguageLexer
|
||||
public final void synpred1_InternalBacktrackingLexerTestLanguageLexer_fragment() throws RecognitionException {
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:31:2: ( FRAGMENT_Abc )
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:31:3: FRAGMENT_Abc
|
||||
{
|
||||
mFRAGMENT_Abc(); if (state.failed) return ;
|
||||
|
||||
}
|
||||
}
|
||||
// $ANTLR end synpred1_InternalBacktrackingLexerTestLanguageLexer
|
||||
|
||||
// $ANTLR start synpred2_InternalBacktrackingLexerTestLanguageLexer
|
||||
public final void synpred2_InternalBacktrackingLexerTestLanguageLexer_fragment() throws RecognitionException {
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:32:2: ( FRAGMENT_Efg )
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:32:3: FRAGMENT_Efg
|
||||
{
|
||||
mFRAGMENT_Efg(); if (state.failed) return ;
|
||||
|
||||
}
|
||||
}
|
||||
// $ANTLR end synpred2_InternalBacktrackingLexerTestLanguageLexer
|
||||
|
||||
// $ANTLR start synpred3_InternalBacktrackingLexerTestLanguageLexer
|
||||
public final void synpred3_InternalBacktrackingLexerTestLanguageLexer_fragment() throws RecognitionException {
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:33:2: ( FRAGMENT_RULE_CHARA )
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:33:3: FRAGMENT_RULE_CHARA
|
||||
{
|
||||
mFRAGMENT_RULE_CHARA(); if (state.failed) return ;
|
||||
|
||||
}
|
||||
}
|
||||
// $ANTLR end synpred3_InternalBacktrackingLexerTestLanguageLexer
|
||||
|
||||
// $ANTLR start synpred4_InternalBacktrackingLexerTestLanguageLexer
|
||||
public final void synpred4_InternalBacktrackingLexerTestLanguageLexer_fragment() throws RecognitionException {
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:34:2: ( FRAGMENT_RULE_CHARB )
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:34:3: FRAGMENT_RULE_CHARB
|
||||
{
|
||||
mFRAGMENT_RULE_CHARB(); if (state.failed) return ;
|
||||
|
||||
}
|
||||
}
|
||||
// $ANTLR end synpred4_InternalBacktrackingLexerTestLanguageLexer
|
||||
|
||||
// $ANTLR start synpred5_InternalBacktrackingLexerTestLanguageLexer
|
||||
public final void synpred5_InternalBacktrackingLexerTestLanguageLexer_fragment() throws RecognitionException {
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:35:2: ( FRAGMENT_RULE_CHARX )
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:35:3: FRAGMENT_RULE_CHARX
|
||||
{
|
||||
mFRAGMENT_RULE_CHARX(); if (state.failed) return ;
|
||||
|
||||
}
|
||||
}
|
||||
// $ANTLR end synpred5_InternalBacktrackingLexerTestLanguageLexer
|
||||
|
||||
// $ANTLR start synpred6_InternalBacktrackingLexerTestLanguageLexer
|
||||
public final void synpred6_InternalBacktrackingLexerTestLanguageLexer_fragment() throws RecognitionException {
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:36:2: ( FRAGMENT_RULE_YC )
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:36:3: FRAGMENT_RULE_YC
|
||||
{
|
||||
mFRAGMENT_RULE_YC(); if (state.failed) return ;
|
||||
|
||||
}
|
||||
}
|
||||
// $ANTLR end synpred6_InternalBacktrackingLexerTestLanguageLexer
|
||||
|
||||
// $ANTLR start synpred7_InternalBacktrackingLexerTestLanguageLexer
|
||||
public final void synpred7_InternalBacktrackingLexerTestLanguageLexer_fragment() throws RecognitionException {
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:37:2: ( FRAGMENT_RULE_CHARY )
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:37:3: FRAGMENT_RULE_CHARY
|
||||
{
|
||||
mFRAGMENT_RULE_CHARY(); if (state.failed) return ;
|
||||
|
||||
}
|
||||
}
|
||||
// $ANTLR end synpred7_InternalBacktrackingLexerTestLanguageLexer
|
||||
|
||||
// $ANTLR start synpred8_InternalBacktrackingLexerTestLanguageLexer
|
||||
public final void synpred8_InternalBacktrackingLexerTestLanguageLexer_fragment() throws RecognitionException {
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:38:2: ( FRAGMENT_RULE_WS )
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:38:3: FRAGMENT_RULE_WS
|
||||
{
|
||||
mFRAGMENT_RULE_WS(); if (state.failed) return ;
|
||||
|
||||
}
|
||||
}
|
||||
// $ANTLR end synpred8_InternalBacktrackingLexerTestLanguageLexer
|
||||
|
||||
// $ANTLR start synpred9_InternalBacktrackingLexerTestLanguageLexer
|
||||
public final void synpred9_InternalBacktrackingLexerTestLanguageLexer_fragment() throws RecognitionException {
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:39:2: ( FRAGMENT_RULE_SL_COMMENT )
|
||||
// InternalBacktrackingLexerTestLanguageLexer.g:39:3: FRAGMENT_RULE_SL_COMMENT
|
||||
{
|
||||
mFRAGMENT_RULE_SL_COMMENT(); if (state.failed) return ;
|
||||
|
||||
}
|
||||
}
|
||||
// $ANTLR end synpred9_InternalBacktrackingLexerTestLanguageLexer
|
||||
|
||||
public final boolean synpred2_InternalBacktrackingLexerTestLanguageLexer() {
|
||||
state.backtracking++;
|
||||
int start = input.mark();
|
||||
try {
|
||||
synpred2_InternalBacktrackingLexerTestLanguageLexer_fragment(); // can never throw exception
|
||||
} catch (RecognitionException re) {
|
||||
System.err.println("impossible: "+re);
|
||||
}
|
||||
boolean success = !state.failed;
|
||||
input.rewind(start);
|
||||
state.backtracking--;
|
||||
state.failed=false;
|
||||
return success;
|
||||
}
|
||||
public final boolean synpred8_InternalBacktrackingLexerTestLanguageLexer() {
|
||||
state.backtracking++;
|
||||
int start = input.mark();
|
||||
try {
|
||||
synpred8_InternalBacktrackingLexerTestLanguageLexer_fragment(); // can never throw exception
|
||||
} catch (RecognitionException re) {
|
||||
System.err.println("impossible: "+re);
|
||||
}
|
||||
boolean success = !state.failed;
|
||||
input.rewind(start);
|
||||
state.backtracking--;
|
||||
state.failed=false;
|
||||
return success;
|
||||
}
|
||||
public final boolean synpred3_InternalBacktrackingLexerTestLanguageLexer() {
|
||||
state.backtracking++;
|
||||
int start = input.mark();
|
||||
try {
|
||||
synpred3_InternalBacktrackingLexerTestLanguageLexer_fragment(); // can never throw exception
|
||||
} catch (RecognitionException re) {
|
||||
System.err.println("impossible: "+re);
|
||||
}
|
||||
boolean success = !state.failed;
|
||||
input.rewind(start);
|
||||
state.backtracking--;
|
||||
state.failed=false;
|
||||
return success;
|
||||
}
|
||||
public final boolean synpred7_InternalBacktrackingLexerTestLanguageLexer() {
|
||||
state.backtracking++;
|
||||
int start = input.mark();
|
||||
try {
|
||||
synpred7_InternalBacktrackingLexerTestLanguageLexer_fragment(); // can never throw exception
|
||||
} catch (RecognitionException re) {
|
||||
System.err.println("impossible: "+re);
|
||||
}
|
||||
boolean success = !state.failed;
|
||||
input.rewind(start);
|
||||
state.backtracking--;
|
||||
state.failed=false;
|
||||
return success;
|
||||
}
|
||||
public final boolean synpred5_InternalBacktrackingLexerTestLanguageLexer() {
|
||||
state.backtracking++;
|
||||
int start = input.mark();
|
||||
try {
|
||||
synpred5_InternalBacktrackingLexerTestLanguageLexer_fragment(); // can never throw exception
|
||||
} catch (RecognitionException re) {
|
||||
System.err.println("impossible: "+re);
|
||||
}
|
||||
boolean success = !state.failed;
|
||||
input.rewind(start);
|
||||
state.backtracking--;
|
||||
state.failed=false;
|
||||
return success;
|
||||
}
|
||||
public final boolean synpred1_InternalBacktrackingLexerTestLanguageLexer() {
|
||||
state.backtracking++;
|
||||
int start = input.mark();
|
||||
try {
|
||||
synpred1_InternalBacktrackingLexerTestLanguageLexer_fragment(); // can never throw exception
|
||||
} catch (RecognitionException re) {
|
||||
System.err.println("impossible: "+re);
|
||||
}
|
||||
boolean success = !state.failed;
|
||||
input.rewind(start);
|
||||
state.backtracking--;
|
||||
state.failed=false;
|
||||
return success;
|
||||
}
|
||||
public final boolean synpred9_InternalBacktrackingLexerTestLanguageLexer() {
|
||||
state.backtracking++;
|
||||
int start = input.mark();
|
||||
try {
|
||||
synpred9_InternalBacktrackingLexerTestLanguageLexer_fragment(); // can never throw exception
|
||||
} catch (RecognitionException re) {
|
||||
System.err.println("impossible: "+re);
|
||||
}
|
||||
boolean success = !state.failed;
|
||||
input.rewind(start);
|
||||
state.backtracking--;
|
||||
state.failed=false;
|
||||
return success;
|
||||
}
|
||||
public final boolean synpred4_InternalBacktrackingLexerTestLanguageLexer() {
|
||||
state.backtracking++;
|
||||
int start = input.mark();
|
||||
try {
|
||||
synpred4_InternalBacktrackingLexerTestLanguageLexer_fragment(); // can never throw exception
|
||||
} catch (RecognitionException re) {
|
||||
System.err.println("impossible: "+re);
|
||||
}
|
||||
boolean success = !state.failed;
|
||||
input.rewind(start);
|
||||
state.backtracking--;
|
||||
state.failed=false;
|
||||
return success;
|
||||
}
|
||||
public final boolean synpred6_InternalBacktrackingLexerTestLanguageLexer() {
|
||||
state.backtracking++;
|
||||
int start = input.mark();
|
||||
try {
|
||||
synpred6_InternalBacktrackingLexerTestLanguageLexer_fragment(); // can never throw exception
|
||||
} catch (RecognitionException re) {
|
||||
System.err.println("impossible: "+re);
|
||||
}
|
||||
boolean success = !state.failed;
|
||||
input.rewind(start);
|
||||
state.backtracking--;
|
||||
state.failed=false;
|
||||
return success;
|
||||
}
|
||||
|
||||
|
||||
protected DFA1 dfa1 = new DFA1(this);
|
||||
static final String DFA1_eotS =
|
||||
"\1\uffff\1\11\3\uffff\1\12\6\uffff";
|
||||
static final String DFA1_eofS =
|
||||
"\14\uffff";
|
||||
static final String DFA1_minS =
|
||||
"\1\11\1\142\3\uffff\1\143\6\uffff";
|
||||
static final String DFA1_maxS =
|
||||
"\2\142\3\uffff\1\143\6\uffff";
|
||||
static final String DFA1_acceptS =
|
||||
"\2\uffff\1\2\1\4\1\5\1\uffff\1\10\1\11\1\1\1\3\1\7\1\6";
|
||||
static final String DFA1_specialS =
|
||||
"\1\2\1\1\3\uffff\1\0\6\uffff}>";
|
||||
static final String[] DFA1_transitionS = {
|
||||
"\2\6\2\uffff\1\6\22\uffff\1\6\16\uffff\1\7\21\uffff\1\1\3\uffff\1\2\22\uffff\1\4\1\5\10\uffff\1\3",
|
||||
"\1\10",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"\1\13",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
""
|
||||
};
|
||||
|
||||
static final short[] DFA1_eot = DFA.unpackEncodedString(DFA1_eotS);
|
||||
static final short[] DFA1_eof = DFA.unpackEncodedString(DFA1_eofS);
|
||||
static final char[] DFA1_min = DFA.unpackEncodedStringToUnsignedChars(DFA1_minS);
|
||||
static final char[] DFA1_max = DFA.unpackEncodedStringToUnsignedChars(DFA1_maxS);
|
||||
static final short[] DFA1_accept = DFA.unpackEncodedString(DFA1_acceptS);
|
||||
static final short[] DFA1_special = DFA.unpackEncodedString(DFA1_specialS);
|
||||
static final short[][] DFA1_transition;
|
||||
|
||||
static {
|
||||
int numStates = DFA1_transitionS.length;
|
||||
DFA1_transition = new short[numStates][];
|
||||
for (int i=0; i<numStates; i++) {
|
||||
DFA1_transition[i] = DFA.unpackEncodedString(DFA1_transitionS[i]);
|
||||
}
|
||||
}
|
||||
|
||||
class DFA1 extends DFA {
|
||||
|
||||
public DFA1(BaseRecognizer recognizer) {
|
||||
this.recognizer = recognizer;
|
||||
this.decisionNumber = 1;
|
||||
this.eot = DFA1_eot;
|
||||
this.eof = DFA1_eof;
|
||||
this.min = DFA1_min;
|
||||
this.max = DFA1_max;
|
||||
this.accept = DFA1_accept;
|
||||
this.special = DFA1_special;
|
||||
this.transition = DFA1_transition;
|
||||
}
|
||||
public String getDescription() {
|
||||
return "30:1: SYNTHETIC_ALL_KEYWORDS : ( ( FRAGMENT_Abc )=> FRAGMENT_Abc | ( FRAGMENT_Efg )=> FRAGMENT_Efg | ( FRAGMENT_RULE_CHARA )=> FRAGMENT_RULE_CHARA | ( FRAGMENT_RULE_CHARB )=> FRAGMENT_RULE_CHARB | ( FRAGMENT_RULE_CHARX )=> FRAGMENT_RULE_CHARX | ( FRAGMENT_RULE_YC )=> FRAGMENT_RULE_YC | ( FRAGMENT_RULE_CHARY )=> FRAGMENT_RULE_CHARY | ( FRAGMENT_RULE_WS )=> FRAGMENT_RULE_WS | ( FRAGMENT_RULE_SL_COMMENT )=> FRAGMENT_RULE_SL_COMMENT );";
|
||||
}
|
||||
public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
|
||||
IntStream input = _input;
|
||||
int _s = s;
|
||||
switch ( s ) {
|
||||
case 0 :
|
||||
int LA1_5 = input.LA(1);
|
||||
|
||||
|
||||
int index1_5 = input.index();
|
||||
input.rewind();
|
||||
s = -1;
|
||||
if ( (LA1_5=='c') && (synpred6_InternalBacktrackingLexerTestLanguageLexer())) {s = 11;}
|
||||
|
||||
else s = 10;
|
||||
|
||||
|
||||
input.seek(index1_5);
|
||||
if ( s>=0 ) return s;
|
||||
break;
|
||||
case 1 :
|
||||
int LA1_1 = input.LA(1);
|
||||
|
||||
|
||||
int index1_1 = input.index();
|
||||
input.rewind();
|
||||
s = -1;
|
||||
if ( (LA1_1=='b') && (synpred1_InternalBacktrackingLexerTestLanguageLexer())) {s = 8;}
|
||||
|
||||
else s = 9;
|
||||
|
||||
|
||||
input.seek(index1_1);
|
||||
if ( s>=0 ) return s;
|
||||
break;
|
||||
case 2 :
|
||||
int LA1_0 = input.LA(1);
|
||||
|
||||
|
||||
int index1_0 = input.index();
|
||||
input.rewind();
|
||||
s = -1;
|
||||
if ( (LA1_0=='A') ) {s = 1;}
|
||||
|
||||
else if ( (LA1_0=='E') && (synpred2_InternalBacktrackingLexerTestLanguageLexer())) {s = 2;}
|
||||
|
||||
else if ( (LA1_0=='b') && (synpred4_InternalBacktrackingLexerTestLanguageLexer())) {s = 3;}
|
||||
|
||||
else if ( (LA1_0=='X') && (synpred5_InternalBacktrackingLexerTestLanguageLexer())) {s = 4;}
|
||||
|
||||
else if ( (LA1_0=='Y') ) {s = 5;}
|
||||
|
||||
else if ( ((LA1_0>='\t' && LA1_0<='\n')||LA1_0=='\r'||LA1_0==' ') && (synpred8_InternalBacktrackingLexerTestLanguageLexer())) {s = 6;}
|
||||
|
||||
else if ( (LA1_0=='/') && (synpred9_InternalBacktrackingLexerTestLanguageLexer())) {s = 7;}
|
||||
|
||||
|
||||
input.seek(index1_0);
|
||||
if ( s>=0 ) return s;
|
||||
break;
|
||||
}
|
||||
if (state.backtracking>0) {state.failed=true; return -1;}
|
||||
NoViableAltException nvae =
|
||||
new NoViableAltException(getDescription(), 1, _s, input);
|
||||
error(nvae);
|
||||
throw nvae;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
Abc=4
|
||||
Efg=5
|
||||
RULE_CHARA=6
|
||||
RULE_CHARB=7
|
||||
RULE_CHARC=11
|
||||
RULE_CHARX=8
|
||||
RULE_CHARY=10
|
||||
RULE_SL_COMMENT=13
|
||||
RULE_WS=12
|
||||
RULE_YC=9
|
|
@ -0,0 +1,110 @@
|
|||
/*
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.lexer.serializer;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import java.util.Set;
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
import org.eclipse.emf.ecore.EPackage;
|
||||
import org.eclipse.xtext.Action;
|
||||
import org.eclipse.xtext.Parameter;
|
||||
import org.eclipse.xtext.ParserRule;
|
||||
import org.eclipse.xtext.lexer.backtrackingTestLanguage.Ab;
|
||||
import org.eclipse.xtext.lexer.backtrackingTestLanguage.BacktrackingTestLanguagePackage;
|
||||
import org.eclipse.xtext.lexer.backtrackingTestLanguage.Model;
|
||||
import org.eclipse.xtext.lexer.backtrackingTestLanguage.Xb;
|
||||
import org.eclipse.xtext.lexer.services.BacktrackingLexerTestLanguageGrammarAccess;
|
||||
import org.eclipse.xtext.serializer.ISerializationContext;
|
||||
import org.eclipse.xtext.serializer.acceptor.SequenceFeeder;
|
||||
import org.eclipse.xtext.serializer.sequencer.AbstractDelegatingSemanticSequencer;
|
||||
import org.eclipse.xtext.serializer.sequencer.ITransientValueService.ValueTransient;
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public class BacktrackingLexerTestLanguageSemanticSequencer extends AbstractDelegatingSemanticSequencer {
|
||||
|
||||
@Inject
|
||||
private BacktrackingLexerTestLanguageGrammarAccess grammarAccess;
|
||||
|
||||
@Override
|
||||
public void sequence(ISerializationContext context, EObject semanticObject) {
|
||||
EPackage epackage = semanticObject.eClass().getEPackage();
|
||||
ParserRule rule = context.getParserRule();
|
||||
Action action = context.getAssignedAction();
|
||||
Set<Parameter> parameters = context.getEnabledBooleanParameters();
|
||||
if (epackage == BacktrackingTestLanguagePackage.eINSTANCE)
|
||||
switch (semanticObject.eClass().getClassifierID()) {
|
||||
case BacktrackingTestLanguagePackage.AB:
|
||||
sequence_Ab(context, (Ab) semanticObject);
|
||||
return;
|
||||
case BacktrackingTestLanguagePackage.MODEL:
|
||||
sequence_Model(context, (Model) semanticObject);
|
||||
return;
|
||||
case BacktrackingTestLanguagePackage.XB:
|
||||
sequence_Xb(context, (Xb) semanticObject);
|
||||
return;
|
||||
}
|
||||
if (errorAcceptor != null)
|
||||
errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
|
||||
}
|
||||
|
||||
/**
|
||||
* Contexts:
|
||||
* Ab returns Ab
|
||||
*
|
||||
* Constraint:
|
||||
* (x=CharA y=Charb)
|
||||
*/
|
||||
protected void sequence_Ab(ISerializationContext context, Ab semanticObject) {
|
||||
if (errorAcceptor != null) {
|
||||
if (transientValues.isValueTransient(semanticObject, BacktrackingTestLanguagePackage.Literals.AB__X) == ValueTransient.YES)
|
||||
errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, BacktrackingTestLanguagePackage.Literals.AB__X));
|
||||
if (transientValues.isValueTransient(semanticObject, BacktrackingTestLanguagePackage.Literals.AB__Y) == ValueTransient.YES)
|
||||
errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, BacktrackingTestLanguagePackage.Literals.AB__Y));
|
||||
}
|
||||
SequenceFeeder feeder = createSequencerFeeder(context, semanticObject);
|
||||
feeder.accept(grammarAccess.getAbAccess().getXCharATerminalRuleCall_0_0(), semanticObject.getX());
|
||||
feeder.accept(grammarAccess.getAbAccess().getYCharbTerminalRuleCall_1_0(), semanticObject.getY());
|
||||
feeder.finish();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Contexts:
|
||||
* Model returns Model
|
||||
*
|
||||
* Constraint:
|
||||
* (
|
||||
* (enums+=EnumName+ ycs+=Yc+ abs+=Ab+ xbs+=Xb+ ((ys+=CharY+ as+=CharA+) | as+=CharA+)?) |
|
||||
* (((enums+=EnumName+ abs+=Ab+) | (enums+=EnumName+ ycs+=Yc+ abs+=Ab+) | abs+=Ab+)? ys+=CharY+ as+=CharA+) |
|
||||
* enums+=EnumName+ |
|
||||
* (enums+=EnumName+ (ycs+=Yc+ | (ycs+=Yc+ (abs+=Ab+ | (abs+=Ab+ as+=CharA+))))?)
|
||||
* )?
|
||||
*/
|
||||
protected void sequence_Model(ISerializationContext context, Model semanticObject) {
|
||||
genericSequencer.createSequence(context, semanticObject);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Contexts:
|
||||
* Xb returns Xb
|
||||
*
|
||||
* Constraint:
|
||||
* (x=CharX y=Charb)
|
||||
*/
|
||||
protected void sequence_Xb(ISerializationContext context, Xb semanticObject) {
|
||||
if (errorAcceptor != null) {
|
||||
if (transientValues.isValueTransient(semanticObject, BacktrackingTestLanguagePackage.Literals.XB__X) == ValueTransient.YES)
|
||||
errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, BacktrackingTestLanguagePackage.Literals.XB__X));
|
||||
if (transientValues.isValueTransient(semanticObject, BacktrackingTestLanguagePackage.Literals.XB__Y) == ValueTransient.YES)
|
||||
errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, BacktrackingTestLanguagePackage.Literals.XB__Y));
|
||||
}
|
||||
SequenceFeeder feeder = createSequencerFeeder(context, semanticObject);
|
||||
feeder.accept(grammarAccess.getXbAccess().getXCharXTerminalRuleCall_0_0(), semanticObject.getX());
|
||||
feeder.accept(grammarAccess.getXbAccess().getYCharbTerminalRuleCall_1_0(), semanticObject.getY());
|
||||
feeder.finish();
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.lexer.serializer;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import java.util.List;
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
import org.eclipse.xtext.IGrammarAccess;
|
||||
import org.eclipse.xtext.RuleCall;
|
||||
import org.eclipse.xtext.lexer.services.BacktrackingLexerTestLanguageGrammarAccess;
|
||||
import org.eclipse.xtext.nodemodel.INode;
|
||||
import org.eclipse.xtext.serializer.analysis.GrammarAlias.AbstractElementAlias;
|
||||
import org.eclipse.xtext.serializer.analysis.ISyntacticSequencerPDAProvider.ISynTransition;
|
||||
import org.eclipse.xtext.serializer.sequencer.AbstractSyntacticSequencer;
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public class BacktrackingLexerTestLanguageSyntacticSequencer extends AbstractSyntacticSequencer {
|
||||
|
||||
protected BacktrackingLexerTestLanguageGrammarAccess grammarAccess;
|
||||
|
||||
@Inject
|
||||
protected void init(IGrammarAccess access) {
|
||||
grammarAccess = (BacktrackingLexerTestLanguageGrammarAccess) access;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getUnassignedRuleCallToken(EObject semanticObject, RuleCall ruleCall, INode node) {
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void emitUnassignedTokens(EObject semanticObject, ISynTransition transition, INode fromNode, INode toNode) {
|
||||
if (transition.getAmbiguousSyntaxes().isEmpty()) return;
|
||||
List<INode> transitionNodes = collectNodes(fromNode, toNode);
|
||||
for (AbstractElementAlias syntax : transition.getAmbiguousSyntaxes()) {
|
||||
List<INode> syntaxNodes = getNodesFor(transitionNodes, syntax);
|
||||
acceptNodes(getLastNavigableState(), syntaxNodes);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,321 @@
|
|||
/*
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.lexer.services;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import com.google.inject.Singleton;
|
||||
import java.util.List;
|
||||
import org.eclipse.xtext.Alternatives;
|
||||
import org.eclipse.xtext.Assignment;
|
||||
import org.eclipse.xtext.EnumLiteralDeclaration;
|
||||
import org.eclipse.xtext.EnumRule;
|
||||
import org.eclipse.xtext.Grammar;
|
||||
import org.eclipse.xtext.GrammarUtil;
|
||||
import org.eclipse.xtext.Group;
|
||||
import org.eclipse.xtext.Keyword;
|
||||
import org.eclipse.xtext.ParserRule;
|
||||
import org.eclipse.xtext.RuleCall;
|
||||
import org.eclipse.xtext.TerminalRule;
|
||||
import org.eclipse.xtext.service.AbstractElementFinder.AbstractEnumRuleElementFinder;
|
||||
import org.eclipse.xtext.service.AbstractElementFinder.AbstractGrammarElementFinder;
|
||||
import org.eclipse.xtext.service.GrammarProvider;
|
||||
|
||||
@Singleton
|
||||
public class BacktrackingLexerTestLanguageGrammarAccess extends AbstractGrammarElementFinder {
|
||||
|
||||
public class ModelElements extends AbstractParserRuleElementFinder {
|
||||
private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.lexer.BacktrackingLexerTestLanguage.Model");
|
||||
private final Group cGroup = (Group)rule.eContents().get(1);
|
||||
private final Assignment cEnumsAssignment_0 = (Assignment)cGroup.eContents().get(0);
|
||||
private final RuleCall cEnumsEnumNameEnumRuleCall_0_0 = (RuleCall)cEnumsAssignment_0.eContents().get(0);
|
||||
private final Assignment cYcsAssignment_1 = (Assignment)cGroup.eContents().get(1);
|
||||
private final RuleCall cYcsYcTerminalRuleCall_1_0 = (RuleCall)cYcsAssignment_1.eContents().get(0);
|
||||
private final Assignment cAbsAssignment_2 = (Assignment)cGroup.eContents().get(2);
|
||||
private final RuleCall cAbsAbParserRuleCall_2_0 = (RuleCall)cAbsAssignment_2.eContents().get(0);
|
||||
private final Assignment cXbsAssignment_3 = (Assignment)cGroup.eContents().get(3);
|
||||
private final RuleCall cXbsXbParserRuleCall_3_0 = (RuleCall)cXbsAssignment_3.eContents().get(0);
|
||||
private final Assignment cYsAssignment_4 = (Assignment)cGroup.eContents().get(4);
|
||||
private final RuleCall cYsCharYTerminalRuleCall_4_0 = (RuleCall)cYsAssignment_4.eContents().get(0);
|
||||
private final Assignment cAsAssignment_5 = (Assignment)cGroup.eContents().get(5);
|
||||
private final RuleCall cAsCharATerminalRuleCall_5_0 = (RuleCall)cAsAssignment_5.eContents().get(0);
|
||||
|
||||
//Model:
|
||||
// enums+=EnumName*
|
||||
// ycs+=Yc*
|
||||
// abs+=Ab*
|
||||
// xbs+=Xb*
|
||||
// ys+=CharY*
|
||||
// ^as+=CharA*;
|
||||
@Override public ParserRule getRule() { return rule; }
|
||||
|
||||
//enums+=EnumName* ycs+=Yc* abs+=Ab* xbs+=Xb* ys+=CharY* ^as+=CharA*
|
||||
public Group getGroup() { return cGroup; }
|
||||
|
||||
//enums+=EnumName*
|
||||
public Assignment getEnumsAssignment_0() { return cEnumsAssignment_0; }
|
||||
|
||||
//EnumName
|
||||
public RuleCall getEnumsEnumNameEnumRuleCall_0_0() { return cEnumsEnumNameEnumRuleCall_0_0; }
|
||||
|
||||
//ycs+=Yc*
|
||||
public Assignment getYcsAssignment_1() { return cYcsAssignment_1; }
|
||||
|
||||
//Yc
|
||||
public RuleCall getYcsYcTerminalRuleCall_1_0() { return cYcsYcTerminalRuleCall_1_0; }
|
||||
|
||||
//abs+=Ab*
|
||||
public Assignment getAbsAssignment_2() { return cAbsAssignment_2; }
|
||||
|
||||
//Ab
|
||||
public RuleCall getAbsAbParserRuleCall_2_0() { return cAbsAbParserRuleCall_2_0; }
|
||||
|
||||
//xbs+=Xb*
|
||||
public Assignment getXbsAssignment_3() { return cXbsAssignment_3; }
|
||||
|
||||
//Xb
|
||||
public RuleCall getXbsXbParserRuleCall_3_0() { return cXbsXbParserRuleCall_3_0; }
|
||||
|
||||
//ys+=CharY*
|
||||
public Assignment getYsAssignment_4() { return cYsAssignment_4; }
|
||||
|
||||
//CharY
|
||||
public RuleCall getYsCharYTerminalRuleCall_4_0() { return cYsCharYTerminalRuleCall_4_0; }
|
||||
|
||||
//^as+=CharA*
|
||||
public Assignment getAsAssignment_5() { return cAsAssignment_5; }
|
||||
|
||||
//CharA
|
||||
public RuleCall getAsCharATerminalRuleCall_5_0() { return cAsCharATerminalRuleCall_5_0; }
|
||||
}
|
||||
public class AbElements extends AbstractParserRuleElementFinder {
|
||||
private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.lexer.BacktrackingLexerTestLanguage.Ab");
|
||||
private final Group cGroup = (Group)rule.eContents().get(1);
|
||||
private final Assignment cXAssignment_0 = (Assignment)cGroup.eContents().get(0);
|
||||
private final RuleCall cXCharATerminalRuleCall_0_0 = (RuleCall)cXAssignment_0.eContents().get(0);
|
||||
private final Assignment cYAssignment_1 = (Assignment)cGroup.eContents().get(1);
|
||||
private final RuleCall cYCharbTerminalRuleCall_1_0 = (RuleCall)cYAssignment_1.eContents().get(0);
|
||||
|
||||
//Ab:
|
||||
// x=CharA y=Charb;
|
||||
@Override public ParserRule getRule() { return rule; }
|
||||
|
||||
//x=CharA y=Charb
|
||||
public Group getGroup() { return cGroup; }
|
||||
|
||||
//x=CharA
|
||||
public Assignment getXAssignment_0() { return cXAssignment_0; }
|
||||
|
||||
//CharA
|
||||
public RuleCall getXCharATerminalRuleCall_0_0() { return cXCharATerminalRuleCall_0_0; }
|
||||
|
||||
//y=Charb
|
||||
public Assignment getYAssignment_1() { return cYAssignment_1; }
|
||||
|
||||
//Charb
|
||||
public RuleCall getYCharbTerminalRuleCall_1_0() { return cYCharbTerminalRuleCall_1_0; }
|
||||
}
|
||||
public class XbElements extends AbstractParserRuleElementFinder {
|
||||
private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.lexer.BacktrackingLexerTestLanguage.Xb");
|
||||
private final Group cGroup = (Group)rule.eContents().get(1);
|
||||
private final Assignment cXAssignment_0 = (Assignment)cGroup.eContents().get(0);
|
||||
private final RuleCall cXCharXTerminalRuleCall_0_0 = (RuleCall)cXAssignment_0.eContents().get(0);
|
||||
private final Assignment cYAssignment_1 = (Assignment)cGroup.eContents().get(1);
|
||||
private final RuleCall cYCharbTerminalRuleCall_1_0 = (RuleCall)cYAssignment_1.eContents().get(0);
|
||||
|
||||
//Xb:
|
||||
// x=CharX y=Charb;
|
||||
@Override public ParserRule getRule() { return rule; }
|
||||
|
||||
//x=CharX y=Charb
|
||||
public Group getGroup() { return cGroup; }
|
||||
|
||||
//x=CharX
|
||||
public Assignment getXAssignment_0() { return cXAssignment_0; }
|
||||
|
||||
//CharX
|
||||
public RuleCall getXCharXTerminalRuleCall_0_0() { return cXCharXTerminalRuleCall_0_0; }
|
||||
|
||||
//y=Charb
|
||||
public Assignment getYAssignment_1() { return cYAssignment_1; }
|
||||
|
||||
//Charb
|
||||
public RuleCall getYCharbTerminalRuleCall_1_0() { return cYCharbTerminalRuleCall_1_0; }
|
||||
}
|
||||
|
||||
public class EnumNameElements extends AbstractEnumRuleElementFinder {
|
||||
private final EnumRule rule = (EnumRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.lexer.BacktrackingLexerTestLanguage.EnumName");
|
||||
private final Alternatives cAlternatives = (Alternatives)rule.eContents().get(1);
|
||||
private final EnumLiteralDeclaration cAbcEnumLiteralDeclaration_0 = (EnumLiteralDeclaration)cAlternatives.eContents().get(0);
|
||||
private final Keyword cAbcAbcKeyword_0_0 = (Keyword)cAbcEnumLiteralDeclaration_0.eContents().get(0);
|
||||
private final EnumLiteralDeclaration cEfgEnumLiteralDeclaration_1 = (EnumLiteralDeclaration)cAlternatives.eContents().get(1);
|
||||
private final Keyword cEfgEfgKeyword_1_0 = (Keyword)cEfgEnumLiteralDeclaration_1.eContents().get(0);
|
||||
|
||||
//enum EnumName:
|
||||
// abc='Abc' | efg="Efg";
|
||||
public EnumRule getRule() { return rule; }
|
||||
|
||||
//abc='Abc' | efg="Efg"
|
||||
public Alternatives getAlternatives() { return cAlternatives; }
|
||||
|
||||
//abc='Abc'
|
||||
public EnumLiteralDeclaration getAbcEnumLiteralDeclaration_0() { return cAbcEnumLiteralDeclaration_0; }
|
||||
|
||||
//'Abc'
|
||||
public Keyword getAbcAbcKeyword_0_0() { return cAbcAbcKeyword_0_0; }
|
||||
|
||||
//efg="Efg"
|
||||
public EnumLiteralDeclaration getEfgEnumLiteralDeclaration_1() { return cEfgEnumLiteralDeclaration_1; }
|
||||
|
||||
//"Efg"
|
||||
public Keyword getEfgEfgKeyword_1_0() { return cEfgEfgKeyword_1_0; }
|
||||
}
|
||||
|
||||
private final ModelElements pModel;
|
||||
private final AbElements pAb;
|
||||
private final XbElements pXb;
|
||||
private final TerminalRule tCharA;
|
||||
private final TerminalRule tCharb;
|
||||
private final TerminalRule tCharX;
|
||||
private final TerminalRule tYc;
|
||||
private final TerminalRule tCharY;
|
||||
private final TerminalRule tCharC;
|
||||
private final EnumNameElements eEnumName;
|
||||
private final TerminalRule tWS;
|
||||
private final TerminalRule tSL_COMMENT;
|
||||
|
||||
private final Grammar grammar;
|
||||
|
||||
@Inject
|
||||
public BacktrackingLexerTestLanguageGrammarAccess(GrammarProvider grammarProvider) {
|
||||
this.grammar = internalFindGrammar(grammarProvider);
|
||||
this.pModel = new ModelElements();
|
||||
this.pAb = new AbElements();
|
||||
this.pXb = new XbElements();
|
||||
this.tCharA = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.lexer.BacktrackingLexerTestLanguage.CharA");
|
||||
this.tCharb = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.lexer.BacktrackingLexerTestLanguage.Charb");
|
||||
this.tCharX = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.lexer.BacktrackingLexerTestLanguage.CharX");
|
||||
this.tYc = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.lexer.BacktrackingLexerTestLanguage.Yc");
|
||||
this.tCharY = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.lexer.BacktrackingLexerTestLanguage.CharY");
|
||||
this.tCharC = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.lexer.BacktrackingLexerTestLanguage.CharC");
|
||||
this.eEnumName = new EnumNameElements();
|
||||
this.tWS = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.lexer.BacktrackingLexerTestLanguage.WS");
|
||||
this.tSL_COMMENT = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.lexer.BacktrackingLexerTestLanguage.SL_COMMENT");
|
||||
}
|
||||
|
||||
protected Grammar internalFindGrammar(GrammarProvider grammarProvider) {
|
||||
Grammar grammar = grammarProvider.getGrammar(this);
|
||||
while (grammar != null) {
|
||||
if ("org.eclipse.xtext.lexer.BacktrackingLexerTestLanguage".equals(grammar.getName())) {
|
||||
return grammar;
|
||||
}
|
||||
List<Grammar> grammars = grammar.getUsedGrammars();
|
||||
if (!grammars.isEmpty()) {
|
||||
grammar = grammars.iterator().next();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return grammar;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Grammar getGrammar() {
|
||||
return grammar;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//Model:
|
||||
// enums+=EnumName*
|
||||
// ycs+=Yc*
|
||||
// abs+=Ab*
|
||||
// xbs+=Xb*
|
||||
// ys+=CharY*
|
||||
// ^as+=CharA*;
|
||||
public ModelElements getModelAccess() {
|
||||
return pModel;
|
||||
}
|
||||
|
||||
public ParserRule getModelRule() {
|
||||
return getModelAccess().getRule();
|
||||
}
|
||||
|
||||
//Ab:
|
||||
// x=CharA y=Charb;
|
||||
public AbElements getAbAccess() {
|
||||
return pAb;
|
||||
}
|
||||
|
||||
public ParserRule getAbRule() {
|
||||
return getAbAccess().getRule();
|
||||
}
|
||||
|
||||
//Xb:
|
||||
// x=CharX y=Charb;
|
||||
public XbElements getXbAccess() {
|
||||
return pXb;
|
||||
}
|
||||
|
||||
public ParserRule getXbRule() {
|
||||
return getXbAccess().getRule();
|
||||
}
|
||||
|
||||
//terminal CharA:
|
||||
// 'A';
|
||||
public TerminalRule getCharARule() {
|
||||
return tCharA;
|
||||
}
|
||||
|
||||
//terminal Charb:
|
||||
// 'b';
|
||||
public TerminalRule getCharbRule() {
|
||||
return tCharb;
|
||||
}
|
||||
|
||||
//terminal CharX:
|
||||
// 'X';
|
||||
public TerminalRule getCharXRule() {
|
||||
return tCharX;
|
||||
}
|
||||
|
||||
//terminal Yc:
|
||||
// CharY CharC;
|
||||
public TerminalRule getYcRule() {
|
||||
return tYc;
|
||||
}
|
||||
|
||||
//terminal CharY:
|
||||
// 'Y';
|
||||
public TerminalRule getCharYRule() {
|
||||
return tCharY;
|
||||
}
|
||||
|
||||
//terminal CharC:
|
||||
// 'c';
|
||||
public TerminalRule getCharCRule() {
|
||||
return tCharC;
|
||||
}
|
||||
|
||||
//enum EnumName:
|
||||
// abc='Abc' | efg="Efg";
|
||||
public EnumNameElements getEnumNameAccess() {
|
||||
return eEnumName;
|
||||
}
|
||||
|
||||
public EnumRule getEnumNameRule() {
|
||||
return getEnumNameAccess().getRule();
|
||||
}
|
||||
|
||||
//terminal WS:
|
||||
// ' ' | '\t' | '\r' | '\n'+;
|
||||
public TerminalRule getWSRule() {
|
||||
return tWS;
|
||||
}
|
||||
|
||||
//terminal SL_COMMENT:
|
||||
// '//' !('\n' | '\r')* ('\r'? '\n')?;
|
||||
public TerminalRule getSL_COMMENTRule() {
|
||||
return tSL_COMMENT;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue