Skip to content

Commit

Permalink
eclipse-archived#190 xtext new plugin generation
Browse files Browse the repository at this point in the history
  • Loading branch information
Rodolfo Totaro committed Dec 16, 2016
1 parent 290ca0d commit d899c1c
Show file tree
Hide file tree
Showing 51 changed files with 11,752 additions and 19 deletions.
10 changes: 3 additions & 7 deletions org.eclipse.triquetrum.commands.xtext.ide/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: org.eclipse.triquetrum.commands.xtext.ide
Bundle-Vendor: My Company
Bundle-Version: 1.0.0.qualifier
Bundle-SymbolicName: org.eclipse.triquetrum.commands.xtext.ide; singleton:=true
Bundle-SymbolicName: org.eclipse.triquetrum.commands.xtext.ide;singleton:=true
Bundle-Version: 0.0.1.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Require-Bundle: org.eclipse.triquetrum.commands.xtext,
org.eclipse.xtext.ide,
org.eclipse.xtext.xbase.ide
Bundle-RequiredExecutionEnvironment: JavaSE-1.8

16 changes: 15 additions & 1 deletion org.eclipse.triquetrum.commands.xtext/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,20 @@ Require-Bundle: org.eclipse.xtext,
org.eclipse.xtend.lib,
org.eclipse.emf.common,
org.eclipse.xtext.common.types,
org.objectweb.asm;bundle-version="[5.0.1,6.0.0)";resolution:=optional
org.objectweb.asm;bundle-version="[5.0.1,6.0.0)";resolution:=optional,
org.eclipse.xtext.xbase.ui,
org.eclipse.xtext.ui,
org.eclipse.xtext.generator;bundle-version="2.10.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Import-Package: org.apache.log4j
Export-Package: org.eclipse.triquetrum.commands.tqcl,
org.eclipse.triquetrum.commands.validation,
org.eclipse.triquetrum.commands.parser.antlr,
org.eclipse.triquetrum.commands.parser.antlr.internal,
org.eclipse.triquetrum.commands.serializer,
org.eclipse.triquetrum.commands.generator,
org.eclipse.triquetrum.commands,
org.eclipse.triquetrum.commands.tqcl.impl,
org.eclipse.triquetrum.commands.services,
org.eclipse.triquetrum.commands.scoping,
org.eclipse.triquetrum.commands.tqcl.util
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?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 2.10.0" modelDirectory="/org.eclipse.triquetrum.commands.xtext/src-gen"
xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" copyrightText="generated by Xtext 2.10.0" modelDirectory="org.eclipse.triquetrum.commands.xtext/src/main/java-gen"
modelPluginID="org.eclipse.triquetrum.commands.xtext" forceOverwrite="true" modelName="Tqcl"
updateClasspath="false" rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container"
complianceLevel="6.0" copyrightFields="false" runtimeVersion="2.12">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
/*
* generated by Xtext 2.10.0
*/
package org.eclipse.triquetrum.commands;

import com.google.inject.Binder;
import com.google.inject.Provider;
import com.google.inject.name.Names;
import java.util.Properties;
import org.eclipse.triquetrum.commands.generator.TqclGenerator;
import org.eclipse.triquetrum.commands.parser.antlr.TqclAntlrTokenFileProvider;
import org.eclipse.triquetrum.commands.parser.antlr.TqclParser;
import org.eclipse.triquetrum.commands.parser.antlr.internal.InternalTqclLexer;
import org.eclipse.triquetrum.commands.scoping.TqclScopeProvider;
import org.eclipse.triquetrum.commands.serializer.TqclSemanticSequencer;
import org.eclipse.triquetrum.commands.serializer.TqclSyntacticSequencer;
import org.eclipse.triquetrum.commands.services.TqclGrammarAccess;
import org.eclipse.triquetrum.commands.validation.TqclValidator;
import org.eclipse.xtext.Constants;
import org.eclipse.xtext.IGrammarAccess;
import org.eclipse.xtext.common.types.DefaultCommonTypesRuntimeModule;
import org.eclipse.xtext.common.types.xtext.TypesAwareDefaultGlobalScopeProvider;
import org.eclipse.xtext.generator.IGenerator2;
import org.eclipse.xtext.naming.DefaultDeclarativeQualifiedNameProvider;
import org.eclipse.xtext.naming.IQualifiedNameProvider;
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.resource.IContainer;
import org.eclipse.xtext.resource.IResourceDescriptions;
import org.eclipse.xtext.resource.containers.IAllContainersState;
import org.eclipse.xtext.resource.containers.ResourceSetBasedAllContainersStateProvider;
import org.eclipse.xtext.resource.containers.StateBasedContainerManager;
import org.eclipse.xtext.resource.impl.ResourceDescriptionsProvider;
import org.eclipse.xtext.resource.impl.ResourceSetBasedResourceDescriptions;
import org.eclipse.xtext.scoping.IGlobalScopeProvider;
import org.eclipse.xtext.scoping.IScopeProvider;
import org.eclipse.xtext.scoping.IgnoreCaseLinking;
import org.eclipse.xtext.scoping.impl.AbstractDeclarativeScopeProvider;
import org.eclipse.xtext.scoping.impl.ImportedNamespaceAwareLocalScopeProvider;
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.SingletonBinding;

/**
* Manual modifications go to {@link TqclRuntimeModule}.
*/
@SuppressWarnings("all")
public abstract class AbstractTqclRuntimeModule extends DefaultCommonTypesRuntimeModule {

protected Properties properties = null;

@Override
public void configure(Binder binder) {
properties = tryBindProperties(binder, "org/eclipse/triquetrum/commands/Tqcl.properties");
super.configure(binder);
}

public void configureLanguageName(Binder binder) {
binder.bind(String.class).annotatedWith(Names.named(Constants.LANGUAGE_NAME)).toInstance("org.eclipse.triquetrum.commands.Tqcl");
}

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("tdcl");
}

// 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 TqclGrammarAccess.class;
}

// contributed by org.eclipse.xtext.xtext.generator.serializer.SerializerFragment2
public Class<? extends ISemanticSequencer> bindISemanticSequencer() {
return TqclSemanticSequencer.class;
}

// contributed by org.eclipse.xtext.xtext.generator.serializer.SerializerFragment2
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
return TqclSyntacticSequencer.class;
}

// contributed by org.eclipse.xtext.xtext.generator.serializer.SerializerFragment2
public Class<? extends ISerializer> bindISerializer() {
return Serializer.class;
}

// contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2
public Class<? extends IParser> bindIParser() {
return TqclParser.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 TqclAntlrTokenFileProvider.class;
}

// contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2
public Class<? extends Lexer> bindLexer() {
return InternalTqclLexer.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<InternalTqclLexer> provideInternalTqclLexer() {
return LexerProvider.create(InternalTqclLexer.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(InternalTqclLexer.class);
}

// contributed by org.eclipse.xtext.xtext.generator.validation.ValidatorFragment2
@SingletonBinding(eager=true)
public Class<? extends TqclValidator> bindTqclValidator() {
return TqclValidator.class;
}

// contributed by org.eclipse.xtext.xtext.generator.scoping.ImportNamespacesScopingFragment2
public Class<? extends IScopeProvider> bindIScopeProvider() {
return TqclScopeProvider.class;
}

// contributed by org.eclipse.xtext.xtext.generator.scoping.ImportNamespacesScopingFragment2
public void configureIScopeProviderDelegate(Binder binder) {
binder.bind(IScopeProvider.class).annotatedWith(Names.named(AbstractDeclarativeScopeProvider.NAMED_DELEGATE)).to(ImportedNamespaceAwareLocalScopeProvider.class);
}

// contributed by org.eclipse.xtext.xtext.generator.scoping.ImportNamespacesScopingFragment2
public void configureIgnoreCaseLinking(Binder binder) {
binder.bindConstant().annotatedWith(IgnoreCaseLinking.class).to(false);
}

// contributed by org.eclipse.xtext.xtext.generator.exporting.QualifiedNamesFragment2
public Class<? extends IQualifiedNameProvider> bindIQualifiedNameProvider() {
return DefaultDeclarativeQualifiedNameProvider.class;
}

// contributed by org.eclipse.xtext.xtext.generator.builder.BuilderIntegrationFragment2
public Class<? extends IContainer.Manager> bindIContainer$Manager() {
return StateBasedContainerManager.class;
}

// contributed by org.eclipse.xtext.xtext.generator.builder.BuilderIntegrationFragment2
public Class<? extends IAllContainersState.Provider> bindIAllContainersState$Provider() {
return ResourceSetBasedAllContainersStateProvider.class;
}

// contributed by org.eclipse.xtext.xtext.generator.builder.BuilderIntegrationFragment2
public void configureIResourceDescriptions(Binder binder) {
binder.bind(IResourceDescriptions.class).to(ResourceSetBasedResourceDescriptions.class);
}

// contributed by org.eclipse.xtext.xtext.generator.builder.BuilderIntegrationFragment2
public void configureIResourceDescriptionsPersisted(Binder binder) {
binder.bind(IResourceDescriptions.class).annotatedWith(Names.named(ResourceDescriptionsProvider.PERSISTED_DESCRIPTIONS)).to(ResourceSetBasedResourceDescriptions.class);
}

// contributed by org.eclipse.xtext.xtext.generator.generator.GeneratorFragment2
public Class<? extends IGenerator2> bindIGenerator2() {
return TqclGenerator.class;
}

// contributed by org.eclipse.xtext.xtext.generator.types.TypesGeneratorFragment2
public Class<? extends IGlobalScopeProvider> bindIGlobalScopeProvider() {
return TypesAwareDefaultGlobalScopeProvider.class;
}

}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* generated by Xtext 2.10.0
*/
package org.eclipse.triquetrum.commands;

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.triquetrum.commands.tqcl.TqclPackage;
import org.eclipse.xtext.ISetup;
import org.eclipse.xtext.resource.IResourceFactory;
import org.eclipse.xtext.resource.IResourceServiceProvider;
import org.eclipse.xtext.xbase.XtypeStandaloneSetup;

@SuppressWarnings("all")
public class TqclStandaloneSetupGenerated implements ISetup {

@Override
public Injector createInjectorAndDoEMFRegistration() {
XtypeStandaloneSetup.doSetup();

Injector injector = createInjector();
register(injector);
return injector;
}

public Injector createInjector() {
return Guice.createInjector(new TqclRuntimeModule());
}

public void register(Injector injector) {
if (!EPackage.Registry.INSTANCE.containsKey("http://www.eclipse.org/triquetrum/commands/Tqcl")) {
EPackage.Registry.INSTANCE.put("http://www.eclipse.org/triquetrum/commands/Tqcl", TqclPackage.eINSTANCE);
}
IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class);
IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class);

Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("tdcl", resourceFactory);
IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("tdcl", serviceProvider);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* generated by Xtext 2.10.0
*/
package org.eclipse.triquetrum.commands.parser.antlr;

import java.io.InputStream;
import org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider;

public class TqclAntlrTokenFileProvider implements IAntlrTokenFileProvider {

@Override
public InputStream getAntlrTokenFile() {
ClassLoader classLoader = getClass().getClassLoader();
return classLoader.getResourceAsStream("org/eclipse/triquetrum/commands/parser/antlr/internal/InternalTqcl.tokens");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* generated by Xtext 2.10.0
*/
package org.eclipse.triquetrum.commands.parser.antlr;

import com.google.inject.Inject;
import org.eclipse.triquetrum.commands.parser.antlr.internal.InternalTqclParser;
import org.eclipse.triquetrum.commands.services.TqclGrammarAccess;
import org.eclipse.xtext.parser.antlr.AbstractAntlrParser;
import org.eclipse.xtext.parser.antlr.XtextTokenStream;

public class TqclParser extends AbstractAntlrParser {

@Inject
private TqclGrammarAccess grammarAccess;

@Override
protected void setInitialHiddenTokens(XtextTokenStream tokenStream) {
tokenStream.setInitialHiddenTokens("RULE_WS", "RULE_ML_COMMENT", "RULE_SL_COMMENT");
}


@Override
protected InternalTqclParser createParser(XtextTokenStream stream) {
return new InternalTqclParser(stream, getGrammarAccess());
}

@Override
protected String getDefaultRuleName() {
return "TriquetrumScript";
}

public TqclGrammarAccess getGrammarAccess() {
return this.grammarAccess;
}

public void setGrammarAccess(TqclGrammarAccess grammarAccess) {
this.grammarAccess = grammarAccess;
}
}
Loading

0 comments on commit d899c1c

Please sign in to comment.