| /** |
| * Copyright (c) 2011, 2015 - Lunifera GmbH (Gross Enzersdorf, Austria), Loetz GmbH&Co.KG (69115 Heidelberg, Germany) |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * Florian Pirchner - Initial implementation |
| * |
| * generated by Xtext 2.11.0 |
| */ |
| package org.eclipse.osbp.xtext.oxtype; |
| |
| import com.google.inject.Binder; |
| import com.google.inject.Provider; |
| import com.google.inject.name.Names; |
| import java.util.Properties; |
| import org.eclipse.osbp.xtext.oxtype.jvmmodel.OXtypeJvmModelInferrer; |
| import org.eclipse.osbp.xtext.oxtype.parser.antlr.OXtypeAntlrTokenFileProvider; |
| import org.eclipse.osbp.xtext.oxtype.parser.antlr.OXtypeParser; |
| import org.eclipse.osbp.xtext.oxtype.parser.antlr.internal.InternalOXtypeLexer; |
| import org.eclipse.osbp.xtext.oxtype.scoping.OXtypeScopeProvider; |
| import org.eclipse.osbp.xtext.oxtype.serializer.OXtypeSemanticSequencer; |
| import org.eclipse.osbp.xtext.oxtype.serializer.OXtypeSyntacticSequencer; |
| import org.eclipse.osbp.xtext.oxtype.services.OXtypeGrammarAccess; |
| import org.eclipse.osbp.xtext.oxtype.validation.OXtypeValidator; |
| import org.eclipse.xtext.Constants; |
| import org.eclipse.xtext.IGrammarAccess; |
| import org.eclipse.xtext.common.types.xtext.TypesAwareDefaultGlobalScopeProvider; |
| 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.ILocationInFileProvider; |
| 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.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; |
| import org.eclipse.xtext.validation.IResourceValidator; |
| import org.eclipse.xtext.xbase.annotations.DefaultXbaseWithAnnotationsRuntimeModule; |
| import org.eclipse.xtext.xbase.annotations.validation.DerivedStateAwareResourceValidator; |
| import org.eclipse.xtext.xbase.jvmmodel.IJvmModelInferrer; |
| import org.eclipse.xtext.xbase.jvmmodel.JvmLocationInFileProvider; |
| import org.eclipse.xtext.xbase.scoping.XImportSectionNamespaceScopeProvider; |
| import org.eclipse.xtext.xbase.scoping.XbaseQualifiedNameProvider; |
| import org.eclipse.xtext.xbase.scoping.batch.IBatchScopeProvider; |
| import org.eclipse.xtext.xbase.typesystem.internal.DefaultBatchTypeResolver; |
| import org.eclipse.xtext.xbase.typesystem.internal.DefaultReentrantTypeResolver; |
| import org.eclipse.xtext.xbase.typesystem.internal.LogicalContainerAwareBatchTypeResolver; |
| import org.eclipse.xtext.xbase.typesystem.internal.LogicalContainerAwareReentrantTypeResolver; |
| import org.eclipse.xtext.xbase.validation.FeatureNameValidator; |
| import org.eclipse.xtext.xbase.validation.LogicalContainerAwareFeatureNameValidator; |
| |
| /** |
| * Manual modifications go to {@link OXtypeRuntimeModule}. |
| */ |
| @SuppressWarnings("all") |
| public abstract class AbstractOXtypeRuntimeModule extends DefaultXbaseWithAnnotationsRuntimeModule { |
| |
| protected Properties properties = null; |
| |
| @Override |
| public void configure(Binder binder) { |
| properties = tryBindProperties(binder, "org/eclipse/osbp/xtext/oxtype/OXtype.properties"); |
| super.configure(binder); |
| } |
| |
| public void configureLanguageName(Binder binder) { |
| binder.bind(String.class).annotatedWith(Names.named(Constants.LANGUAGE_NAME)).toInstance("org.eclipse.osbp.xtext.oxtype.OXtype"); |
| } |
| |
| 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("oxtype"); |
| } |
| |
| // 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 OXtypeGrammarAccess.class; |
| } |
| |
| // contributed by org.eclipse.xtext.xtext.generator.serializer.SerializerFragment2 |
| public Class<? extends ISemanticSequencer> bindISemanticSequencer() { |
| return OXtypeSemanticSequencer.class; |
| } |
| |
| // contributed by org.eclipse.xtext.xtext.generator.serializer.SerializerFragment2 |
| public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() { |
| return OXtypeSyntacticSequencer.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 OXtypeParser.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 OXtypeAntlrTokenFileProvider.class; |
| } |
| |
| // contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2 |
| public Class<? extends Lexer> bindLexer() { |
| return InternalOXtypeLexer.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 InternalOXtypeLexer> provideInternalOXtypeLexer() { |
| return LexerProvider.create(InternalOXtypeLexer.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(InternalOXtypeLexer.class); |
| } |
| |
| // contributed by org.eclipse.xtext.xtext.generator.validation.ValidatorFragment2 |
| @SingletonBinding(eager=true) |
| public Class<? extends OXtypeValidator> bindOXtypeValidator() { |
| return OXtypeValidator.class; |
| } |
| |
| // contributed by org.eclipse.xtext.xtext.generator.scoping.ImportNamespacesScopingFragment2 |
| public Class<? extends IBatchScopeProvider> bindIBatchScopeProvider() { |
| return OXtypeScopeProvider.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(XImportSectionNamespaceScopeProvider.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.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.xbase.XbaseGeneratorFragment2 |
| public Class<? extends IQualifiedNameProvider> bindIQualifiedNameProvider() { |
| return XbaseQualifiedNameProvider.class; |
| } |
| |
| // contributed by org.eclipse.xtext.xtext.generator.xbase.XbaseGeneratorFragment2 |
| public Class<? extends ILocationInFileProvider> bindILocationInFileProvider() { |
| return JvmLocationInFileProvider.class; |
| } |
| |
| // contributed by org.eclipse.xtext.xtext.generator.xbase.XbaseGeneratorFragment2 |
| public Class<? extends IGlobalScopeProvider> bindIGlobalScopeProvider() { |
| return TypesAwareDefaultGlobalScopeProvider.class; |
| } |
| |
| // contributed by org.eclipse.xtext.xtext.generator.xbase.XbaseGeneratorFragment2 |
| public Class<? extends FeatureNameValidator> bindFeatureNameValidator() { |
| return LogicalContainerAwareFeatureNameValidator.class; |
| } |
| |
| // contributed by org.eclipse.xtext.xtext.generator.xbase.XbaseGeneratorFragment2 |
| public Class<? extends DefaultBatchTypeResolver> bindDefaultBatchTypeResolver() { |
| return LogicalContainerAwareBatchTypeResolver.class; |
| } |
| |
| // contributed by org.eclipse.xtext.xtext.generator.xbase.XbaseGeneratorFragment2 |
| public Class<? extends DefaultReentrantTypeResolver> bindDefaultReentrantTypeResolver() { |
| return LogicalContainerAwareReentrantTypeResolver.class; |
| } |
| |
| // contributed by org.eclipse.xtext.xtext.generator.xbase.XbaseGeneratorFragment2 |
| public Class<? extends IResourceValidator> bindIResourceValidator() { |
| return DerivedStateAwareResourceValidator.class; |
| } |
| |
| // contributed by org.eclipse.xtext.xtext.generator.xbase.XbaseGeneratorFragment2 |
| public Class<? extends IJvmModelInferrer> bindIJvmModelInferrer() { |
| return OXtypeJvmModelInferrer.class; |
| } |
| |
| } |