[xtext tests] re-generation of Super- & SubTestLanguage with new generator

Signed-off-by: Christian Schneider <christian.schneider@itemis.de>
This commit is contained in:
Christian Schneider 2015-11-16 19:37:09 +01:00
parent 960dc02bf8
commit 5e8262a66e
56 changed files with 6536 additions and 37 deletions

View file

@ -20,4 +20,4 @@ Import-Package: org.junit.runner;version="4.5.0",
org.junit.runners;version="4.5.0",
org.junit.runners.model;version="4.5.0",
org.hamcrest.core
Bundle-Activator: org.eclipse.xtext.generator.ecore.ui.internal.SuperTestLanguageActivator
Bundle-Activator: org.eclipse.xtext.ui.internal.XtextGrammarTestLanguageActivator

View file

@ -0,0 +1,12 @@
<?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="subPackage" nsURI="http://www.eclipse.org/2009/tmf/xtext/SubTestLanguage"
nsPrefix="subPackage">
<eClassifiers xsi:type="ecore:EClass" name="SubMain">
<eStructuralFeatures xsi:type="ecore:EReference" name="superMains" upperBound="-1"
eType="ecore:EClass SuperTestLanguage.ecore#//SuperMain" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="another" eType="#//AnotherSuperMain"
containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="AnotherSuperMain" eSuperTypes="SuperTestLanguage.ecore#//AnotherSuperMain"/>
</ecore:EPackage>

View file

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<genmodel:GenModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" copyrightText="generated by Xtext" modelDirectory="/org.eclipse.xtext.tests/src-gen2"
modelPluginID="org.eclipse.xtext.tests" forceOverwrite="true" modelName="SubTestLanguage"
updateClasspath="false" rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container"
complianceLevel="6.0" copyrightFields="false" runtimeVersion="2.11" usedGenPackages="SuperTestLanguage.genmodel#//superPackage">
<genPackages prefix="SubPackage" basePackage="org.eclipse.xtext.generator.ecore"
disposableProviderFactory="true" fileExtensions="subtestlanguage" ecorePackage="SubTestLanguage.ecore#/">
<genClasses ecoreClass="SubTestLanguage.ecore#//SubMain">
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference SubTestLanguage.ecore#//SubMain/superMains"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference SubTestLanguage.ecore#//SubMain/another"/>
</genClasses>
<genClasses ecoreClass="SubTestLanguage.ecore#//AnotherSuperMain"/>
</genPackages>
</genmodel:GenModel>

View file

@ -0,0 +1,11 @@
<?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="superPackage" nsURI="http://www.eclipse.org/2009/tmf/xtext/SuperTestLanguage"
nsPrefix="superPackage">
<eClassifiers xsi:type="ecore:EClass" name="SuperMain">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType platform:/resource/org.eclipse.emf.ecore/model/Ecore.ecore#//EString"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="AnotherSuperMain">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType platform:/resource/org.eclipse.emf.ecore/model/Ecore.ecore#//EString"/>
</eClassifiers>
</ecore:EPackage>

View file

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<genmodel:GenModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" copyrightText="generated by Xtext" modelDirectory="/org.eclipse.xtext.tests/src-gen2"
modelPluginID="org.eclipse.xtext.tests" forceOverwrite="true" modelName="SuperTestLanguage"
updateClasspath="false" rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container"
complianceLevel="6.0" copyrightFields="false" runtimeVersion="2.11" usedGenPackages="platform:/resource/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore">
<genPackages prefix="SuperPackage" basePackage="org.eclipse.xtext.generator.ecore"
disposableProviderFactory="true" fileExtensions="supertestlanguage" ecorePackage="SuperTestLanguage.ecore#/">
<genClasses ecoreClass="SuperTestLanguage.ecore#//SuperMain">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute SuperTestLanguage.ecore#//SuperMain/name"/>
</genClasses>
<genClasses ecoreClass="SuperTestLanguage.ecore#//AnotherSuperMain">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute SuperTestLanguage.ecore#//AnotherSuperMain/name"/>
</genClasses>
</genPackages>
</genmodel:GenModel>

View file

@ -3,24 +3,6 @@
<plugin>
<extension point="org.eclipse.emf.ecore.generated_package">
<package
uri = "http://www.eclipse.org/2009/tmf/xtext/SuperTestLanguage"
class = "org.eclipse.xtext.generator.ecore.superPackage.SuperPackagePackage"
genModel = "org/eclipse/xtext/generator/ecore/SuperTestLanguage.genmodel" />
</extension>
<extension point="org.eclipse.emf.ecore.generated_package">
<package
uri = "http://www.eclipse.org/2009/tmf/xtext/SubTestLanguage"
class = "org.eclipse.xtext.generator.ecore.subPackage.SubPackagePackage"
genModel = "org/eclipse/xtext/generator/ecore/SubTestLanguage.genmodel" />
</extension>
<extension point="org.eclipse.emf.ecore.generated_package">
<package
uri = "http://www.eclipse.org/2008/Test/XtextTest"

View file

@ -0,0 +1,118 @@
/*
* generated by Xtext
*/
package org.eclipse.xtext.generator.ecore;
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.generator.ecore.parser.antlr.SubTestLanguageAntlrTokenFileProvider;
import org.eclipse.xtext.generator.ecore.parser.antlr.SubTestLanguageParser;
import org.eclipse.xtext.generator.ecore.parser.antlr.internal.InternalSubTestLanguageLexer;
import org.eclipse.xtext.generator.ecore.serializer.SubTestLanguageSemanticSequencer;
import org.eclipse.xtext.generator.ecore.serializer.SubTestLanguageSyntacticSequencer;
import org.eclipse.xtext.generator.ecore.services.SubTestLanguageGrammarAccess;
import org.eclipse.xtext.parser.IParser;
import org.eclipse.xtext.parser.ITokenToStringConverter;
import org.eclipse.xtext.parser.antlr.AntlrTokenDefProvider;
import org.eclipse.xtext.parser.antlr.AntlrTokenToStringConverter;
import org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider;
import org.eclipse.xtext.parser.antlr.ITokenDefProvider;
import org.eclipse.xtext.parser.antlr.Lexer;
import org.eclipse.xtext.parser.antlr.LexerBindings;
import org.eclipse.xtext.parser.antlr.LexerProvider;
import org.eclipse.xtext.serializer.ISerializer;
import org.eclipse.xtext.serializer.impl.Serializer;
import org.eclipse.xtext.serializer.sequencer.ISemanticSequencer;
import org.eclipse.xtext.serializer.sequencer.ISyntacticSequencer;
import org.eclipse.xtext.service.DefaultRuntimeModule;
/**
* Manual modifications go to {@link SubTestLanguageRuntimeModule}.
*/
@SuppressWarnings("all")
public abstract class AbstractSubTestLanguageRuntimeModule extends DefaultRuntimeModule {
protected Properties properties = null;
@Override
public void configure(Binder binder) {
properties = tryBindProperties(binder, "org/eclipse/xtext/generator/ecore/SubTestLanguage.properties");
super.configure(binder);
}
public void configureLanguageName(Binder binder) {
binder.bind(String.class).annotatedWith(Names.named(Constants.LANGUAGE_NAME)).toInstance("org.eclipse.xtext.generator.ecore.SubTestLanguage");
}
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("subtestlanguage");
}
// contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2
public Class<? extends IParser> bindIParser() {
return SubTestLanguageParser.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 SubTestLanguageAntlrTokenFileProvider.class;
}
// contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2
public Class<? extends Lexer> bindLexer() {
return InternalSubTestLanguageLexer.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<InternalSubTestLanguageLexer> provideInternalSubTestLanguageLexer() {
return LexerProvider.create(InternalSubTestLanguageLexer.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(InternalSubTestLanguageLexer.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 SubTestLanguageGrammarAccess.class;
}
// contributed by org.eclipse.xtext.xtext.generator.serializer.SerializerFragment2
public Class<? extends ISemanticSequencer> bindISemanticSequencer() {
return SubTestLanguageSemanticSequencer.class;
}
// contributed by org.eclipse.xtext.xtext.generator.serializer.SerializerFragment2
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
return SubTestLanguageSyntacticSequencer.class;
}
// contributed by org.eclipse.xtext.xtext.generator.serializer.SerializerFragment2
public Class<? extends ISerializer> bindISerializer() {
return Serializer.class;
}
}

View file

@ -0,0 +1,118 @@
/*
* generated by Xtext
*/
package org.eclipse.xtext.generator.ecore;
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.generator.ecore.parser.antlr.SuperTestLanguageAntlrTokenFileProvider;
import org.eclipse.xtext.generator.ecore.parser.antlr.SuperTestLanguageParser;
import org.eclipse.xtext.generator.ecore.parser.antlr.internal.InternalSuperTestLanguageLexer;
import org.eclipse.xtext.generator.ecore.serializer.SuperTestLanguageSemanticSequencer;
import org.eclipse.xtext.generator.ecore.serializer.SuperTestLanguageSyntacticSequencer;
import org.eclipse.xtext.generator.ecore.services.SuperTestLanguageGrammarAccess;
import org.eclipse.xtext.parser.IParser;
import org.eclipse.xtext.parser.ITokenToStringConverter;
import org.eclipse.xtext.parser.antlr.AntlrTokenDefProvider;
import org.eclipse.xtext.parser.antlr.AntlrTokenToStringConverter;
import org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider;
import org.eclipse.xtext.parser.antlr.ITokenDefProvider;
import org.eclipse.xtext.parser.antlr.Lexer;
import org.eclipse.xtext.parser.antlr.LexerBindings;
import org.eclipse.xtext.parser.antlr.LexerProvider;
import org.eclipse.xtext.serializer.ISerializer;
import org.eclipse.xtext.serializer.impl.Serializer;
import org.eclipse.xtext.serializer.sequencer.ISemanticSequencer;
import org.eclipse.xtext.serializer.sequencer.ISyntacticSequencer;
import org.eclipse.xtext.service.DefaultRuntimeModule;
/**
* Manual modifications go to {@link SuperTestLanguageRuntimeModule}.
*/
@SuppressWarnings("all")
public abstract class AbstractSuperTestLanguageRuntimeModule extends DefaultRuntimeModule {
protected Properties properties = null;
@Override
public void configure(Binder binder) {
properties = tryBindProperties(binder, "org/eclipse/xtext/generator/ecore/SuperTestLanguage.properties");
super.configure(binder);
}
public void configureLanguageName(Binder binder) {
binder.bind(String.class).annotatedWith(Names.named(Constants.LANGUAGE_NAME)).toInstance("org.eclipse.xtext.generator.ecore.SuperTestLanguage");
}
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("supertestlanguage");
}
// contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2
public Class<? extends IParser> bindIParser() {
return SuperTestLanguageParser.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 SuperTestLanguageAntlrTokenFileProvider.class;
}
// contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2
public Class<? extends Lexer> bindLexer() {
return InternalSuperTestLanguageLexer.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<InternalSuperTestLanguageLexer> provideInternalSuperTestLanguageLexer() {
return LexerProvider.create(InternalSuperTestLanguageLexer.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(InternalSuperTestLanguageLexer.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 SuperTestLanguageGrammarAccess.class;
}
// contributed by org.eclipse.xtext.xtext.generator.serializer.SerializerFragment2
public Class<? extends ISemanticSequencer> bindISemanticSequencer() {
return SuperTestLanguageSemanticSequencer.class;
}
// contributed by org.eclipse.xtext.xtext.generator.serializer.SerializerFragment2
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
return SuperTestLanguageSyntacticSequencer.class;
}
// contributed by org.eclipse.xtext.xtext.generator.serializer.SerializerFragment2
public Class<? extends ISerializer> bindISerializer() {
return Serializer.class;
}
}

View file

@ -0,0 +1,41 @@
/*
* generated by Xtext
*/
package org.eclipse.xtext.generator.ecore;
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.generator.ecore.subPackage.SubPackagePackage;
import org.eclipse.xtext.resource.IResourceFactory;
import org.eclipse.xtext.resource.IResourceServiceProvider;
@SuppressWarnings("all")
public class SubTestLanguageStandaloneSetupGenerated implements ISetup {
@Override
public Injector createInjectorAndDoEMFRegistration() {
SuperTestLanguageStandaloneSetup.doSetup();
Injector injector = createInjector();
register(injector);
return injector;
}
public Injector createInjector() {
return Guice.createInjector(new SubTestLanguageRuntimeModule());
}
public void register(Injector injector) {
if (!EPackage.Registry.INSTANCE.containsKey("http://www.eclipse.org/2009/tmf/xtext/SubTestLanguage")) {
EPackage.Registry.INSTANCE.put("http://www.eclipse.org/2009/tmf/xtext/SubTestLanguage", SubPackagePackage.eINSTANCE);
}
IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class);
IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class);
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("subtestlanguage", resourceFactory);
IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("subtestlanguage", serviceProvider);
}
}

View file

@ -0,0 +1,42 @@
/*
* generated by Xtext
*/
package org.eclipse.xtext.generator.ecore;
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.generator.ecore.superPackage.SuperPackagePackage;
import org.eclipse.xtext.resource.IResourceFactory;
import org.eclipse.xtext.resource.IResourceServiceProvider;
@SuppressWarnings("all")
public class SuperTestLanguageStandaloneSetupGenerated implements ISetup {
@Override
public Injector createInjectorAndDoEMFRegistration() {
TerminalsStandaloneSetup.doSetup();
Injector injector = createInjector();
register(injector);
return injector;
}
public Injector createInjector() {
return Guice.createInjector(new SuperTestLanguageRuntimeModule());
}
public void register(Injector injector) {
if (!EPackage.Registry.INSTANCE.containsKey("http://www.eclipse.org/2009/tmf/xtext/SuperTestLanguage")) {
EPackage.Registry.INSTANCE.put("http://www.eclipse.org/2009/tmf/xtext/SuperTestLanguage", SuperPackagePackage.eINSTANCE);
}
IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class);
IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class);
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("supertestlanguage", resourceFactory);
IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("supertestlanguage", serviceProvider);
}
}

View file

@ -0,0 +1,16 @@
/*
* generated by Xtext
*/
package org.eclipse.xtext.generator.ecore.parser.antlr;
import java.io.InputStream;
import org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider;
public class SubTestLanguageAntlrTokenFileProvider implements IAntlrTokenFileProvider {
@Override
public InputStream getAntlrTokenFile() {
ClassLoader classLoader = getClass().getClassLoader();
return classLoader.getResourceAsStream("org/eclipse/xtext/generator/ecore/parser/antlr/internal/InternalSubTestLanguage.tokens");
}
}

View file

@ -0,0 +1,40 @@
/*
* generated by Xtext
*/
package org.eclipse.xtext.generator.ecore.parser.antlr;
import com.google.inject.Inject;
import org.eclipse.xtext.generator.ecore.parser.antlr.internal.InternalSubTestLanguageParser;
import org.eclipse.xtext.generator.ecore.services.SubTestLanguageGrammarAccess;
import org.eclipse.xtext.parser.antlr.AbstractAntlrParser;
import org.eclipse.xtext.parser.antlr.XtextTokenStream;
public class SubTestLanguageParser extends AbstractAntlrParser {
@Inject
private SubTestLanguageGrammarAccess grammarAccess;
@Override
protected void setInitialHiddenTokens(XtextTokenStream tokenStream) {
tokenStream.setInitialHiddenTokens("RULE_WS", "RULE_ML_COMMENT", "RULE_SL_COMMENT");
}
@Override
protected InternalSubTestLanguageParser createParser(XtextTokenStream stream) {
return new InternalSubTestLanguageParser(stream, getGrammarAccess());
}
@Override
protected String getDefaultRuleName() {
return "SubMain";
}
public SubTestLanguageGrammarAccess getGrammarAccess() {
return this.grammarAccess;
}
public void setGrammarAccess(SubTestLanguageGrammarAccess grammarAccess) {
this.grammarAccess = grammarAccess;
}
}

View file

@ -0,0 +1,16 @@
/*
* generated by Xtext
*/
package org.eclipse.xtext.generator.ecore.parser.antlr;
import java.io.InputStream;
import org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider;
public class SuperTestLanguageAntlrTokenFileProvider implements IAntlrTokenFileProvider {
@Override
public InputStream getAntlrTokenFile() {
ClassLoader classLoader = getClass().getClassLoader();
return classLoader.getResourceAsStream("org/eclipse/xtext/generator/ecore/parser/antlr/internal/InternalSuperTestLanguage.tokens");
}
}

View file

@ -0,0 +1,40 @@
/*
* generated by Xtext
*/
package org.eclipse.xtext.generator.ecore.parser.antlr;
import com.google.inject.Inject;
import org.eclipse.xtext.generator.ecore.parser.antlr.internal.InternalSuperTestLanguageParser;
import org.eclipse.xtext.generator.ecore.services.SuperTestLanguageGrammarAccess;
import org.eclipse.xtext.parser.antlr.AbstractAntlrParser;
import org.eclipse.xtext.parser.antlr.XtextTokenStream;
public class SuperTestLanguageParser extends AbstractAntlrParser {
@Inject
private SuperTestLanguageGrammarAccess grammarAccess;
@Override
protected void setInitialHiddenTokens(XtextTokenStream tokenStream) {
tokenStream.setInitialHiddenTokens("RULE_WS", "RULE_ML_COMMENT", "RULE_SL_COMMENT");
}
@Override
protected InternalSuperTestLanguageParser createParser(XtextTokenStream stream) {
return new InternalSuperTestLanguageParser(stream, getGrammarAccess());
}
@Override
protected String getDefaultRuleName() {
return "SuperMain";
}
public SuperTestLanguageGrammarAccess getGrammarAccess() {
return this.grammarAccess;
}
public void setGrammarAccess(SuperTestLanguageGrammarAccess grammarAccess) {
this.grammarAccess = grammarAccess;
}
}

View file

@ -0,0 +1,39 @@
/*
* generated by Xtext
*/
grammar DebugInternalSubTestLanguage;
// Rule SubMain
ruleSubMain:
'{'
ruleSuperMain
'}'
ruleAnotherSuperMain
?
;
// Rule AnotherSuperMain
ruleAnotherSuperMain:
'ups'
RULE_ID
;
// Rule SuperMain
ruleSuperMain:
'super'
RULE_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;} : . )*'*/' {skip();};
RULE_SL_COMMENT : '//' ~(('\n'|'\r'))* ('\r'? '\n')? {skip();};
RULE_WS : (' '|'\t'|'\r'|'\n')+ {skip();};
RULE_ANY_OTHER : .;

View file

@ -0,0 +1,24 @@
/*
* generated by Xtext
*/
grammar DebugInternalSuperTestLanguage;
// Rule SuperMain
ruleSuperMain:
'super'
RULE_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;} : . )*'*/' {skip();};
RULE_SL_COMMENT : '//' ~(('\n'|'\r'))* ('\r'? '\n')? {skip();};
RULE_WS : (' '|'\t'|'\r'|'\n')+ {skip();};
RULE_ANY_OTHER : .;

View file

@ -0,0 +1,222 @@
/*
* generated by Xtext
*/
grammar InternalSubTestLanguage;
options {
superClass=AbstractInternalAntlrParser;
}
@lexer::header {
package org.eclipse.xtext.generator.ecore.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.generator.ecore.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.generator.ecore.services.SubTestLanguageGrammarAccess;
}
@parser::members {
private SubTestLanguageGrammarAccess grammarAccess;
public InternalSubTestLanguageParser(TokenStream input, SubTestLanguageGrammarAccess grammarAccess) {
this(input);
this.grammarAccess = grammarAccess;
registerRules(grammarAccess.getGrammar());
}
@Override
protected String getFirstRuleName() {
return "SubMain";
}
@Override
protected SubTestLanguageGrammarAccess getGrammarAccess() {
return grammarAccess;
}
}
@rulecatch {
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
}
// Entry rule entryRuleSubMain
entryRuleSubMain returns [EObject current=null]:
{ newCompositeNode(grammarAccess.getSubMainRule()); }
iv_ruleSubMain=ruleSubMain
{ $current=$iv_ruleSubMain.current; }
EOF;
// Rule SubMain
ruleSubMain returns [EObject current=null]
@init {
enterRule();
}
@after {
leaveRule();
}:
(
otherlv_0='{'
{
newLeafNode(otherlv_0, grammarAccess.getSubMainAccess().getLeftCurlyBracketKeyword_0());
}
(
(
{
newCompositeNode(grammarAccess.getSubMainAccess().getSuperMainsSuperMainParserRuleCall_1_0());
}
lv_superMains_1_0=ruleSuperMain
{
if ($current==null) {
$current = createModelElementForParent(grammarAccess.getSubMainRule());
}
add(
$current,
"superMains",
lv_superMains_1_0,
"org.eclipse.xtext.generator.ecore.SuperTestLanguage.SuperMain");
afterParserOrEnumRuleCall();
}
)
)
otherlv_2='}'
{
newLeafNode(otherlv_2, grammarAccess.getSubMainAccess().getRightCurlyBracketKeyword_2());
}
(
(
{
newCompositeNode(grammarAccess.getSubMainAccess().getAnotherAnotherSuperMainParserRuleCall_3_0());
}
lv_another_3_0=ruleAnotherSuperMain
{
if ($current==null) {
$current = createModelElementForParent(grammarAccess.getSubMainRule());
}
set(
$current,
"another",
lv_another_3_0,
"org.eclipse.xtext.generator.ecore.SubTestLanguage.AnotherSuperMain");
afterParserOrEnumRuleCall();
}
)
)?
)
;
// Entry rule entryRuleAnotherSuperMain
entryRuleAnotherSuperMain returns [EObject current=null]:
{ newCompositeNode(grammarAccess.getAnotherSuperMainRule()); }
iv_ruleAnotherSuperMain=ruleAnotherSuperMain
{ $current=$iv_ruleAnotherSuperMain.current; }
EOF;
// Rule AnotherSuperMain
ruleAnotherSuperMain returns [EObject current=null]
@init {
enterRule();
}
@after {
leaveRule();
}:
(
otherlv_0='ups'
{
newLeafNode(otherlv_0, grammarAccess.getAnotherSuperMainAccess().getUpsKeyword_0());
}
(
(
lv_name_1_0=RULE_ID
{
newLeafNode(lv_name_1_0, grammarAccess.getAnotherSuperMainAccess().getNameIDTerminalRuleCall_1_0());
}
{
if ($current==null) {
$current = createModelElement(grammarAccess.getAnotherSuperMainRule());
}
setWithLastConsumed(
$current,
"name",
lv_name_1_0,
"org.eclipse.xtext.common.Terminals.ID");
}
)
)
)
;
// Entry rule entryRuleSuperMain
entryRuleSuperMain returns [EObject current=null]:
{ newCompositeNode(grammarAccess.getSuperMainRule()); }
iv_ruleSuperMain=ruleSuperMain
{ $current=$iv_ruleSuperMain.current; }
EOF;
// Rule SuperMain
ruleSuperMain returns [EObject current=null]
@init {
enterRule();
}
@after {
leaveRule();
}:
(
otherlv_0='super'
{
newLeafNode(otherlv_0, grammarAccess.getSuperMainAccess().getSuperKeyword_0());
}
(
(
lv_name_1_0=RULE_ID
{
newLeafNode(lv_name_1_0, grammarAccess.getSuperMainAccess().getNameIDTerminalRuleCall_1_0());
}
{
if ($current==null) {
$current = createModelElement(grammarAccess.getSuperMainRule());
}
setWithLastConsumed(
$current,
"name",
lv_name_1_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 : .;

View file

@ -0,0 +1,15 @@
'super'=14
'ups'=13
'{'=11
'}'=12
RULE_ANY_OTHER=10
RULE_ID=4
RULE_INT=5
RULE_ML_COMMENT=7
RULE_SL_COMMENT=8
RULE_STRING=6
RULE_WS=9
T__11=11
T__12=12
T__13=13
T__14=14

View file

@ -0,0 +1,849 @@
package org.eclipse.xtext.generator.ecore.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 InternalSubTestLanguageLexer extends Lexer {
public static final int RULE_ID=4;
public static final int RULE_STRING=6;
public static final int T__12=12;
public static final int T__11=11;
public static final int T__14=14;
public static final int T__13=13;
public static final int RULE_ANY_OTHER=10;
public static final int RULE_INT=5;
public static final int RULE_WS=9;
public static final int RULE_SL_COMMENT=8;
public static final int EOF=-1;
public static final int RULE_ML_COMMENT=7;
// delegates
// delegators
public InternalSubTestLanguageLexer() {;}
public InternalSubTestLanguageLexer(CharStream input) {
this(input, new RecognizerSharedState());
}
public InternalSubTestLanguageLexer(CharStream input, RecognizerSharedState state) {
super(input,state);
}
public String getGrammarFileName() { return "InternalSubTestLanguage.g"; }
// $ANTLR start "T__11"
public final void mT__11() throws RecognitionException {
try {
int _type = T__11;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalSubTestLanguage.g:11:7: ( '{' )
// InternalSubTestLanguage.g:11:9: '{'
{
match('{');
}
state.type = _type;
state.channel = _channel;
}
finally {
}
}
// $ANTLR end "T__11"
// $ANTLR start "T__12"
public final void mT__12() throws RecognitionException {
try {
int _type = T__12;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalSubTestLanguage.g:12:7: ( '}' )
// InternalSubTestLanguage.g:12:9: '}'
{
match('}');
}
state.type = _type;
state.channel = _channel;
}
finally {
}
}
// $ANTLR end "T__12"
// $ANTLR start "T__13"
public final void mT__13() throws RecognitionException {
try {
int _type = T__13;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalSubTestLanguage.g:13:7: ( 'ups' )
// InternalSubTestLanguage.g:13:9: 'ups'
{
match("ups");
}
state.type = _type;
state.channel = _channel;
}
finally {
}
}
// $ANTLR end "T__13"
// $ANTLR start "T__14"
public final void mT__14() throws RecognitionException {
try {
int _type = T__14;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalSubTestLanguage.g:14:7: ( 'super' )
// InternalSubTestLanguage.g:14:9: 'super'
{
match("super");
}
state.type = _type;
state.channel = _channel;
}
finally {
}
}
// $ANTLR end "T__14"
// $ANTLR start "RULE_ID"
public final void mRULE_ID() throws RecognitionException {
try {
int _type = RULE_ID;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalSubTestLanguage.g:210:9: ( ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* )
// InternalSubTestLanguage.g:210:11: ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )*
{
// InternalSubTestLanguage.g:210:11: ( '^' )?
int alt1=2;
int LA1_0 = input.LA(1);
if ( (LA1_0=='^') ) {
alt1=1;
}
switch (alt1) {
case 1 :
// InternalSubTestLanguage.g:210: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;}
// InternalSubTestLanguage.g:210: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 :
// InternalSubTestLanguage.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;
// InternalSubTestLanguage.g:212:10: ( ( '0' .. '9' )+ )
// InternalSubTestLanguage.g:212:12: ( '0' .. '9' )+
{
// InternalSubTestLanguage.g:212: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 :
// InternalSubTestLanguage.g:212: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;
// InternalSubTestLanguage.g:214:13: ( ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) )
// InternalSubTestLanguage.g:214:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' )
{
// InternalSubTestLanguage.g:214: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 :
// InternalSubTestLanguage.g:214:16: '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"'
{
match('\"');
// InternalSubTestLanguage.g:214: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 :
// InternalSubTestLanguage.g:214:21: '\\\\' .
{
match('\\');
matchAny();
}
break;
case 2 :
// InternalSubTestLanguage.g:214: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 :
// InternalSubTestLanguage.g:214:48: '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\''
{
match('\'');
// InternalSubTestLanguage.g:214: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 :
// InternalSubTestLanguage.g:214:54: '\\\\' .
{
match('\\');
matchAny();
}
break;
case 2 :
// InternalSubTestLanguage.g:214: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;
// InternalSubTestLanguage.g:216:17: ( '/*' ( options {greedy=false; } : . )* '*/' )
// InternalSubTestLanguage.g:216:19: '/*' ( options {greedy=false; } : . )* '*/'
{
match("/*");
// InternalSubTestLanguage.g:216: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 :
// InternalSubTestLanguage.g:216: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;
// InternalSubTestLanguage.g:218:17: ( '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? )
// InternalSubTestLanguage.g:218:19: '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )?
{
match("//");
// InternalSubTestLanguage.g:218: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 :
// InternalSubTestLanguage.g:218: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);
// InternalSubTestLanguage.g:218: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 :
// InternalSubTestLanguage.g:218:41: ( '\\r' )? '\\n'
{
// InternalSubTestLanguage.g:218:41: ( '\\r' )?
int alt9=2;
int LA9_0 = input.LA(1);
if ( (LA9_0=='\r') ) {
alt9=1;
}
switch (alt9) {
case 1 :
// InternalSubTestLanguage.g:218: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;
// InternalSubTestLanguage.g:220:9: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ )
// InternalSubTestLanguage.g:220:11: ( ' ' | '\\t' | '\\r' | '\\n' )+
{
// InternalSubTestLanguage.g:220: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 :
// InternalSubTestLanguage.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;
// InternalSubTestLanguage.g:222:16: ( . )
// InternalSubTestLanguage.g:222:18: .
{
matchAny();
}
state.type = _type;
state.channel = _channel;
}
finally {
}
}
// $ANTLR end "RULE_ANY_OTHER"
public void mTokens() throws RecognitionException {
// InternalSubTestLanguage.g:1:8: ( T__11 | T__12 | T__13 | T__14 | RULE_ID | RULE_INT | RULE_STRING | RULE_ML_COMMENT | RULE_SL_COMMENT | RULE_WS | RULE_ANY_OTHER )
int alt12=11;
alt12 = dfa12.predict(input);
switch (alt12) {
case 1 :
// InternalSubTestLanguage.g:1:10: T__11
{
mT__11();
}
break;
case 2 :
// InternalSubTestLanguage.g:1:16: T__12
{
mT__12();
}
break;
case 3 :
// InternalSubTestLanguage.g:1:22: T__13
{
mT__13();
}
break;
case 4 :
// InternalSubTestLanguage.g:1:28: T__14
{
mT__14();
}
break;
case 5 :
// InternalSubTestLanguage.g:1:34: RULE_ID
{
mRULE_ID();
}
break;
case 6 :
// InternalSubTestLanguage.g:1:42: RULE_INT
{
mRULE_INT();
}
break;
case 7 :
// InternalSubTestLanguage.g:1:51: RULE_STRING
{
mRULE_STRING();
}
break;
case 8 :
// InternalSubTestLanguage.g:1:63: RULE_ML_COMMENT
{
mRULE_ML_COMMENT();
}
break;
case 9 :
// InternalSubTestLanguage.g:1:79: RULE_SL_COMMENT
{
mRULE_SL_COMMENT();
}
break;
case 10 :
// InternalSubTestLanguage.g:1:95: RULE_WS
{
mRULE_WS();
}
break;
case 11 :
// InternalSubTestLanguage.g:1:103: RULE_ANY_OTHER
{
mRULE_ANY_OTHER();
}
break;
}
}
protected DFA12 dfa12 = new DFA12(this);
static final String DFA12_eotS =
"\3\uffff\2\20\1\14\2\uffff\3\14\4\uffff\1\20\1\uffff\1\20\5\uffff\1\31\1\20\1\uffff\1\20\1\34\1\uffff";
static final String DFA12_eofS =
"\35\uffff";
static final String DFA12_minS =
"\1\0\2\uffff\1\160\1\165\1\101\2\uffff\2\0\1\52\4\uffff\1\163\1\uffff\1\160\5\uffff\1\60\1\145\1\uffff\1\162\1\60\1\uffff";
static final String DFA12_maxS =
"\1\uffff\2\uffff\1\160\1\165\1\172\2\uffff\2\uffff\1\57\4\uffff\1\163\1\uffff\1\160\5\uffff\1\172\1\145\1\uffff\1\162\1\172\1\uffff";
static final String DFA12_acceptS =
"\1\uffff\1\1\1\2\3\uffff\1\5\1\6\3\uffff\1\12\1\13\1\1\1\2\1\uffff\1\5\1\uffff\1\6\1\7\1\10\1\11\1\12\2\uffff\1\3\2\uffff\1\4";
static final String DFA12_specialS =
"\1\1\7\uffff\1\0\1\2\23\uffff}>";
static final String[] DFA12_transitionS = {
"\11\14\2\13\2\14\1\13\22\14\1\13\1\14\1\10\4\14\1\11\7\14\1\12\12\7\7\14\32\6\3\14\1\5\1\6\1\14\22\6\1\4\1\6\1\3\5\6\1\1\1\14\1\2\uff82\14",
"",
"",
"\1\17",
"\1\21",
"\32\20\4\uffff\1\20\1\uffff\32\20",
"",
"",
"\0\23",
"\0\23",
"\1\24\4\uffff\1\25",
"",
"",
"",
"",
"\1\27",
"",
"\1\30",
"",
"",
"",
"",
"",
"\12\20\7\uffff\32\20\4\uffff\1\20\1\uffff\32\20",
"\1\32",
"",
"\1\33",
"\12\20\7\uffff\32\20\4\uffff\1\20\1\uffff\32\20",
""
};
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 : ( T__11 | T__12 | T__13 | T__14 | 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_8 = input.LA(1);
s = -1;
if ( ((LA12_8>='\u0000' && LA12_8<='\uFFFF')) ) {s = 19;}
else s = 12;
if ( s>=0 ) return s;
break;
case 1 :
int LA12_0 = input.LA(1);
s = -1;
if ( (LA12_0=='{') ) {s = 1;}
else if ( (LA12_0=='}') ) {s = 2;}
else if ( (LA12_0=='u') ) {s = 3;}
else if ( (LA12_0=='s') ) {s = 4;}
else if ( (LA12_0=='^') ) {s = 5;}
else if ( ((LA12_0>='A' && LA12_0<='Z')||LA12_0=='_'||(LA12_0>='a' && LA12_0<='r')||LA12_0=='t'||(LA12_0>='v' && LA12_0<='z')) ) {s = 6;}
else if ( ((LA12_0>='0' && LA12_0<='9')) ) {s = 7;}
else if ( (LA12_0=='\"') ) {s = 8;}
else if ( (LA12_0=='\'') ) {s = 9;}
else if ( (LA12_0=='/') ) {s = 10;}
else if ( ((LA12_0>='\t' && LA12_0<='\n')||LA12_0=='\r'||LA12_0==' ') ) {s = 11;}
else if ( ((LA12_0>='\u0000' && LA12_0<='\b')||(LA12_0>='\u000B' && LA12_0<='\f')||(LA12_0>='\u000E' && LA12_0<='\u001F')||LA12_0=='!'||(LA12_0>='#' && LA12_0<='&')||(LA12_0>='(' && LA12_0<='.')||(LA12_0>=':' && LA12_0<='@')||(LA12_0>='[' && LA12_0<=']')||LA12_0=='`'||LA12_0=='|'||(LA12_0>='~' && LA12_0<='\uFFFF')) ) {s = 12;}
if ( s>=0 ) return s;
break;
case 2 :
int LA12_9 = input.LA(1);
s = -1;
if ( ((LA12_9>='\u0000' && LA12_9<='\uFFFF')) ) {s = 19;}
else s = 12;
if ( s>=0 ) return s;
break;
}
NoViableAltException nvae =
new NoViableAltException(getDescription(), 12, _s, input);
error(nvae);
throw nvae;
}
}
}

View file

@ -0,0 +1,466 @@
package org.eclipse.xtext.generator.ecore.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.generator.ecore.services.SubTestLanguageGrammarAccess;
import org.antlr.runtime.*;
import java.util.Stack;
import java.util.List;
import java.util.ArrayList;
@SuppressWarnings("all")
public class InternalSubTestLanguageParser extends AbstractInternalAntlrParser {
public static final String[] tokenNames = new String[] {
"<invalid>", "<EOR>", "<DOWN>", "<UP>", "RULE_ID", "RULE_INT", "RULE_STRING", "RULE_ML_COMMENT", "RULE_SL_COMMENT", "RULE_WS", "RULE_ANY_OTHER", "'{'", "'}'", "'ups'", "'super'"
};
public static final int RULE_ID=4;
public static final int RULE_STRING=6;
public static final int T__12=12;
public static final int T__11=11;
public static final int T__14=14;
public static final int T__13=13;
public static final int RULE_ANY_OTHER=10;
public static final int RULE_INT=5;
public static final int RULE_WS=9;
public static final int RULE_SL_COMMENT=8;
public static final int EOF=-1;
public static final int RULE_ML_COMMENT=7;
// delegates
// delegators
public InternalSubTestLanguageParser(TokenStream input) {
this(input, new RecognizerSharedState());
}
public InternalSubTestLanguageParser(TokenStream input, RecognizerSharedState state) {
super(input, state);
}
public String[] getTokenNames() { return InternalSubTestLanguageParser.tokenNames; }
public String getGrammarFileName() { return "InternalSubTestLanguage.g"; }
private SubTestLanguageGrammarAccess grammarAccess;
public InternalSubTestLanguageParser(TokenStream input, SubTestLanguageGrammarAccess grammarAccess) {
this(input);
this.grammarAccess = grammarAccess;
registerRules(grammarAccess.getGrammar());
}
@Override
protected String getFirstRuleName() {
return "SubMain";
}
@Override
protected SubTestLanguageGrammarAccess getGrammarAccess() {
return grammarAccess;
}
// $ANTLR start "entryRuleSubMain"
// InternalSubTestLanguage.g:64:1: entryRuleSubMain returns [EObject current=null] : iv_ruleSubMain= ruleSubMain EOF ;
public final EObject entryRuleSubMain() throws RecognitionException {
EObject current = null;
EObject iv_ruleSubMain = null;
try {
// InternalSubTestLanguage.g:64:48: (iv_ruleSubMain= ruleSubMain EOF )
// InternalSubTestLanguage.g:65:2: iv_ruleSubMain= ruleSubMain EOF
{
newCompositeNode(grammarAccess.getSubMainRule());
pushFollow(FollowSets000.FOLLOW_1);
iv_ruleSubMain=ruleSubMain();
state._fsp--;
current =iv_ruleSubMain;
match(input,EOF,FollowSets000.FOLLOW_2);
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleSubMain"
// $ANTLR start "ruleSubMain"
// InternalSubTestLanguage.g:71:1: ruleSubMain returns [EObject current=null] : (otherlv_0= '{' ( (lv_superMains_1_0= ruleSuperMain ) ) otherlv_2= '}' ( (lv_another_3_0= ruleAnotherSuperMain ) )? ) ;
public final EObject ruleSubMain() throws RecognitionException {
EObject current = null;
Token otherlv_0=null;
Token otherlv_2=null;
EObject lv_superMains_1_0 = null;
EObject lv_another_3_0 = null;
enterRule();
try {
// InternalSubTestLanguage.g:77:2: ( (otherlv_0= '{' ( (lv_superMains_1_0= ruleSuperMain ) ) otherlv_2= '}' ( (lv_another_3_0= ruleAnotherSuperMain ) )? ) )
// InternalSubTestLanguage.g:78:2: (otherlv_0= '{' ( (lv_superMains_1_0= ruleSuperMain ) ) otherlv_2= '}' ( (lv_another_3_0= ruleAnotherSuperMain ) )? )
{
// InternalSubTestLanguage.g:78:2: (otherlv_0= '{' ( (lv_superMains_1_0= ruleSuperMain ) ) otherlv_2= '}' ( (lv_another_3_0= ruleAnotherSuperMain ) )? )
// InternalSubTestLanguage.g:79:3: otherlv_0= '{' ( (lv_superMains_1_0= ruleSuperMain ) ) otherlv_2= '}' ( (lv_another_3_0= ruleAnotherSuperMain ) )?
{
otherlv_0=(Token)match(input,11,FollowSets000.FOLLOW_3);
newLeafNode(otherlv_0, grammarAccess.getSubMainAccess().getLeftCurlyBracketKeyword_0());
// InternalSubTestLanguage.g:83:3: ( (lv_superMains_1_0= ruleSuperMain ) )
// InternalSubTestLanguage.g:84:4: (lv_superMains_1_0= ruleSuperMain )
{
// InternalSubTestLanguage.g:84:4: (lv_superMains_1_0= ruleSuperMain )
// InternalSubTestLanguage.g:85:5: lv_superMains_1_0= ruleSuperMain
{
newCompositeNode(grammarAccess.getSubMainAccess().getSuperMainsSuperMainParserRuleCall_1_0());
pushFollow(FollowSets000.FOLLOW_4);
lv_superMains_1_0=ruleSuperMain();
state._fsp--;
if (current==null) {
current = createModelElementForParent(grammarAccess.getSubMainRule());
}
add(
current,
"superMains",
lv_superMains_1_0,
"org.eclipse.xtext.generator.ecore.SuperTestLanguage.SuperMain");
afterParserOrEnumRuleCall();
}
}
otherlv_2=(Token)match(input,12,FollowSets000.FOLLOW_5);
newLeafNode(otherlv_2, grammarAccess.getSubMainAccess().getRightCurlyBracketKeyword_2());
// InternalSubTestLanguage.g:106:3: ( (lv_another_3_0= ruleAnotherSuperMain ) )?
int alt1=2;
int LA1_0 = input.LA(1);
if ( (LA1_0==13) ) {
alt1=1;
}
switch (alt1) {
case 1 :
// InternalSubTestLanguage.g:107:4: (lv_another_3_0= ruleAnotherSuperMain )
{
// InternalSubTestLanguage.g:107:4: (lv_another_3_0= ruleAnotherSuperMain )
// InternalSubTestLanguage.g:108:5: lv_another_3_0= ruleAnotherSuperMain
{
newCompositeNode(grammarAccess.getSubMainAccess().getAnotherAnotherSuperMainParserRuleCall_3_0());
pushFollow(FollowSets000.FOLLOW_2);
lv_another_3_0=ruleAnotherSuperMain();
state._fsp--;
if (current==null) {
current = createModelElementForParent(grammarAccess.getSubMainRule());
}
set(
current,
"another",
lv_another_3_0,
"org.eclipse.xtext.generator.ecore.SubTestLanguage.AnotherSuperMain");
afterParserOrEnumRuleCall();
}
}
break;
}
}
}
leaveRule();
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleSubMain"
// $ANTLR start "entryRuleAnotherSuperMain"
// InternalSubTestLanguage.g:129:1: entryRuleAnotherSuperMain returns [EObject current=null] : iv_ruleAnotherSuperMain= ruleAnotherSuperMain EOF ;
public final EObject entryRuleAnotherSuperMain() throws RecognitionException {
EObject current = null;
EObject iv_ruleAnotherSuperMain = null;
try {
// InternalSubTestLanguage.g:129:57: (iv_ruleAnotherSuperMain= ruleAnotherSuperMain EOF )
// InternalSubTestLanguage.g:130:2: iv_ruleAnotherSuperMain= ruleAnotherSuperMain EOF
{
newCompositeNode(grammarAccess.getAnotherSuperMainRule());
pushFollow(FollowSets000.FOLLOW_1);
iv_ruleAnotherSuperMain=ruleAnotherSuperMain();
state._fsp--;
current =iv_ruleAnotherSuperMain;
match(input,EOF,FollowSets000.FOLLOW_2);
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleAnotherSuperMain"
// $ANTLR start "ruleAnotherSuperMain"
// InternalSubTestLanguage.g:136:1: ruleAnotherSuperMain returns [EObject current=null] : (otherlv_0= 'ups' ( (lv_name_1_0= RULE_ID ) ) ) ;
public final EObject ruleAnotherSuperMain() throws RecognitionException {
EObject current = null;
Token otherlv_0=null;
Token lv_name_1_0=null;
enterRule();
try {
// InternalSubTestLanguage.g:142:2: ( (otherlv_0= 'ups' ( (lv_name_1_0= RULE_ID ) ) ) )
// InternalSubTestLanguage.g:143:2: (otherlv_0= 'ups' ( (lv_name_1_0= RULE_ID ) ) )
{
// InternalSubTestLanguage.g:143:2: (otherlv_0= 'ups' ( (lv_name_1_0= RULE_ID ) ) )
// InternalSubTestLanguage.g:144:3: otherlv_0= 'ups' ( (lv_name_1_0= RULE_ID ) )
{
otherlv_0=(Token)match(input,13,FollowSets000.FOLLOW_6);
newLeafNode(otherlv_0, grammarAccess.getAnotherSuperMainAccess().getUpsKeyword_0());
// InternalSubTestLanguage.g:148:3: ( (lv_name_1_0= RULE_ID ) )
// InternalSubTestLanguage.g:149:4: (lv_name_1_0= RULE_ID )
{
// InternalSubTestLanguage.g:149:4: (lv_name_1_0= RULE_ID )
// InternalSubTestLanguage.g:150:5: lv_name_1_0= RULE_ID
{
lv_name_1_0=(Token)match(input,RULE_ID,FollowSets000.FOLLOW_2);
newLeafNode(lv_name_1_0, grammarAccess.getAnotherSuperMainAccess().getNameIDTerminalRuleCall_1_0());
if (current==null) {
current = createModelElement(grammarAccess.getAnotherSuperMainRule());
}
setWithLastConsumed(
current,
"name",
lv_name_1_0,
"org.eclipse.xtext.common.Terminals.ID");
}
}
}
}
leaveRule();
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleAnotherSuperMain"
// $ANTLR start "entryRuleSuperMain"
// InternalSubTestLanguage.g:170:1: entryRuleSuperMain returns [EObject current=null] : iv_ruleSuperMain= ruleSuperMain EOF ;
public final EObject entryRuleSuperMain() throws RecognitionException {
EObject current = null;
EObject iv_ruleSuperMain = null;
try {
// InternalSubTestLanguage.g:170:50: (iv_ruleSuperMain= ruleSuperMain EOF )
// InternalSubTestLanguage.g:171:2: iv_ruleSuperMain= ruleSuperMain EOF
{
newCompositeNode(grammarAccess.getSuperMainRule());
pushFollow(FollowSets000.FOLLOW_1);
iv_ruleSuperMain=ruleSuperMain();
state._fsp--;
current =iv_ruleSuperMain;
match(input,EOF,FollowSets000.FOLLOW_2);
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleSuperMain"
// $ANTLR start "ruleSuperMain"
// InternalSubTestLanguage.g:177:1: ruleSuperMain returns [EObject current=null] : (otherlv_0= 'super' ( (lv_name_1_0= RULE_ID ) ) ) ;
public final EObject ruleSuperMain() throws RecognitionException {
EObject current = null;
Token otherlv_0=null;
Token lv_name_1_0=null;
enterRule();
try {
// InternalSubTestLanguage.g:183:2: ( (otherlv_0= 'super' ( (lv_name_1_0= RULE_ID ) ) ) )
// InternalSubTestLanguage.g:184:2: (otherlv_0= 'super' ( (lv_name_1_0= RULE_ID ) ) )
{
// InternalSubTestLanguage.g:184:2: (otherlv_0= 'super' ( (lv_name_1_0= RULE_ID ) ) )
// InternalSubTestLanguage.g:185:3: otherlv_0= 'super' ( (lv_name_1_0= RULE_ID ) )
{
otherlv_0=(Token)match(input,14,FollowSets000.FOLLOW_6);
newLeafNode(otherlv_0, grammarAccess.getSuperMainAccess().getSuperKeyword_0());
// InternalSubTestLanguage.g:189:3: ( (lv_name_1_0= RULE_ID ) )
// InternalSubTestLanguage.g:190:4: (lv_name_1_0= RULE_ID )
{
// InternalSubTestLanguage.g:190:4: (lv_name_1_0= RULE_ID )
// InternalSubTestLanguage.g:191:5: lv_name_1_0= RULE_ID
{
lv_name_1_0=(Token)match(input,RULE_ID,FollowSets000.FOLLOW_2);
newLeafNode(lv_name_1_0, grammarAccess.getSuperMainAccess().getNameIDTerminalRuleCall_1_0());
if (current==null) {
current = createModelElement(grammarAccess.getSuperMainRule());
}
setWithLastConsumed(
current,
"name",
lv_name_1_0,
"org.eclipse.xtext.common.Terminals.ID");
}
}
}
}
leaveRule();
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleSuperMain"
// 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[]{0x0000000000004000L});
public static final BitSet FOLLOW_4 = new BitSet(new long[]{0x0000000000001000L});
public static final BitSet FOLLOW_5 = new BitSet(new long[]{0x0000000000002002L});
public static final BitSet FOLLOW_6 = new BitSet(new long[]{0x0000000000000010L});
}
}

View file

@ -0,0 +1,116 @@
/*
* generated by Xtext
*/
grammar InternalSuperTestLanguage;
options {
superClass=AbstractInternalAntlrParser;
}
@lexer::header {
package org.eclipse.xtext.generator.ecore.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.generator.ecore.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.generator.ecore.services.SuperTestLanguageGrammarAccess;
}
@parser::members {
private SuperTestLanguageGrammarAccess grammarAccess;
public InternalSuperTestLanguageParser(TokenStream input, SuperTestLanguageGrammarAccess grammarAccess) {
this(input);
this.grammarAccess = grammarAccess;
registerRules(grammarAccess.getGrammar());
}
@Override
protected String getFirstRuleName() {
return "SuperMain";
}
@Override
protected SuperTestLanguageGrammarAccess getGrammarAccess() {
return grammarAccess;
}
}
@rulecatch {
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
}
// Entry rule entryRuleSuperMain
entryRuleSuperMain returns [EObject current=null]:
{ newCompositeNode(grammarAccess.getSuperMainRule()); }
iv_ruleSuperMain=ruleSuperMain
{ $current=$iv_ruleSuperMain.current; }
EOF;
// Rule SuperMain
ruleSuperMain returns [EObject current=null]
@init {
enterRule();
}
@after {
leaveRule();
}:
(
otherlv_0='super'
{
newLeafNode(otherlv_0, grammarAccess.getSuperMainAccess().getSuperKeyword_0());
}
(
(
lv_name_1_0=RULE_ID
{
newLeafNode(lv_name_1_0, grammarAccess.getSuperMainAccess().getNameIDTerminalRuleCall_1_0());
}
{
if ($current==null) {
$current = createModelElement(grammarAccess.getSuperMainRule());
}
setWithLastConsumed(
$current,
"name",
lv_name_1_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 : .;

View file

@ -0,0 +1,9 @@
'super'=11
RULE_ANY_OTHER=10
RULE_ID=4
RULE_INT=5
RULE_ML_COMMENT=7
RULE_SL_COMMENT=8
RULE_STRING=6
RULE_WS=9
T__11=11

View file

@ -0,0 +1,750 @@
package org.eclipse.xtext.generator.ecore.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 InternalSuperTestLanguageLexer extends Lexer {
public static final int RULE_ID=4;
public static final int RULE_STRING=6;
public static final int T__11=11;
public static final int RULE_ANY_OTHER=10;
public static final int RULE_INT=5;
public static final int RULE_WS=9;
public static final int RULE_SL_COMMENT=8;
public static final int EOF=-1;
public static final int RULE_ML_COMMENT=7;
// delegates
// delegators
public InternalSuperTestLanguageLexer() {;}
public InternalSuperTestLanguageLexer(CharStream input) {
this(input, new RecognizerSharedState());
}
public InternalSuperTestLanguageLexer(CharStream input, RecognizerSharedState state) {
super(input,state);
}
public String getGrammarFileName() { return "InternalSuperTestLanguage.g"; }
// $ANTLR start "T__11"
public final void mT__11() throws RecognitionException {
try {
int _type = T__11;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalSuperTestLanguage.g:11:7: ( 'super' )
// InternalSuperTestLanguage.g:11:9: 'super'
{
match("super");
}
state.type = _type;
state.channel = _channel;
}
finally {
}
}
// $ANTLR end "T__11"
// $ANTLR start "RULE_ID"
public final void mRULE_ID() throws RecognitionException {
try {
int _type = RULE_ID;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalSuperTestLanguage.g:104:9: ( ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* )
// InternalSuperTestLanguage.g:104:11: ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )*
{
// InternalSuperTestLanguage.g:104:11: ( '^' )?
int alt1=2;
int LA1_0 = input.LA(1);
if ( (LA1_0=='^') ) {
alt1=1;
}
switch (alt1) {
case 1 :
// InternalSuperTestLanguage.g:104: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;}
// InternalSuperTestLanguage.g:104: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 :
// InternalSuperTestLanguage.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;
// InternalSuperTestLanguage.g:106:10: ( ( '0' .. '9' )+ )
// InternalSuperTestLanguage.g:106:12: ( '0' .. '9' )+
{
// InternalSuperTestLanguage.g:106: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 :
// InternalSuperTestLanguage.g:106: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;
// InternalSuperTestLanguage.g:108:13: ( ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) )
// InternalSuperTestLanguage.g:108:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' )
{
// InternalSuperTestLanguage.g:108: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 :
// InternalSuperTestLanguage.g:108:16: '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"'
{
match('\"');
// InternalSuperTestLanguage.g:108: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 :
// InternalSuperTestLanguage.g:108:21: '\\\\' .
{
match('\\');
matchAny();
}
break;
case 2 :
// InternalSuperTestLanguage.g:108: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 :
// InternalSuperTestLanguage.g:108:48: '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\''
{
match('\'');
// InternalSuperTestLanguage.g:108: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 :
// InternalSuperTestLanguage.g:108:54: '\\\\' .
{
match('\\');
matchAny();
}
break;
case 2 :
// InternalSuperTestLanguage.g:108: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;
// InternalSuperTestLanguage.g:110:17: ( '/*' ( options {greedy=false; } : . )* '*/' )
// InternalSuperTestLanguage.g:110:19: '/*' ( options {greedy=false; } : . )* '*/'
{
match("/*");
// InternalSuperTestLanguage.g:110: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 :
// InternalSuperTestLanguage.g:110: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;
// InternalSuperTestLanguage.g:112:17: ( '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? )
// InternalSuperTestLanguage.g:112:19: '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )?
{
match("//");
// InternalSuperTestLanguage.g:112: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 :
// InternalSuperTestLanguage.g:112: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);
// InternalSuperTestLanguage.g:112: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 :
// InternalSuperTestLanguage.g:112:41: ( '\\r' )? '\\n'
{
// InternalSuperTestLanguage.g:112:41: ( '\\r' )?
int alt9=2;
int LA9_0 = input.LA(1);
if ( (LA9_0=='\r') ) {
alt9=1;
}
switch (alt9) {
case 1 :
// InternalSuperTestLanguage.g:112: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;
// InternalSuperTestLanguage.g:114:9: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ )
// InternalSuperTestLanguage.g:114:11: ( ' ' | '\\t' | '\\r' | '\\n' )+
{
// InternalSuperTestLanguage.g:114: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 :
// InternalSuperTestLanguage.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;
// InternalSuperTestLanguage.g:116:16: ( . )
// InternalSuperTestLanguage.g:116:18: .
{
matchAny();
}
state.type = _type;
state.channel = _channel;
}
finally {
}
}
// $ANTLR end "RULE_ANY_OTHER"
public void mTokens() throws RecognitionException {
// InternalSuperTestLanguage.g:1:8: ( T__11 | RULE_ID | RULE_INT | RULE_STRING | RULE_ML_COMMENT | RULE_SL_COMMENT | RULE_WS | RULE_ANY_OTHER )
int alt12=8;
alt12 = dfa12.predict(input);
switch (alt12) {
case 1 :
// InternalSuperTestLanguage.g:1:10: T__11
{
mT__11();
}
break;
case 2 :
// InternalSuperTestLanguage.g:1:16: RULE_ID
{
mRULE_ID();
}
break;
case 3 :
// InternalSuperTestLanguage.g:1:24: RULE_INT
{
mRULE_INT();
}
break;
case 4 :
// InternalSuperTestLanguage.g:1:33: RULE_STRING
{
mRULE_STRING();
}
break;
case 5 :
// InternalSuperTestLanguage.g:1:45: RULE_ML_COMMENT
{
mRULE_ML_COMMENT();
}
break;
case 6 :
// InternalSuperTestLanguage.g:1:61: RULE_SL_COMMENT
{
mRULE_SL_COMMENT();
}
break;
case 7 :
// InternalSuperTestLanguage.g:1:77: RULE_WS
{
mRULE_WS();
}
break;
case 8 :
// InternalSuperTestLanguage.g:1:85: RULE_ANY_OTHER
{
mRULE_ANY_OTHER();
}
break;
}
}
protected DFA12 dfa12 = new DFA12(this);
static final String DFA12_eotS =
"\1\uffff\1\13\1\11\2\uffff\3\11\2\uffff\1\13\6\uffff\2\13\1\24\1\uffff";
static final String DFA12_eofS =
"\25\uffff";
static final String DFA12_minS =
"\1\0\1\165\1\101\2\uffff\2\0\1\52\2\uffff\1\160\6\uffff\1\145\1\162\1\60\1\uffff";
static final String DFA12_maxS =
"\1\uffff\1\165\1\172\2\uffff\2\uffff\1\57\2\uffff\1\160\6\uffff\1\145\1\162\1\172\1\uffff";
static final String DFA12_acceptS =
"\3\uffff\1\2\1\3\3\uffff\1\7\1\10\1\uffff\1\2\1\3\1\4\1\5\1\6\1\7\3\uffff\1\1";
static final String DFA12_specialS =
"\1\2\4\uffff\1\0\1\1\16\uffff}>";
static final String[] DFA12_transitionS = {
"\11\11\2\10\2\11\1\10\22\11\1\10\1\11\1\5\4\11\1\6\7\11\1\7\12\4\7\11\32\3\3\11\1\2\1\3\1\11\22\3\1\1\7\3\uff85\11",
"\1\12",
"\32\13\4\uffff\1\13\1\uffff\32\13",
"",
"",
"\0\15",
"\0\15",
"\1\16\4\uffff\1\17",
"",
"",
"\1\21",
"",
"",
"",
"",
"",
"",
"\1\22",
"\1\23",
"\12\13\7\uffff\32\13\4\uffff\1\13\1\uffff\32\13",
""
};
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 : ( T__11 | 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_5 = input.LA(1);
s = -1;
if ( ((LA12_5>='\u0000' && LA12_5<='\uFFFF')) ) {s = 13;}
else s = 9;
if ( s>=0 ) return s;
break;
case 1 :
int LA12_6 = input.LA(1);
s = -1;
if ( ((LA12_6>='\u0000' && LA12_6<='\uFFFF')) ) {s = 13;}
else s = 9;
if ( s>=0 ) return s;
break;
case 2 :
int LA12_0 = input.LA(1);
s = -1;
if ( (LA12_0=='s') ) {s = 1;}
else if ( (LA12_0=='^') ) {s = 2;}
else if ( ((LA12_0>='A' && LA12_0<='Z')||LA12_0=='_'||(LA12_0>='a' && LA12_0<='r')||(LA12_0>='t' && LA12_0<='z')) ) {s = 3;}
else if ( ((LA12_0>='0' && LA12_0<='9')) ) {s = 4;}
else if ( (LA12_0=='\"') ) {s = 5;}
else if ( (LA12_0=='\'') ) {s = 6;}
else if ( (LA12_0=='/') ) {s = 7;}
else if ( ((LA12_0>='\t' && LA12_0<='\n')||LA12_0=='\r'||LA12_0==' ') ) {s = 8;}
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 = 9;}
if ( s>=0 ) return s;
break;
}
NoViableAltException nvae =
new NoViableAltException(getDescription(), 12, _s, input);
error(nvae);
throw nvae;
}
}
}

View file

@ -0,0 +1,193 @@
package org.eclipse.xtext.generator.ecore.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.generator.ecore.services.SuperTestLanguageGrammarAccess;
import org.antlr.runtime.*;
import java.util.Stack;
import java.util.List;
import java.util.ArrayList;
@SuppressWarnings("all")
public class InternalSuperTestLanguageParser extends AbstractInternalAntlrParser {
public static final String[] tokenNames = new String[] {
"<invalid>", "<EOR>", "<DOWN>", "<UP>", "RULE_ID", "RULE_INT", "RULE_STRING", "RULE_ML_COMMENT", "RULE_SL_COMMENT", "RULE_WS", "RULE_ANY_OTHER", "'super'"
};
public static final int RULE_ID=4;
public static final int RULE_STRING=6;
public static final int T__11=11;
public static final int RULE_ANY_OTHER=10;
public static final int RULE_INT=5;
public static final int RULE_WS=9;
public static final int RULE_SL_COMMENT=8;
public static final int EOF=-1;
public static final int RULE_ML_COMMENT=7;
// delegates
// delegators
public InternalSuperTestLanguageParser(TokenStream input) {
this(input, new RecognizerSharedState());
}
public InternalSuperTestLanguageParser(TokenStream input, RecognizerSharedState state) {
super(input, state);
}
public String[] getTokenNames() { return InternalSuperTestLanguageParser.tokenNames; }
public String getGrammarFileName() { return "InternalSuperTestLanguage.g"; }
private SuperTestLanguageGrammarAccess grammarAccess;
public InternalSuperTestLanguageParser(TokenStream input, SuperTestLanguageGrammarAccess grammarAccess) {
this(input);
this.grammarAccess = grammarAccess;
registerRules(grammarAccess.getGrammar());
}
@Override
protected String getFirstRuleName() {
return "SuperMain";
}
@Override
protected SuperTestLanguageGrammarAccess getGrammarAccess() {
return grammarAccess;
}
// $ANTLR start "entryRuleSuperMain"
// InternalSuperTestLanguage.g:64:1: entryRuleSuperMain returns [EObject current=null] : iv_ruleSuperMain= ruleSuperMain EOF ;
public final EObject entryRuleSuperMain() throws RecognitionException {
EObject current = null;
EObject iv_ruleSuperMain = null;
try {
// InternalSuperTestLanguage.g:64:50: (iv_ruleSuperMain= ruleSuperMain EOF )
// InternalSuperTestLanguage.g:65:2: iv_ruleSuperMain= ruleSuperMain EOF
{
newCompositeNode(grammarAccess.getSuperMainRule());
pushFollow(FollowSets000.FOLLOW_1);
iv_ruleSuperMain=ruleSuperMain();
state._fsp--;
current =iv_ruleSuperMain;
match(input,EOF,FollowSets000.FOLLOW_2);
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "entryRuleSuperMain"
// $ANTLR start "ruleSuperMain"
// InternalSuperTestLanguage.g:71:1: ruleSuperMain returns [EObject current=null] : (otherlv_0= 'super' ( (lv_name_1_0= RULE_ID ) ) ) ;
public final EObject ruleSuperMain() throws RecognitionException {
EObject current = null;
Token otherlv_0=null;
Token lv_name_1_0=null;
enterRule();
try {
// InternalSuperTestLanguage.g:77:2: ( (otherlv_0= 'super' ( (lv_name_1_0= RULE_ID ) ) ) )
// InternalSuperTestLanguage.g:78:2: (otherlv_0= 'super' ( (lv_name_1_0= RULE_ID ) ) )
{
// InternalSuperTestLanguage.g:78:2: (otherlv_0= 'super' ( (lv_name_1_0= RULE_ID ) ) )
// InternalSuperTestLanguage.g:79:3: otherlv_0= 'super' ( (lv_name_1_0= RULE_ID ) )
{
otherlv_0=(Token)match(input,11,FollowSets000.FOLLOW_3);
newLeafNode(otherlv_0, grammarAccess.getSuperMainAccess().getSuperKeyword_0());
// InternalSuperTestLanguage.g:83:3: ( (lv_name_1_0= RULE_ID ) )
// InternalSuperTestLanguage.g:84:4: (lv_name_1_0= RULE_ID )
{
// InternalSuperTestLanguage.g:84:4: (lv_name_1_0= RULE_ID )
// InternalSuperTestLanguage.g:85:5: lv_name_1_0= RULE_ID
{
lv_name_1_0=(Token)match(input,RULE_ID,FollowSets000.FOLLOW_2);
newLeafNode(lv_name_1_0, grammarAccess.getSuperMainAccess().getNameIDTerminalRuleCall_1_0());
if (current==null) {
current = createModelElement(grammarAccess.getSuperMainRule());
}
setWithLastConsumed(
current,
"name",
lv_name_1_0,
"org.eclipse.xtext.common.Terminals.ID");
}
}
}
}
leaveRule();
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
}
// $ANTLR end "ruleSuperMain"
// 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[]{0x0000000000000010L});
}
}

View file

@ -0,0 +1,84 @@
/*
* generated by Xtext
*/
package org.eclipse.xtext.generator.ecore.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.generator.ecore.services.SubTestLanguageGrammarAccess;
import org.eclipse.xtext.generator.ecore.subPackage.AnotherSuperMain;
import org.eclipse.xtext.generator.ecore.subPackage.SubMain;
import org.eclipse.xtext.generator.ecore.subPackage.SubPackagePackage;
import org.eclipse.xtext.generator.ecore.superPackage.SuperMain;
import org.eclipse.xtext.generator.ecore.superPackage.SuperPackagePackage;
import org.eclipse.xtext.serializer.ISerializationContext;
import org.eclipse.xtext.serializer.acceptor.SequenceFeeder;
import org.eclipse.xtext.serializer.sequencer.ITransientValueService.ValueTransient;
@SuppressWarnings("all")
public class SubTestLanguageSemanticSequencer extends SuperTestLanguageSemanticSequencer {
@Inject
private SubTestLanguageGrammarAccess 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 == SubPackagePackage.eINSTANCE)
switch (semanticObject.eClass().getClassifierID()) {
case SubPackagePackage.ANOTHER_SUPER_MAIN:
sequence_AnotherSuperMain(context, (AnotherSuperMain) semanticObject);
return;
case SubPackagePackage.SUB_MAIN:
sequence_SubMain(context, (SubMain) semanticObject);
return;
}
else if (epackage == SuperPackagePackage.eINSTANCE)
switch (semanticObject.eClass().getClassifierID()) {
case SuperPackagePackage.SUPER_MAIN:
sequence_SuperMain(context, (SuperMain) semanticObject);
return;
}
if (errorAcceptor != null)
errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
/**
* Contexts:
* AnotherSuperMain returns AnotherSuperMain
*
* Constraint:
* name=ID
*/
protected void sequence_AnotherSuperMain(ISerializationContext context, AnotherSuperMain semanticObject) {
if (errorAcceptor != null) {
if (transientValues.isValueTransient(semanticObject, SuperPackagePackage.Literals.ANOTHER_SUPER_MAIN__NAME) == ValueTransient.YES)
errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, SuperPackagePackage.Literals.ANOTHER_SUPER_MAIN__NAME));
}
SequenceFeeder feeder = createSequencerFeeder(context, semanticObject);
feeder.accept(grammarAccess.getAnotherSuperMainAccess().getNameIDTerminalRuleCall_1_0(), semanticObject.getName());
feeder.finish();
}
/**
* Contexts:
* SubMain returns SubMain
*
* Constraint:
* (superMains+=SuperMain another=AnotherSuperMain?)
*/
protected void sequence_SubMain(ISerializationContext context, SubMain semanticObject) {
genericSequencer.createSequence(context, semanticObject);
}
}

View file

@ -0,0 +1,43 @@
/*
* generated by Xtext
*/
package org.eclipse.xtext.generator.ecore.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.generator.ecore.services.SubTestLanguageGrammarAccess;
import org.eclipse.xtext.nodemodel.INode;
import org.eclipse.xtext.serializer.analysis.GrammarAlias.AbstractElementAlias;
import org.eclipse.xtext.serializer.analysis.ISyntacticSequencerPDAProvider.ISynTransition;
import org.eclipse.xtext.serializer.sequencer.AbstractSyntacticSequencer;
@SuppressWarnings("all")
public class SubTestLanguageSyntacticSequencer extends AbstractSyntacticSequencer {
protected SubTestLanguageGrammarAccess grammarAccess;
@Inject
protected void init(IGrammarAccess access) {
grammarAccess = (SubTestLanguageGrammarAccess) access;
}
@Override
protected String getUnassignedRuleCallToken(EObject semanticObject, RuleCall ruleCall, INode node) {
return "";
}
@Override
protected void emitUnassignedTokens(EObject semanticObject, ISynTransition transition, INode fromNode, INode toNode) {
if (transition.getAmbiguousSyntaxes().isEmpty()) return;
List<INode> transitionNodes = collectNodes(fromNode, toNode);
for (AbstractElementAlias syntax : transition.getAmbiguousSyntaxes()) {
List<INode> syntaxNodes = getNodesFor(transitionNodes, syntax);
acceptNodes(getLastNavigableState(), syntaxNodes);
}
}
}

View file

@ -0,0 +1,83 @@
/*
* generated by Xtext
*/
package org.eclipse.xtext.generator.ecore.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.generator.ecore.services.SuperTestLanguageGrammarAccess;
import org.eclipse.xtext.generator.ecore.superPackage.AnotherSuperMain;
import org.eclipse.xtext.generator.ecore.superPackage.SuperMain;
import org.eclipse.xtext.generator.ecore.superPackage.SuperPackagePackage;
import org.eclipse.xtext.serializer.ISerializationContext;
import org.eclipse.xtext.serializer.acceptor.SequenceFeeder;
import org.eclipse.xtext.serializer.sequencer.AbstractDelegatingSemanticSequencer;
import org.eclipse.xtext.serializer.sequencer.ITransientValueService.ValueTransient;
@SuppressWarnings("all")
public class SuperTestLanguageSemanticSequencer extends AbstractDelegatingSemanticSequencer {
@Inject
private SuperTestLanguageGrammarAccess 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 == SuperPackagePackage.eINSTANCE)
switch (semanticObject.eClass().getClassifierID()) {
case SuperPackagePackage.ANOTHER_SUPER_MAIN:
sequence_AnotherSuperMain(context, (AnotherSuperMain) semanticObject);
return;
case SuperPackagePackage.SUPER_MAIN:
sequence_SuperMain(context, (SuperMain) semanticObject);
return;
}
if (errorAcceptor != null)
errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
/**
* Contexts:
* AnotherSuperMain returns AnotherSuperMain
*
* Constraint:
* name=ID
*/
protected void sequence_AnotherSuperMain(ISerializationContext context, AnotherSuperMain semanticObject) {
if (errorAcceptor != null) {
if (transientValues.isValueTransient(semanticObject, SuperPackagePackage.Literals.ANOTHER_SUPER_MAIN__NAME) == ValueTransient.YES)
errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, SuperPackagePackage.Literals.ANOTHER_SUPER_MAIN__NAME));
}
SequenceFeeder feeder = createSequencerFeeder(context, semanticObject);
feeder.accept(grammarAccess.getAnotherSuperMainAccess().getNameIDTerminalRuleCall_1_0(), semanticObject.getName());
feeder.finish();
}
/**
* Contexts:
* SuperMain returns SuperMain
*
* Constraint:
* name=ID
*/
protected void sequence_SuperMain(ISerializationContext context, SuperMain semanticObject) {
if (errorAcceptor != null) {
if (transientValues.isValueTransient(semanticObject, SuperPackagePackage.Literals.SUPER_MAIN__NAME) == ValueTransient.YES)
errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, SuperPackagePackage.Literals.SUPER_MAIN__NAME));
}
SequenceFeeder feeder = createSequencerFeeder(context, semanticObject);
feeder.accept(grammarAccess.getSuperMainAccess().getNameIDTerminalRuleCall_1_0(), semanticObject.getName());
feeder.finish();
}
}

View file

@ -0,0 +1,43 @@
/*
* generated by Xtext
*/
package org.eclipse.xtext.generator.ecore.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.generator.ecore.services.SuperTestLanguageGrammarAccess;
import org.eclipse.xtext.nodemodel.INode;
import org.eclipse.xtext.serializer.analysis.GrammarAlias.AbstractElementAlias;
import org.eclipse.xtext.serializer.analysis.ISyntacticSequencerPDAProvider.ISynTransition;
import org.eclipse.xtext.serializer.sequencer.AbstractSyntacticSequencer;
@SuppressWarnings("all")
public class SuperTestLanguageSyntacticSequencer extends AbstractSyntacticSequencer {
protected SuperTestLanguageGrammarAccess grammarAccess;
@Inject
protected void init(IGrammarAccess access) {
grammarAccess = (SuperTestLanguageGrammarAccess) access;
}
@Override
protected String getUnassignedRuleCallToken(EObject semanticObject, RuleCall ruleCall, INode node) {
return "";
}
@Override
protected void emitUnassignedTokens(EObject semanticObject, ISynTransition transition, INode fromNode, INode toNode) {
if (transition.getAmbiguousSyntaxes().isEmpty()) return;
List<INode> transitionNodes = collectNodes(fromNode, toNode);
for (AbstractElementAlias syntax : transition.getAmbiguousSyntaxes()) {
List<INode> syntaxNodes = getNodesFor(transitionNodes, syntax);
acceptNodes(getLastNavigableState(), syntaxNodes);
}
}
}

View file

@ -0,0 +1,207 @@
/*
* generated by Xtext
*/
package org.eclipse.xtext.generator.ecore.services;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import java.util.List;
import org.eclipse.xtext.Assignment;
import org.eclipse.xtext.Grammar;
import org.eclipse.xtext.GrammarUtil;
import org.eclipse.xtext.Group;
import org.eclipse.xtext.Keyword;
import org.eclipse.xtext.ParserRule;
import org.eclipse.xtext.RuleCall;
import org.eclipse.xtext.TerminalRule;
import org.eclipse.xtext.common.services.TerminalsGrammarAccess;
import org.eclipse.xtext.service.AbstractElementFinder.AbstractGrammarElementFinder;
import org.eclipse.xtext.service.GrammarProvider;
@Singleton
public class SubTestLanguageGrammarAccess extends AbstractGrammarElementFinder {
public class SubMainElements extends AbstractParserRuleElementFinder {
private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.generator.ecore.SubTestLanguage.SubMain");
private final Group cGroup = (Group)rule.eContents().get(1);
private final Keyword cLeftCurlyBracketKeyword_0 = (Keyword)cGroup.eContents().get(0);
private final Assignment cSuperMainsAssignment_1 = (Assignment)cGroup.eContents().get(1);
private final RuleCall cSuperMainsSuperMainParserRuleCall_1_0 = (RuleCall)cSuperMainsAssignment_1.eContents().get(0);
private final Keyword cRightCurlyBracketKeyword_2 = (Keyword)cGroup.eContents().get(2);
private final Assignment cAnotherAssignment_3 = (Assignment)cGroup.eContents().get(3);
private final RuleCall cAnotherAnotherSuperMainParserRuleCall_3_0 = (RuleCall)cAnotherAssignment_3.eContents().get(0);
//SubMain:
// "{" superMains+=SuperMain "}" another=AnotherSuperMain?;
@Override public ParserRule getRule() { return rule; }
//"{" superMains+=SuperMain "}" another=AnotherSuperMain?
public Group getGroup() { return cGroup; }
//"{"
public Keyword getLeftCurlyBracketKeyword_0() { return cLeftCurlyBracketKeyword_0; }
//superMains+=SuperMain
public Assignment getSuperMainsAssignment_1() { return cSuperMainsAssignment_1; }
//SuperMain
public RuleCall getSuperMainsSuperMainParserRuleCall_1_0() { return cSuperMainsSuperMainParserRuleCall_1_0; }
//"}"
public Keyword getRightCurlyBracketKeyword_2() { return cRightCurlyBracketKeyword_2; }
//another=AnotherSuperMain?
public Assignment getAnotherAssignment_3() { return cAnotherAssignment_3; }
//AnotherSuperMain
public RuleCall getAnotherAnotherSuperMainParserRuleCall_3_0() { return cAnotherAnotherSuperMainParserRuleCall_3_0; }
}
public class AnotherSuperMainElements extends AbstractParserRuleElementFinder {
private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.generator.ecore.SubTestLanguage.AnotherSuperMain");
private final Group cGroup = (Group)rule.eContents().get(1);
private final Keyword cUpsKeyword_0 = (Keyword)cGroup.eContents().get(0);
private final Assignment cNameAssignment_1 = (Assignment)cGroup.eContents().get(1);
private final RuleCall cNameIDTerminalRuleCall_1_0 = (RuleCall)cNameAssignment_1.eContents().get(0);
//AnotherSuperMain:
// "ups" name=ID;
@Override public ParserRule getRule() { return rule; }
//"ups" name=ID
public Group getGroup() { return cGroup; }
//"ups"
public Keyword getUpsKeyword_0() { return cUpsKeyword_0; }
//name=ID
public Assignment getNameAssignment_1() { return cNameAssignment_1; }
//ID
public RuleCall getNameIDTerminalRuleCall_1_0() { return cNameIDTerminalRuleCall_1_0; }
}
private final SubMainElements pSubMain;
private final AnotherSuperMainElements pAnotherSuperMain;
private final Grammar grammar;
private final SuperTestLanguageGrammarAccess gaSuperTestLanguage;
private final TerminalsGrammarAccess gaTerminals;
@Inject
public SubTestLanguageGrammarAccess(GrammarProvider grammarProvider,
SuperTestLanguageGrammarAccess gaSuperTestLanguage,
TerminalsGrammarAccess gaTerminals) {
this.grammar = internalFindGrammar(grammarProvider);
this.gaSuperTestLanguage = gaSuperTestLanguage;
this.gaTerminals = gaTerminals;
this.pSubMain = new SubMainElements();
this.pAnotherSuperMain = new AnotherSuperMainElements();
}
protected Grammar internalFindGrammar(GrammarProvider grammarProvider) {
Grammar grammar = grammarProvider.getGrammar(this);
while (grammar != null) {
if ("org.eclipse.xtext.generator.ecore.SubTestLanguage".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 SuperTestLanguageGrammarAccess getSuperTestLanguageGrammarAccess() {
return gaSuperTestLanguage;
}
public TerminalsGrammarAccess getTerminalsGrammarAccess() {
return gaTerminals;
}
//SubMain:
// "{" superMains+=SuperMain "}" another=AnotherSuperMain?;
public SubMainElements getSubMainAccess() {
return pSubMain;
}
public ParserRule getSubMainRule() {
return getSubMainAccess().getRule();
}
//AnotherSuperMain:
// "ups" name=ID;
public AnotherSuperMainElements getAnotherSuperMainAccess() {
return pAnotherSuperMain;
}
public ParserRule getAnotherSuperMainRule() {
return getAnotherSuperMainAccess().getRule();
}
//SuperMain:
// "super" name=ID;
public SuperTestLanguageGrammarAccess.SuperMainElements getSuperMainAccess() {
return gaSuperTestLanguage.getSuperMainAccess();
}
public ParserRule getSuperMainRule() {
return getSuperMainAccess().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();
}
}

View file

@ -0,0 +1,177 @@
/*
* generated by Xtext
*/
package org.eclipse.xtext.generator.ecore.services;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import java.util.List;
import org.eclipse.xtext.Assignment;
import org.eclipse.xtext.Grammar;
import org.eclipse.xtext.GrammarUtil;
import org.eclipse.xtext.Group;
import org.eclipse.xtext.Keyword;
import org.eclipse.xtext.ParserRule;
import org.eclipse.xtext.RuleCall;
import org.eclipse.xtext.TerminalRule;
import org.eclipse.xtext.common.services.TerminalsGrammarAccess;
import org.eclipse.xtext.service.AbstractElementFinder.AbstractGrammarElementFinder;
import org.eclipse.xtext.service.GrammarProvider;
@Singleton
public class SuperTestLanguageGrammarAccess extends AbstractGrammarElementFinder {
public class SuperMainElements extends AbstractParserRuleElementFinder {
private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.generator.ecore.SuperTestLanguage.SuperMain");
private final Group cGroup = (Group)rule.eContents().get(1);
private final Keyword cSuperKeyword_0 = (Keyword)cGroup.eContents().get(0);
private final Assignment cNameAssignment_1 = (Assignment)cGroup.eContents().get(1);
private final RuleCall cNameIDTerminalRuleCall_1_0 = (RuleCall)cNameAssignment_1.eContents().get(0);
//SuperMain:
// "super" name=ID;
@Override public ParserRule getRule() { return rule; }
//"super" name=ID
public Group getGroup() { return cGroup; }
//"super"
public Keyword getSuperKeyword_0() { return cSuperKeyword_0; }
//name=ID
public Assignment getNameAssignment_1() { return cNameAssignment_1; }
//ID
public RuleCall getNameIDTerminalRuleCall_1_0() { return cNameIDTerminalRuleCall_1_0; }
}
public class AnotherSuperMainElements extends AbstractParserRuleElementFinder {
private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.generator.ecore.SuperTestLanguage.AnotherSuperMain");
private final Group cGroup = (Group)rule.eContents().get(1);
private final Keyword cAnotherKeyword_0 = (Keyword)cGroup.eContents().get(0);
private final Assignment cNameAssignment_1 = (Assignment)cGroup.eContents().get(1);
private final RuleCall cNameIDTerminalRuleCall_1_0 = (RuleCall)cNameAssignment_1.eContents().get(0);
//AnotherSuperMain:
// "another" name=ID;
@Override public ParserRule getRule() { return rule; }
//"another" name=ID
public Group getGroup() { return cGroup; }
//"another"
public Keyword getAnotherKeyword_0() { return cAnotherKeyword_0; }
//name=ID
public Assignment getNameAssignment_1() { return cNameAssignment_1; }
//ID
public RuleCall getNameIDTerminalRuleCall_1_0() { return cNameIDTerminalRuleCall_1_0; }
}
private final SuperMainElements pSuperMain;
private final AnotherSuperMainElements pAnotherSuperMain;
private final Grammar grammar;
private final TerminalsGrammarAccess gaTerminals;
@Inject
public SuperTestLanguageGrammarAccess(GrammarProvider grammarProvider,
TerminalsGrammarAccess gaTerminals) {
this.grammar = internalFindGrammar(grammarProvider);
this.gaTerminals = gaTerminals;
this.pSuperMain = new SuperMainElements();
this.pAnotherSuperMain = new AnotherSuperMainElements();
}
protected Grammar internalFindGrammar(GrammarProvider grammarProvider) {
Grammar grammar = grammarProvider.getGrammar(this);
while (grammar != null) {
if ("org.eclipse.xtext.generator.ecore.SuperTestLanguage".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;
}
//SuperMain:
// "super" name=ID;
public SuperMainElements getSuperMainAccess() {
return pSuperMain;
}
public ParserRule getSuperMainRule() {
return getSuperMainAccess().getRule();
}
//AnotherSuperMain:
// "another" name=ID;
public AnotherSuperMainElements getAnotherSuperMainAccess() {
return pAnotherSuperMain;
}
public ParserRule getAnotherSuperMainRule() {
return getAnotherSuperMainAccess().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();
}
}

View file

@ -0,0 +1,19 @@
/**
* generated by Xtext
*/
package org.eclipse.xtext.generator.ecore.subPackage;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Another Super Main</b></em>'.
* <!-- end-user-doc -->
*
*
* @see org.eclipse.xtext.generator.ecore.subPackage.SubPackagePackage#getAnotherSuperMain()
* @model
* @generated
*/
public interface AnotherSuperMain extends org.eclipse.xtext.generator.ecore.superPackage.AnotherSuperMain
{
} // AnotherSuperMain

View file

@ -0,0 +1,73 @@
/**
* generated by Xtext
*/
package org.eclipse.xtext.generator.ecore.subPackage;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.xtext.generator.ecore.superPackage.SuperMain;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Sub Main</b></em>'.
* <!-- end-user-doc -->
*
* <p>
* The following features are supported:
* </p>
* <ul>
* <li>{@link org.eclipse.xtext.generator.ecore.subPackage.SubMain#getSuperMains <em>Super Mains</em>}</li>
* <li>{@link org.eclipse.xtext.generator.ecore.subPackage.SubMain#getAnother <em>Another</em>}</li>
* </ul>
*
* @see org.eclipse.xtext.generator.ecore.subPackage.SubPackagePackage#getSubMain()
* @model
* @generated
*/
public interface SubMain extends EObject
{
/**
* Returns the value of the '<em><b>Super Mains</b></em>' containment reference list.
* The list contents are of type {@link org.eclipse.xtext.generator.ecore.superPackage.SuperMain}.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Super Mains</em>' containment reference list isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Super Mains</em>' containment reference list.
* @see org.eclipse.xtext.generator.ecore.subPackage.SubPackagePackage#getSubMain_SuperMains()
* @model containment="true"
* @generated
*/
EList<SuperMain> getSuperMains();
/**
* Returns the value of the '<em><b>Another</b></em>' containment reference.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Another</em>' containment reference isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Another</em>' containment reference.
* @see #setAnother(AnotherSuperMain)
* @see org.eclipse.xtext.generator.ecore.subPackage.SubPackagePackage#getSubMain_Another()
* @model containment="true"
* @generated
*/
AnotherSuperMain getAnother();
/**
* Sets the value of the '{@link org.eclipse.xtext.generator.ecore.subPackage.SubMain#getAnother <em>Another</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Another</em>' containment reference.
* @see #getAnother()
* @generated
*/
void setAnother(AnotherSuperMain value);
} // SubMain

View file

@ -0,0 +1,53 @@
/**
* generated by Xtext
*/
package org.eclipse.xtext.generator.ecore.subPackage;
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.generator.ecore.subPackage.SubPackagePackage
* @generated
*/
public interface SubPackageFactory extends EFactory
{
/**
* The singleton instance of the factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
SubPackageFactory eINSTANCE = org.eclipse.xtext.generator.ecore.subPackage.impl.SubPackageFactoryImpl.init();
/**
* Returns a new object of class '<em>Sub Main</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return a new object of class '<em>Sub Main</em>'.
* @generated
*/
SubMain createSubMain();
/**
* Returns a new object of class '<em>Another Super Main</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return a new object of class '<em>Another Super Main</em>'.
* @generated
*/
AnotherSuperMain createAnotherSuperMain();
/**
* Returns the package supported by this factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the package supported by this factory.
* @generated
*/
SubPackagePackage getSubPackagePackage();
} //SubPackageFactory

View file

@ -0,0 +1,230 @@
/**
* generated by Xtext
*/
package org.eclipse.xtext.generator.ecore.subPackage;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.xtext.generator.ecore.superPackage.SuperPackagePackage;
/**
* <!-- 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.generator.ecore.subPackage.SubPackageFactory
* @model kind="package"
* @generated
*/
public interface SubPackagePackage extends EPackage
{
/**
* The package name.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
String eNAME = "subPackage";
/**
* The package namespace URI.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
String eNS_URI = "http://www.eclipse.org/2009/tmf/xtext/SubTestLanguage";
/**
* The package namespace name.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
String eNS_PREFIX = "subPackage";
/**
* The singleton instance of the package.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
SubPackagePackage eINSTANCE = org.eclipse.xtext.generator.ecore.subPackage.impl.SubPackagePackageImpl.init();
/**
* The meta object id for the '{@link org.eclipse.xtext.generator.ecore.subPackage.impl.SubMainImpl <em>Sub Main</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see org.eclipse.xtext.generator.ecore.subPackage.impl.SubMainImpl
* @see org.eclipse.xtext.generator.ecore.subPackage.impl.SubPackagePackageImpl#getSubMain()
* @generated
*/
int SUB_MAIN = 0;
/**
* The feature id for the '<em><b>Super Mains</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int SUB_MAIN__SUPER_MAINS = 0;
/**
* The feature id for the '<em><b>Another</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int SUB_MAIN__ANOTHER = 1;
/**
* The number of structural features of the '<em>Sub Main</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int SUB_MAIN_FEATURE_COUNT = 2;
/**
* The meta object id for the '{@link org.eclipse.xtext.generator.ecore.subPackage.impl.AnotherSuperMainImpl <em>Another Super Main</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see org.eclipse.xtext.generator.ecore.subPackage.impl.AnotherSuperMainImpl
* @see org.eclipse.xtext.generator.ecore.subPackage.impl.SubPackagePackageImpl#getAnotherSuperMain()
* @generated
*/
int ANOTHER_SUPER_MAIN = 1;
/**
* The feature id for the '<em><b>Name</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int ANOTHER_SUPER_MAIN__NAME = SuperPackagePackage.ANOTHER_SUPER_MAIN__NAME;
/**
* The number of structural features of the '<em>Another Super Main</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int ANOTHER_SUPER_MAIN_FEATURE_COUNT = SuperPackagePackage.ANOTHER_SUPER_MAIN_FEATURE_COUNT + 0;
/**
* Returns the meta object for class '{@link org.eclipse.xtext.generator.ecore.subPackage.SubMain <em>Sub Main</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for class '<em>Sub Main</em>'.
* @see org.eclipse.xtext.generator.ecore.subPackage.SubMain
* @generated
*/
EClass getSubMain();
/**
* Returns the meta object for the containment reference list '{@link org.eclipse.xtext.generator.ecore.subPackage.SubMain#getSuperMains <em>Super Mains</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the containment reference list '<em>Super Mains</em>'.
* @see org.eclipse.xtext.generator.ecore.subPackage.SubMain#getSuperMains()
* @see #getSubMain()
* @generated
*/
EReference getSubMain_SuperMains();
/**
* Returns the meta object for the containment reference '{@link org.eclipse.xtext.generator.ecore.subPackage.SubMain#getAnother <em>Another</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the containment reference '<em>Another</em>'.
* @see org.eclipse.xtext.generator.ecore.subPackage.SubMain#getAnother()
* @see #getSubMain()
* @generated
*/
EReference getSubMain_Another();
/**
* Returns the meta object for class '{@link org.eclipse.xtext.generator.ecore.subPackage.AnotherSuperMain <em>Another Super Main</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for class '<em>Another Super Main</em>'.
* @see org.eclipse.xtext.generator.ecore.subPackage.AnotherSuperMain
* @generated
*/
EClass getAnotherSuperMain();
/**
* 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
*/
SubPackageFactory getSubPackageFactory();
/**
* <!-- 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.generator.ecore.subPackage.impl.SubMainImpl <em>Sub Main</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see org.eclipse.xtext.generator.ecore.subPackage.impl.SubMainImpl
* @see org.eclipse.xtext.generator.ecore.subPackage.impl.SubPackagePackageImpl#getSubMain()
* @generated
*/
EClass SUB_MAIN = eINSTANCE.getSubMain();
/**
* The meta object literal for the '<em><b>Super Mains</b></em>' containment reference list feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EReference SUB_MAIN__SUPER_MAINS = eINSTANCE.getSubMain_SuperMains();
/**
* The meta object literal for the '<em><b>Another</b></em>' containment reference feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EReference SUB_MAIN__ANOTHER = eINSTANCE.getSubMain_Another();
/**
* The meta object literal for the '{@link org.eclipse.xtext.generator.ecore.subPackage.impl.AnotherSuperMainImpl <em>Another Super Main</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see org.eclipse.xtext.generator.ecore.subPackage.impl.AnotherSuperMainImpl
* @see org.eclipse.xtext.generator.ecore.subPackage.impl.SubPackagePackageImpl#getAnotherSuperMain()
* @generated
*/
EClass ANOTHER_SUPER_MAIN = eINSTANCE.getAnotherSuperMain();
}
} //SubPackagePackage

View file

@ -0,0 +1,41 @@
/**
* generated by Xtext
*/
package org.eclipse.xtext.generator.ecore.subPackage.impl;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.xtext.generator.ecore.subPackage.AnotherSuperMain;
import org.eclipse.xtext.generator.ecore.subPackage.SubPackagePackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Another Super Main</b></em>'.
* <!-- end-user-doc -->
*
* @generated
*/
public class AnotherSuperMainImpl extends org.eclipse.xtext.generator.ecore.superPackage.impl.AnotherSuperMainImpl implements AnotherSuperMain
{
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected AnotherSuperMainImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return SubPackagePackage.Literals.ANOTHER_SUPER_MAIN;
}
} //AnotherSuperMainImpl

View file

@ -0,0 +1,243 @@
/**
* generated by Xtext
*/
package org.eclipse.xtext.generator.ecore.subPackage.impl;
import java.util.Collection;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
import org.eclipse.xtext.generator.ecore.subPackage.AnotherSuperMain;
import org.eclipse.xtext.generator.ecore.subPackage.SubMain;
import org.eclipse.xtext.generator.ecore.subPackage.SubPackagePackage;
import org.eclipse.xtext.generator.ecore.superPackage.SuperMain;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Sub Main</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.xtext.generator.ecore.subPackage.impl.SubMainImpl#getSuperMains <em>Super Mains</em>}</li>
* <li>{@link org.eclipse.xtext.generator.ecore.subPackage.impl.SubMainImpl#getAnother <em>Another</em>}</li>
* </ul>
*
* @generated
*/
public class SubMainImpl extends MinimalEObjectImpl.Container implements SubMain
{
/**
* The cached value of the '{@link #getSuperMains() <em>Super Mains</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getSuperMains()
* @generated
* @ordered
*/
protected EList<SuperMain> superMains;
/**
* The cached value of the '{@link #getAnother() <em>Another</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAnother()
* @generated
* @ordered
*/
protected AnotherSuperMain another;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected SubMainImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return SubPackagePackage.Literals.SUB_MAIN;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<SuperMain> getSuperMains()
{
if (superMains == null)
{
superMains = new EObjectContainmentEList<SuperMain>(SuperMain.class, this, SubPackagePackage.SUB_MAIN__SUPER_MAINS);
}
return superMains;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public AnotherSuperMain getAnother()
{
return another;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetAnother(AnotherSuperMain newAnother, NotificationChain msgs)
{
AnotherSuperMain oldAnother = another;
another = newAnother;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SubPackagePackage.SUB_MAIN__ANOTHER, oldAnother, newAnother);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setAnother(AnotherSuperMain newAnother)
{
if (newAnother != another)
{
NotificationChain msgs = null;
if (another != null)
msgs = ((InternalEObject)another).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - SubPackagePackage.SUB_MAIN__ANOTHER, null, msgs);
if (newAnother != null)
msgs = ((InternalEObject)newAnother).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - SubPackagePackage.SUB_MAIN__ANOTHER, null, msgs);
msgs = basicSetAnother(newAnother, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, SubPackagePackage.SUB_MAIN__ANOTHER, newAnother, newAnother));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case SubPackagePackage.SUB_MAIN__SUPER_MAINS:
return ((InternalEList<?>)getSuperMains()).basicRemove(otherEnd, msgs);
case SubPackagePackage.SUB_MAIN__ANOTHER:
return basicSetAnother(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 SubPackagePackage.SUB_MAIN__SUPER_MAINS:
return getSuperMains();
case SubPackagePackage.SUB_MAIN__ANOTHER:
return getAnother();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case SubPackagePackage.SUB_MAIN__SUPER_MAINS:
getSuperMains().clear();
getSuperMains().addAll((Collection<? extends SuperMain>)newValue);
return;
case SubPackagePackage.SUB_MAIN__ANOTHER:
setAnother((AnotherSuperMain)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case SubPackagePackage.SUB_MAIN__SUPER_MAINS:
getSuperMains().clear();
return;
case SubPackagePackage.SUB_MAIN__ANOTHER:
setAnother((AnotherSuperMain)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case SubPackagePackage.SUB_MAIN__SUPER_MAINS:
return superMains != null && !superMains.isEmpty();
case SubPackagePackage.SUB_MAIN__ANOTHER:
return another != null;
}
return super.eIsSet(featureID);
}
} //SubMainImpl

View file

@ -0,0 +1,119 @@
/**
* generated by Xtext
*/
package org.eclipse.xtext.generator.ecore.subPackage.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.generator.ecore.subPackage.*;
/**
* <!-- begin-user-doc -->
* An implementation of the model <b>Factory</b>.
* <!-- end-user-doc -->
* @generated
*/
public class SubPackageFactoryImpl extends EFactoryImpl implements SubPackageFactory
{
/**
* Creates the default factory implementation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static SubPackageFactory init()
{
try
{
SubPackageFactory theSubPackageFactory = (SubPackageFactory)EPackage.Registry.INSTANCE.getEFactory(SubPackagePackage.eNS_URI);
if (theSubPackageFactory != null)
{
return theSubPackageFactory;
}
}
catch (Exception exception)
{
EcorePlugin.INSTANCE.log(exception);
}
return new SubPackageFactoryImpl();
}
/**
* Creates an instance of the factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public SubPackageFactoryImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EObject create(EClass eClass)
{
switch (eClass.getClassifierID())
{
case SubPackagePackage.SUB_MAIN: return createSubMain();
case SubPackagePackage.ANOTHER_SUPER_MAIN: return createAnotherSuperMain();
default:
throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public SubMain createSubMain()
{
SubMainImpl subMain = new SubMainImpl();
return subMain;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public AnotherSuperMain createAnotherSuperMain()
{
AnotherSuperMainImpl anotherSuperMain = new AnotherSuperMainImpl();
return anotherSuperMain;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public SubPackagePackage getSubPackagePackage()
{
return (SubPackagePackage)getEPackage();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @deprecated
* @generated
*/
@Deprecated
public static SubPackagePackage getPackage()
{
return SubPackagePackage.eINSTANCE;
}
} //SubPackageFactoryImpl

View file

@ -0,0 +1,229 @@
/**
* generated by Xtext
*/
package org.eclipse.xtext.generator.ecore.subPackage.impl;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.impl.EPackageImpl;
import org.eclipse.xtext.generator.ecore.subPackage.AnotherSuperMain;
import org.eclipse.xtext.generator.ecore.subPackage.SubMain;
import org.eclipse.xtext.generator.ecore.subPackage.SubPackageFactory;
import org.eclipse.xtext.generator.ecore.subPackage.SubPackagePackage;
import org.eclipse.xtext.generator.ecore.superPackage.SuperPackagePackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model <b>Package</b>.
* <!-- end-user-doc -->
* @generated
*/
public class SubPackagePackageImpl extends EPackageImpl implements SubPackagePackage
{
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass subMainEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass anotherSuperMainEClass = 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.generator.ecore.subPackage.SubPackagePackage#eNS_URI
* @see #init()
* @generated
*/
private SubPackagePackageImpl()
{
super(eNS_URI, SubPackageFactory.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 SubPackagePackage#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 SubPackagePackage init()
{
if (isInited) return (SubPackagePackage)EPackage.Registry.INSTANCE.getEPackage(SubPackagePackage.eNS_URI);
// Obtain or create and register package
SubPackagePackageImpl theSubPackagePackage = (SubPackagePackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof SubPackagePackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new SubPackagePackageImpl());
isInited = true;
// Initialize simple dependencies
SuperPackagePackage.eINSTANCE.eClass();
// Create package meta-data objects
theSubPackagePackage.createPackageContents();
// Initialize created meta-data
theSubPackagePackage.initializePackageContents();
// Mark meta-data to indicate it can't be changed
theSubPackagePackage.freeze();
// Update the registry and return the package
EPackage.Registry.INSTANCE.put(SubPackagePackage.eNS_URI, theSubPackagePackage);
return theSubPackagePackage;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getSubMain()
{
return subMainEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getSubMain_SuperMains()
{
return (EReference)subMainEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getSubMain_Another()
{
return (EReference)subMainEClass.getEStructuralFeatures().get(1);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getAnotherSuperMain()
{
return anotherSuperMainEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public SubPackageFactory getSubPackageFactory()
{
return (SubPackageFactory)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
subMainEClass = createEClass(SUB_MAIN);
createEReference(subMainEClass, SUB_MAIN__SUPER_MAINS);
createEReference(subMainEClass, SUB_MAIN__ANOTHER);
anotherSuperMainEClass = createEClass(ANOTHER_SUPER_MAIN);
}
/**
* <!-- 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
SuperPackagePackage theSuperPackagePackage = (SuperPackagePackage)EPackage.Registry.INSTANCE.getEPackage(SuperPackagePackage.eNS_URI);
// Create type parameters
// Set bounds for type parameters
// Add supertypes to classes
anotherSuperMainEClass.getESuperTypes().add(theSuperPackagePackage.getAnotherSuperMain());
// Initialize classes and features; add operations and parameters
initEClass(subMainEClass, SubMain.class, "SubMain", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getSubMain_SuperMains(), theSuperPackagePackage.getSuperMain(), null, "superMains", null, 0, -1, SubMain.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getSubMain_Another(), this.getAnotherSuperMain(), null, "another", null, 0, 1, SubMain.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(anotherSuperMainEClass, AnotherSuperMain.class, "AnotherSuperMain", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
// Create resource
createResource(eNS_URI);
}
} //SubPackagePackageImpl

View file

@ -0,0 +1,173 @@
/**
* generated by Xtext
*/
package org.eclipse.xtext.generator.ecore.subPackage.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.generator.ecore.subPackage.*;
/**
* <!-- 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.generator.ecore.subPackage.SubPackagePackage
* @generated
*/
public class SubPackageAdapterFactory extends AdapterFactoryImpl
{
/**
* The cached model package.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected static SubPackagePackage modelPackage;
/**
* Creates an instance of the adapter factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public SubPackageAdapterFactory()
{
if (modelPackage == null)
{
modelPackage = SubPackagePackage.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 SubPackageSwitch<Adapter> modelSwitch =
new SubPackageSwitch<Adapter>()
{
@Override
public Adapter caseSubMain(SubMain object)
{
return createSubMainAdapter();
}
@Override
public Adapter caseAnotherSuperMain(AnotherSuperMain object)
{
return createAnotherSuperMainAdapter();
}
@Override
public Adapter caseSuperPackage_AnotherSuperMain(org.eclipse.xtext.generator.ecore.superPackage.AnotherSuperMain object)
{
return createSuperPackage_AnotherSuperMainAdapter();
}
@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.generator.ecore.subPackage.SubMain <em>Sub Main</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.generator.ecore.subPackage.SubMain
* @generated
*/
public Adapter createSubMainAdapter()
{
return null;
}
/**
* Creates a new adapter for an object of class '{@link org.eclipse.xtext.generator.ecore.subPackage.AnotherSuperMain <em>Another Super Main</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.generator.ecore.subPackage.AnotherSuperMain
* @generated
*/
public Adapter createAnotherSuperMainAdapter()
{
return null;
}
/**
* Creates a new adapter for an object of class '{@link org.eclipse.xtext.generator.ecore.superPackage.AnotherSuperMain <em>Another Super Main</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.generator.ecore.superPackage.AnotherSuperMain
* @generated
*/
public Adapter createSuperPackage_AnotherSuperMainAdapter()
{
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;
}
} //SubPackageAdapterFactory

View file

@ -0,0 +1,160 @@
/**
* generated by Xtext
*/
package org.eclipse.xtext.generator.ecore.subPackage.util;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.util.Switch;
import org.eclipse.xtext.generator.ecore.subPackage.*;
/**
* <!-- 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.generator.ecore.subPackage.SubPackagePackage
* @generated
*/
public class SubPackageSwitch<T> extends Switch<T>
{
/**
* The cached model package
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected static SubPackagePackage modelPackage;
/**
* Creates an instance of the switch.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public SubPackageSwitch()
{
if (modelPackage == null)
{
modelPackage = SubPackagePackage.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 SubPackagePackage.SUB_MAIN:
{
SubMain subMain = (SubMain)theEObject;
T result = caseSubMain(subMain);
if (result == null) result = defaultCase(theEObject);
return result;
}
case SubPackagePackage.ANOTHER_SUPER_MAIN:
{
AnotherSuperMain anotherSuperMain = (AnotherSuperMain)theEObject;
T result = caseAnotherSuperMain(anotherSuperMain);
if (result == null) result = caseSuperPackage_AnotherSuperMain(anotherSuperMain);
if (result == null) result = defaultCase(theEObject);
return result;
}
default: return defaultCase(theEObject);
}
}
/**
* Returns the result of interpreting the object as an instance of '<em>Sub Main</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>Sub Main</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseSubMain(SubMain object)
{
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Another Super Main</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>Another Super Main</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseAnotherSuperMain(AnotherSuperMain object)
{
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Another Super Main</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>Another Super Main</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseSuperPackage_AnotherSuperMain(org.eclipse.xtext.generator.ecore.superPackage.AnotherSuperMain 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;
}
} //SubPackageSwitch

View file

@ -0,0 +1,52 @@
/**
* generated by Xtext
*/
package org.eclipse.xtext.generator.ecore.superPackage;
import org.eclipse.emf.ecore.EObject;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Another Super Main</b></em>'.
* <!-- end-user-doc -->
*
* <p>
* The following features are supported:
* </p>
* <ul>
* <li>{@link org.eclipse.xtext.generator.ecore.superPackage.AnotherSuperMain#getName <em>Name</em>}</li>
* </ul>
*
* @see org.eclipse.xtext.generator.ecore.superPackage.SuperPackagePackage#getAnotherSuperMain()
* @model
* @generated
*/
public interface AnotherSuperMain extends EObject
{
/**
* Returns the value of the '<em><b>Name</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Name</em>' attribute isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Name</em>' attribute.
* @see #setName(String)
* @see org.eclipse.xtext.generator.ecore.superPackage.SuperPackagePackage#getAnotherSuperMain_Name()
* @model
* @generated
*/
String getName();
/**
* Sets the value of the '{@link org.eclipse.xtext.generator.ecore.superPackage.AnotherSuperMain#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);
} // AnotherSuperMain

View file

@ -0,0 +1,52 @@
/**
* generated by Xtext
*/
package org.eclipse.xtext.generator.ecore.superPackage;
import org.eclipse.emf.ecore.EObject;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Super Main</b></em>'.
* <!-- end-user-doc -->
*
* <p>
* The following features are supported:
* </p>
* <ul>
* <li>{@link org.eclipse.xtext.generator.ecore.superPackage.SuperMain#getName <em>Name</em>}</li>
* </ul>
*
* @see org.eclipse.xtext.generator.ecore.superPackage.SuperPackagePackage#getSuperMain()
* @model
* @generated
*/
public interface SuperMain extends EObject
{
/**
* Returns the value of the '<em><b>Name</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Name</em>' attribute isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Name</em>' attribute.
* @see #setName(String)
* @see org.eclipse.xtext.generator.ecore.superPackage.SuperPackagePackage#getSuperMain_Name()
* @model
* @generated
*/
String getName();
/**
* Sets the value of the '{@link org.eclipse.xtext.generator.ecore.superPackage.SuperMain#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);
} // SuperMain

View file

@ -0,0 +1,53 @@
/**
* generated by Xtext
*/
package org.eclipse.xtext.generator.ecore.superPackage;
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.generator.ecore.superPackage.SuperPackagePackage
* @generated
*/
public interface SuperPackageFactory extends EFactory
{
/**
* The singleton instance of the factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
SuperPackageFactory eINSTANCE = org.eclipse.xtext.generator.ecore.superPackage.impl.SuperPackageFactoryImpl.init();
/**
* Returns a new object of class '<em>Super Main</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return a new object of class '<em>Super Main</em>'.
* @generated
*/
SuperMain createSuperMain();
/**
* Returns a new object of class '<em>Another Super Main</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return a new object of class '<em>Another Super Main</em>'.
* @generated
*/
AnotherSuperMain createAnotherSuperMain();
/**
* Returns the package supported by this factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the package supported by this factory.
* @generated
*/
SuperPackagePackage getSuperPackagePackage();
} //SuperPackageFactory

View file

@ -0,0 +1,219 @@
/**
* generated by Xtext
*/
package org.eclipse.xtext.generator.ecore.superPackage;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EPackage;
/**
* <!-- begin-user-doc -->
* The <b>Package</b> for the model.
* It contains accessors for the meta objects to represent
* <ul>
* <li>each class,</li>
* <li>each feature of each class,</li>
* <li>each enum,</li>
* <li>and each data type</li>
* </ul>
* <!-- end-user-doc -->
* @see org.eclipse.xtext.generator.ecore.superPackage.SuperPackageFactory
* @model kind="package"
* @generated
*/
public interface SuperPackagePackage extends EPackage
{
/**
* The package name.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
String eNAME = "superPackage";
/**
* The package namespace URI.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
String eNS_URI = "http://www.eclipse.org/2009/tmf/xtext/SuperTestLanguage";
/**
* The package namespace name.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
String eNS_PREFIX = "superPackage";
/**
* The singleton instance of the package.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
SuperPackagePackage eINSTANCE = org.eclipse.xtext.generator.ecore.superPackage.impl.SuperPackagePackageImpl.init();
/**
* The meta object id for the '{@link org.eclipse.xtext.generator.ecore.superPackage.impl.SuperMainImpl <em>Super Main</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see org.eclipse.xtext.generator.ecore.superPackage.impl.SuperMainImpl
* @see org.eclipse.xtext.generator.ecore.superPackage.impl.SuperPackagePackageImpl#getSuperMain()
* @generated
*/
int SUPER_MAIN = 0;
/**
* The feature id for the '<em><b>Name</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int SUPER_MAIN__NAME = 0;
/**
* The number of structural features of the '<em>Super Main</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int SUPER_MAIN_FEATURE_COUNT = 1;
/**
* The meta object id for the '{@link org.eclipse.xtext.generator.ecore.superPackage.impl.AnotherSuperMainImpl <em>Another Super Main</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see org.eclipse.xtext.generator.ecore.superPackage.impl.AnotherSuperMainImpl
* @see org.eclipse.xtext.generator.ecore.superPackage.impl.SuperPackagePackageImpl#getAnotherSuperMain()
* @generated
*/
int ANOTHER_SUPER_MAIN = 1;
/**
* The feature id for the '<em><b>Name</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int ANOTHER_SUPER_MAIN__NAME = 0;
/**
* The number of structural features of the '<em>Another Super Main</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int ANOTHER_SUPER_MAIN_FEATURE_COUNT = 1;
/**
* Returns the meta object for class '{@link org.eclipse.xtext.generator.ecore.superPackage.SuperMain <em>Super Main</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for class '<em>Super Main</em>'.
* @see org.eclipse.xtext.generator.ecore.superPackage.SuperMain
* @generated
*/
EClass getSuperMain();
/**
* Returns the meta object for the attribute '{@link org.eclipse.xtext.generator.ecore.superPackage.SuperMain#getName <em>Name</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute '<em>Name</em>'.
* @see org.eclipse.xtext.generator.ecore.superPackage.SuperMain#getName()
* @see #getSuperMain()
* @generated
*/
EAttribute getSuperMain_Name();
/**
* Returns the meta object for class '{@link org.eclipse.xtext.generator.ecore.superPackage.AnotherSuperMain <em>Another Super Main</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for class '<em>Another Super Main</em>'.
* @see org.eclipse.xtext.generator.ecore.superPackage.AnotherSuperMain
* @generated
*/
EClass getAnotherSuperMain();
/**
* Returns the meta object for the attribute '{@link org.eclipse.xtext.generator.ecore.superPackage.AnotherSuperMain#getName <em>Name</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute '<em>Name</em>'.
* @see org.eclipse.xtext.generator.ecore.superPackage.AnotherSuperMain#getName()
* @see #getAnotherSuperMain()
* @generated
*/
EAttribute getAnotherSuperMain_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
*/
SuperPackageFactory getSuperPackageFactory();
/**
* <!-- 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.generator.ecore.superPackage.impl.SuperMainImpl <em>Super Main</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see org.eclipse.xtext.generator.ecore.superPackage.impl.SuperMainImpl
* @see org.eclipse.xtext.generator.ecore.superPackage.impl.SuperPackagePackageImpl#getSuperMain()
* @generated
*/
EClass SUPER_MAIN = eINSTANCE.getSuperMain();
/**
* The meta object literal for the '<em><b>Name</b></em>' attribute feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EAttribute SUPER_MAIN__NAME = eINSTANCE.getSuperMain_Name();
/**
* The meta object literal for the '{@link org.eclipse.xtext.generator.ecore.superPackage.impl.AnotherSuperMainImpl <em>Another Super Main</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see org.eclipse.xtext.generator.ecore.superPackage.impl.AnotherSuperMainImpl
* @see org.eclipse.xtext.generator.ecore.superPackage.impl.SuperPackagePackageImpl#getAnotherSuperMain()
* @generated
*/
EClass ANOTHER_SUPER_MAIN = eINSTANCE.getAnotherSuperMain();
/**
* The meta object literal for the '<em><b>Name</b></em>' attribute feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EAttribute ANOTHER_SUPER_MAIN__NAME = eINSTANCE.getAnotherSuperMain_Name();
}
} //SuperPackagePackage

View file

@ -0,0 +1,178 @@
/**
* generated by Xtext
*/
package org.eclipse.xtext.generator.ecore.superPackage.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
import org.eclipse.xtext.generator.ecore.superPackage.AnotherSuperMain;
import org.eclipse.xtext.generator.ecore.superPackage.SuperPackagePackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Another Super Main</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.xtext.generator.ecore.superPackage.impl.AnotherSuperMainImpl#getName <em>Name</em>}</li>
* </ul>
*
* @generated
*/
public class AnotherSuperMainImpl extends MinimalEObjectImpl.Container implements AnotherSuperMain
{
/**
* 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 AnotherSuperMainImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return SuperPackagePackage.Literals.ANOTHER_SUPER_MAIN;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getName()
{
return name;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setName(String newName)
{
String oldName = name;
name = newName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, SuperPackagePackage.ANOTHER_SUPER_MAIN__NAME, oldName, name));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case SuperPackagePackage.ANOTHER_SUPER_MAIN__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 SuperPackagePackage.ANOTHER_SUPER_MAIN__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 SuperPackagePackage.ANOTHER_SUPER_MAIN__NAME:
setName(NAME_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case SuperPackagePackage.ANOTHER_SUPER_MAIN__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();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (name: ");
result.append(name);
result.append(')');
return result.toString();
}
} //AnotherSuperMainImpl

View file

@ -0,0 +1,178 @@
/**
* generated by Xtext
*/
package org.eclipse.xtext.generator.ecore.superPackage.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
import org.eclipse.xtext.generator.ecore.superPackage.SuperMain;
import org.eclipse.xtext.generator.ecore.superPackage.SuperPackagePackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Super Main</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.xtext.generator.ecore.superPackage.impl.SuperMainImpl#getName <em>Name</em>}</li>
* </ul>
*
* @generated
*/
public class SuperMainImpl extends MinimalEObjectImpl.Container implements SuperMain
{
/**
* 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 SuperMainImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return SuperPackagePackage.Literals.SUPER_MAIN;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getName()
{
return name;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setName(String newName)
{
String oldName = name;
name = newName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, SuperPackagePackage.SUPER_MAIN__NAME, oldName, name));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case SuperPackagePackage.SUPER_MAIN__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 SuperPackagePackage.SUPER_MAIN__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 SuperPackagePackage.SUPER_MAIN__NAME:
setName(NAME_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case SuperPackagePackage.SUPER_MAIN__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();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (name: ");
result.append(name);
result.append(')');
return result.toString();
}
} //SuperMainImpl

View file

@ -0,0 +1,119 @@
/**
* generated by Xtext
*/
package org.eclipse.xtext.generator.ecore.superPackage.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.generator.ecore.superPackage.*;
/**
* <!-- begin-user-doc -->
* An implementation of the model <b>Factory</b>.
* <!-- end-user-doc -->
* @generated
*/
public class SuperPackageFactoryImpl extends EFactoryImpl implements SuperPackageFactory
{
/**
* Creates the default factory implementation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static SuperPackageFactory init()
{
try
{
SuperPackageFactory theSuperPackageFactory = (SuperPackageFactory)EPackage.Registry.INSTANCE.getEFactory(SuperPackagePackage.eNS_URI);
if (theSuperPackageFactory != null)
{
return theSuperPackageFactory;
}
}
catch (Exception exception)
{
EcorePlugin.INSTANCE.log(exception);
}
return new SuperPackageFactoryImpl();
}
/**
* Creates an instance of the factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public SuperPackageFactoryImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EObject create(EClass eClass)
{
switch (eClass.getClassifierID())
{
case SuperPackagePackage.SUPER_MAIN: return createSuperMain();
case SuperPackagePackage.ANOTHER_SUPER_MAIN: return createAnotherSuperMain();
default:
throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public SuperMain createSuperMain()
{
SuperMainImpl superMain = new SuperMainImpl();
return superMain;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public AnotherSuperMain createAnotherSuperMain()
{
AnotherSuperMainImpl anotherSuperMain = new AnotherSuperMainImpl();
return anotherSuperMain;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public SuperPackagePackage getSuperPackagePackage()
{
return (SuperPackagePackage)getEPackage();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @deprecated
* @generated
*/
@Deprecated
public static SuperPackagePackage getPackage()
{
return SuperPackagePackage.eINSTANCE;
}
} //SuperPackageFactoryImpl

View file

@ -0,0 +1,227 @@
/**
* generated by Xtext
*/
package org.eclipse.xtext.generator.ecore.superPackage.impl;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EcorePackage;
import org.eclipse.emf.ecore.impl.EPackageImpl;
import org.eclipse.xtext.generator.ecore.superPackage.AnotherSuperMain;
import org.eclipse.xtext.generator.ecore.superPackage.SuperMain;
import org.eclipse.xtext.generator.ecore.superPackage.SuperPackageFactory;
import org.eclipse.xtext.generator.ecore.superPackage.SuperPackagePackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model <b>Package</b>.
* <!-- end-user-doc -->
* @generated
*/
public class SuperPackagePackageImpl extends EPackageImpl implements SuperPackagePackage
{
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass superMainEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass anotherSuperMainEClass = 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.generator.ecore.superPackage.SuperPackagePackage#eNS_URI
* @see #init()
* @generated
*/
private SuperPackagePackageImpl()
{
super(eNS_URI, SuperPackageFactory.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 SuperPackagePackage#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 SuperPackagePackage init()
{
if (isInited) return (SuperPackagePackage)EPackage.Registry.INSTANCE.getEPackage(SuperPackagePackage.eNS_URI);
// Obtain or create and register package
SuperPackagePackageImpl theSuperPackagePackage = (SuperPackagePackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof SuperPackagePackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new SuperPackagePackageImpl());
isInited = true;
// Initialize simple dependencies
EcorePackage.eINSTANCE.eClass();
// Create package meta-data objects
theSuperPackagePackage.createPackageContents();
// Initialize created meta-data
theSuperPackagePackage.initializePackageContents();
// Mark meta-data to indicate it can't be changed
theSuperPackagePackage.freeze();
// Update the registry and return the package
EPackage.Registry.INSTANCE.put(SuperPackagePackage.eNS_URI, theSuperPackagePackage);
return theSuperPackagePackage;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getSuperMain()
{
return superMainEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getSuperMain_Name()
{
return (EAttribute)superMainEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getAnotherSuperMain()
{
return anotherSuperMainEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getAnotherSuperMain_Name()
{
return (EAttribute)anotherSuperMainEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public SuperPackageFactory getSuperPackageFactory()
{
return (SuperPackageFactory)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
superMainEClass = createEClass(SUPER_MAIN);
createEAttribute(superMainEClass, SUPER_MAIN__NAME);
anotherSuperMainEClass = createEClass(ANOTHER_SUPER_MAIN);
createEAttribute(anotherSuperMainEClass, ANOTHER_SUPER_MAIN__NAME);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private boolean isInitialized = false;
/**
* Complete the initialization of the package and its meta-model. This
* method is guarded to have no affect on any invocation but its first.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void initializePackageContents()
{
if (isInitialized) return;
isInitialized = true;
// Initialize package
setName(eNAME);
setNsPrefix(eNS_PREFIX);
setNsURI(eNS_URI);
// Obtain other dependent packages
EcorePackage theEcorePackage = (EcorePackage)EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI);
// Create type parameters
// Set bounds for type parameters
// Add supertypes to classes
// Initialize classes and features; add operations and parameters
initEClass(superMainEClass, SuperMain.class, "SuperMain", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getSuperMain_Name(), theEcorePackage.getEString(), "name", null, 0, 1, SuperMain.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(anotherSuperMainEClass, AnotherSuperMain.class, "AnotherSuperMain", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getAnotherSuperMain_Name(), theEcorePackage.getEString(), "name", null, 0, 1, AnotherSuperMain.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
// Create resource
createResource(eNS_URI);
}
} //SuperPackagePackageImpl

View file

@ -0,0 +1,153 @@
/**
* generated by Xtext
*/
package org.eclipse.xtext.generator.ecore.superPackage.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.generator.ecore.superPackage.*;
/**
* <!-- 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.generator.ecore.superPackage.SuperPackagePackage
* @generated
*/
public class SuperPackageAdapterFactory extends AdapterFactoryImpl
{
/**
* The cached model package.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected static SuperPackagePackage modelPackage;
/**
* Creates an instance of the adapter factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public SuperPackageAdapterFactory()
{
if (modelPackage == null)
{
modelPackage = SuperPackagePackage.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 SuperPackageSwitch<Adapter> modelSwitch =
new SuperPackageSwitch<Adapter>()
{
@Override
public Adapter caseSuperMain(SuperMain object)
{
return createSuperMainAdapter();
}
@Override
public Adapter caseAnotherSuperMain(AnotherSuperMain object)
{
return createAnotherSuperMainAdapter();
}
@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.generator.ecore.superPackage.SuperMain <em>Super Main</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.generator.ecore.superPackage.SuperMain
* @generated
*/
public Adapter createSuperMainAdapter()
{
return null;
}
/**
* Creates a new adapter for an object of class '{@link org.eclipse.xtext.generator.ecore.superPackage.AnotherSuperMain <em>Another Super Main</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.generator.ecore.superPackage.AnotherSuperMain
* @generated
*/
public Adapter createAnotherSuperMainAdapter()
{
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;
}
} //SuperPackageAdapterFactory

View file

@ -0,0 +1,143 @@
/**
* generated by Xtext
*/
package org.eclipse.xtext.generator.ecore.superPackage.util;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.util.Switch;
import org.eclipse.xtext.generator.ecore.superPackage.*;
/**
* <!-- 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.generator.ecore.superPackage.SuperPackagePackage
* @generated
*/
public class SuperPackageSwitch<T> extends Switch<T>
{
/**
* The cached model package
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected static SuperPackagePackage modelPackage;
/**
* Creates an instance of the switch.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public SuperPackageSwitch()
{
if (modelPackage == null)
{
modelPackage = SuperPackagePackage.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 SuperPackagePackage.SUPER_MAIN:
{
SuperMain superMain = (SuperMain)theEObject;
T result = caseSuperMain(superMain);
if (result == null) result = defaultCase(theEObject);
return result;
}
case SuperPackagePackage.ANOTHER_SUPER_MAIN:
{
AnotherSuperMain anotherSuperMain = (AnotherSuperMain)theEObject;
T result = caseAnotherSuperMain(anotherSuperMain);
if (result == null) result = defaultCase(theEObject);
return result;
}
default: return defaultCase(theEObject);
}
}
/**
* Returns the result of interpreting the object as an instance of '<em>Super Main</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>Super Main</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseSuperMain(SuperMain object)
{
return null;
}
/**
* Returns the result of interpreting the object as an instance of '<em>Another Super Main</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>Another Super Main</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
public T caseAnotherSuperMain(AnotherSuperMain 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;
}
} //SuperPackageSwitch

View file

@ -66,16 +66,16 @@ Workflow {
pathTestProject = runtimeProject
projectNameRt = projectName
language = {
uri = "classpath:/org/eclipse/xtext/generator/ecore/SuperTestLanguage.xtext"
fragment = @TestLanguagesFragments {
srcGenOnly = false
}
}
language = {
uri = "classpath:/org/eclipse/xtext/generator/ecore/SubTestLanguage.xtext"
fragment = @TestLanguagesFragments {}
}
// language = {
// uri = "classpath:/org/eclipse/xtext/generator/ecore/SuperTestLanguage.xtext"
// fragment = @TestLanguagesFragments {
// srcGenOnly = false
// }
// }
// language = {
// uri = "classpath:/org/eclipse/xtext/generator/ecore/SubTestLanguage.xtext"
// fragment = @TestLanguagesFragments {}
// }
language = {
uri = "classpath:/org/eclipse/xtext/XtextGrammarTestLanguage.xtext"
fragment = @TestLanguagesFragments {}

View file

@ -89,9 +89,15 @@ Workflow {
}
language = TestLanguage {
name = "org.eclipse.xtext.generator.ecore.SuperTestLanguage"
ideaPlugin = {
generateXtendStub = true
}
}
language = TestLanguage {
name = "org.eclipse.xtext.generator.ecore.SubTestLanguage"
ideaPlugin = {
generateXtendStub = true
}
}
// language = TestLanguage {
// name = "org.eclipse.xtext.XtextGrammarTestLanguage"

View file

@ -1,4 +0,0 @@
package org.eclipse.xtext.generator.ecore.serializer;
public class SuperTestLanguageSemanticSequencer extends AbstractSuperTestLanguageSemanticSequencer {
}

View file

@ -1,4 +0,0 @@
package org.eclipse.xtext.generator.ecore.serializer;
public class SuperTestLanguageSyntacticSequencer extends AbstractSuperTestLanguageSyntacticSequencer {
}