2021-11-30 17:25:45 +00:00
|
|
|
/*
|
|
|
|
* generated by Xtext 2.23.0
|
|
|
|
*/
|
2021-12-03 10:28:42 +00:00
|
|
|
package fr.n7.xtext;
|
2021-11-30 17:25:45 +00:00
|
|
|
|
|
|
|
import com.google.inject.Binder;
|
|
|
|
import com.google.inject.Provider;
|
|
|
|
import com.google.inject.name.Names;
|
2021-12-03 10:28:42 +00:00
|
|
|
import fr.n7.xtext.generator.GAMEGenerator;
|
|
|
|
import fr.n7.xtext.parser.antlr.GAMEAntlrTokenFileProvider;
|
|
|
|
import fr.n7.xtext.parser.antlr.GAMEParser;
|
|
|
|
import fr.n7.xtext.parser.antlr.internal.InternalGAMELexer;
|
|
|
|
import fr.n7.xtext.scoping.GAMEScopeProvider;
|
|
|
|
import fr.n7.xtext.serializer.GAMESemanticSequencer;
|
|
|
|
import fr.n7.xtext.serializer.GAMESyntacticSequencer;
|
|
|
|
import fr.n7.xtext.services.GAMEGrammarAccess;
|
|
|
|
import fr.n7.xtext.validation.GAMEConfigurableIssueCodesProvider;
|
|
|
|
import fr.n7.xtext.validation.GAMEValidator;
|
2021-11-30 17:25:45 +00:00
|
|
|
import java.util.Properties;
|
|
|
|
import org.eclipse.xtext.Constants;
|
|
|
|
import org.eclipse.xtext.IGrammarAccess;
|
|
|
|
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.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;
|
|
|
|
import org.eclipse.xtext.validation.ConfigurableIssueCodesProvider;
|
|
|
|
|
|
|
|
/**
|
2021-12-03 07:37:31 +00:00
|
|
|
* Manual modifications go to {@link GAMERuntimeModule}.
|
2021-11-30 17:25:45 +00:00
|
|
|
*/
|
|
|
|
@SuppressWarnings("all")
|
2021-12-03 07:37:31 +00:00
|
|
|
public abstract class AbstractGAMERuntimeModule extends DefaultRuntimeModule {
|
2021-11-30 17:25:45 +00:00
|
|
|
|
|
|
|
protected Properties properties = null;
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void configure(Binder binder) {
|
2021-12-03 10:28:42 +00:00
|
|
|
properties = tryBindProperties(binder, "fr/n7/xtext/GAME.properties");
|
2021-11-30 17:25:45 +00:00
|
|
|
super.configure(binder);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void configureLanguageName(Binder binder) {
|
2021-12-03 10:28:42 +00:00
|
|
|
binder.bind(String.class).annotatedWith(Names.named(Constants.LANGUAGE_NAME)).toInstance("fr.n7.xtext.GAME");
|
2021-11-30 17:25:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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("game");
|
|
|
|
}
|
|
|
|
|
|
|
|
// 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() {
|
2021-12-03 07:37:31 +00:00
|
|
|
return GAMEGrammarAccess.class;
|
2021-11-30 17:25:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// contributed by org.eclipse.xtext.xtext.generator.serializer.SerializerFragment2
|
|
|
|
public Class<? extends ISemanticSequencer> bindISemanticSequencer() {
|
2021-12-03 07:37:31 +00:00
|
|
|
return GAMESemanticSequencer.class;
|
2021-11-30 17:25:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// contributed by org.eclipse.xtext.xtext.generator.serializer.SerializerFragment2
|
|
|
|
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
|
2021-12-03 07:37:31 +00:00
|
|
|
return GAMESyntacticSequencer.class;
|
2021-11-30 17:25:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// 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() {
|
2021-12-03 07:37:31 +00:00
|
|
|
return GAMEParser.class;
|
2021-11-30 17:25:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// 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() {
|
2021-12-03 07:37:31 +00:00
|
|
|
return GAMEAntlrTokenFileProvider.class;
|
2021-11-30 17:25:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2
|
|
|
|
public Class<? extends Lexer> bindLexer() {
|
2021-12-03 07:37:31 +00:00
|
|
|
return InternalGAMELexer.class;
|
2021-11-30 17:25:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// 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
|
2021-12-03 07:37:31 +00:00
|
|
|
public Provider<? extends InternalGAMELexer> provideInternalGAMELexer() {
|
|
|
|
return LexerProvider.create(InternalGAMELexer.class);
|
2021-11-30 17:25:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2
|
|
|
|
public void configureRuntimeLexer(Binder binder) {
|
|
|
|
binder.bind(Lexer.class)
|
|
|
|
.annotatedWith(Names.named(LexerBindings.RUNTIME))
|
2021-12-03 07:37:31 +00:00
|
|
|
.to(InternalGAMELexer.class);
|
2021-11-30 17:25:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// contributed by org.eclipse.xtext.xtext.generator.validation.ValidatorFragment2
|
|
|
|
@SingletonBinding(eager=true)
|
2021-12-03 07:37:31 +00:00
|
|
|
public Class<? extends GAMEValidator> bindGAMEValidator() {
|
|
|
|
return GAMEValidator.class;
|
2021-11-30 17:25:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// contributed by org.eclipse.xtext.xtext.generator.validation.ValidatorFragment2
|
|
|
|
public Class<? extends ConfigurableIssueCodesProvider> bindConfigurableIssueCodesProvider() {
|
2021-12-03 07:37:31 +00:00
|
|
|
return GAMEConfigurableIssueCodesProvider.class;
|
2021-11-30 17:25:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// contributed by org.eclipse.xtext.xtext.generator.scoping.ImportNamespacesScopingFragment2
|
|
|
|
public Class<? extends IScopeProvider> bindIScopeProvider() {
|
2021-12-03 07:37:31 +00:00
|
|
|
return GAMEScopeProvider.class;
|
2021-11-30 17:25:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// 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() {
|
2021-12-03 07:37:31 +00:00
|
|
|
return GAMEGenerator.class;
|
2021-11-30 17:25:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|