mirror of
https://github.com/sigmasternchen/xtext-core
synced 2025-03-15 08:18:55 +00:00
Merge pull request #1411 from eclipse/cd_xtend_issue1018
fixed getEntryParserRule with actions [eclipse/xtext-xtend#1018]
This commit is contained in:
commit
f7650e0bbc
43 changed files with 5414 additions and 27 deletions
|
@ -424,6 +424,9 @@ Export-Package: org.eclipse.xtext,
|
|||
org.eclipse.xtext.testlanguages.actionLang2,
|
||||
org.eclipse.xtext.testlanguages.actionLang2.impl,
|
||||
org.eclipse.xtext.testlanguages.actionLang2.util,
|
||||
org.eclipse.xtext.testlanguages.actionLang3,
|
||||
org.eclipse.xtext.testlanguages.actionLang3.impl,
|
||||
org.eclipse.xtext.testlanguages.actionLang3.util,
|
||||
org.eclipse.xtext.testlanguages.fowlerdsl,
|
||||
org.eclipse.xtext.testlanguages.fowlerdsl.impl,
|
||||
org.eclipse.xtext.testlanguages.fowlerdsl.util,
|
||||
|
|
|
@ -0,0 +1,118 @@
|
|||
/*
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages;
|
||||
|
||||
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.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;
|
||||
import org.eclipse.xtext.testlanguages.parser.antlr.ActionTestLanguage3AntlrTokenFileProvider;
|
||||
import org.eclipse.xtext.testlanguages.parser.antlr.ActionTestLanguage3Parser;
|
||||
import org.eclipse.xtext.testlanguages.parser.antlr.internal.InternalActionTestLanguage3Lexer;
|
||||
import org.eclipse.xtext.testlanguages.serializer.ActionTestLanguage3SemanticSequencer;
|
||||
import org.eclipse.xtext.testlanguages.serializer.ActionTestLanguage3SyntacticSequencer;
|
||||
import org.eclipse.xtext.testlanguages.services.ActionTestLanguage3GrammarAccess;
|
||||
|
||||
/**
|
||||
* Manual modifications go to {@link ActionTestLanguage3RuntimeModule}.
|
||||
*/
|
||||
@SuppressWarnings("all")
|
||||
public abstract class AbstractActionTestLanguage3RuntimeModule extends DefaultRuntimeModule {
|
||||
|
||||
protected Properties properties = null;
|
||||
|
||||
@Override
|
||||
public void configure(Binder binder) {
|
||||
properties = tryBindProperties(binder, "org/eclipse/xtext/testlanguages/ActionTestLanguage3.properties");
|
||||
super.configure(binder);
|
||||
}
|
||||
|
||||
public void configureLanguageName(Binder binder) {
|
||||
binder.bind(String.class).annotatedWith(Names.named(Constants.LANGUAGE_NAME)).toInstance("org.eclipse.xtext.testlanguages.ActionTestLanguage3");
|
||||
}
|
||||
|
||||
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("actiontestlanguage3");
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2
|
||||
public Class<? extends IParser> bindIParser() {
|
||||
return ActionTestLanguage3Parser.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 ActionTestLanguage3AntlrTokenFileProvider.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2
|
||||
public Class<? extends Lexer> bindLexer() {
|
||||
return InternalActionTestLanguage3Lexer.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<? extends InternalActionTestLanguage3Lexer> provideInternalActionTestLanguage3Lexer() {
|
||||
return LexerProvider.create(InternalActionTestLanguage3Lexer.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(InternalActionTestLanguage3Lexer.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 ActionTestLanguage3GrammarAccess.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.serializer.SerializerFragment2
|
||||
public Class<? extends ISemanticSequencer> bindISemanticSequencer() {
|
||||
return ActionTestLanguage3SemanticSequencer.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.serializer.SerializerFragment2
|
||||
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
|
||||
return ActionTestLanguage3SyntacticSequencer.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.serializer.SerializerFragment2
|
||||
public Class<? extends ISerializer> bindISerializer() {
|
||||
return Serializer.class;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
<?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="actionLang3" nsURI="http://www.eclipse.org/2008/tmf/xtext/ActionLang3"
|
||||
nsPrefix="actionLang3">
|
||||
<eClassifiers xsi:type="ecore:EClass" name="ProductionRules"/>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="ProductionRule1" eSuperTypes="#//ProductionRules"/>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="ProductionRule2" eSuperTypes="#//ProductionRules"/>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="P1" eSuperTypes="#//ProductionRule1">
|
||||
<eStructuralFeatures xsi:type="ecore:EAttribute" name="id" eType="ecore:EDataType platform:/resource/org.eclipse.emf.ecore/model/Ecore.ecore#//EString"/>
|
||||
</eClassifiers>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="P2" eSuperTypes="#//ProductionRule1">
|
||||
<eStructuralFeatures xsi:type="ecore:EReference" name="p" eType="#//P1" containment="true"/>
|
||||
<eStructuralFeatures xsi:type="ecore:EAttribute" name="string" eType="ecore:EDataType platform:/resource/org.eclipse.emf.ecore/model/Ecore.ecore#//EString"/>
|
||||
</eClassifiers>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="P3" eSuperTypes="#//ProductionRule1">
|
||||
<eStructuralFeatures xsi:type="ecore:EReference" name="p" eType="#//P2" containment="true"/>
|
||||
<eStructuralFeatures xsi:type="ecore:EAttribute" name="i" eType="ecore:EDataType platform:/resource/org.eclipse.emf.ecore/model/Ecore.ecore#//EInt"/>
|
||||
</eClassifiers>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="Entry" eSuperTypes="#//ProductionRule2">
|
||||
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType platform:/resource/org.eclipse.emf.ecore/model/Ecore.ecore#//EString"/>
|
||||
</eClassifiers>
|
||||
</ecore:EPackage>
|
|
@ -0,0 +1,27 @@
|
|||
<?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-gen"
|
||||
modelPluginID="org.eclipse.xtext.tests" forceOverwrite="true" modelName="ActionTestLanguage3"
|
||||
updateClasspath="false" rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container"
|
||||
complianceLevel="8.0" copyrightFields="false" runtimeVersion="2.20" usedGenPackages="platform:/resource/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore">
|
||||
<genPackages prefix="ActionLang3" basePackage="org.eclipse.xtext.testlanguages"
|
||||
disposableProviderFactory="true" fileExtensions="actiontestlanguage3" ecorePackage="ActionTestLanguage3.ecore#/">
|
||||
<genClasses ecoreClass="ActionTestLanguage3.ecore#//ProductionRules"/>
|
||||
<genClasses ecoreClass="ActionTestLanguage3.ecore#//ProductionRule1"/>
|
||||
<genClasses ecoreClass="ActionTestLanguage3.ecore#//ProductionRule2"/>
|
||||
<genClasses ecoreClass="ActionTestLanguage3.ecore#//P1">
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute ActionTestLanguage3.ecore#//P1/id"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="ActionTestLanguage3.ecore#//P2">
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference ActionTestLanguage3.ecore#//P2/p"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute ActionTestLanguage3.ecore#//P2/string"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="ActionTestLanguage3.ecore#//P3">
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference ActionTestLanguage3.ecore#//P3/p"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute ActionTestLanguage3.ecore#//P3/i"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="ActionTestLanguage3.ecore#//Entry">
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute ActionTestLanguage3.ecore#//Entry/name"/>
|
||||
</genClasses>
|
||||
</genPackages>
|
||||
</genmodel:GenModel>
|
Binary file not shown.
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages;
|
||||
|
||||
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.xtext.ISetup;
|
||||
import org.eclipse.xtext.common.TerminalsStandaloneSetup;
|
||||
import org.eclipse.xtext.resource.IResourceFactory;
|
||||
import org.eclipse.xtext.resource.IResourceServiceProvider;
|
||||
import org.eclipse.xtext.testlanguages.actionLang3.ActionLang3Package;
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public class ActionTestLanguage3StandaloneSetupGenerated implements ISetup {
|
||||
|
||||
@Override
|
||||
public Injector createInjectorAndDoEMFRegistration() {
|
||||
TerminalsStandaloneSetup.doSetup();
|
||||
|
||||
Injector injector = createInjector();
|
||||
register(injector);
|
||||
return injector;
|
||||
}
|
||||
|
||||
public Injector createInjector() {
|
||||
return Guice.createInjector(new ActionTestLanguage3RuntimeModule());
|
||||
}
|
||||
|
||||
public void register(Injector injector) {
|
||||
IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class);
|
||||
IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class);
|
||||
|
||||
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("actiontestlanguage3", resourceFactory);
|
||||
IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("actiontestlanguage3", serviceProvider);
|
||||
if (!EPackage.Registry.INSTANCE.containsKey("http://www.eclipse.org/2008/tmf/xtext/ActionLang3")) {
|
||||
EPackage.Registry.INSTANCE.put("http://www.eclipse.org/2008/tmf/xtext/ActionLang3", ActionLang3Package.eINSTANCE);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,98 @@
|
|||
/**
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages.actionLang3;
|
||||
|
||||
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.testlanguages.actionLang3.ActionLang3Package
|
||||
* @generated
|
||||
*/
|
||||
public interface ActionLang3Factory extends EFactory
|
||||
{
|
||||
/**
|
||||
* The singleton instance of the factory.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
ActionLang3Factory eINSTANCE = org.eclipse.xtext.testlanguages.actionLang3.impl.ActionLang3FactoryImpl.init();
|
||||
|
||||
/**
|
||||
* Returns a new object of class '<em>Production Rules</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return a new object of class '<em>Production Rules</em>'.
|
||||
* @generated
|
||||
*/
|
||||
ProductionRules createProductionRules();
|
||||
|
||||
/**
|
||||
* Returns a new object of class '<em>Production Rule1</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return a new object of class '<em>Production Rule1</em>'.
|
||||
* @generated
|
||||
*/
|
||||
ProductionRule1 createProductionRule1();
|
||||
|
||||
/**
|
||||
* Returns a new object of class '<em>Production Rule2</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return a new object of class '<em>Production Rule2</em>'.
|
||||
* @generated
|
||||
*/
|
||||
ProductionRule2 createProductionRule2();
|
||||
|
||||
/**
|
||||
* Returns a new object of class '<em>P1</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return a new object of class '<em>P1</em>'.
|
||||
* @generated
|
||||
*/
|
||||
P1 createP1();
|
||||
|
||||
/**
|
||||
* Returns a new object of class '<em>P2</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return a new object of class '<em>P2</em>'.
|
||||
* @generated
|
||||
*/
|
||||
P2 createP2();
|
||||
|
||||
/**
|
||||
* Returns a new object of class '<em>P3</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return a new object of class '<em>P3</em>'.
|
||||
* @generated
|
||||
*/
|
||||
P3 createP3();
|
||||
|
||||
/**
|
||||
* Returns a new object of class '<em>Entry</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return a new object of class '<em>Entry</em>'.
|
||||
* @generated
|
||||
*/
|
||||
Entry createEntry();
|
||||
|
||||
/**
|
||||
* Returns the package supported by this factory.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the package supported by this factory.
|
||||
* @generated
|
||||
*/
|
||||
ActionLang3Package getActionLang3Package();
|
||||
|
||||
} //ActionLang3Factory
|
|
@ -0,0 +1,527 @@
|
|||
/**
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages.actionLang3;
|
||||
|
||||
import org.eclipse.emf.ecore.EAttribute;
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
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.testlanguages.actionLang3.ActionLang3Factory
|
||||
* @model kind="package"
|
||||
* @generated
|
||||
*/
|
||||
public interface ActionLang3Package extends EPackage
|
||||
{
|
||||
/**
|
||||
* The package name.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
String eNAME = "actionLang3";
|
||||
|
||||
/**
|
||||
* The package namespace URI.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
String eNS_URI = "http://www.eclipse.org/2008/tmf/xtext/ActionLang3";
|
||||
|
||||
/**
|
||||
* The package namespace name.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
String eNS_PREFIX = "actionLang3";
|
||||
|
||||
/**
|
||||
* The singleton instance of the package.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
ActionLang3Package eINSTANCE = org.eclipse.xtext.testlanguages.actionLang3.impl.ActionLang3PackageImpl.init();
|
||||
|
||||
/**
|
||||
* The meta object id for the '{@link org.eclipse.xtext.testlanguages.actionLang3.impl.ProductionRulesImpl <em>Production Rules</em>}' class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.xtext.testlanguages.actionLang3.impl.ProductionRulesImpl
|
||||
* @see org.eclipse.xtext.testlanguages.actionLang3.impl.ActionLang3PackageImpl#getProductionRules()
|
||||
* @generated
|
||||
*/
|
||||
int PRODUCTION_RULES = 0;
|
||||
|
||||
/**
|
||||
* The number of structural features of the '<em>Production Rules</em>' class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
int PRODUCTION_RULES_FEATURE_COUNT = 0;
|
||||
|
||||
/**
|
||||
* The meta object id for the '{@link org.eclipse.xtext.testlanguages.actionLang3.impl.ProductionRule1Impl <em>Production Rule1</em>}' class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.xtext.testlanguages.actionLang3.impl.ProductionRule1Impl
|
||||
* @see org.eclipse.xtext.testlanguages.actionLang3.impl.ActionLang3PackageImpl#getProductionRule1()
|
||||
* @generated
|
||||
*/
|
||||
int PRODUCTION_RULE1 = 1;
|
||||
|
||||
/**
|
||||
* The number of structural features of the '<em>Production Rule1</em>' class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
int PRODUCTION_RULE1_FEATURE_COUNT = PRODUCTION_RULES_FEATURE_COUNT + 0;
|
||||
|
||||
/**
|
||||
* The meta object id for the '{@link org.eclipse.xtext.testlanguages.actionLang3.impl.ProductionRule2Impl <em>Production Rule2</em>}' class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.xtext.testlanguages.actionLang3.impl.ProductionRule2Impl
|
||||
* @see org.eclipse.xtext.testlanguages.actionLang3.impl.ActionLang3PackageImpl#getProductionRule2()
|
||||
* @generated
|
||||
*/
|
||||
int PRODUCTION_RULE2 = 2;
|
||||
|
||||
/**
|
||||
* The number of structural features of the '<em>Production Rule2</em>' class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
int PRODUCTION_RULE2_FEATURE_COUNT = PRODUCTION_RULES_FEATURE_COUNT + 0;
|
||||
|
||||
/**
|
||||
* The meta object id for the '{@link org.eclipse.xtext.testlanguages.actionLang3.impl.P1Impl <em>P1</em>}' class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.xtext.testlanguages.actionLang3.impl.P1Impl
|
||||
* @see org.eclipse.xtext.testlanguages.actionLang3.impl.ActionLang3PackageImpl#getP1()
|
||||
* @generated
|
||||
*/
|
||||
int P1 = 3;
|
||||
|
||||
/**
|
||||
* The feature id for the '<em><b>Id</b></em>' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
int P1__ID = PRODUCTION_RULE1_FEATURE_COUNT + 0;
|
||||
|
||||
/**
|
||||
* The number of structural features of the '<em>P1</em>' class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
int P1_FEATURE_COUNT = PRODUCTION_RULE1_FEATURE_COUNT + 1;
|
||||
|
||||
/**
|
||||
* The meta object id for the '{@link org.eclipse.xtext.testlanguages.actionLang3.impl.P2Impl <em>P2</em>}' class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.xtext.testlanguages.actionLang3.impl.P2Impl
|
||||
* @see org.eclipse.xtext.testlanguages.actionLang3.impl.ActionLang3PackageImpl#getP2()
|
||||
* @generated
|
||||
*/
|
||||
int P2 = 4;
|
||||
|
||||
/**
|
||||
* The feature id for the '<em><b>P</b></em>' containment reference.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
int P2__P = PRODUCTION_RULE1_FEATURE_COUNT + 0;
|
||||
|
||||
/**
|
||||
* The feature id for the '<em><b>String</b></em>' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
int P2__STRING = PRODUCTION_RULE1_FEATURE_COUNT + 1;
|
||||
|
||||
/**
|
||||
* The number of structural features of the '<em>P2</em>' class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
int P2_FEATURE_COUNT = PRODUCTION_RULE1_FEATURE_COUNT + 2;
|
||||
|
||||
/**
|
||||
* The meta object id for the '{@link org.eclipse.xtext.testlanguages.actionLang3.impl.P3Impl <em>P3</em>}' class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.xtext.testlanguages.actionLang3.impl.P3Impl
|
||||
* @see org.eclipse.xtext.testlanguages.actionLang3.impl.ActionLang3PackageImpl#getP3()
|
||||
* @generated
|
||||
*/
|
||||
int P3 = 5;
|
||||
|
||||
/**
|
||||
* The feature id for the '<em><b>P</b></em>' containment reference.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
int P3__P = PRODUCTION_RULE1_FEATURE_COUNT + 0;
|
||||
|
||||
/**
|
||||
* The feature id for the '<em><b>I</b></em>' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
int P3__I = PRODUCTION_RULE1_FEATURE_COUNT + 1;
|
||||
|
||||
/**
|
||||
* The number of structural features of the '<em>P3</em>' class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
int P3_FEATURE_COUNT = PRODUCTION_RULE1_FEATURE_COUNT + 2;
|
||||
|
||||
/**
|
||||
* The meta object id for the '{@link org.eclipse.xtext.testlanguages.actionLang3.impl.EntryImpl <em>Entry</em>}' class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.xtext.testlanguages.actionLang3.impl.EntryImpl
|
||||
* @see org.eclipse.xtext.testlanguages.actionLang3.impl.ActionLang3PackageImpl#getEntry()
|
||||
* @generated
|
||||
*/
|
||||
int ENTRY = 6;
|
||||
|
||||
/**
|
||||
* The feature id for the '<em><b>Name</b></em>' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
int ENTRY__NAME = PRODUCTION_RULE2_FEATURE_COUNT + 0;
|
||||
|
||||
/**
|
||||
* The number of structural features of the '<em>Entry</em>' class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
int ENTRY_FEATURE_COUNT = PRODUCTION_RULE2_FEATURE_COUNT + 1;
|
||||
|
||||
|
||||
/**
|
||||
* Returns the meta object for class '{@link org.eclipse.xtext.testlanguages.actionLang3.ProductionRules <em>Production Rules</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the meta object for class '<em>Production Rules</em>'.
|
||||
* @see org.eclipse.xtext.testlanguages.actionLang3.ProductionRules
|
||||
* @generated
|
||||
*/
|
||||
EClass getProductionRules();
|
||||
|
||||
/**
|
||||
* Returns the meta object for class '{@link org.eclipse.xtext.testlanguages.actionLang3.ProductionRule1 <em>Production Rule1</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the meta object for class '<em>Production Rule1</em>'.
|
||||
* @see org.eclipse.xtext.testlanguages.actionLang3.ProductionRule1
|
||||
* @generated
|
||||
*/
|
||||
EClass getProductionRule1();
|
||||
|
||||
/**
|
||||
* Returns the meta object for class '{@link org.eclipse.xtext.testlanguages.actionLang3.ProductionRule2 <em>Production Rule2</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the meta object for class '<em>Production Rule2</em>'.
|
||||
* @see org.eclipse.xtext.testlanguages.actionLang3.ProductionRule2
|
||||
* @generated
|
||||
*/
|
||||
EClass getProductionRule2();
|
||||
|
||||
/**
|
||||
* Returns the meta object for class '{@link org.eclipse.xtext.testlanguages.actionLang3.P1 <em>P1</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the meta object for class '<em>P1</em>'.
|
||||
* @see org.eclipse.xtext.testlanguages.actionLang3.P1
|
||||
* @generated
|
||||
*/
|
||||
EClass getP1();
|
||||
|
||||
/**
|
||||
* Returns the meta object for the attribute '{@link org.eclipse.xtext.testlanguages.actionLang3.P1#getId <em>Id</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the meta object for the attribute '<em>Id</em>'.
|
||||
* @see org.eclipse.xtext.testlanguages.actionLang3.P1#getId()
|
||||
* @see #getP1()
|
||||
* @generated
|
||||
*/
|
||||
EAttribute getP1_Id();
|
||||
|
||||
/**
|
||||
* Returns the meta object for class '{@link org.eclipse.xtext.testlanguages.actionLang3.P2 <em>P2</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the meta object for class '<em>P2</em>'.
|
||||
* @see org.eclipse.xtext.testlanguages.actionLang3.P2
|
||||
* @generated
|
||||
*/
|
||||
EClass getP2();
|
||||
|
||||
/**
|
||||
* Returns the meta object for the containment reference '{@link org.eclipse.xtext.testlanguages.actionLang3.P2#getP <em>P</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the meta object for the containment reference '<em>P</em>'.
|
||||
* @see org.eclipse.xtext.testlanguages.actionLang3.P2#getP()
|
||||
* @see #getP2()
|
||||
* @generated
|
||||
*/
|
||||
EReference getP2_P();
|
||||
|
||||
/**
|
||||
* Returns the meta object for the attribute '{@link org.eclipse.xtext.testlanguages.actionLang3.P2#getString <em>String</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the meta object for the attribute '<em>String</em>'.
|
||||
* @see org.eclipse.xtext.testlanguages.actionLang3.P2#getString()
|
||||
* @see #getP2()
|
||||
* @generated
|
||||
*/
|
||||
EAttribute getP2_String();
|
||||
|
||||
/**
|
||||
* Returns the meta object for class '{@link org.eclipse.xtext.testlanguages.actionLang3.P3 <em>P3</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the meta object for class '<em>P3</em>'.
|
||||
* @see org.eclipse.xtext.testlanguages.actionLang3.P3
|
||||
* @generated
|
||||
*/
|
||||
EClass getP3();
|
||||
|
||||
/**
|
||||
* Returns the meta object for the containment reference '{@link org.eclipse.xtext.testlanguages.actionLang3.P3#getP <em>P</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the meta object for the containment reference '<em>P</em>'.
|
||||
* @see org.eclipse.xtext.testlanguages.actionLang3.P3#getP()
|
||||
* @see #getP3()
|
||||
* @generated
|
||||
*/
|
||||
EReference getP3_P();
|
||||
|
||||
/**
|
||||
* Returns the meta object for the attribute '{@link org.eclipse.xtext.testlanguages.actionLang3.P3#getI <em>I</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the meta object for the attribute '<em>I</em>'.
|
||||
* @see org.eclipse.xtext.testlanguages.actionLang3.P3#getI()
|
||||
* @see #getP3()
|
||||
* @generated
|
||||
*/
|
||||
EAttribute getP3_I();
|
||||
|
||||
/**
|
||||
* Returns the meta object for class '{@link org.eclipse.xtext.testlanguages.actionLang3.Entry <em>Entry</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the meta object for class '<em>Entry</em>'.
|
||||
* @see org.eclipse.xtext.testlanguages.actionLang3.Entry
|
||||
* @generated
|
||||
*/
|
||||
EClass getEntry();
|
||||
|
||||
/**
|
||||
* Returns the meta object for the attribute '{@link org.eclipse.xtext.testlanguages.actionLang3.Entry#getName <em>Name</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the meta object for the attribute '<em>Name</em>'.
|
||||
* @see org.eclipse.xtext.testlanguages.actionLang3.Entry#getName()
|
||||
* @see #getEntry()
|
||||
* @generated
|
||||
*/
|
||||
EAttribute getEntry_Name();
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
ActionLang3Factory getActionLang3Factory();
|
||||
|
||||
/**
|
||||
* <!-- 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.testlanguages.actionLang3.impl.ProductionRulesImpl <em>Production Rules</em>}' class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.xtext.testlanguages.actionLang3.impl.ProductionRulesImpl
|
||||
* @see org.eclipse.xtext.testlanguages.actionLang3.impl.ActionLang3PackageImpl#getProductionRules()
|
||||
* @generated
|
||||
*/
|
||||
EClass PRODUCTION_RULES = eINSTANCE.getProductionRules();
|
||||
|
||||
/**
|
||||
* The meta object literal for the '{@link org.eclipse.xtext.testlanguages.actionLang3.impl.ProductionRule1Impl <em>Production Rule1</em>}' class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.xtext.testlanguages.actionLang3.impl.ProductionRule1Impl
|
||||
* @see org.eclipse.xtext.testlanguages.actionLang3.impl.ActionLang3PackageImpl#getProductionRule1()
|
||||
* @generated
|
||||
*/
|
||||
EClass PRODUCTION_RULE1 = eINSTANCE.getProductionRule1();
|
||||
|
||||
/**
|
||||
* The meta object literal for the '{@link org.eclipse.xtext.testlanguages.actionLang3.impl.ProductionRule2Impl <em>Production Rule2</em>}' class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.xtext.testlanguages.actionLang3.impl.ProductionRule2Impl
|
||||
* @see org.eclipse.xtext.testlanguages.actionLang3.impl.ActionLang3PackageImpl#getProductionRule2()
|
||||
* @generated
|
||||
*/
|
||||
EClass PRODUCTION_RULE2 = eINSTANCE.getProductionRule2();
|
||||
|
||||
/**
|
||||
* The meta object literal for the '{@link org.eclipse.xtext.testlanguages.actionLang3.impl.P1Impl <em>P1</em>}' class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.xtext.testlanguages.actionLang3.impl.P1Impl
|
||||
* @see org.eclipse.xtext.testlanguages.actionLang3.impl.ActionLang3PackageImpl#getP1()
|
||||
* @generated
|
||||
*/
|
||||
EClass P1 = eINSTANCE.getP1();
|
||||
|
||||
/**
|
||||
* The meta object literal for the '<em><b>Id</b></em>' attribute feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
EAttribute P1__ID = eINSTANCE.getP1_Id();
|
||||
|
||||
/**
|
||||
* The meta object literal for the '{@link org.eclipse.xtext.testlanguages.actionLang3.impl.P2Impl <em>P2</em>}' class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.xtext.testlanguages.actionLang3.impl.P2Impl
|
||||
* @see org.eclipse.xtext.testlanguages.actionLang3.impl.ActionLang3PackageImpl#getP2()
|
||||
* @generated
|
||||
*/
|
||||
EClass P2 = eINSTANCE.getP2();
|
||||
|
||||
/**
|
||||
* The meta object literal for the '<em><b>P</b></em>' containment reference feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
EReference P2__P = eINSTANCE.getP2_P();
|
||||
|
||||
/**
|
||||
* The meta object literal for the '<em><b>String</b></em>' attribute feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
EAttribute P2__STRING = eINSTANCE.getP2_String();
|
||||
|
||||
/**
|
||||
* The meta object literal for the '{@link org.eclipse.xtext.testlanguages.actionLang3.impl.P3Impl <em>P3</em>}' class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.xtext.testlanguages.actionLang3.impl.P3Impl
|
||||
* @see org.eclipse.xtext.testlanguages.actionLang3.impl.ActionLang3PackageImpl#getP3()
|
||||
* @generated
|
||||
*/
|
||||
EClass P3 = eINSTANCE.getP3();
|
||||
|
||||
/**
|
||||
* The meta object literal for the '<em><b>P</b></em>' containment reference feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
EReference P3__P = eINSTANCE.getP3_P();
|
||||
|
||||
/**
|
||||
* The meta object literal for the '<em><b>I</b></em>' attribute feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
EAttribute P3__I = eINSTANCE.getP3_I();
|
||||
|
||||
/**
|
||||
* The meta object literal for the '{@link org.eclipse.xtext.testlanguages.actionLang3.impl.EntryImpl <em>Entry</em>}' class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.xtext.testlanguages.actionLang3.impl.EntryImpl
|
||||
* @see org.eclipse.xtext.testlanguages.actionLang3.impl.ActionLang3PackageImpl#getEntry()
|
||||
* @generated
|
||||
*/
|
||||
EClass ENTRY = eINSTANCE.getEntry();
|
||||
|
||||
/**
|
||||
* The meta object literal for the '<em><b>Name</b></em>' attribute feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
EAttribute ENTRY__NAME = eINSTANCE.getEntry_Name();
|
||||
|
||||
}
|
||||
|
||||
} //ActionLang3Package
|
|
@ -0,0 +1,47 @@
|
|||
/**
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages.actionLang3;
|
||||
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* A representation of the model object '<em><b>Entry</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
*
|
||||
* <p>
|
||||
* The following features are supported:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>{@link org.eclipse.xtext.testlanguages.actionLang3.Entry#getName <em>Name</em>}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @see org.eclipse.xtext.testlanguages.actionLang3.ActionLang3Package#getEntry()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
public interface Entry extends ProductionRule2
|
||||
{
|
||||
/**
|
||||
* Returns the value of the '<em><b>Name</b></em>' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Name</em>' attribute.
|
||||
* @see #setName(String)
|
||||
* @see org.eclipse.xtext.testlanguages.actionLang3.ActionLang3Package#getEntry_Name()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* Sets the value of the '{@link org.eclipse.xtext.testlanguages.actionLang3.Entry#getName <em>Name</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param value the new value of the '<em>Name</em>' attribute.
|
||||
* @see #getName()
|
||||
* @generated
|
||||
*/
|
||||
void setName(String value);
|
||||
|
||||
} // Entry
|
|
@ -0,0 +1,47 @@
|
|||
/**
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages.actionLang3;
|
||||
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* A representation of the model object '<em><b>P1</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
*
|
||||
* <p>
|
||||
* The following features are supported:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>{@link org.eclipse.xtext.testlanguages.actionLang3.P1#getId <em>Id</em>}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @see org.eclipse.xtext.testlanguages.actionLang3.ActionLang3Package#getP1()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
public interface P1 extends ProductionRule1
|
||||
{
|
||||
/**
|
||||
* Returns the value of the '<em><b>Id</b></em>' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Id</em>' attribute.
|
||||
* @see #setId(String)
|
||||
* @see org.eclipse.xtext.testlanguages.actionLang3.ActionLang3Package#getP1_Id()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
String getId();
|
||||
|
||||
/**
|
||||
* Sets the value of the '{@link org.eclipse.xtext.testlanguages.actionLang3.P1#getId <em>Id</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param value the new value of the '<em>Id</em>' attribute.
|
||||
* @see #getId()
|
||||
* @generated
|
||||
*/
|
||||
void setId(String value);
|
||||
|
||||
} // P1
|
|
@ -0,0 +1,70 @@
|
|||
/**
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages.actionLang3;
|
||||
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* A representation of the model object '<em><b>P2</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
*
|
||||
* <p>
|
||||
* The following features are supported:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>{@link org.eclipse.xtext.testlanguages.actionLang3.P2#getP <em>P</em>}</li>
|
||||
* <li>{@link org.eclipse.xtext.testlanguages.actionLang3.P2#getString <em>String</em>}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @see org.eclipse.xtext.testlanguages.actionLang3.ActionLang3Package#getP2()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
public interface P2 extends ProductionRule1
|
||||
{
|
||||
/**
|
||||
* Returns the value of the '<em><b>P</b></em>' containment reference.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>P</em>' containment reference.
|
||||
* @see #setP(P1)
|
||||
* @see org.eclipse.xtext.testlanguages.actionLang3.ActionLang3Package#getP2_P()
|
||||
* @model containment="true"
|
||||
* @generated
|
||||
*/
|
||||
P1 getP();
|
||||
|
||||
/**
|
||||
* Sets the value of the '{@link org.eclipse.xtext.testlanguages.actionLang3.P2#getP <em>P</em>}' containment reference.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param value the new value of the '<em>P</em>' containment reference.
|
||||
* @see #getP()
|
||||
* @generated
|
||||
*/
|
||||
void setP(P1 value);
|
||||
|
||||
/**
|
||||
* Returns the value of the '<em><b>String</b></em>' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>String</em>' attribute.
|
||||
* @see #setString(String)
|
||||
* @see org.eclipse.xtext.testlanguages.actionLang3.ActionLang3Package#getP2_String()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
String getString();
|
||||
|
||||
/**
|
||||
* Sets the value of the '{@link org.eclipse.xtext.testlanguages.actionLang3.P2#getString <em>String</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param value the new value of the '<em>String</em>' attribute.
|
||||
* @see #getString()
|
||||
* @generated
|
||||
*/
|
||||
void setString(String value);
|
||||
|
||||
} // P2
|
|
@ -0,0 +1,70 @@
|
|||
/**
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages.actionLang3;
|
||||
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* A representation of the model object '<em><b>P3</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
*
|
||||
* <p>
|
||||
* The following features are supported:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>{@link org.eclipse.xtext.testlanguages.actionLang3.P3#getP <em>P</em>}</li>
|
||||
* <li>{@link org.eclipse.xtext.testlanguages.actionLang3.P3#getI <em>I</em>}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @see org.eclipse.xtext.testlanguages.actionLang3.ActionLang3Package#getP3()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
public interface P3 extends ProductionRule1
|
||||
{
|
||||
/**
|
||||
* Returns the value of the '<em><b>P</b></em>' containment reference.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>P</em>' containment reference.
|
||||
* @see #setP(P2)
|
||||
* @see org.eclipse.xtext.testlanguages.actionLang3.ActionLang3Package#getP3_P()
|
||||
* @model containment="true"
|
||||
* @generated
|
||||
*/
|
||||
P2 getP();
|
||||
|
||||
/**
|
||||
* Sets the value of the '{@link org.eclipse.xtext.testlanguages.actionLang3.P3#getP <em>P</em>}' containment reference.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param value the new value of the '<em>P</em>' containment reference.
|
||||
* @see #getP()
|
||||
* @generated
|
||||
*/
|
||||
void setP(P2 value);
|
||||
|
||||
/**
|
||||
* Returns the value of the '<em><b>I</b></em>' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>I</em>' attribute.
|
||||
* @see #setI(int)
|
||||
* @see org.eclipse.xtext.testlanguages.actionLang3.ActionLang3Package#getP3_I()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
int getI();
|
||||
|
||||
/**
|
||||
* Sets the value of the '{@link org.eclipse.xtext.testlanguages.actionLang3.P3#getI <em>I</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param value the new value of the '<em>I</em>' attribute.
|
||||
* @see #getI()
|
||||
* @generated
|
||||
*/
|
||||
void setI(int value);
|
||||
|
||||
} // P3
|
|
@ -0,0 +1,19 @@
|
|||
/**
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages.actionLang3;
|
||||
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* A representation of the model object '<em><b>Production Rule1</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
*
|
||||
*
|
||||
* @see org.eclipse.xtext.testlanguages.actionLang3.ActionLang3Package#getProductionRule1()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
public interface ProductionRule1 extends ProductionRules
|
||||
{
|
||||
} // ProductionRule1
|
|
@ -0,0 +1,19 @@
|
|||
/**
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages.actionLang3;
|
||||
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* A representation of the model object '<em><b>Production Rule2</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
*
|
||||
*
|
||||
* @see org.eclipse.xtext.testlanguages.actionLang3.ActionLang3Package#getProductionRule2()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
public interface ProductionRule2 extends ProductionRules
|
||||
{
|
||||
} // ProductionRule2
|
|
@ -0,0 +1,20 @@
|
|||
/**
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages.actionLang3;
|
||||
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* A representation of the model object '<em><b>Production Rules</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
*
|
||||
*
|
||||
* @see org.eclipse.xtext.testlanguages.actionLang3.ActionLang3Package#getProductionRules()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
public interface ProductionRules extends EObject
|
||||
{
|
||||
} // ProductionRules
|
|
@ -0,0 +1,187 @@
|
|||
/**
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages.actionLang3.impl;
|
||||
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
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.testlanguages.actionLang3.*;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model <b>Factory</b>.
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public class ActionLang3FactoryImpl extends EFactoryImpl implements ActionLang3Factory
|
||||
{
|
||||
/**
|
||||
* Creates the default factory implementation.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public static ActionLang3Factory init()
|
||||
{
|
||||
try
|
||||
{
|
||||
ActionLang3Factory theActionLang3Factory = (ActionLang3Factory)EPackage.Registry.INSTANCE.getEFactory(ActionLang3Package.eNS_URI);
|
||||
if (theActionLang3Factory != null)
|
||||
{
|
||||
return theActionLang3Factory;
|
||||
}
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
EcorePlugin.INSTANCE.log(exception);
|
||||
}
|
||||
return new ActionLang3FactoryImpl();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an instance of the factory.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public ActionLang3FactoryImpl()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public EObject create(EClass eClass)
|
||||
{
|
||||
switch (eClass.getClassifierID())
|
||||
{
|
||||
case ActionLang3Package.PRODUCTION_RULES: return createProductionRules();
|
||||
case ActionLang3Package.PRODUCTION_RULE1: return createProductionRule1();
|
||||
case ActionLang3Package.PRODUCTION_RULE2: return createProductionRule2();
|
||||
case ActionLang3Package.P1: return createP1();
|
||||
case ActionLang3Package.P2: return createP2();
|
||||
case ActionLang3Package.P3: return createP3();
|
||||
case ActionLang3Package.ENTRY: return createEntry();
|
||||
default:
|
||||
throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public ProductionRules createProductionRules()
|
||||
{
|
||||
ProductionRulesImpl productionRules = new ProductionRulesImpl();
|
||||
return productionRules;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public ProductionRule1 createProductionRule1()
|
||||
{
|
||||
ProductionRule1Impl productionRule1 = new ProductionRule1Impl();
|
||||
return productionRule1;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public ProductionRule2 createProductionRule2()
|
||||
{
|
||||
ProductionRule2Impl productionRule2 = new ProductionRule2Impl();
|
||||
return productionRule2;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public P1 createP1()
|
||||
{
|
||||
P1Impl p1 = new P1Impl();
|
||||
return p1;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public P2 createP2()
|
||||
{
|
||||
P2Impl p2 = new P2Impl();
|
||||
return p2;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public P3 createP3()
|
||||
{
|
||||
P3Impl p3 = new P3Impl();
|
||||
return p3;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Entry createEntry()
|
||||
{
|
||||
EntryImpl entry = new EntryImpl();
|
||||
return entry;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public ActionLang3Package getActionLang3Package()
|
||||
{
|
||||
return (ActionLang3Package)getEPackage();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @deprecated
|
||||
* @generated
|
||||
*/
|
||||
@Deprecated
|
||||
public static ActionLang3Package getPackage()
|
||||
{
|
||||
return ActionLang3Package.eINSTANCE;
|
||||
}
|
||||
|
||||
} //ActionLang3FactoryImpl
|
|
@ -0,0 +1,403 @@
|
|||
/**
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages.actionLang3.impl;
|
||||
|
||||
import org.eclipse.emf.ecore.EAttribute;
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
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.testlanguages.actionLang3.ActionLang3Factory;
|
||||
import org.eclipse.xtext.testlanguages.actionLang3.ActionLang3Package;
|
||||
import org.eclipse.xtext.testlanguages.actionLang3.Entry;
|
||||
import org.eclipse.xtext.testlanguages.actionLang3.ProductionRule1;
|
||||
import org.eclipse.xtext.testlanguages.actionLang3.ProductionRule2;
|
||||
import org.eclipse.xtext.testlanguages.actionLang3.ProductionRules;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model <b>Package</b>.
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public class ActionLang3PackageImpl extends EPackageImpl implements ActionLang3Package
|
||||
{
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EClass productionRulesEClass = null;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EClass productionRule1EClass = null;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EClass productionRule2EClass = null;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EClass p1EClass = null;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EClass p2EClass = null;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EClass p3EClass = null;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EClass entryEClass = 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.testlanguages.actionLang3.ActionLang3Package#eNS_URI
|
||||
* @see #init()
|
||||
* @generated
|
||||
*/
|
||||
private ActionLang3PackageImpl()
|
||||
{
|
||||
super(eNS_URI, ActionLang3Factory.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 ActionLang3Package#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 ActionLang3Package init()
|
||||
{
|
||||
if (isInited) return (ActionLang3Package)EPackage.Registry.INSTANCE.getEPackage(ActionLang3Package.eNS_URI);
|
||||
|
||||
// Obtain or create and register package
|
||||
Object registeredActionLang3Package = EPackage.Registry.INSTANCE.get(eNS_URI);
|
||||
ActionLang3PackageImpl theActionLang3Package = registeredActionLang3Package instanceof ActionLang3PackageImpl ? (ActionLang3PackageImpl)registeredActionLang3Package : new ActionLang3PackageImpl();
|
||||
|
||||
isInited = true;
|
||||
|
||||
// Initialize simple dependencies
|
||||
EcorePackage.eINSTANCE.eClass();
|
||||
|
||||
// Create package meta-data objects
|
||||
theActionLang3Package.createPackageContents();
|
||||
|
||||
// Initialize created meta-data
|
||||
theActionLang3Package.initializePackageContents();
|
||||
|
||||
// Mark meta-data to indicate it can't be changed
|
||||
theActionLang3Package.freeze();
|
||||
|
||||
// Update the registry and return the package
|
||||
EPackage.Registry.INSTANCE.put(ActionLang3Package.eNS_URI, theActionLang3Package);
|
||||
return theActionLang3Package;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public EClass getProductionRules()
|
||||
{
|
||||
return productionRulesEClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public EClass getProductionRule1()
|
||||
{
|
||||
return productionRule1EClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public EClass getProductionRule2()
|
||||
{
|
||||
return productionRule2EClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public EClass getP1()
|
||||
{
|
||||
return p1EClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public EAttribute getP1_Id()
|
||||
{
|
||||
return (EAttribute)p1EClass.getEStructuralFeatures().get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public EClass getP2()
|
||||
{
|
||||
return p2EClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public EReference getP2_P()
|
||||
{
|
||||
return (EReference)p2EClass.getEStructuralFeatures().get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public EAttribute getP2_String()
|
||||
{
|
||||
return (EAttribute)p2EClass.getEStructuralFeatures().get(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public EClass getP3()
|
||||
{
|
||||
return p3EClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public EReference getP3_P()
|
||||
{
|
||||
return (EReference)p3EClass.getEStructuralFeatures().get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public EAttribute getP3_I()
|
||||
{
|
||||
return (EAttribute)p3EClass.getEStructuralFeatures().get(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public EClass getEntry()
|
||||
{
|
||||
return entryEClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public EAttribute getEntry_Name()
|
||||
{
|
||||
return (EAttribute)entryEClass.getEStructuralFeatures().get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public ActionLang3Factory getActionLang3Factory()
|
||||
{
|
||||
return (ActionLang3Factory)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
|
||||
productionRulesEClass = createEClass(PRODUCTION_RULES);
|
||||
|
||||
productionRule1EClass = createEClass(PRODUCTION_RULE1);
|
||||
|
||||
productionRule2EClass = createEClass(PRODUCTION_RULE2);
|
||||
|
||||
p1EClass = createEClass(P1);
|
||||
createEAttribute(p1EClass, P1__ID);
|
||||
|
||||
p2EClass = createEClass(P2);
|
||||
createEReference(p2EClass, P2__P);
|
||||
createEAttribute(p2EClass, P2__STRING);
|
||||
|
||||
p3EClass = createEClass(P3);
|
||||
createEReference(p3EClass, P3__P);
|
||||
createEAttribute(p3EClass, P3__I);
|
||||
|
||||
entryEClass = createEClass(ENTRY);
|
||||
createEAttribute(entryEClass, ENTRY__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
|
||||
productionRule1EClass.getESuperTypes().add(this.getProductionRules());
|
||||
productionRule2EClass.getESuperTypes().add(this.getProductionRules());
|
||||
p1EClass.getESuperTypes().add(this.getProductionRule1());
|
||||
p2EClass.getESuperTypes().add(this.getProductionRule1());
|
||||
p3EClass.getESuperTypes().add(this.getProductionRule1());
|
||||
entryEClass.getESuperTypes().add(this.getProductionRule2());
|
||||
|
||||
// Initialize classes and features; add operations and parameters
|
||||
initEClass(productionRulesEClass, ProductionRules.class, "ProductionRules", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
|
||||
|
||||
initEClass(productionRule1EClass, ProductionRule1.class, "ProductionRule1", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
|
||||
|
||||
initEClass(productionRule2EClass, ProductionRule2.class, "ProductionRule2", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
|
||||
|
||||
initEClass(p1EClass, org.eclipse.xtext.testlanguages.actionLang3.P1.class, "P1", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
|
||||
initEAttribute(getP1_Id(), theEcorePackage.getEString(), "id", null, 0, 1, org.eclipse.xtext.testlanguages.actionLang3.P1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
|
||||
initEClass(p2EClass, org.eclipse.xtext.testlanguages.actionLang3.P2.class, "P2", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
|
||||
initEReference(getP2_P(), this.getP1(), null, "p", null, 0, 1, org.eclipse.xtext.testlanguages.actionLang3.P2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
initEAttribute(getP2_String(), theEcorePackage.getEString(), "string", null, 0, 1, org.eclipse.xtext.testlanguages.actionLang3.P2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
|
||||
initEClass(p3EClass, org.eclipse.xtext.testlanguages.actionLang3.P3.class, "P3", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
|
||||
initEReference(getP3_P(), this.getP2(), null, "p", null, 0, 1, org.eclipse.xtext.testlanguages.actionLang3.P3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
initEAttribute(getP3_I(), theEcorePackage.getEInt(), "i", null, 0, 1, org.eclipse.xtext.testlanguages.actionLang3.P3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
|
||||
initEClass(entryEClass, Entry.class, "Entry", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
|
||||
initEAttribute(getEntry_Name(), theEcorePackage.getEString(), "name", null, 0, 1, Entry.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
|
||||
// Create resource
|
||||
createResource(eNS_URI);
|
||||
}
|
||||
|
||||
} //ActionLang3PackageImpl
|
|
@ -0,0 +1,179 @@
|
|||
/**
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages.actionLang3.impl;
|
||||
|
||||
import org.eclipse.emf.common.notify.Notification;
|
||||
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
|
||||
import org.eclipse.emf.ecore.impl.ENotificationImpl;
|
||||
|
||||
import org.eclipse.xtext.testlanguages.actionLang3.ActionLang3Package;
|
||||
import org.eclipse.xtext.testlanguages.actionLang3.Entry;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model object '<em><b>Entry</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
* <p>
|
||||
* The following features are implemented:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>{@link org.eclipse.xtext.testlanguages.actionLang3.impl.EntryImpl#getName <em>Name</em>}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @generated
|
||||
*/
|
||||
public class EntryImpl extends ProductionRule2Impl implements Entry
|
||||
{
|
||||
/**
|
||||
* The default value of the '{@link #getName() <em>Name</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getName()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final String NAME_EDEFAULT = null;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getName() <em>Name</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getName()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected String name = NAME_EDEFAULT;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected EntryImpl()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
protected EClass eStaticClass()
|
||||
{
|
||||
return ActionLang3Package.Literals.ENTRY;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void setName(String newName)
|
||||
{
|
||||
String oldName = name;
|
||||
name = newName;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, ActionLang3Package.ENTRY__NAME, oldName, name));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Object eGet(int featureID, boolean resolve, boolean coreType)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case ActionLang3Package.ENTRY__NAME:
|
||||
return getName();
|
||||
}
|
||||
return super.eGet(featureID, resolve, coreType);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eSet(int featureID, Object newValue)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case ActionLang3Package.ENTRY__NAME:
|
||||
setName((String)newValue);
|
||||
return;
|
||||
}
|
||||
super.eSet(featureID, newValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eUnset(int featureID)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case ActionLang3Package.ENTRY__NAME:
|
||||
setName(NAME_EDEFAULT);
|
||||
return;
|
||||
}
|
||||
super.eUnset(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public boolean eIsSet(int featureID)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case ActionLang3Package.ENTRY__NAME:
|
||||
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
|
||||
}
|
||||
return super.eIsSet(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
if (eIsProxy()) return super.toString();
|
||||
|
||||
StringBuilder result = new StringBuilder(super.toString());
|
||||
result.append(" (name: ");
|
||||
result.append(name);
|
||||
result.append(')');
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
} //EntryImpl
|
|
@ -0,0 +1,179 @@
|
|||
/**
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages.actionLang3.impl;
|
||||
|
||||
import org.eclipse.emf.common.notify.Notification;
|
||||
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
|
||||
import org.eclipse.emf.ecore.impl.ENotificationImpl;
|
||||
|
||||
import org.eclipse.xtext.testlanguages.actionLang3.ActionLang3Package;
|
||||
import org.eclipse.xtext.testlanguages.actionLang3.P1;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model object '<em><b>P1</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
* <p>
|
||||
* The following features are implemented:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>{@link org.eclipse.xtext.testlanguages.actionLang3.impl.P1Impl#getId <em>Id</em>}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @generated
|
||||
*/
|
||||
public class P1Impl extends ProductionRule1Impl implements P1
|
||||
{
|
||||
/**
|
||||
* The default value of the '{@link #getId() <em>Id</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getId()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final String ID_EDEFAULT = null;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getId() <em>Id</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getId()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected String id = ID_EDEFAULT;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected P1Impl()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
protected EClass eStaticClass()
|
||||
{
|
||||
return ActionLang3Package.Literals.P1;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public String getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void setId(String newId)
|
||||
{
|
||||
String oldId = id;
|
||||
id = newId;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, ActionLang3Package.P1__ID, oldId, id));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Object eGet(int featureID, boolean resolve, boolean coreType)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case ActionLang3Package.P1__ID:
|
||||
return getId();
|
||||
}
|
||||
return super.eGet(featureID, resolve, coreType);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eSet(int featureID, Object newValue)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case ActionLang3Package.P1__ID:
|
||||
setId((String)newValue);
|
||||
return;
|
||||
}
|
||||
super.eSet(featureID, newValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eUnset(int featureID)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case ActionLang3Package.P1__ID:
|
||||
setId(ID_EDEFAULT);
|
||||
return;
|
||||
}
|
||||
super.eUnset(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public boolean eIsSet(int featureID)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case ActionLang3Package.P1__ID:
|
||||
return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id);
|
||||
}
|
||||
return super.eIsSet(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
if (eIsProxy()) return super.toString();
|
||||
|
||||
StringBuilder result = new StringBuilder(super.toString());
|
||||
result.append(" (id: ");
|
||||
result.append(id);
|
||||
result.append(')');
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
} //P1Impl
|
|
@ -0,0 +1,269 @@
|
|||
/**
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages.actionLang3.impl;
|
||||
|
||||
import org.eclipse.emf.common.notify.Notification;
|
||||
import org.eclipse.emf.common.notify.NotificationChain;
|
||||
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
import org.eclipse.emf.ecore.InternalEObject;
|
||||
|
||||
import org.eclipse.emf.ecore.impl.ENotificationImpl;
|
||||
|
||||
import org.eclipse.xtext.testlanguages.actionLang3.ActionLang3Package;
|
||||
import org.eclipse.xtext.testlanguages.actionLang3.P1;
|
||||
import org.eclipse.xtext.testlanguages.actionLang3.P2;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model object '<em><b>P2</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
* <p>
|
||||
* The following features are implemented:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>{@link org.eclipse.xtext.testlanguages.actionLang3.impl.P2Impl#getP <em>P</em>}</li>
|
||||
* <li>{@link org.eclipse.xtext.testlanguages.actionLang3.impl.P2Impl#getString <em>String</em>}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @generated
|
||||
*/
|
||||
public class P2Impl extends ProductionRule1Impl implements P2
|
||||
{
|
||||
/**
|
||||
* The cached value of the '{@link #getP() <em>P</em>}' containment reference.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getP()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected P1 p;
|
||||
|
||||
/**
|
||||
* The default value of the '{@link #getString() <em>String</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getString()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final String STRING_EDEFAULT = null;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getString() <em>String</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getString()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected String string = STRING_EDEFAULT;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected P2Impl()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
protected EClass eStaticClass()
|
||||
{
|
||||
return ActionLang3Package.Literals.P2;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public P1 getP()
|
||||
{
|
||||
return p;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public NotificationChain basicSetP(P1 newP, NotificationChain msgs)
|
||||
{
|
||||
P1 oldP = p;
|
||||
p = newP;
|
||||
if (eNotificationRequired())
|
||||
{
|
||||
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ActionLang3Package.P2__P, oldP, newP);
|
||||
if (msgs == null) msgs = notification; else msgs.add(notification);
|
||||
}
|
||||
return msgs;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void setP(P1 newP)
|
||||
{
|
||||
if (newP != p)
|
||||
{
|
||||
NotificationChain msgs = null;
|
||||
if (p != null)
|
||||
msgs = ((InternalEObject)p).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ActionLang3Package.P2__P, null, msgs);
|
||||
if (newP != null)
|
||||
msgs = ((InternalEObject)newP).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ActionLang3Package.P2__P, null, msgs);
|
||||
msgs = basicSetP(newP, msgs);
|
||||
if (msgs != null) msgs.dispatch();
|
||||
}
|
||||
else if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, ActionLang3Package.P2__P, newP, newP));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public String getString()
|
||||
{
|
||||
return string;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void setString(String newString)
|
||||
{
|
||||
String oldString = string;
|
||||
string = newString;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, ActionLang3Package.P2__STRING, oldString, string));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case ActionLang3Package.P2__P:
|
||||
return basicSetP(null, 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 ActionLang3Package.P2__P:
|
||||
return getP();
|
||||
case ActionLang3Package.P2__STRING:
|
||||
return getString();
|
||||
}
|
||||
return super.eGet(featureID, resolve, coreType);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eSet(int featureID, Object newValue)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case ActionLang3Package.P2__P:
|
||||
setP((P1)newValue);
|
||||
return;
|
||||
case ActionLang3Package.P2__STRING:
|
||||
setString((String)newValue);
|
||||
return;
|
||||
}
|
||||
super.eSet(featureID, newValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eUnset(int featureID)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case ActionLang3Package.P2__P:
|
||||
setP((P1)null);
|
||||
return;
|
||||
case ActionLang3Package.P2__STRING:
|
||||
setString(STRING_EDEFAULT);
|
||||
return;
|
||||
}
|
||||
super.eUnset(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public boolean eIsSet(int featureID)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case ActionLang3Package.P2__P:
|
||||
return p != null;
|
||||
case ActionLang3Package.P2__STRING:
|
||||
return STRING_EDEFAULT == null ? string != null : !STRING_EDEFAULT.equals(string);
|
||||
}
|
||||
return super.eIsSet(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
if (eIsProxy()) return super.toString();
|
||||
|
||||
StringBuilder result = new StringBuilder(super.toString());
|
||||
result.append(" (string: ");
|
||||
result.append(string);
|
||||
result.append(')');
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
} //P2Impl
|
|
@ -0,0 +1,269 @@
|
|||
/**
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages.actionLang3.impl;
|
||||
|
||||
import org.eclipse.emf.common.notify.Notification;
|
||||
import org.eclipse.emf.common.notify.NotificationChain;
|
||||
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
import org.eclipse.emf.ecore.InternalEObject;
|
||||
|
||||
import org.eclipse.emf.ecore.impl.ENotificationImpl;
|
||||
|
||||
import org.eclipse.xtext.testlanguages.actionLang3.ActionLang3Package;
|
||||
import org.eclipse.xtext.testlanguages.actionLang3.P2;
|
||||
import org.eclipse.xtext.testlanguages.actionLang3.P3;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model object '<em><b>P3</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
* <p>
|
||||
* The following features are implemented:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>{@link org.eclipse.xtext.testlanguages.actionLang3.impl.P3Impl#getP <em>P</em>}</li>
|
||||
* <li>{@link org.eclipse.xtext.testlanguages.actionLang3.impl.P3Impl#getI <em>I</em>}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @generated
|
||||
*/
|
||||
public class P3Impl extends ProductionRule1Impl implements P3
|
||||
{
|
||||
/**
|
||||
* The cached value of the '{@link #getP() <em>P</em>}' containment reference.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getP()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected P2 p;
|
||||
|
||||
/**
|
||||
* The default value of the '{@link #getI() <em>I</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getI()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final int I_EDEFAULT = 0;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getI() <em>I</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getI()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected int i = I_EDEFAULT;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected P3Impl()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
protected EClass eStaticClass()
|
||||
{
|
||||
return ActionLang3Package.Literals.P3;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public P2 getP()
|
||||
{
|
||||
return p;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public NotificationChain basicSetP(P2 newP, NotificationChain msgs)
|
||||
{
|
||||
P2 oldP = p;
|
||||
p = newP;
|
||||
if (eNotificationRequired())
|
||||
{
|
||||
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ActionLang3Package.P3__P, oldP, newP);
|
||||
if (msgs == null) msgs = notification; else msgs.add(notification);
|
||||
}
|
||||
return msgs;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void setP(P2 newP)
|
||||
{
|
||||
if (newP != p)
|
||||
{
|
||||
NotificationChain msgs = null;
|
||||
if (p != null)
|
||||
msgs = ((InternalEObject)p).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ActionLang3Package.P3__P, null, msgs);
|
||||
if (newP != null)
|
||||
msgs = ((InternalEObject)newP).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ActionLang3Package.P3__P, null, msgs);
|
||||
msgs = basicSetP(newP, msgs);
|
||||
if (msgs != null) msgs.dispatch();
|
||||
}
|
||||
else if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, ActionLang3Package.P3__P, newP, newP));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public int getI()
|
||||
{
|
||||
return i;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void setI(int newI)
|
||||
{
|
||||
int oldI = i;
|
||||
i = newI;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, ActionLang3Package.P3__I, oldI, i));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case ActionLang3Package.P3__P:
|
||||
return basicSetP(null, 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 ActionLang3Package.P3__P:
|
||||
return getP();
|
||||
case ActionLang3Package.P3__I:
|
||||
return getI();
|
||||
}
|
||||
return super.eGet(featureID, resolve, coreType);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eSet(int featureID, Object newValue)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case ActionLang3Package.P3__P:
|
||||
setP((P2)newValue);
|
||||
return;
|
||||
case ActionLang3Package.P3__I:
|
||||
setI((Integer)newValue);
|
||||
return;
|
||||
}
|
||||
super.eSet(featureID, newValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eUnset(int featureID)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case ActionLang3Package.P3__P:
|
||||
setP((P2)null);
|
||||
return;
|
||||
case ActionLang3Package.P3__I:
|
||||
setI(I_EDEFAULT);
|
||||
return;
|
||||
}
|
||||
super.eUnset(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public boolean eIsSet(int featureID)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case ActionLang3Package.P3__P:
|
||||
return p != null;
|
||||
case ActionLang3Package.P3__I:
|
||||
return i != I_EDEFAULT;
|
||||
}
|
||||
return super.eIsSet(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
if (eIsProxy()) return super.toString();
|
||||
|
||||
StringBuilder result = new StringBuilder(super.toString());
|
||||
result.append(" (i: ");
|
||||
result.append(i);
|
||||
result.append(')');
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
} //P3Impl
|
|
@ -0,0 +1,41 @@
|
|||
/**
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages.actionLang3.impl;
|
||||
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
|
||||
import org.eclipse.xtext.testlanguages.actionLang3.ActionLang3Package;
|
||||
import org.eclipse.xtext.testlanguages.actionLang3.ProductionRule1;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model object '<em><b>Production Rule1</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
*
|
||||
* @generated
|
||||
*/
|
||||
public class ProductionRule1Impl extends ProductionRulesImpl implements ProductionRule1
|
||||
{
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected ProductionRule1Impl()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
protected EClass eStaticClass()
|
||||
{
|
||||
return ActionLang3Package.Literals.PRODUCTION_RULE1;
|
||||
}
|
||||
|
||||
} //ProductionRule1Impl
|
|
@ -0,0 +1,41 @@
|
|||
/**
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages.actionLang3.impl;
|
||||
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
|
||||
import org.eclipse.xtext.testlanguages.actionLang3.ActionLang3Package;
|
||||
import org.eclipse.xtext.testlanguages.actionLang3.ProductionRule2;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model object '<em><b>Production Rule2</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
*
|
||||
* @generated
|
||||
*/
|
||||
public class ProductionRule2Impl extends ProductionRulesImpl implements ProductionRule2
|
||||
{
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected ProductionRule2Impl()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
protected EClass eStaticClass()
|
||||
{
|
||||
return ActionLang3Package.Literals.PRODUCTION_RULE2;
|
||||
}
|
||||
|
||||
} //ProductionRule2Impl
|
|
@ -0,0 +1,43 @@
|
|||
/**
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages.actionLang3.impl;
|
||||
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
|
||||
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
|
||||
|
||||
import org.eclipse.xtext.testlanguages.actionLang3.ActionLang3Package;
|
||||
import org.eclipse.xtext.testlanguages.actionLang3.ProductionRules;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model object '<em><b>Production Rules</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
*
|
||||
* @generated
|
||||
*/
|
||||
public class ProductionRulesImpl extends MinimalEObjectImpl.Container implements ProductionRules
|
||||
{
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected ProductionRulesImpl()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
protected EClass eStaticClass()
|
||||
{
|
||||
return ActionLang3Package.Literals.PRODUCTION_RULES;
|
||||
}
|
||||
|
||||
} //ProductionRulesImpl
|
|
@ -0,0 +1,253 @@
|
|||
/**
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages.actionLang3.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.testlanguages.actionLang3.*;
|
||||
|
||||
/**
|
||||
* <!-- 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.testlanguages.actionLang3.ActionLang3Package
|
||||
* @generated
|
||||
*/
|
||||
public class ActionLang3AdapterFactory extends AdapterFactoryImpl
|
||||
{
|
||||
/**
|
||||
* The cached model package.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected static ActionLang3Package modelPackage;
|
||||
|
||||
/**
|
||||
* Creates an instance of the adapter factory.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public ActionLang3AdapterFactory()
|
||||
{
|
||||
if (modelPackage == null)
|
||||
{
|
||||
modelPackage = ActionLang3Package.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 ActionLang3Switch<Adapter> modelSwitch =
|
||||
new ActionLang3Switch<Adapter>()
|
||||
{
|
||||
@Override
|
||||
public Adapter caseProductionRules(ProductionRules object)
|
||||
{
|
||||
return createProductionRulesAdapter();
|
||||
}
|
||||
@Override
|
||||
public Adapter caseProductionRule1(ProductionRule1 object)
|
||||
{
|
||||
return createProductionRule1Adapter();
|
||||
}
|
||||
@Override
|
||||
public Adapter caseProductionRule2(ProductionRule2 object)
|
||||
{
|
||||
return createProductionRule2Adapter();
|
||||
}
|
||||
@Override
|
||||
public Adapter caseP1(P1 object)
|
||||
{
|
||||
return createP1Adapter();
|
||||
}
|
||||
@Override
|
||||
public Adapter caseP2(P2 object)
|
||||
{
|
||||
return createP2Adapter();
|
||||
}
|
||||
@Override
|
||||
public Adapter caseP3(P3 object)
|
||||
{
|
||||
return createP3Adapter();
|
||||
}
|
||||
@Override
|
||||
public Adapter caseEntry(Entry object)
|
||||
{
|
||||
return createEntryAdapter();
|
||||
}
|
||||
@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.testlanguages.actionLang3.ProductionRules <em>Production Rules</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.testlanguages.actionLang3.ProductionRules
|
||||
* @generated
|
||||
*/
|
||||
public Adapter createProductionRulesAdapter()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new adapter for an object of class '{@link org.eclipse.xtext.testlanguages.actionLang3.ProductionRule1 <em>Production Rule1</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.testlanguages.actionLang3.ProductionRule1
|
||||
* @generated
|
||||
*/
|
||||
public Adapter createProductionRule1Adapter()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new adapter for an object of class '{@link org.eclipse.xtext.testlanguages.actionLang3.ProductionRule2 <em>Production Rule2</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.testlanguages.actionLang3.ProductionRule2
|
||||
* @generated
|
||||
*/
|
||||
public Adapter createProductionRule2Adapter()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new adapter for an object of class '{@link org.eclipse.xtext.testlanguages.actionLang3.P1 <em>P1</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.testlanguages.actionLang3.P1
|
||||
* @generated
|
||||
*/
|
||||
public Adapter createP1Adapter()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new adapter for an object of class '{@link org.eclipse.xtext.testlanguages.actionLang3.P2 <em>P2</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.testlanguages.actionLang3.P2
|
||||
* @generated
|
||||
*/
|
||||
public Adapter createP2Adapter()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new adapter for an object of class '{@link org.eclipse.xtext.testlanguages.actionLang3.P3 <em>P3</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.testlanguages.actionLang3.P3
|
||||
* @generated
|
||||
*/
|
||||
public Adapter createP3Adapter()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new adapter for an object of class '{@link org.eclipse.xtext.testlanguages.actionLang3.Entry <em>Entry</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.testlanguages.actionLang3.Entry
|
||||
* @generated
|
||||
*/
|
||||
public Adapter createEntryAdapter()
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
} //ActionLang3AdapterFactory
|
|
@ -0,0 +1,268 @@
|
|||
/**
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages.actionLang3.util;
|
||||
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
import org.eclipse.emf.ecore.EPackage;
|
||||
|
||||
import org.eclipse.emf.ecore.util.Switch;
|
||||
|
||||
import org.eclipse.xtext.testlanguages.actionLang3.*;
|
||||
|
||||
/**
|
||||
* <!-- 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.testlanguages.actionLang3.ActionLang3Package
|
||||
* @generated
|
||||
*/
|
||||
public class ActionLang3Switch<T> extends Switch<T>
|
||||
{
|
||||
/**
|
||||
* The cached model package
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected static ActionLang3Package modelPackage;
|
||||
|
||||
/**
|
||||
* Creates an instance of the switch.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public ActionLang3Switch()
|
||||
{
|
||||
if (modelPackage == null)
|
||||
{
|
||||
modelPackage = ActionLang3Package.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 ActionLang3Package.PRODUCTION_RULES:
|
||||
{
|
||||
ProductionRules productionRules = (ProductionRules)theEObject;
|
||||
T result = caseProductionRules(productionRules);
|
||||
if (result == null) result = defaultCase(theEObject);
|
||||
return result;
|
||||
}
|
||||
case ActionLang3Package.PRODUCTION_RULE1:
|
||||
{
|
||||
ProductionRule1 productionRule1 = (ProductionRule1)theEObject;
|
||||
T result = caseProductionRule1(productionRule1);
|
||||
if (result == null) result = caseProductionRules(productionRule1);
|
||||
if (result == null) result = defaultCase(theEObject);
|
||||
return result;
|
||||
}
|
||||
case ActionLang3Package.PRODUCTION_RULE2:
|
||||
{
|
||||
ProductionRule2 productionRule2 = (ProductionRule2)theEObject;
|
||||
T result = caseProductionRule2(productionRule2);
|
||||
if (result == null) result = caseProductionRules(productionRule2);
|
||||
if (result == null) result = defaultCase(theEObject);
|
||||
return result;
|
||||
}
|
||||
case ActionLang3Package.P1:
|
||||
{
|
||||
P1 p1 = (P1)theEObject;
|
||||
T result = caseP1(p1);
|
||||
if (result == null) result = caseProductionRule1(p1);
|
||||
if (result == null) result = caseProductionRules(p1);
|
||||
if (result == null) result = defaultCase(theEObject);
|
||||
return result;
|
||||
}
|
||||
case ActionLang3Package.P2:
|
||||
{
|
||||
P2 p2 = (P2)theEObject;
|
||||
T result = caseP2(p2);
|
||||
if (result == null) result = caseProductionRule1(p2);
|
||||
if (result == null) result = caseProductionRules(p2);
|
||||
if (result == null) result = defaultCase(theEObject);
|
||||
return result;
|
||||
}
|
||||
case ActionLang3Package.P3:
|
||||
{
|
||||
P3 p3 = (P3)theEObject;
|
||||
T result = caseP3(p3);
|
||||
if (result == null) result = caseProductionRule1(p3);
|
||||
if (result == null) result = caseProductionRules(p3);
|
||||
if (result == null) result = defaultCase(theEObject);
|
||||
return result;
|
||||
}
|
||||
case ActionLang3Package.ENTRY:
|
||||
{
|
||||
Entry entry = (Entry)theEObject;
|
||||
T result = caseEntry(entry);
|
||||
if (result == null) result = caseProductionRule2(entry);
|
||||
if (result == null) result = caseProductionRules(entry);
|
||||
if (result == null) result = defaultCase(theEObject);
|
||||
return result;
|
||||
}
|
||||
default: return defaultCase(theEObject);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result of interpreting the object as an instance of '<em>Production Rules</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>Production Rules</em>'.
|
||||
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
|
||||
* @generated
|
||||
*/
|
||||
public T caseProductionRules(ProductionRules object)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result of interpreting the object as an instance of '<em>Production Rule1</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>Production Rule1</em>'.
|
||||
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
|
||||
* @generated
|
||||
*/
|
||||
public T caseProductionRule1(ProductionRule1 object)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result of interpreting the object as an instance of '<em>Production Rule2</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>Production Rule2</em>'.
|
||||
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
|
||||
* @generated
|
||||
*/
|
||||
public T caseProductionRule2(ProductionRule2 object)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result of interpreting the object as an instance of '<em>P1</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>P1</em>'.
|
||||
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
|
||||
* @generated
|
||||
*/
|
||||
public T caseP1(P1 object)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result of interpreting the object as an instance of '<em>P2</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>P2</em>'.
|
||||
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
|
||||
* @generated
|
||||
*/
|
||||
public T caseP2(P2 object)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result of interpreting the object as an instance of '<em>P3</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>P3</em>'.
|
||||
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
|
||||
* @generated
|
||||
*/
|
||||
public T caseP3(P3 object)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result of interpreting the object as an instance of '<em>Entry</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>Entry</em>'.
|
||||
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
|
||||
* @generated
|
||||
*/
|
||||
public T caseEntry(Entry 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;
|
||||
}
|
||||
|
||||
} //ActionLang3Switch
|
|
@ -0,0 +1,16 @@
|
|||
/*
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages.parser.antlr;
|
||||
|
||||
import java.io.InputStream;
|
||||
import org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider;
|
||||
|
||||
public class ActionTestLanguage3AntlrTokenFileProvider implements IAntlrTokenFileProvider {
|
||||
|
||||
@Override
|
||||
public InputStream getAntlrTokenFile() {
|
||||
ClassLoader classLoader = getClass().getClassLoader();
|
||||
return classLoader.getResourceAsStream("org/eclipse/xtext/testlanguages/parser/antlr/internal/InternalActionTestLanguage3.tokens");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages.parser.antlr;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import org.eclipse.xtext.parser.antlr.AbstractAntlrParser;
|
||||
import org.eclipse.xtext.parser.antlr.XtextTokenStream;
|
||||
import org.eclipse.xtext.testlanguages.parser.antlr.internal.InternalActionTestLanguage3Parser;
|
||||
import org.eclipse.xtext.testlanguages.services.ActionTestLanguage3GrammarAccess;
|
||||
|
||||
public class ActionTestLanguage3Parser extends AbstractAntlrParser {
|
||||
|
||||
@Inject
|
||||
private ActionTestLanguage3GrammarAccess grammarAccess;
|
||||
|
||||
@Override
|
||||
protected void setInitialHiddenTokens(XtextTokenStream tokenStream) {
|
||||
tokenStream.setInitialHiddenTokens("RULE_WS", "RULE_ML_COMMENT", "RULE_SL_COMMENT");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected InternalActionTestLanguage3Parser createParser(XtextTokenStream stream) {
|
||||
return new InternalActionTestLanguage3Parser(stream, getGrammarAccess());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getDefaultRuleName() {
|
||||
return "ProductionRules";
|
||||
}
|
||||
|
||||
public ActionTestLanguage3GrammarAccess getGrammarAccess() {
|
||||
return this.grammarAccess;
|
||||
}
|
||||
|
||||
public void setGrammarAccess(ActionTestLanguage3GrammarAccess grammarAccess) {
|
||||
this.grammarAccess = grammarAccess;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,253 @@
|
|||
/*
|
||||
* generated by Xtext
|
||||
*/
|
||||
grammar InternalActionTestLanguage3;
|
||||
|
||||
options {
|
||||
superClass=AbstractInternalAntlrParser;
|
||||
}
|
||||
|
||||
@lexer::header {
|
||||
package org.eclipse.xtext.testlanguages.parser.antlr.internal;
|
||||
|
||||
// Hack: Use our own Lexer superclass by means of import.
|
||||
// Currently there is no other way to specify the superclass for the lexer.
|
||||
import org.eclipse.xtext.parser.antlr.Lexer;
|
||||
}
|
||||
|
||||
@parser::header {
|
||||
package org.eclipse.xtext.testlanguages.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.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.testlanguages.services.ActionTestLanguage3GrammarAccess;
|
||||
|
||||
}
|
||||
|
||||
@parser::members {
|
||||
|
||||
private ActionTestLanguage3GrammarAccess grammarAccess;
|
||||
|
||||
public InternalActionTestLanguage3Parser(TokenStream input, ActionTestLanguage3GrammarAccess grammarAccess) {
|
||||
this(input);
|
||||
this.grammarAccess = grammarAccess;
|
||||
registerRules(grammarAccess.getGrammar());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getFirstRuleName() {
|
||||
return "ProductionRules";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ActionTestLanguage3GrammarAccess getGrammarAccess() {
|
||||
return grammarAccess;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@rulecatch {
|
||||
catch (RecognitionException re) {
|
||||
recover(input,re);
|
||||
appendSkippedTokens();
|
||||
}
|
||||
}
|
||||
|
||||
// Entry rule entryRuleProductionRules
|
||||
entryRuleProductionRules returns [EObject current=null]:
|
||||
{ newCompositeNode(grammarAccess.getProductionRulesRule()); }
|
||||
iv_ruleProductionRules=ruleProductionRules
|
||||
{ $current=$iv_ruleProductionRules.current; }
|
||||
EOF;
|
||||
|
||||
// Rule ProductionRules
|
||||
ruleProductionRules returns [EObject current=null]
|
||||
@init {
|
||||
enterRule();
|
||||
}
|
||||
@after {
|
||||
leaveRule();
|
||||
}:
|
||||
(
|
||||
{
|
||||
newCompositeNode(grammarAccess.getProductionRulesAccess().getProductionRule1ParserRuleCall_0());
|
||||
}
|
||||
this_ProductionRule1_0=ruleProductionRule1
|
||||
{
|
||||
$current = $this_ProductionRule1_0.current;
|
||||
afterParserOrEnumRuleCall();
|
||||
}
|
||||
|
|
||||
{
|
||||
newCompositeNode(grammarAccess.getProductionRulesAccess().getProductionRule2ParserRuleCall_1());
|
||||
}
|
||||
this_ProductionRule2_1=ruleProductionRule2
|
||||
{
|
||||
$current = $this_ProductionRule2_1.current;
|
||||
afterParserOrEnumRuleCall();
|
||||
}
|
||||
)
|
||||
;
|
||||
|
||||
// Entry rule entryRuleProductionRule1
|
||||
entryRuleProductionRule1 returns [EObject current=null]:
|
||||
{ newCompositeNode(grammarAccess.getProductionRule1Rule()); }
|
||||
iv_ruleProductionRule1=ruleProductionRule1
|
||||
{ $current=$iv_ruleProductionRule1.current; }
|
||||
EOF;
|
||||
|
||||
// Rule ProductionRule1
|
||||
ruleProductionRule1 returns [EObject current=null]
|
||||
@init {
|
||||
enterRule();
|
||||
}
|
||||
@after {
|
||||
leaveRule();
|
||||
}:
|
||||
(
|
||||
(
|
||||
{
|
||||
$current = forceCreateModelElement(
|
||||
grammarAccess.getProductionRule1Access().getP1Action_0(),
|
||||
$current);
|
||||
}
|
||||
)
|
||||
(
|
||||
(
|
||||
lv_id_1_0=RULE_ID
|
||||
{
|
||||
newLeafNode(lv_id_1_0, grammarAccess.getProductionRule1Access().getIdIDTerminalRuleCall_1_0());
|
||||
}
|
||||
{
|
||||
if ($current==null) {
|
||||
$current = createModelElement(grammarAccess.getProductionRule1Rule());
|
||||
}
|
||||
setWithLastConsumed(
|
||||
$current,
|
||||
"id",
|
||||
lv_id_1_0,
|
||||
"org.eclipse.xtext.common.Terminals.ID");
|
||||
}
|
||||
)
|
||||
)?
|
||||
(
|
||||
{
|
||||
$current = forceCreateModelElementAndSet(
|
||||
grammarAccess.getProductionRule1Access().getP2PAction_2(),
|
||||
$current);
|
||||
}
|
||||
)
|
||||
(
|
||||
(
|
||||
lv_string_3_0=RULE_STRING
|
||||
{
|
||||
newLeafNode(lv_string_3_0, grammarAccess.getProductionRule1Access().getStringSTRINGTerminalRuleCall_3_0());
|
||||
}
|
||||
{
|
||||
if ($current==null) {
|
||||
$current = createModelElement(grammarAccess.getProductionRule1Rule());
|
||||
}
|
||||
setWithLastConsumed(
|
||||
$current,
|
||||
"string",
|
||||
lv_string_3_0,
|
||||
"org.eclipse.xtext.common.Terminals.STRING");
|
||||
}
|
||||
)
|
||||
)?
|
||||
(
|
||||
{
|
||||
$current = forceCreateModelElementAndSet(
|
||||
grammarAccess.getProductionRule1Access().getP3PAction_4(),
|
||||
$current);
|
||||
}
|
||||
)
|
||||
(
|
||||
(
|
||||
lv_i_5_0=RULE_INT
|
||||
{
|
||||
newLeafNode(lv_i_5_0, grammarAccess.getProductionRule1Access().getIINTTerminalRuleCall_5_0());
|
||||
}
|
||||
{
|
||||
if ($current==null) {
|
||||
$current = createModelElement(grammarAccess.getProductionRule1Rule());
|
||||
}
|
||||
setWithLastConsumed(
|
||||
$current,
|
||||
"i",
|
||||
lv_i_5_0,
|
||||
"org.eclipse.xtext.common.Terminals.INT");
|
||||
}
|
||||
)
|
||||
)
|
||||
)
|
||||
;
|
||||
|
||||
// Entry rule entryRuleProductionRule2
|
||||
entryRuleProductionRule2 returns [EObject current=null]:
|
||||
{ newCompositeNode(grammarAccess.getProductionRule2Rule()); }
|
||||
iv_ruleProductionRule2=ruleProductionRule2
|
||||
{ $current=$iv_ruleProductionRule2.current; }
|
||||
EOF;
|
||||
|
||||
// Rule ProductionRule2
|
||||
ruleProductionRule2 returns [EObject current=null]
|
||||
@init {
|
||||
enterRule();
|
||||
}
|
||||
@after {
|
||||
leaveRule();
|
||||
}:
|
||||
(
|
||||
this_STRING_0=RULE_STRING
|
||||
{
|
||||
newLeafNode(this_STRING_0, grammarAccess.getProductionRule2Access().getSTRINGTerminalRuleCall_0());
|
||||
}
|
||||
(
|
||||
{
|
||||
$current = forceCreateModelElement(
|
||||
grammarAccess.getProductionRule2Access().getEntryAction_1(),
|
||||
$current);
|
||||
}
|
||||
)
|
||||
(
|
||||
(
|
||||
lv_name_2_0=RULE_ID
|
||||
{
|
||||
newLeafNode(lv_name_2_0, grammarAccess.getProductionRule2Access().getNameIDTerminalRuleCall_2_0());
|
||||
}
|
||||
{
|
||||
if ($current==null) {
|
||||
$current = createModelElement(grammarAccess.getProductionRule2Rule());
|
||||
}
|
||||
setWithLastConsumed(
|
||||
$current,
|
||||
"name",
|
||||
lv_name_2_0,
|
||||
"org.eclipse.xtext.common.Terminals.ID");
|
||||
}
|
||||
)
|
||||
)
|
||||
)
|
||||
;
|
||||
|
||||
RULE_ID : '^'? ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'_'|'0'..'9')*;
|
||||
|
||||
RULE_INT : ('0'..'9')+;
|
||||
|
||||
RULE_STRING : ('"' ('\\' .|~(('\\'|'"')))* '"'|'\'' ('\\' .|~(('\\'|'\'')))* '\'');
|
||||
|
||||
RULE_ML_COMMENT : '/*' ( options {greedy=false;} : . )*'*/';
|
||||
|
||||
RULE_SL_COMMENT : '//' ~(('\n'|'\r'))* ('\r'? '\n')?;
|
||||
|
||||
RULE_WS : (' '|'\t'|'\r'|'\n')+;
|
||||
|
||||
RULE_ANY_OTHER : .;
|
|
@ -0,0 +1,7 @@
|
|||
RULE_ANY_OTHER=10
|
||||
RULE_ID=4
|
||||
RULE_INT=6
|
||||
RULE_ML_COMMENT=7
|
||||
RULE_SL_COMMENT=8
|
||||
RULE_STRING=5
|
||||
RULE_WS=9
|
|
@ -0,0 +1,716 @@
|
|||
package org.eclipse.xtext.testlanguages.parser.antlr.internal;
|
||||
|
||||
// Hack: Use our own Lexer superclass by means of import.
|
||||
// Currently there is no other way to specify the superclass for the lexer.
|
||||
import org.eclipse.xtext.parser.antlr.Lexer;
|
||||
|
||||
|
||||
import org.antlr.runtime.*;
|
||||
import java.util.Stack;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public class InternalActionTestLanguage3Lexer extends Lexer {
|
||||
public static final int RULE_ID=4;
|
||||
public static final int RULE_WS=9;
|
||||
public static final int RULE_STRING=5;
|
||||
public static final int RULE_ANY_OTHER=10;
|
||||
public static final int RULE_SL_COMMENT=8;
|
||||
public static final int RULE_INT=6;
|
||||
public static final int RULE_ML_COMMENT=7;
|
||||
public static final int EOF=-1;
|
||||
|
||||
// delegates
|
||||
// delegators
|
||||
|
||||
public InternalActionTestLanguage3Lexer() {;}
|
||||
public InternalActionTestLanguage3Lexer(CharStream input) {
|
||||
this(input, new RecognizerSharedState());
|
||||
}
|
||||
public InternalActionTestLanguage3Lexer(CharStream input, RecognizerSharedState state) {
|
||||
super(input,state);
|
||||
|
||||
}
|
||||
public String getGrammarFileName() { return "InternalActionTestLanguage3.g"; }
|
||||
|
||||
// $ANTLR start "RULE_ID"
|
||||
public final void mRULE_ID() throws RecognitionException {
|
||||
try {
|
||||
int _type = RULE_ID;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalActionTestLanguage3.g:241:9: ( ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* )
|
||||
// InternalActionTestLanguage3.g:241:11: ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )*
|
||||
{
|
||||
// InternalActionTestLanguage3.g:241:11: ( '^' )?
|
||||
int alt1=2;
|
||||
int LA1_0 = input.LA(1);
|
||||
|
||||
if ( (LA1_0=='^') ) {
|
||||
alt1=1;
|
||||
}
|
||||
switch (alt1) {
|
||||
case 1 :
|
||||
// InternalActionTestLanguage3.g:241:11: '^'
|
||||
{
|
||||
match('^');
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
if ( (input.LA(1)>='A' && input.LA(1)<='Z')||input.LA(1)=='_'||(input.LA(1)>='a' && input.LA(1)<='z') ) {
|
||||
input.consume();
|
||||
|
||||
}
|
||||
else {
|
||||
MismatchedSetException mse = new MismatchedSetException(null,input);
|
||||
recover(mse);
|
||||
throw mse;}
|
||||
|
||||
// InternalActionTestLanguage3.g:241:40: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )*
|
||||
loop2:
|
||||
do {
|
||||
int alt2=2;
|
||||
int LA2_0 = input.LA(1);
|
||||
|
||||
if ( ((LA2_0>='0' && LA2_0<='9')||(LA2_0>='A' && LA2_0<='Z')||LA2_0=='_'||(LA2_0>='a' && LA2_0<='z')) ) {
|
||||
alt2=1;
|
||||
}
|
||||
|
||||
|
||||
switch (alt2) {
|
||||
case 1 :
|
||||
// InternalActionTestLanguage3.g:
|
||||
{
|
||||
if ( (input.LA(1)>='0' && input.LA(1)<='9')||(input.LA(1)>='A' && input.LA(1)<='Z')||input.LA(1)=='_'||(input.LA(1)>='a' && input.LA(1)<='z') ) {
|
||||
input.consume();
|
||||
|
||||
}
|
||||
else {
|
||||
MismatchedSetException mse = new MismatchedSetException(null,input);
|
||||
recover(mse);
|
||||
throw mse;}
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
break loop2;
|
||||
}
|
||||
} while (true);
|
||||
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "RULE_ID"
|
||||
|
||||
// $ANTLR start "RULE_INT"
|
||||
public final void mRULE_INT() throws RecognitionException {
|
||||
try {
|
||||
int _type = RULE_INT;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalActionTestLanguage3.g:243:10: ( ( '0' .. '9' )+ )
|
||||
// InternalActionTestLanguage3.g:243:12: ( '0' .. '9' )+
|
||||
{
|
||||
// InternalActionTestLanguage3.g:243:12: ( '0' .. '9' )+
|
||||
int cnt3=0;
|
||||
loop3:
|
||||
do {
|
||||
int alt3=2;
|
||||
int LA3_0 = input.LA(1);
|
||||
|
||||
if ( ((LA3_0>='0' && LA3_0<='9')) ) {
|
||||
alt3=1;
|
||||
}
|
||||
|
||||
|
||||
switch (alt3) {
|
||||
case 1 :
|
||||
// InternalActionTestLanguage3.g:243:13: '0' .. '9'
|
||||
{
|
||||
matchRange('0','9');
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
if ( cnt3 >= 1 ) break loop3;
|
||||
EarlyExitException eee =
|
||||
new EarlyExitException(3, input);
|
||||
throw eee;
|
||||
}
|
||||
cnt3++;
|
||||
} while (true);
|
||||
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "RULE_INT"
|
||||
|
||||
// $ANTLR start "RULE_STRING"
|
||||
public final void mRULE_STRING() throws RecognitionException {
|
||||
try {
|
||||
int _type = RULE_STRING;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalActionTestLanguage3.g:245:13: ( ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) )
|
||||
// InternalActionTestLanguage3.g:245:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' )
|
||||
{
|
||||
// InternalActionTestLanguage3.g:245:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' )
|
||||
int alt6=2;
|
||||
int LA6_0 = input.LA(1);
|
||||
|
||||
if ( (LA6_0=='\"') ) {
|
||||
alt6=1;
|
||||
}
|
||||
else if ( (LA6_0=='\'') ) {
|
||||
alt6=2;
|
||||
}
|
||||
else {
|
||||
NoViableAltException nvae =
|
||||
new NoViableAltException("", 6, 0, input);
|
||||
|
||||
throw nvae;
|
||||
}
|
||||
switch (alt6) {
|
||||
case 1 :
|
||||
// InternalActionTestLanguage3.g:245:16: '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"'
|
||||
{
|
||||
match('\"');
|
||||
// InternalActionTestLanguage3.g:245:20: ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )*
|
||||
loop4:
|
||||
do {
|
||||
int alt4=3;
|
||||
int LA4_0 = input.LA(1);
|
||||
|
||||
if ( (LA4_0=='\\') ) {
|
||||
alt4=1;
|
||||
}
|
||||
else if ( ((LA4_0>='\u0000' && LA4_0<='!')||(LA4_0>='#' && LA4_0<='[')||(LA4_0>=']' && LA4_0<='\uFFFF')) ) {
|
||||
alt4=2;
|
||||
}
|
||||
|
||||
|
||||
switch (alt4) {
|
||||
case 1 :
|
||||
// InternalActionTestLanguage3.g:245:21: '\\\\' .
|
||||
{
|
||||
match('\\');
|
||||
matchAny();
|
||||
|
||||
}
|
||||
break;
|
||||
case 2 :
|
||||
// InternalActionTestLanguage3.g:245:28: ~ ( ( '\\\\' | '\"' ) )
|
||||
{
|
||||
if ( (input.LA(1)>='\u0000' && input.LA(1)<='!')||(input.LA(1)>='#' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) {
|
||||
input.consume();
|
||||
|
||||
}
|
||||
else {
|
||||
MismatchedSetException mse = new MismatchedSetException(null,input);
|
||||
recover(mse);
|
||||
throw mse;}
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
break loop4;
|
||||
}
|
||||
} while (true);
|
||||
|
||||
match('\"');
|
||||
|
||||
}
|
||||
break;
|
||||
case 2 :
|
||||
// InternalActionTestLanguage3.g:245:48: '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\''
|
||||
{
|
||||
match('\'');
|
||||
// InternalActionTestLanguage3.g:245:53: ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )*
|
||||
loop5:
|
||||
do {
|
||||
int alt5=3;
|
||||
int LA5_0 = input.LA(1);
|
||||
|
||||
if ( (LA5_0=='\\') ) {
|
||||
alt5=1;
|
||||
}
|
||||
else if ( ((LA5_0>='\u0000' && LA5_0<='&')||(LA5_0>='(' && LA5_0<='[')||(LA5_0>=']' && LA5_0<='\uFFFF')) ) {
|
||||
alt5=2;
|
||||
}
|
||||
|
||||
|
||||
switch (alt5) {
|
||||
case 1 :
|
||||
// InternalActionTestLanguage3.g:245:54: '\\\\' .
|
||||
{
|
||||
match('\\');
|
||||
matchAny();
|
||||
|
||||
}
|
||||
break;
|
||||
case 2 :
|
||||
// InternalActionTestLanguage3.g:245:61: ~ ( ( '\\\\' | '\\'' ) )
|
||||
{
|
||||
if ( (input.LA(1)>='\u0000' && input.LA(1)<='&')||(input.LA(1)>='(' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) {
|
||||
input.consume();
|
||||
|
||||
}
|
||||
else {
|
||||
MismatchedSetException mse = new MismatchedSetException(null,input);
|
||||
recover(mse);
|
||||
throw mse;}
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
break loop5;
|
||||
}
|
||||
} while (true);
|
||||
|
||||
match('\'');
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "RULE_STRING"
|
||||
|
||||
// $ANTLR start "RULE_ML_COMMENT"
|
||||
public final void mRULE_ML_COMMENT() throws RecognitionException {
|
||||
try {
|
||||
int _type = RULE_ML_COMMENT;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalActionTestLanguage3.g:247:17: ( '/*' ( options {greedy=false; } : . )* '*/' )
|
||||
// InternalActionTestLanguage3.g:247:19: '/*' ( options {greedy=false; } : . )* '*/'
|
||||
{
|
||||
match("/*");
|
||||
|
||||
// InternalActionTestLanguage3.g:247:24: ( options {greedy=false; } : . )*
|
||||
loop7:
|
||||
do {
|
||||
int alt7=2;
|
||||
int LA7_0 = input.LA(1);
|
||||
|
||||
if ( (LA7_0=='*') ) {
|
||||
int LA7_1 = input.LA(2);
|
||||
|
||||
if ( (LA7_1=='/') ) {
|
||||
alt7=2;
|
||||
}
|
||||
else if ( ((LA7_1>='\u0000' && LA7_1<='.')||(LA7_1>='0' && LA7_1<='\uFFFF')) ) {
|
||||
alt7=1;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else if ( ((LA7_0>='\u0000' && LA7_0<=')')||(LA7_0>='+' && LA7_0<='\uFFFF')) ) {
|
||||
alt7=1;
|
||||
}
|
||||
|
||||
|
||||
switch (alt7) {
|
||||
case 1 :
|
||||
// InternalActionTestLanguage3.g:247:52: .
|
||||
{
|
||||
matchAny();
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
break loop7;
|
||||
}
|
||||
} while (true);
|
||||
|
||||
match("*/");
|
||||
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "RULE_ML_COMMENT"
|
||||
|
||||
// $ANTLR start "RULE_SL_COMMENT"
|
||||
public final void mRULE_SL_COMMENT() throws RecognitionException {
|
||||
try {
|
||||
int _type = RULE_SL_COMMENT;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalActionTestLanguage3.g:249:17: ( '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? )
|
||||
// InternalActionTestLanguage3.g:249:19: '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )?
|
||||
{
|
||||
match("//");
|
||||
|
||||
// InternalActionTestLanguage3.g:249:24: (~ ( ( '\\n' | '\\r' ) ) )*
|
||||
loop8:
|
||||
do {
|
||||
int alt8=2;
|
||||
int LA8_0 = input.LA(1);
|
||||
|
||||
if ( ((LA8_0>='\u0000' && LA8_0<='\t')||(LA8_0>='\u000B' && LA8_0<='\f')||(LA8_0>='\u000E' && LA8_0<='\uFFFF')) ) {
|
||||
alt8=1;
|
||||
}
|
||||
|
||||
|
||||
switch (alt8) {
|
||||
case 1 :
|
||||
// InternalActionTestLanguage3.g:249:24: ~ ( ( '\\n' | '\\r' ) )
|
||||
{
|
||||
if ( (input.LA(1)>='\u0000' && input.LA(1)<='\t')||(input.LA(1)>='\u000B' && input.LA(1)<='\f')||(input.LA(1)>='\u000E' && input.LA(1)<='\uFFFF') ) {
|
||||
input.consume();
|
||||
|
||||
}
|
||||
else {
|
||||
MismatchedSetException mse = new MismatchedSetException(null,input);
|
||||
recover(mse);
|
||||
throw mse;}
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
break loop8;
|
||||
}
|
||||
} while (true);
|
||||
|
||||
// InternalActionTestLanguage3.g:249:40: ( ( '\\r' )? '\\n' )?
|
||||
int alt10=2;
|
||||
int LA10_0 = input.LA(1);
|
||||
|
||||
if ( (LA10_0=='\n'||LA10_0=='\r') ) {
|
||||
alt10=1;
|
||||
}
|
||||
switch (alt10) {
|
||||
case 1 :
|
||||
// InternalActionTestLanguage3.g:249:41: ( '\\r' )? '\\n'
|
||||
{
|
||||
// InternalActionTestLanguage3.g:249:41: ( '\\r' )?
|
||||
int alt9=2;
|
||||
int LA9_0 = input.LA(1);
|
||||
|
||||
if ( (LA9_0=='\r') ) {
|
||||
alt9=1;
|
||||
}
|
||||
switch (alt9) {
|
||||
case 1 :
|
||||
// InternalActionTestLanguage3.g:249:41: '\\r'
|
||||
{
|
||||
match('\r');
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
match('\n');
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "RULE_SL_COMMENT"
|
||||
|
||||
// $ANTLR start "RULE_WS"
|
||||
public final void mRULE_WS() throws RecognitionException {
|
||||
try {
|
||||
int _type = RULE_WS;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalActionTestLanguage3.g:251:9: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ )
|
||||
// InternalActionTestLanguage3.g:251:11: ( ' ' | '\\t' | '\\r' | '\\n' )+
|
||||
{
|
||||
// InternalActionTestLanguage3.g:251:11: ( ' ' | '\\t' | '\\r' | '\\n' )+
|
||||
int cnt11=0;
|
||||
loop11:
|
||||
do {
|
||||
int alt11=2;
|
||||
int LA11_0 = input.LA(1);
|
||||
|
||||
if ( ((LA11_0>='\t' && LA11_0<='\n')||LA11_0=='\r'||LA11_0==' ') ) {
|
||||
alt11=1;
|
||||
}
|
||||
|
||||
|
||||
switch (alt11) {
|
||||
case 1 :
|
||||
// InternalActionTestLanguage3.g:
|
||||
{
|
||||
if ( (input.LA(1)>='\t' && input.LA(1)<='\n')||input.LA(1)=='\r'||input.LA(1)==' ' ) {
|
||||
input.consume();
|
||||
|
||||
}
|
||||
else {
|
||||
MismatchedSetException mse = new MismatchedSetException(null,input);
|
||||
recover(mse);
|
||||
throw mse;}
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
if ( cnt11 >= 1 ) break loop11;
|
||||
EarlyExitException eee =
|
||||
new EarlyExitException(11, input);
|
||||
throw eee;
|
||||
}
|
||||
cnt11++;
|
||||
} while (true);
|
||||
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "RULE_WS"
|
||||
|
||||
// $ANTLR start "RULE_ANY_OTHER"
|
||||
public final void mRULE_ANY_OTHER() throws RecognitionException {
|
||||
try {
|
||||
int _type = RULE_ANY_OTHER;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalActionTestLanguage3.g:253:16: ( . )
|
||||
// InternalActionTestLanguage3.g:253:18: .
|
||||
{
|
||||
matchAny();
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "RULE_ANY_OTHER"
|
||||
|
||||
public void mTokens() throws RecognitionException {
|
||||
// InternalActionTestLanguage3.g:1:8: ( RULE_ID | RULE_INT | RULE_STRING | RULE_ML_COMMENT | RULE_SL_COMMENT | RULE_WS | RULE_ANY_OTHER )
|
||||
int alt12=7;
|
||||
alt12 = dfa12.predict(input);
|
||||
switch (alt12) {
|
||||
case 1 :
|
||||
// InternalActionTestLanguage3.g:1:10: RULE_ID
|
||||
{
|
||||
mRULE_ID();
|
||||
|
||||
}
|
||||
break;
|
||||
case 2 :
|
||||
// InternalActionTestLanguage3.g:1:18: RULE_INT
|
||||
{
|
||||
mRULE_INT();
|
||||
|
||||
}
|
||||
break;
|
||||
case 3 :
|
||||
// InternalActionTestLanguage3.g:1:27: RULE_STRING
|
||||
{
|
||||
mRULE_STRING();
|
||||
|
||||
}
|
||||
break;
|
||||
case 4 :
|
||||
// InternalActionTestLanguage3.g:1:39: RULE_ML_COMMENT
|
||||
{
|
||||
mRULE_ML_COMMENT();
|
||||
|
||||
}
|
||||
break;
|
||||
case 5 :
|
||||
// InternalActionTestLanguage3.g:1:55: RULE_SL_COMMENT
|
||||
{
|
||||
mRULE_SL_COMMENT();
|
||||
|
||||
}
|
||||
break;
|
||||
case 6 :
|
||||
// InternalActionTestLanguage3.g:1:71: RULE_WS
|
||||
{
|
||||
mRULE_WS();
|
||||
|
||||
}
|
||||
break;
|
||||
case 7 :
|
||||
// InternalActionTestLanguage3.g:1:79: RULE_ANY_OTHER
|
||||
{
|
||||
mRULE_ANY_OTHER();
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
protected DFA12 dfa12 = new DFA12(this);
|
||||
static final String DFA12_eotS =
|
||||
"\1\uffff\1\10\2\uffff\3\10\10\uffff";
|
||||
static final String DFA12_eofS =
|
||||
"\17\uffff";
|
||||
static final String DFA12_minS =
|
||||
"\1\0\1\101\2\uffff\2\0\1\52\10\uffff";
|
||||
static final String DFA12_maxS =
|
||||
"\1\uffff\1\172\2\uffff\2\uffff\1\57\10\uffff";
|
||||
static final String DFA12_acceptS =
|
||||
"\2\uffff\1\1\1\2\3\uffff\1\6\1\7\1\1\1\2\1\3\1\4\1\5\1\6";
|
||||
static final String DFA12_specialS =
|
||||
"\1\2\3\uffff\1\0\1\1\11\uffff}>";
|
||||
static final String[] DFA12_transitionS = DFA12_transitionS_.DFA12_transitionS;
|
||||
private static final class DFA12_transitionS_ {
|
||||
static final String[] DFA12_transitionS = {
|
||||
"\11\10\2\7\2\10\1\7\22\10\1\7\1\10\1\4\4\10\1\5\7\10\1\6\12\3\7\10\32\2\3\10\1\1\1\2\1\10\32\2\uff85\10",
|
||||
"\32\11\4\uffff\1\11\1\uffff\32\11",
|
||||
"",
|
||||
"",
|
||||
"\0\13",
|
||||
"\0\13",
|
||||
"\1\14\4\uffff\1\15",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
""
|
||||
};
|
||||
}
|
||||
|
||||
static final short[] DFA12_eot = DFA.unpackEncodedString(DFA12_eotS);
|
||||
static final short[] DFA12_eof = DFA.unpackEncodedString(DFA12_eofS);
|
||||
static final char[] DFA12_min = DFA.unpackEncodedStringToUnsignedChars(DFA12_minS);
|
||||
static final char[] DFA12_max = DFA.unpackEncodedStringToUnsignedChars(DFA12_maxS);
|
||||
static final short[] DFA12_accept = DFA.unpackEncodedString(DFA12_acceptS);
|
||||
static final short[] DFA12_special = DFA.unpackEncodedString(DFA12_specialS);
|
||||
static final short[][] DFA12_transition;
|
||||
|
||||
static {
|
||||
int numStates = DFA12_transitionS.length;
|
||||
DFA12_transition = new short[numStates][];
|
||||
for (int i=0; i<numStates; i++) {
|
||||
DFA12_transition[i] = DFA.unpackEncodedString(DFA12_transitionS[i]);
|
||||
}
|
||||
}
|
||||
|
||||
static class DFA12 extends DFA {
|
||||
|
||||
public DFA12(BaseRecognizer recognizer) {
|
||||
this.recognizer = recognizer;
|
||||
this.decisionNumber = 12;
|
||||
this.eot = DFA12_eot;
|
||||
this.eof = DFA12_eof;
|
||||
this.min = DFA12_min;
|
||||
this.max = DFA12_max;
|
||||
this.accept = DFA12_accept;
|
||||
this.special = DFA12_special;
|
||||
this.transition = DFA12_transition;
|
||||
}
|
||||
public String getDescription() {
|
||||
return "1:1: Tokens : ( RULE_ID | RULE_INT | RULE_STRING | RULE_ML_COMMENT | RULE_SL_COMMENT | RULE_WS | RULE_ANY_OTHER );";
|
||||
}
|
||||
public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
|
||||
IntStream input = _input;
|
||||
int _s = s;
|
||||
switch ( s ) {
|
||||
case 0 :
|
||||
int LA12_4 = input.LA(1);
|
||||
|
||||
s = -1;
|
||||
if ( ((LA12_4>='\u0000' && LA12_4<='\uFFFF')) ) {s = 11;}
|
||||
|
||||
else s = 8;
|
||||
|
||||
if ( s>=0 ) return s;
|
||||
break;
|
||||
case 1 :
|
||||
int LA12_5 = input.LA(1);
|
||||
|
||||
s = -1;
|
||||
if ( ((LA12_5>='\u0000' && LA12_5<='\uFFFF')) ) {s = 11;}
|
||||
|
||||
else s = 8;
|
||||
|
||||
if ( s>=0 ) return s;
|
||||
break;
|
||||
case 2 :
|
||||
int LA12_0 = input.LA(1);
|
||||
|
||||
s = -1;
|
||||
if ( (LA12_0=='^') ) {s = 1;}
|
||||
|
||||
else if ( ((LA12_0>='A' && LA12_0<='Z')||LA12_0=='_'||(LA12_0>='a' && LA12_0<='z')) ) {s = 2;}
|
||||
|
||||
else if ( ((LA12_0>='0' && LA12_0<='9')) ) {s = 3;}
|
||||
|
||||
else if ( (LA12_0=='\"') ) {s = 4;}
|
||||
|
||||
else if ( (LA12_0=='\'') ) {s = 5;}
|
||||
|
||||
else if ( (LA12_0=='/') ) {s = 6;}
|
||||
|
||||
else if ( ((LA12_0>='\t' && LA12_0<='\n')||LA12_0=='\r'||LA12_0==' ') ) {s = 7;}
|
||||
|
||||
else if ( ((LA12_0>='\u0000' && LA12_0<='\b')||(LA12_0>='\u000B' && LA12_0<='\f')||(LA12_0>='\u000E' && LA12_0<='\u001F')||LA12_0=='!'||(LA12_0>='#' && LA12_0<='&')||(LA12_0>='(' && LA12_0<='.')||(LA12_0>=':' && LA12_0<='@')||(LA12_0>='[' && LA12_0<=']')||LA12_0=='`'||(LA12_0>='{' && LA12_0<='\uFFFF')) ) {s = 8;}
|
||||
|
||||
if ( s>=0 ) return s;
|
||||
break;
|
||||
}
|
||||
NoViableAltException nvae =
|
||||
new NoViableAltException(getDescription(), 12, _s, input);
|
||||
error(nvae);
|
||||
throw nvae;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,556 @@
|
|||
package org.eclipse.xtext.testlanguages.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.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.testlanguages.services.ActionTestLanguage3GrammarAccess;
|
||||
|
||||
|
||||
|
||||
import org.antlr.runtime.*;
|
||||
import java.util.Stack;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public class InternalActionTestLanguage3Parser extends AbstractInternalAntlrParser {
|
||||
public static final String[] tokenNames = new String[] {
|
||||
"<invalid>", "<EOR>", "<DOWN>", "<UP>", "RULE_ID", "RULE_STRING", "RULE_INT", "RULE_ML_COMMENT", "RULE_SL_COMMENT", "RULE_WS", "RULE_ANY_OTHER"
|
||||
};
|
||||
public static final int RULE_ID=4;
|
||||
public static final int RULE_WS=9;
|
||||
public static final int RULE_STRING=5;
|
||||
public static final int RULE_ANY_OTHER=10;
|
||||
public static final int RULE_SL_COMMENT=8;
|
||||
public static final int RULE_INT=6;
|
||||
public static final int RULE_ML_COMMENT=7;
|
||||
public static final int EOF=-1;
|
||||
|
||||
// delegates
|
||||
// delegators
|
||||
|
||||
|
||||
public InternalActionTestLanguage3Parser(TokenStream input) {
|
||||
this(input, new RecognizerSharedState());
|
||||
}
|
||||
public InternalActionTestLanguage3Parser(TokenStream input, RecognizerSharedState state) {
|
||||
super(input, state);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public String[] getTokenNames() { return InternalActionTestLanguage3Parser.tokenNames; }
|
||||
public String getGrammarFileName() { return "InternalActionTestLanguage3.g"; }
|
||||
|
||||
|
||||
|
||||
private ActionTestLanguage3GrammarAccess grammarAccess;
|
||||
|
||||
public InternalActionTestLanguage3Parser(TokenStream input, ActionTestLanguage3GrammarAccess grammarAccess) {
|
||||
this(input);
|
||||
this.grammarAccess = grammarAccess;
|
||||
registerRules(grammarAccess.getGrammar());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getFirstRuleName() {
|
||||
return "ProductionRules";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ActionTestLanguage3GrammarAccess getGrammarAccess() {
|
||||
return grammarAccess;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// $ANTLR start "entryRuleProductionRules"
|
||||
// InternalActionTestLanguage3.g:64:1: entryRuleProductionRules returns [EObject current=null] : iv_ruleProductionRules= ruleProductionRules EOF ;
|
||||
public final EObject entryRuleProductionRules() throws RecognitionException {
|
||||
EObject current = null;
|
||||
|
||||
EObject iv_ruleProductionRules = null;
|
||||
|
||||
|
||||
try {
|
||||
// InternalActionTestLanguage3.g:64:56: (iv_ruleProductionRules= ruleProductionRules EOF )
|
||||
// InternalActionTestLanguage3.g:65:2: iv_ruleProductionRules= ruleProductionRules EOF
|
||||
{
|
||||
newCompositeNode(grammarAccess.getProductionRulesRule());
|
||||
pushFollow(FollowSets000.FOLLOW_1);
|
||||
iv_ruleProductionRules=ruleProductionRules();
|
||||
|
||||
state._fsp--;
|
||||
|
||||
current =iv_ruleProductionRules;
|
||||
match(input,EOF,FollowSets000.FOLLOW_2);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
catch (RecognitionException re) {
|
||||
recover(input,re);
|
||||
appendSkippedTokens();
|
||||
}
|
||||
finally {
|
||||
}
|
||||
return current;
|
||||
}
|
||||
// $ANTLR end "entryRuleProductionRules"
|
||||
|
||||
|
||||
// $ANTLR start "ruleProductionRules"
|
||||
// InternalActionTestLanguage3.g:71:1: ruleProductionRules returns [EObject current=null] : (this_ProductionRule1_0= ruleProductionRule1 | this_ProductionRule2_1= ruleProductionRule2 ) ;
|
||||
public final EObject ruleProductionRules() throws RecognitionException {
|
||||
EObject current = null;
|
||||
|
||||
EObject this_ProductionRule1_0 = null;
|
||||
|
||||
EObject this_ProductionRule2_1 = null;
|
||||
|
||||
|
||||
|
||||
enterRule();
|
||||
|
||||
try {
|
||||
// InternalActionTestLanguage3.g:77:2: ( (this_ProductionRule1_0= ruleProductionRule1 | this_ProductionRule2_1= ruleProductionRule2 ) )
|
||||
// InternalActionTestLanguage3.g:78:2: (this_ProductionRule1_0= ruleProductionRule1 | this_ProductionRule2_1= ruleProductionRule2 )
|
||||
{
|
||||
// InternalActionTestLanguage3.g:78:2: (this_ProductionRule1_0= ruleProductionRule1 | this_ProductionRule2_1= ruleProductionRule2 )
|
||||
int alt1=2;
|
||||
int LA1_0 = input.LA(1);
|
||||
|
||||
if ( (LA1_0==RULE_ID||LA1_0==RULE_INT) ) {
|
||||
alt1=1;
|
||||
}
|
||||
else if ( (LA1_0==RULE_STRING) ) {
|
||||
int LA1_2 = input.LA(2);
|
||||
|
||||
if ( (LA1_2==RULE_INT) ) {
|
||||
alt1=1;
|
||||
}
|
||||
else if ( (LA1_2==RULE_ID) ) {
|
||||
alt1=2;
|
||||
}
|
||||
else {
|
||||
NoViableAltException nvae =
|
||||
new NoViableAltException("", 1, 2, input);
|
||||
|
||||
throw nvae;
|
||||
}
|
||||
}
|
||||
else {
|
||||
NoViableAltException nvae =
|
||||
new NoViableAltException("", 1, 0, input);
|
||||
|
||||
throw nvae;
|
||||
}
|
||||
switch (alt1) {
|
||||
case 1 :
|
||||
// InternalActionTestLanguage3.g:79:3: this_ProductionRule1_0= ruleProductionRule1
|
||||
{
|
||||
|
||||
newCompositeNode(grammarAccess.getProductionRulesAccess().getProductionRule1ParserRuleCall_0());
|
||||
|
||||
pushFollow(FollowSets000.FOLLOW_2);
|
||||
this_ProductionRule1_0=ruleProductionRule1();
|
||||
|
||||
state._fsp--;
|
||||
|
||||
|
||||
current = this_ProductionRule1_0;
|
||||
afterParserOrEnumRuleCall();
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
case 2 :
|
||||
// InternalActionTestLanguage3.g:88:3: this_ProductionRule2_1= ruleProductionRule2
|
||||
{
|
||||
|
||||
newCompositeNode(grammarAccess.getProductionRulesAccess().getProductionRule2ParserRuleCall_1());
|
||||
|
||||
pushFollow(FollowSets000.FOLLOW_2);
|
||||
this_ProductionRule2_1=ruleProductionRule2();
|
||||
|
||||
state._fsp--;
|
||||
|
||||
|
||||
current = this_ProductionRule2_1;
|
||||
afterParserOrEnumRuleCall();
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
leaveRule();
|
||||
|
||||
}
|
||||
|
||||
catch (RecognitionException re) {
|
||||
recover(input,re);
|
||||
appendSkippedTokens();
|
||||
}
|
||||
finally {
|
||||
}
|
||||
return current;
|
||||
}
|
||||
// $ANTLR end "ruleProductionRules"
|
||||
|
||||
|
||||
// $ANTLR start "entryRuleProductionRule1"
|
||||
// InternalActionTestLanguage3.g:100:1: entryRuleProductionRule1 returns [EObject current=null] : iv_ruleProductionRule1= ruleProductionRule1 EOF ;
|
||||
public final EObject entryRuleProductionRule1() throws RecognitionException {
|
||||
EObject current = null;
|
||||
|
||||
EObject iv_ruleProductionRule1 = null;
|
||||
|
||||
|
||||
try {
|
||||
// InternalActionTestLanguage3.g:100:56: (iv_ruleProductionRule1= ruleProductionRule1 EOF )
|
||||
// InternalActionTestLanguage3.g:101:2: iv_ruleProductionRule1= ruleProductionRule1 EOF
|
||||
{
|
||||
newCompositeNode(grammarAccess.getProductionRule1Rule());
|
||||
pushFollow(FollowSets000.FOLLOW_1);
|
||||
iv_ruleProductionRule1=ruleProductionRule1();
|
||||
|
||||
state._fsp--;
|
||||
|
||||
current =iv_ruleProductionRule1;
|
||||
match(input,EOF,FollowSets000.FOLLOW_2);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
catch (RecognitionException re) {
|
||||
recover(input,re);
|
||||
appendSkippedTokens();
|
||||
}
|
||||
finally {
|
||||
}
|
||||
return current;
|
||||
}
|
||||
// $ANTLR end "entryRuleProductionRule1"
|
||||
|
||||
|
||||
// $ANTLR start "ruleProductionRule1"
|
||||
// InternalActionTestLanguage3.g:107:1: ruleProductionRule1 returns [EObject current=null] : ( () ( (lv_id_1_0= RULE_ID ) )? () ( (lv_string_3_0= RULE_STRING ) )? () ( (lv_i_5_0= RULE_INT ) ) ) ;
|
||||
public final EObject ruleProductionRule1() throws RecognitionException {
|
||||
EObject current = null;
|
||||
|
||||
Token lv_id_1_0=null;
|
||||
Token lv_string_3_0=null;
|
||||
Token lv_i_5_0=null;
|
||||
|
||||
|
||||
enterRule();
|
||||
|
||||
try {
|
||||
// InternalActionTestLanguage3.g:113:2: ( ( () ( (lv_id_1_0= RULE_ID ) )? () ( (lv_string_3_0= RULE_STRING ) )? () ( (lv_i_5_0= RULE_INT ) ) ) )
|
||||
// InternalActionTestLanguage3.g:114:2: ( () ( (lv_id_1_0= RULE_ID ) )? () ( (lv_string_3_0= RULE_STRING ) )? () ( (lv_i_5_0= RULE_INT ) ) )
|
||||
{
|
||||
// InternalActionTestLanguage3.g:114:2: ( () ( (lv_id_1_0= RULE_ID ) )? () ( (lv_string_3_0= RULE_STRING ) )? () ( (lv_i_5_0= RULE_INT ) ) )
|
||||
// InternalActionTestLanguage3.g:115:3: () ( (lv_id_1_0= RULE_ID ) )? () ( (lv_string_3_0= RULE_STRING ) )? () ( (lv_i_5_0= RULE_INT ) )
|
||||
{
|
||||
// InternalActionTestLanguage3.g:115:3: ()
|
||||
// InternalActionTestLanguage3.g:116:4:
|
||||
{
|
||||
|
||||
current = forceCreateModelElement(
|
||||
grammarAccess.getProductionRule1Access().getP1Action_0(),
|
||||
current);
|
||||
|
||||
|
||||
}
|
||||
|
||||
// InternalActionTestLanguage3.g:122:3: ( (lv_id_1_0= RULE_ID ) )?
|
||||
int alt2=2;
|
||||
int LA2_0 = input.LA(1);
|
||||
|
||||
if ( (LA2_0==RULE_ID) ) {
|
||||
alt2=1;
|
||||
}
|
||||
switch (alt2) {
|
||||
case 1 :
|
||||
// InternalActionTestLanguage3.g:123:4: (lv_id_1_0= RULE_ID )
|
||||
{
|
||||
// InternalActionTestLanguage3.g:123:4: (lv_id_1_0= RULE_ID )
|
||||
// InternalActionTestLanguage3.g:124:5: lv_id_1_0= RULE_ID
|
||||
{
|
||||
lv_id_1_0=(Token)match(input,RULE_ID,FollowSets000.FOLLOW_3);
|
||||
|
||||
newLeafNode(lv_id_1_0, grammarAccess.getProductionRule1Access().getIdIDTerminalRuleCall_1_0());
|
||||
|
||||
|
||||
if (current==null) {
|
||||
current = createModelElement(grammarAccess.getProductionRule1Rule());
|
||||
}
|
||||
setWithLastConsumed(
|
||||
current,
|
||||
"id",
|
||||
lv_id_1_0,
|
||||
"org.eclipse.xtext.common.Terminals.ID");
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
// InternalActionTestLanguage3.g:140:3: ()
|
||||
// InternalActionTestLanguage3.g:141:4:
|
||||
{
|
||||
|
||||
current = forceCreateModelElementAndSet(
|
||||
grammarAccess.getProductionRule1Access().getP2PAction_2(),
|
||||
current);
|
||||
|
||||
|
||||
}
|
||||
|
||||
// InternalActionTestLanguage3.g:147:3: ( (lv_string_3_0= RULE_STRING ) )?
|
||||
int alt3=2;
|
||||
int LA3_0 = input.LA(1);
|
||||
|
||||
if ( (LA3_0==RULE_STRING) ) {
|
||||
alt3=1;
|
||||
}
|
||||
switch (alt3) {
|
||||
case 1 :
|
||||
// InternalActionTestLanguage3.g:148:4: (lv_string_3_0= RULE_STRING )
|
||||
{
|
||||
// InternalActionTestLanguage3.g:148:4: (lv_string_3_0= RULE_STRING )
|
||||
// InternalActionTestLanguage3.g:149:5: lv_string_3_0= RULE_STRING
|
||||
{
|
||||
lv_string_3_0=(Token)match(input,RULE_STRING,FollowSets000.FOLLOW_4);
|
||||
|
||||
newLeafNode(lv_string_3_0, grammarAccess.getProductionRule1Access().getStringSTRINGTerminalRuleCall_3_0());
|
||||
|
||||
|
||||
if (current==null) {
|
||||
current = createModelElement(grammarAccess.getProductionRule1Rule());
|
||||
}
|
||||
setWithLastConsumed(
|
||||
current,
|
||||
"string",
|
||||
lv_string_3_0,
|
||||
"org.eclipse.xtext.common.Terminals.STRING");
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
// InternalActionTestLanguage3.g:165:3: ()
|
||||
// InternalActionTestLanguage3.g:166:4:
|
||||
{
|
||||
|
||||
current = forceCreateModelElementAndSet(
|
||||
grammarAccess.getProductionRule1Access().getP3PAction_4(),
|
||||
current);
|
||||
|
||||
|
||||
}
|
||||
|
||||
// InternalActionTestLanguage3.g:172:3: ( (lv_i_5_0= RULE_INT ) )
|
||||
// InternalActionTestLanguage3.g:173:4: (lv_i_5_0= RULE_INT )
|
||||
{
|
||||
// InternalActionTestLanguage3.g:173:4: (lv_i_5_0= RULE_INT )
|
||||
// InternalActionTestLanguage3.g:174:5: lv_i_5_0= RULE_INT
|
||||
{
|
||||
lv_i_5_0=(Token)match(input,RULE_INT,FollowSets000.FOLLOW_2);
|
||||
|
||||
newLeafNode(lv_i_5_0, grammarAccess.getProductionRule1Access().getIINTTerminalRuleCall_5_0());
|
||||
|
||||
|
||||
if (current==null) {
|
||||
current = createModelElement(grammarAccess.getProductionRule1Rule());
|
||||
}
|
||||
setWithLastConsumed(
|
||||
current,
|
||||
"i",
|
||||
lv_i_5_0,
|
||||
"org.eclipse.xtext.common.Terminals.INT");
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
leaveRule();
|
||||
|
||||
}
|
||||
|
||||
catch (RecognitionException re) {
|
||||
recover(input,re);
|
||||
appendSkippedTokens();
|
||||
}
|
||||
finally {
|
||||
}
|
||||
return current;
|
||||
}
|
||||
// $ANTLR end "ruleProductionRule1"
|
||||
|
||||
|
||||
// $ANTLR start "entryRuleProductionRule2"
|
||||
// InternalActionTestLanguage3.g:194:1: entryRuleProductionRule2 returns [EObject current=null] : iv_ruleProductionRule2= ruleProductionRule2 EOF ;
|
||||
public final EObject entryRuleProductionRule2() throws RecognitionException {
|
||||
EObject current = null;
|
||||
|
||||
EObject iv_ruleProductionRule2 = null;
|
||||
|
||||
|
||||
try {
|
||||
// InternalActionTestLanguage3.g:194:56: (iv_ruleProductionRule2= ruleProductionRule2 EOF )
|
||||
// InternalActionTestLanguage3.g:195:2: iv_ruleProductionRule2= ruleProductionRule2 EOF
|
||||
{
|
||||
newCompositeNode(grammarAccess.getProductionRule2Rule());
|
||||
pushFollow(FollowSets000.FOLLOW_1);
|
||||
iv_ruleProductionRule2=ruleProductionRule2();
|
||||
|
||||
state._fsp--;
|
||||
|
||||
current =iv_ruleProductionRule2;
|
||||
match(input,EOF,FollowSets000.FOLLOW_2);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
catch (RecognitionException re) {
|
||||
recover(input,re);
|
||||
appendSkippedTokens();
|
||||
}
|
||||
finally {
|
||||
}
|
||||
return current;
|
||||
}
|
||||
// $ANTLR end "entryRuleProductionRule2"
|
||||
|
||||
|
||||
// $ANTLR start "ruleProductionRule2"
|
||||
// InternalActionTestLanguage3.g:201:1: ruleProductionRule2 returns [EObject current=null] : (this_STRING_0= RULE_STRING () ( (lv_name_2_0= RULE_ID ) ) ) ;
|
||||
public final EObject ruleProductionRule2() throws RecognitionException {
|
||||
EObject current = null;
|
||||
|
||||
Token this_STRING_0=null;
|
||||
Token lv_name_2_0=null;
|
||||
|
||||
|
||||
enterRule();
|
||||
|
||||
try {
|
||||
// InternalActionTestLanguage3.g:207:2: ( (this_STRING_0= RULE_STRING () ( (lv_name_2_0= RULE_ID ) ) ) )
|
||||
// InternalActionTestLanguage3.g:208:2: (this_STRING_0= RULE_STRING () ( (lv_name_2_0= RULE_ID ) ) )
|
||||
{
|
||||
// InternalActionTestLanguage3.g:208:2: (this_STRING_0= RULE_STRING () ( (lv_name_2_0= RULE_ID ) ) )
|
||||
// InternalActionTestLanguage3.g:209:3: this_STRING_0= RULE_STRING () ( (lv_name_2_0= RULE_ID ) )
|
||||
{
|
||||
this_STRING_0=(Token)match(input,RULE_STRING,FollowSets000.FOLLOW_5);
|
||||
|
||||
newLeafNode(this_STRING_0, grammarAccess.getProductionRule2Access().getSTRINGTerminalRuleCall_0());
|
||||
|
||||
// InternalActionTestLanguage3.g:213:3: ()
|
||||
// InternalActionTestLanguage3.g:214:4:
|
||||
{
|
||||
|
||||
current = forceCreateModelElement(
|
||||
grammarAccess.getProductionRule2Access().getEntryAction_1(),
|
||||
current);
|
||||
|
||||
|
||||
}
|
||||
|
||||
// InternalActionTestLanguage3.g:220:3: ( (lv_name_2_0= RULE_ID ) )
|
||||
// InternalActionTestLanguage3.g:221:4: (lv_name_2_0= RULE_ID )
|
||||
{
|
||||
// InternalActionTestLanguage3.g:221:4: (lv_name_2_0= RULE_ID )
|
||||
// InternalActionTestLanguage3.g:222:5: lv_name_2_0= RULE_ID
|
||||
{
|
||||
lv_name_2_0=(Token)match(input,RULE_ID,FollowSets000.FOLLOW_2);
|
||||
|
||||
newLeafNode(lv_name_2_0, grammarAccess.getProductionRule2Access().getNameIDTerminalRuleCall_2_0());
|
||||
|
||||
|
||||
if (current==null) {
|
||||
current = createModelElement(grammarAccess.getProductionRule2Rule());
|
||||
}
|
||||
setWithLastConsumed(
|
||||
current,
|
||||
"name",
|
||||
lv_name_2_0,
|
||||
"org.eclipse.xtext.common.Terminals.ID");
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
leaveRule();
|
||||
|
||||
}
|
||||
|
||||
catch (RecognitionException re) {
|
||||
recover(input,re);
|
||||
appendSkippedTokens();
|
||||
}
|
||||
finally {
|
||||
}
|
||||
return current;
|
||||
}
|
||||
// $ANTLR end "ruleProductionRule2"
|
||||
|
||||
// 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[]{0x0000000000000060L});
|
||||
public static final BitSet FOLLOW_4 = new BitSet(new long[]{0x0000000000000040L});
|
||||
public static final BitSet FOLLOW_5 = new BitSet(new long[]{0x0000000000000010L});
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,120 @@
|
|||
/*
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages.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.serializer.ISerializationContext;
|
||||
import org.eclipse.xtext.serializer.acceptor.SequenceFeeder;
|
||||
import org.eclipse.xtext.serializer.sequencer.AbstractDelegatingSemanticSequencer;
|
||||
import org.eclipse.xtext.serializer.sequencer.ITransientValueService.ValueTransient;
|
||||
import org.eclipse.xtext.testlanguages.actionLang3.ActionLang3Package;
|
||||
import org.eclipse.xtext.testlanguages.actionLang3.Entry;
|
||||
import org.eclipse.xtext.testlanguages.actionLang3.P1;
|
||||
import org.eclipse.xtext.testlanguages.actionLang3.P2;
|
||||
import org.eclipse.xtext.testlanguages.actionLang3.P3;
|
||||
import org.eclipse.xtext.testlanguages.services.ActionTestLanguage3GrammarAccess;
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public class ActionTestLanguage3SemanticSequencer extends AbstractDelegatingSemanticSequencer {
|
||||
|
||||
@Inject
|
||||
private ActionTestLanguage3GrammarAccess 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 == ActionLang3Package.eINSTANCE)
|
||||
switch (semanticObject.eClass().getClassifierID()) {
|
||||
case ActionLang3Package.ENTRY:
|
||||
sequence_ProductionRule2(context, (Entry) semanticObject);
|
||||
return;
|
||||
case ActionLang3Package.P1:
|
||||
sequence_ProductionRule1_P2_2(context, (P1) semanticObject);
|
||||
return;
|
||||
case ActionLang3Package.P2:
|
||||
sequence_ProductionRule1_P3_4(context, (P2) semanticObject);
|
||||
return;
|
||||
case ActionLang3Package.P3:
|
||||
sequence_ProductionRule1(context, (P3) semanticObject);
|
||||
return;
|
||||
}
|
||||
if (errorAcceptor != null)
|
||||
errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
|
||||
}
|
||||
|
||||
/**
|
||||
* Contexts:
|
||||
* ProductionRule1.P2_2 returns P1
|
||||
*
|
||||
* Constraint:
|
||||
* id=ID?
|
||||
*/
|
||||
protected void sequence_ProductionRule1_P2_2(ISerializationContext context, P1 semanticObject) {
|
||||
genericSequencer.createSequence(context, semanticObject);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Contexts:
|
||||
* ProductionRules returns P3
|
||||
* ProductionRule1 returns P3
|
||||
*
|
||||
* Constraint:
|
||||
* (p=ProductionRule1_P3_4 i=INT)
|
||||
*/
|
||||
protected void sequence_ProductionRule1(ISerializationContext context, P3 semanticObject) {
|
||||
if (errorAcceptor != null) {
|
||||
if (transientValues.isValueTransient(semanticObject, ActionLang3Package.Literals.P3__P) == ValueTransient.YES)
|
||||
errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, ActionLang3Package.Literals.P3__P));
|
||||
if (transientValues.isValueTransient(semanticObject, ActionLang3Package.Literals.P3__I) == ValueTransient.YES)
|
||||
errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, ActionLang3Package.Literals.P3__I));
|
||||
}
|
||||
SequenceFeeder feeder = createSequencerFeeder(context, semanticObject);
|
||||
feeder.accept(grammarAccess.getProductionRule1Access().getP3PAction_4(), semanticObject.getP());
|
||||
feeder.accept(grammarAccess.getProductionRule1Access().getIINTTerminalRuleCall_5_0(), semanticObject.getI());
|
||||
feeder.finish();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Contexts:
|
||||
* ProductionRule1.P3_4 returns P2
|
||||
*
|
||||
* Constraint:
|
||||
* (p=ProductionRule1_P2_2 string=STRING?)
|
||||
*/
|
||||
protected void sequence_ProductionRule1_P3_4(ISerializationContext context, P2 semanticObject) {
|
||||
genericSequencer.createSequence(context, semanticObject);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Contexts:
|
||||
* ProductionRules returns Entry
|
||||
* ProductionRule2 returns Entry
|
||||
*
|
||||
* Constraint:
|
||||
* name=ID
|
||||
*/
|
||||
protected void sequence_ProductionRule2(ISerializationContext context, Entry semanticObject) {
|
||||
if (errorAcceptor != null) {
|
||||
if (transientValues.isValueTransient(semanticObject, ActionLang3Package.Literals.ENTRY__NAME) == ValueTransient.YES)
|
||||
errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, ActionLang3Package.Literals.ENTRY__NAME));
|
||||
}
|
||||
SequenceFeeder feeder = createSequencerFeeder(context, semanticObject);
|
||||
feeder.accept(grammarAccess.getProductionRule2Access().getNameIDTerminalRuleCall_2_0(), semanticObject.getName());
|
||||
feeder.finish();
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
/*
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages.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.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;
|
||||
import org.eclipse.xtext.testlanguages.services.ActionTestLanguage3GrammarAccess;
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public class ActionTestLanguage3SyntacticSequencer extends AbstractSyntacticSequencer {
|
||||
|
||||
protected ActionTestLanguage3GrammarAccess grammarAccess;
|
||||
|
||||
@Inject
|
||||
protected void init(IGrammarAccess access) {
|
||||
grammarAccess = (ActionTestLanguage3GrammarAccess) access;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getUnassignedRuleCallToken(EObject semanticObject, RuleCall ruleCall, INode node) {
|
||||
if (ruleCall.getRule() == grammarAccess.getSTRINGRule())
|
||||
return getSTRINGToken(semanticObject, ruleCall, node);
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* terminal STRING:
|
||||
* '"' ( '\\' . | !('\\'|'"') )* '"' |
|
||||
* "'" ( '\\' . | !('\\'|"'") )* "'"
|
||||
* ;
|
||||
*/
|
||||
protected String getSTRINGToken(EObject semanticObject, RuleCall ruleCall, INode node) {
|
||||
if (node != null)
|
||||
return getTokenText(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,237 @@
|
|||
/*
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages.services;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import com.google.inject.Singleton;
|
||||
import java.util.List;
|
||||
import org.eclipse.xtext.Action;
|
||||
import org.eclipse.xtext.Alternatives;
|
||||
import org.eclipse.xtext.Assignment;
|
||||
import org.eclipse.xtext.Grammar;
|
||||
import org.eclipse.xtext.GrammarUtil;
|
||||
import org.eclipse.xtext.Group;
|
||||
import org.eclipse.xtext.ParserRule;
|
||||
import org.eclipse.xtext.RuleCall;
|
||||
import org.eclipse.xtext.TerminalRule;
|
||||
import org.eclipse.xtext.common.services.TerminalsGrammarAccess;
|
||||
import org.eclipse.xtext.service.AbstractElementFinder.AbstractGrammarElementFinder;
|
||||
import org.eclipse.xtext.service.GrammarProvider;
|
||||
|
||||
@Singleton
|
||||
public class ActionTestLanguage3GrammarAccess extends AbstractGrammarElementFinder {
|
||||
|
||||
public class ProductionRulesElements extends AbstractParserRuleElementFinder {
|
||||
private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.testlanguages.ActionTestLanguage3.ProductionRules");
|
||||
private final Alternatives cAlternatives = (Alternatives)rule.eContents().get(1);
|
||||
private final RuleCall cProductionRule1ParserRuleCall_0 = (RuleCall)cAlternatives.eContents().get(0);
|
||||
private final RuleCall cProductionRule2ParserRuleCall_1 = (RuleCall)cAlternatives.eContents().get(1);
|
||||
|
||||
//ProductionRules:
|
||||
// ProductionRule1 | ProductionRule2;
|
||||
@Override public ParserRule getRule() { return rule; }
|
||||
|
||||
//ProductionRule1 | ProductionRule2
|
||||
public Alternatives getAlternatives() { return cAlternatives; }
|
||||
|
||||
//ProductionRule1
|
||||
public RuleCall getProductionRule1ParserRuleCall_0() { return cProductionRule1ParserRuleCall_0; }
|
||||
|
||||
//ProductionRule2
|
||||
public RuleCall getProductionRule2ParserRuleCall_1() { return cProductionRule2ParserRuleCall_1; }
|
||||
}
|
||||
public class ProductionRule1Elements extends AbstractParserRuleElementFinder {
|
||||
private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.testlanguages.ActionTestLanguage3.ProductionRule1");
|
||||
private final Group cGroup = (Group)rule.eContents().get(1);
|
||||
private final Action cP1Action_0 = (Action)cGroup.eContents().get(0);
|
||||
private final Assignment cIdAssignment_1 = (Assignment)cGroup.eContents().get(1);
|
||||
private final RuleCall cIdIDTerminalRuleCall_1_0 = (RuleCall)cIdAssignment_1.eContents().get(0);
|
||||
private final Action cP2PAction_2 = (Action)cGroup.eContents().get(2);
|
||||
private final Assignment cStringAssignment_3 = (Assignment)cGroup.eContents().get(3);
|
||||
private final RuleCall cStringSTRINGTerminalRuleCall_3_0 = (RuleCall)cStringAssignment_3.eContents().get(0);
|
||||
private final Action cP3PAction_4 = (Action)cGroup.eContents().get(4);
|
||||
private final Assignment cIAssignment_5 = (Assignment)cGroup.eContents().get(5);
|
||||
private final RuleCall cIINTTerminalRuleCall_5_0 = (RuleCall)cIAssignment_5.eContents().get(0);
|
||||
|
||||
//ProductionRule1:
|
||||
// {P1} id=ID? {P2.p=current} string=STRING? {P3.p=current} i=INT;
|
||||
@Override public ParserRule getRule() { return rule; }
|
||||
|
||||
//{P1} id=ID? {P2.p=current} string=STRING? {P3.p=current} i=INT
|
||||
public Group getGroup() { return cGroup; }
|
||||
|
||||
//{P1}
|
||||
public Action getP1Action_0() { return cP1Action_0; }
|
||||
|
||||
//id=ID?
|
||||
public Assignment getIdAssignment_1() { return cIdAssignment_1; }
|
||||
|
||||
//ID
|
||||
public RuleCall getIdIDTerminalRuleCall_1_0() { return cIdIDTerminalRuleCall_1_0; }
|
||||
|
||||
//{P2.p=current}
|
||||
public Action getP2PAction_2() { return cP2PAction_2; }
|
||||
|
||||
//string=STRING?
|
||||
public Assignment getStringAssignment_3() { return cStringAssignment_3; }
|
||||
|
||||
//STRING
|
||||
public RuleCall getStringSTRINGTerminalRuleCall_3_0() { return cStringSTRINGTerminalRuleCall_3_0; }
|
||||
|
||||
//{P3.p=current}
|
||||
public Action getP3PAction_4() { return cP3PAction_4; }
|
||||
|
||||
//i=INT
|
||||
public Assignment getIAssignment_5() { return cIAssignment_5; }
|
||||
|
||||
//INT
|
||||
public RuleCall getIINTTerminalRuleCall_5_0() { return cIINTTerminalRuleCall_5_0; }
|
||||
}
|
||||
public class ProductionRule2Elements extends AbstractParserRuleElementFinder {
|
||||
private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.testlanguages.ActionTestLanguage3.ProductionRule2");
|
||||
private final Group cGroup = (Group)rule.eContents().get(1);
|
||||
private final RuleCall cSTRINGTerminalRuleCall_0 = (RuleCall)cGroup.eContents().get(0);
|
||||
private final Action cEntryAction_1 = (Action)cGroup.eContents().get(1);
|
||||
private final Assignment cNameAssignment_2 = (Assignment)cGroup.eContents().get(2);
|
||||
private final RuleCall cNameIDTerminalRuleCall_2_0 = (RuleCall)cNameAssignment_2.eContents().get(0);
|
||||
|
||||
//ProductionRule2:
|
||||
// STRING {Entry} name=ID;
|
||||
@Override public ParserRule getRule() { return rule; }
|
||||
|
||||
//STRING {Entry} name=ID
|
||||
public Group getGroup() { return cGroup; }
|
||||
|
||||
//STRING
|
||||
public RuleCall getSTRINGTerminalRuleCall_0() { return cSTRINGTerminalRuleCall_0; }
|
||||
|
||||
//{Entry}
|
||||
public Action getEntryAction_1() { return cEntryAction_1; }
|
||||
|
||||
//name=ID
|
||||
public Assignment getNameAssignment_2() { return cNameAssignment_2; }
|
||||
|
||||
//ID
|
||||
public RuleCall getNameIDTerminalRuleCall_2_0() { return cNameIDTerminalRuleCall_2_0; }
|
||||
}
|
||||
|
||||
|
||||
private final ProductionRulesElements pProductionRules;
|
||||
private final ProductionRule1Elements pProductionRule1;
|
||||
private final ProductionRule2Elements pProductionRule2;
|
||||
|
||||
private final Grammar grammar;
|
||||
|
||||
private final TerminalsGrammarAccess gaTerminals;
|
||||
|
||||
@Inject
|
||||
public ActionTestLanguage3GrammarAccess(GrammarProvider grammarProvider,
|
||||
TerminalsGrammarAccess gaTerminals) {
|
||||
this.grammar = internalFindGrammar(grammarProvider);
|
||||
this.gaTerminals = gaTerminals;
|
||||
this.pProductionRules = new ProductionRulesElements();
|
||||
this.pProductionRule1 = new ProductionRule1Elements();
|
||||
this.pProductionRule2 = new ProductionRule2Elements();
|
||||
}
|
||||
|
||||
protected Grammar internalFindGrammar(GrammarProvider grammarProvider) {
|
||||
Grammar grammar = grammarProvider.getGrammar(this);
|
||||
while (grammar != null) {
|
||||
if ("org.eclipse.xtext.testlanguages.ActionTestLanguage3".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;
|
||||
}
|
||||
|
||||
|
||||
public TerminalsGrammarAccess getTerminalsGrammarAccess() {
|
||||
return gaTerminals;
|
||||
}
|
||||
|
||||
|
||||
//ProductionRules:
|
||||
// ProductionRule1 | ProductionRule2;
|
||||
public ProductionRulesElements getProductionRulesAccess() {
|
||||
return pProductionRules;
|
||||
}
|
||||
|
||||
public ParserRule getProductionRulesRule() {
|
||||
return getProductionRulesAccess().getRule();
|
||||
}
|
||||
|
||||
//ProductionRule1:
|
||||
// {P1} id=ID? {P2.p=current} string=STRING? {P3.p=current} i=INT;
|
||||
public ProductionRule1Elements getProductionRule1Access() {
|
||||
return pProductionRule1;
|
||||
}
|
||||
|
||||
public ParserRule getProductionRule1Rule() {
|
||||
return getProductionRule1Access().getRule();
|
||||
}
|
||||
|
||||
//ProductionRule2:
|
||||
// STRING {Entry} name=ID;
|
||||
public ProductionRule2Elements getProductionRule2Access() {
|
||||
return pProductionRule2;
|
||||
}
|
||||
|
||||
public ParserRule getProductionRule2Rule() {
|
||||
return getProductionRule2Access().getRule();
|
||||
}
|
||||
|
||||
//terminal ID:
|
||||
// '^'? ('a'..'z' | 'A'..'Z' | '_') ('a'..'z' | 'A'..'Z' | '_' | '0'..'9')*;
|
||||
public TerminalRule getIDRule() {
|
||||
return gaTerminals.getIDRule();
|
||||
}
|
||||
|
||||
//terminal INT returns ecore::EInt:
|
||||
// '0'..'9'+;
|
||||
public TerminalRule getINTRule() {
|
||||
return gaTerminals.getINTRule();
|
||||
}
|
||||
|
||||
//terminal STRING:
|
||||
// '"' ('\\' . | !('\\' | '"'))* '"' |
|
||||
// "'" ('\\' . | !('\\' | "'"))* "'";
|
||||
public TerminalRule getSTRINGRule() {
|
||||
return gaTerminals.getSTRINGRule();
|
||||
}
|
||||
|
||||
//terminal ML_COMMENT:
|
||||
// '/*'->'*/';
|
||||
public TerminalRule getML_COMMENTRule() {
|
||||
return gaTerminals.getML_COMMENTRule();
|
||||
}
|
||||
|
||||
//terminal SL_COMMENT:
|
||||
// '//' !('\n' | '\r')* ('\r'? '\n')?;
|
||||
public TerminalRule getSL_COMMENTRule() {
|
||||
return gaTerminals.getSL_COMMENTRule();
|
||||
}
|
||||
|
||||
//terminal WS:
|
||||
// ' ' | '\t' | '\r' | '\n'+;
|
||||
public TerminalRule getWSRule() {
|
||||
return gaTerminals.getWSRule();
|
||||
}
|
||||
|
||||
//terminal ANY_OTHER:
|
||||
// .;
|
||||
public TerminalRule getANY_OTHERRule() {
|
||||
return gaTerminals.getANY_OTHERRule();
|
||||
}
|
||||
}
|
|
@ -516,6 +516,10 @@ Workflow {
|
|||
grammarUri = "classpath:/org/eclipse/xtext/testlanguages/ActionTestLanguage2.xtext"
|
||||
fragment = @TestLanguagesFragments {}
|
||||
}
|
||||
language = {
|
||||
grammarUri = "classpath:/org/eclipse/xtext/testlanguages/ActionTestLanguage3.xtext"
|
||||
fragment = @TestLanguagesFragments {}
|
||||
}
|
||||
language = {
|
||||
grammarUri = "classpath:/org/eclipse/xtext/testlanguages/FowlerDslTestLanguage.xtext"
|
||||
fragment = @TestLanguagesFragments {}
|
||||
|
|
|
@ -1,53 +1,79 @@
|
|||
/**
|
||||
* Copyright (c) 2016 TypeFox GmbH (http://www.typefox.io/) and others.
|
||||
* Copyright (c) 2016, 2020 TypeFox GmbH (http://www.typefox.io/) and others.
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Eclipse Public License 2.0 which is available at
|
||||
* http://www.eclipse.org/legal/epl-2.0.
|
||||
*
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package org.eclipse.xtext.resource
|
||||
|
||||
import org.eclipse.emf.common.util.URI
|
||||
import org.eclipse.xtext.nodemodel.util.NodeModelUtils
|
||||
import org.eclipse.xtext.testlanguages.ActionTestLanguage3StandaloneSetup
|
||||
import org.eclipse.xtext.testlanguages.ReferenceGrammarTestLanguageStandaloneSetup
|
||||
import org.eclipse.xtext.testlanguages.services.ReferenceGrammarTestLanguageGrammarAccess
|
||||
import org.eclipse.xtext.tests.AbstractXtextTests
|
||||
import org.eclipse.xtext.util.StringInputStream
|
||||
import org.junit.Test
|
||||
import org.eclipse.xtext.testlanguages.services.ActionTestLanguage3GrammarAccess
|
||||
|
||||
/**
|
||||
* @author Moritz Eysholdt - Initial contribution and API
|
||||
*/
|
||||
class SetEntryPointOnXtextResourceTest extends AbstractXtextTests {
|
||||
|
||||
@Test def void test1() {
|
||||
with(ReferenceGrammarTestLanguageStandaloneSetup)
|
||||
val model = "kind (Hugo 13)"
|
||||
@Test def void test1() {
|
||||
with(ReferenceGrammarTestLanguageStandaloneSetup)
|
||||
val model = "kind (Hugo 13)"
|
||||
|
||||
val kindRule = get(ReferenceGrammarTestLanguageGrammarAccess).kindRule
|
||||
val resource = createResource()
|
||||
val kindRule = get(ReferenceGrammarTestLanguageGrammarAccess).kindRule
|
||||
val resource = createResource()
|
||||
|
||||
// test 1: parse and assume there are no errors
|
||||
resource.entryPoint = kindRule
|
||||
resource.load(new StringInputStream(model), emptyMap)
|
||||
assertTrue(resource.errors.isEmpty)
|
||||
assertEquals(kindRule, NodeModelUtils.getEntryParserRule(resource.parseResult.rootNode))
|
||||
// test 1: parse and assume there are no errors
|
||||
resource.entryPoint = kindRule
|
||||
resource.load(new StringInputStream(model), emptyMap)
|
||||
assertTrue(resource.errors.isEmpty)
|
||||
assertEquals(kindRule, NodeModelUtils.getEntryParserRule(resource.parseResult.rootNode))
|
||||
|
||||
// test 2: update and assume node model does not change
|
||||
val originalNodeModel = NodeModelUtils.compactDump(resource.parseResult.rootNode, false)
|
||||
resource.update(0, model.length, " " + model + " ")
|
||||
val reparsedNodeModel = NodeModelUtils.compactDump(resource.parseResult.rootNode, false)
|
||||
assertEquals(originalNodeModel, reparsedNodeModel)
|
||||
// test 2: update and assume node model does not change
|
||||
val originalNodeModel = NodeModelUtils.compactDump(resource.parseResult.rootNode, false)
|
||||
resource.update(0, model.length, " " + model + " ")
|
||||
val reparsedNodeModel = NodeModelUtils.compactDump(resource.parseResult.rootNode, false)
|
||||
assertEquals(originalNodeModel, reparsedNodeModel)
|
||||
|
||||
// test 3: change parser rule
|
||||
val erwachsenerRule = get(ReferenceGrammarTestLanguageGrammarAccess).erwachsenerRule
|
||||
resource.entryPoint = erwachsenerRule
|
||||
resource.update(0, model.length, "erwachsener (Peter 30)")
|
||||
assertEquals(erwachsenerRule, NodeModelUtils.getEntryParserRule(resource.parseResult.rootNode))
|
||||
}
|
||||
// test 3: change parser rule
|
||||
val erwachsenerRule = get(ReferenceGrammarTestLanguageGrammarAccess).erwachsenerRule
|
||||
resource.entryPoint = erwachsenerRule
|
||||
resource.update(0, model.length, "erwachsener (Peter 30)")
|
||||
assertEquals(erwachsenerRule, NodeModelUtils.getEntryParserRule(resource.parseResult.rootNode))
|
||||
}
|
||||
|
||||
def private createResource() {
|
||||
get(IResourceFactory).createResource(URI.createURI("dummy." + currentFileExtension)) as XtextResource
|
||||
}
|
||||
@Test def void test2() {
|
||||
with(ActionTestLanguage3StandaloneSetup)
|
||||
val rule = get(ActionTestLanguage3GrammarAccess).productionRule1Rule
|
||||
val model = "X \"Y\" 42"
|
||||
val resource = createResource()
|
||||
resource.entryPoint = rule
|
||||
resource.load(new StringInputStream(model), emptyMap)
|
||||
assertTrue(resource.errors.isEmpty)
|
||||
val entryRule = NodeModelUtils.getEntryParserRule(resource.parseResult.rootNode)
|
||||
assertEquals(rule, entryRule)
|
||||
}
|
||||
|
||||
@Test def void test3() {
|
||||
with(ActionTestLanguage3StandaloneSetup)
|
||||
val rule = get(ActionTestLanguage3GrammarAccess).productionRule2Rule
|
||||
val model = "\"Y\" X42"
|
||||
val resource = createResource()
|
||||
resource.entryPoint = rule
|
||||
resource.load(new StringInputStream(model), emptyMap)
|
||||
assertTrue(resource.errors.isEmpty)
|
||||
val entryRule = NodeModelUtils.getEntryParserRule(resource.parseResult.rootNode)
|
||||
assertEquals(rule, entryRule)
|
||||
}
|
||||
|
||||
def private createResource() {
|
||||
get(IResourceFactory).createResource(URI.createURI("dummy." + currentFileExtension)) as XtextResource
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2020 itemis AG (http://www.itemis.eu) and others.
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Eclipse Public License 2.0 which is available at
|
||||
* http://www.eclipse.org/legal/epl-2.0.
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*
|
||||
*******************************************************************************/
|
||||
grammar org.eclipse.xtext.testlanguages.ActionTestLanguage3 with org.eclipse.xtext.common.Terminals
|
||||
|
||||
generate actionLang3 "http://www.eclipse.org/2008/tmf/xtext/ActionLang3"
|
||||
|
||||
ProductionRules:
|
||||
ProductionRule1 | ProductionRule2
|
||||
;
|
||||
|
||||
ProductionRule1:
|
||||
{P1} id=ID? {P2.p=current} string=STRING? {P3.p=current} i=INT;
|
||||
|
||||
ProductionRule2:
|
||||
STRING /* unassigned */ {Entry} name=ID
|
||||
;
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages;
|
||||
|
||||
|
||||
/**
|
||||
* Use this class to register components to be used at runtime / without the Equinox extension registry.
|
||||
*/
|
||||
public class ActionTestLanguage3RuntimeModule extends AbstractActionTestLanguage3RuntimeModule {
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
/*
|
||||
* generated by Xtext
|
||||
*/
|
||||
package org.eclipse.xtext.testlanguages;
|
||||
|
||||
|
||||
/**
|
||||
* Initialization support for running Xtext languages without Equinox extension registry.
|
||||
*/
|
||||
public class ActionTestLanguage3StandaloneSetup extends ActionTestLanguage3StandaloneSetupGenerated {
|
||||
|
||||
public static void doSetup() {
|
||||
new ActionTestLanguage3StandaloneSetup().createInjectorAndDoEMFRegistration();
|
||||
}
|
||||
}
|
|
@ -59,5 +59,9 @@ Workflow {
|
|||
grammarUri = "classpath:/org/eclipse/xtext/testlanguages/ActionTestLanguage2.xtext"
|
||||
fragment = @org.eclipse.xtext.TestLanguagesFragments {}
|
||||
}
|
||||
language = {
|
||||
grammarUri = "classpath:/org/eclipse/xtext/testlanguages/ActionTestLanguage3.xtext"
|
||||
fragment = @org.eclipse.xtext.TestLanguagesFragments {}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* Copyright (c) 2016 TypeFox GmbH (http://www.typefox.io/) and others.
|
||||
* Copyright (c) 2016, 2020 TypeFox GmbH (http://www.typefox.io/) and others.
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Eclipse Public License 2.0 which is available at
|
||||
* http://www.eclipse.org/legal/epl-2.0.
|
||||
|
@ -14,7 +14,9 @@ import org.eclipse.xtext.ParserRule;
|
|||
import org.eclipse.xtext.nodemodel.util.NodeModelUtils;
|
||||
import org.eclipse.xtext.resource.IResourceFactory;
|
||||
import org.eclipse.xtext.resource.XtextResource;
|
||||
import org.eclipse.xtext.testlanguages.ActionTestLanguage3StandaloneSetup;
|
||||
import org.eclipse.xtext.testlanguages.ReferenceGrammarTestLanguageStandaloneSetup;
|
||||
import org.eclipse.xtext.testlanguages.services.ActionTestLanguage3GrammarAccess;
|
||||
import org.eclipse.xtext.testlanguages.services.ReferenceGrammarTestLanguageGrammarAccess;
|
||||
import org.eclipse.xtext.tests.AbstractXtextTests;
|
||||
import org.eclipse.xtext.util.StringInputStream;
|
||||
|
@ -53,6 +55,42 @@ public class SetEntryPointOnXtextResourceTest extends AbstractXtextTests {
|
|||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test2() {
|
||||
try {
|
||||
this.with(ActionTestLanguage3StandaloneSetup.class);
|
||||
final ParserRule rule = this.<ActionTestLanguage3GrammarAccess>get(ActionTestLanguage3GrammarAccess.class).getProductionRule1Rule();
|
||||
final String model = "X \"Y\" 42";
|
||||
final XtextResource resource = this.createResource();
|
||||
resource.setEntryPoint(rule);
|
||||
StringInputStream _stringInputStream = new StringInputStream(model);
|
||||
resource.load(_stringInputStream, CollectionLiterals.<Object, Object>emptyMap());
|
||||
Assert.assertTrue(resource.getErrors().isEmpty());
|
||||
final ParserRule entryRule = NodeModelUtils.getEntryParserRule(resource.getParseResult().getRootNode());
|
||||
Assert.assertEquals(rule, entryRule);
|
||||
} catch (Throwable _e) {
|
||||
throw Exceptions.sneakyThrow(_e);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test3() {
|
||||
try {
|
||||
this.with(ActionTestLanguage3StandaloneSetup.class);
|
||||
final ParserRule rule = this.<ActionTestLanguage3GrammarAccess>get(ActionTestLanguage3GrammarAccess.class).getProductionRule2Rule();
|
||||
final String model = "\"Y\" X42";
|
||||
final XtextResource resource = this.createResource();
|
||||
resource.setEntryPoint(rule);
|
||||
StringInputStream _stringInputStream = new StringInputStream(model);
|
||||
resource.load(_stringInputStream, CollectionLiterals.<Object, Object>emptyMap());
|
||||
Assert.assertTrue(resource.getErrors().isEmpty());
|
||||
final ParserRule entryRule = NodeModelUtils.getEntryParserRule(resource.getParseResult().getRootNode());
|
||||
Assert.assertEquals(rule, entryRule);
|
||||
} catch (Throwable _e) {
|
||||
throw Exceptions.sneakyThrow(_e);
|
||||
}
|
||||
}
|
||||
|
||||
private XtextResource createResource() {
|
||||
String _currentFileExtension = this.getCurrentFileExtension();
|
||||
String _plus = ("dummy." + _currentFileExtension);
|
||||
|
|
|
@ -30,6 +30,7 @@ import org.eclipse.xtext.nodemodel.ILeafNode;
|
|||
import org.eclipse.xtext.nodemodel.INode;
|
||||
import org.eclipse.xtext.nodemodel.SyntaxErrorMessage;
|
||||
import org.eclipse.xtext.nodemodel.impl.AbstractNode;
|
||||
import org.eclipse.xtext.nodemodel.impl.CompositeNode;
|
||||
import org.eclipse.xtext.nodemodel.impl.InternalNodeModelUtils;
|
||||
import org.eclipse.xtext.nodemodel.impl.RootNode;
|
||||
import org.eclipse.xtext.resource.EObjectAtOffsetHelper;
|
||||
|
@ -436,6 +437,9 @@ public class NodeModelUtils extends InternalNodeModelUtils {
|
|||
return (ParserRule) ge1;
|
||||
} else if (ge1 instanceof Action) {
|
||||
INode firstChild = root.getFirstChild();
|
||||
while (firstChild.getGrammarElement() instanceof Action && firstChild instanceof CompositeNode) {
|
||||
firstChild = ((CompositeNode)firstChild).getFirstChild();
|
||||
}
|
||||
EObject ge2 = firstChild.getGrammarElement();
|
||||
if (ge2 instanceof ParserRule) {
|
||||
return (ParserRule) ge2;
|
||||
|
|
Loading…
Reference in a new issue