You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
216 lines
9.8 KiB
216 lines
9.8 KiB
/* |
|
* generated by Xtext 2.12.0 |
|
*/ |
|
package com.irtsaintexupery.xtext; |
|
|
|
import com.google.inject.Binder; |
|
import com.google.inject.Provider; |
|
import com.google.inject.name.Names; |
|
import com.irtsaintexupery.xtext.formatting2.PseimFormatter; |
|
import com.irtsaintexupery.xtext.generator.PseimGenerator; |
|
import com.irtsaintexupery.xtext.parser.antlr.PseimAntlrTokenFileProvider; |
|
import com.irtsaintexupery.xtext.parser.antlr.PseimParser; |
|
import com.irtsaintexupery.xtext.parser.antlr.internal.InternalPseimLexer; |
|
import com.irtsaintexupery.xtext.scoping.PseimScopeProvider; |
|
import com.irtsaintexupery.xtext.serializer.PseimSemanticSequencer; |
|
import com.irtsaintexupery.xtext.serializer.PseimSyntacticSequencer; |
|
import com.irtsaintexupery.xtext.services.PseimGrammarAccess; |
|
import com.irtsaintexupery.xtext.validation.PseimValidator; |
|
import java.util.Properties; |
|
import org.eclipse.xtext.Constants; |
|
import org.eclipse.xtext.IGrammarAccess; |
|
import org.eclipse.xtext.common.services.Ecore2XtextTerminalConverters; |
|
import org.eclipse.xtext.conversion.IValueConverterService; |
|
import org.eclipse.xtext.formatting2.FormatterPreferenceValuesProvider; |
|
import org.eclipse.xtext.formatting2.FormatterPreferences; |
|
import org.eclipse.xtext.formatting2.IFormatter2; |
|
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.preferences.IPreferenceValuesProvider; |
|
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.DefaultGlobalScopeProvider; |
|
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.DefaultRuntimeModule; |
|
import org.eclipse.xtext.service.SingletonBinding; |
|
|
|
/** |
|
* Manual modifications go to {@link PseimRuntimeModule}. |
|
*/ |
|
@SuppressWarnings("all") |
|
public abstract class AbstractPseimRuntimeModule extends DefaultRuntimeModule { |
|
|
|
protected Properties properties = null; |
|
|
|
@Override |
|
public void configure(Binder binder) { |
|
properties = tryBindProperties(binder, "com/irtsaintexupery/xtext/Pseim.properties"); |
|
super.configure(binder); |
|
} |
|
|
|
public void configureLanguageName(Binder binder) { |
|
binder.bind(String.class).annotatedWith(Names.named(Constants.LANGUAGE_NAME)).toInstance("com.irtsaintexupery.xtext.Pseim"); |
|
} |
|
|
|
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("seimx"); |
|
} |
|
|
|
// 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 PseimGrammarAccess.class; |
|
} |
|
|
|
// contributed by org.eclipse.xtext.xtext.generator.serializer.SerializerFragment2 |
|
public Class<? extends ISemanticSequencer> bindISemanticSequencer() { |
|
return PseimSemanticSequencer.class; |
|
} |
|
|
|
// contributed by org.eclipse.xtext.xtext.generator.serializer.SerializerFragment2 |
|
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() { |
|
return PseimSyntacticSequencer.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 PseimParser.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 PseimAntlrTokenFileProvider.class; |
|
} |
|
|
|
// contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2 |
|
public Class<? extends Lexer> bindLexer() { |
|
return InternalPseimLexer.class; |
|
} |
|
|
|
// contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2 |
|
public Class<? extends ITokenDefProvider> bindITokenDefProvider() { |
|
return AntlrTokenDefProvider.class; |
|
} |
|
|
|
// contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2 |
|
public Provider<? extends InternalPseimLexer> provideInternalPseimLexer() { |
|
return LexerProvider.create(InternalPseimLexer.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(InternalPseimLexer.class); |
|
} |
|
|
|
// contributed by org.eclipse.xtext.xtext.generator.validation.ValidatorFragment2 |
|
@SingletonBinding(eager=true) |
|
public Class<? extends PseimValidator> bindPseimValidator() { |
|
return PseimValidator.class; |
|
} |
|
|
|
// contributed by org.eclipse.xtext.xtext.generator.scoping.ImportNamespacesScopingFragment2 |
|
public Class<? extends IScopeProvider> bindIScopeProvider() { |
|
return PseimScopeProvider.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 Class<? extends IGlobalScopeProvider> bindIGlobalScopeProvider() { |
|
return DefaultGlobalScopeProvider.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 PseimGenerator.class; |
|
} |
|
|
|
// contributed by org.eclipse.xtext.xtext.generator.formatting.Formatter2Fragment2 |
|
public Class<? extends IFormatter2> bindIFormatter2() { |
|
return PseimFormatter.class; |
|
} |
|
|
|
// contributed by org.eclipse.xtext.xtext.generator.formatting.Formatter2Fragment2 |
|
public void configureFormatterPreferences(Binder binder) { |
|
binder.bind(IPreferenceValuesProvider.class).annotatedWith(FormatterPreferences.class).to(FormatterPreferenceValuesProvider.class); |
|
} |
|
|
|
// contributed by org.eclipse.xtext.xtext.generator.ecore2xtext.Ecore2XtextValueConverterServiceFragment2 |
|
public Class<? extends IValueConverterService> bindIValueConverterService() { |
|
return Ecore2XtextTerminalConverters.class; |
|
} |
|
|
|
}
|
|
|