| /* |
| * generated by Xtext |
| */ |
| package org.eclipse.handly.examples.basic; |
| |
| import java.util.Properties; |
| |
| import org.eclipse.xtext.Constants; |
| |
| import com.google.inject.Binder; |
| import com.google.inject.name.Names; |
| |
| /** |
| * Manual modifications go to {org.eclipse.handly.examples.basic.FooRuntimeModule} |
| */ |
| @SuppressWarnings("all") |
| public abstract class AbstractFooRuntimeModule extends org.eclipse.xtext.service.DefaultRuntimeModule { |
| |
| protected Properties properties = null; |
| |
| @Override |
| public void configure(Binder binder) { |
| properties = tryBindProperties(binder, "org/eclipse/handly/examples/basic/Foo.properties"); |
| super.configure(binder); |
| } |
| |
| public void configureLanguageName(Binder binder) { |
| binder.bind(String.class).annotatedWith(Names.named(Constants.LANGUAGE_NAME)).toInstance("org.eclipse.handly.examples.basic.Foo"); |
| } |
| |
| 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("foo"); |
| } |
| |
| // contributed by org.eclipse.xtext.generator.grammarAccess.GrammarAccessFragment |
| public java.lang.ClassLoader bindClassLoaderToInstance() { |
| return getClass().getClassLoader(); |
| } |
| |
| // contributed by org.eclipse.xtext.generator.grammarAccess.GrammarAccessFragment |
| public Class<? extends org.eclipse.xtext.IGrammarAccess> bindIGrammarAccess() { |
| return org.eclipse.handly.examples.basic.services.FooGrammarAccess.class; |
| } |
| |
| // contributed by org.eclipse.xtext.generator.serializer.SerializerFragment |
| public Class<? extends org.eclipse.xtext.serializer.sequencer.ISemanticSequencer> bindISemanticSequencer() { |
| return org.eclipse.handly.examples.basic.serializer.FooSemanticSequencer.class; |
| } |
| |
| // contributed by org.eclipse.xtext.generator.serializer.SerializerFragment |
| public Class<? extends org.eclipse.xtext.serializer.sequencer.ISyntacticSequencer> bindISyntacticSequencer() { |
| return org.eclipse.handly.examples.basic.serializer.FooSyntacticSequencer.class; |
| } |
| |
| // contributed by org.eclipse.xtext.generator.serializer.SerializerFragment |
| public Class<? extends org.eclipse.xtext.serializer.ISerializer> bindISerializer() { |
| return org.eclipse.xtext.serializer.impl.Serializer.class; |
| } |
| |
| // contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment |
| public Class<? extends org.eclipse.xtext.parser.IParser> bindIParser() { |
| return org.eclipse.handly.examples.basic.parser.antlr.FooParser.class; |
| } |
| |
| // contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment |
| public Class<? extends org.eclipse.xtext.parser.ITokenToStringConverter> bindITokenToStringConverter() { |
| return org.eclipse.xtext.parser.antlr.AntlrTokenToStringConverter.class; |
| } |
| |
| // contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment |
| public Class<? extends org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider> bindIAntlrTokenFileProvider() { |
| return org.eclipse.handly.examples.basic.parser.antlr.FooAntlrTokenFileProvider.class; |
| } |
| |
| // contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment |
| public Class<? extends org.eclipse.xtext.parser.antlr.Lexer> bindLexer() { |
| return org.eclipse.handly.examples.basic.parser.antlr.internal.InternalFooLexer.class; |
| } |
| |
| // contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment |
| public com.google.inject.Provider<org.eclipse.handly.examples.basic.parser.antlr.internal.InternalFooLexer> provideInternalFooLexer() { |
| return org.eclipse.xtext.parser.antlr.LexerProvider.create(org.eclipse.handly.examples.basic.parser.antlr.internal.InternalFooLexer.class); |
| } |
| |
| // contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment |
| public void configureRuntimeLexer(com.google.inject.Binder binder) { |
| binder.bind(org.eclipse.xtext.parser.antlr.Lexer.class).annotatedWith(com.google.inject.name.Names.named(org.eclipse.xtext.parser.antlr.LexerBindings.RUNTIME)).to(org.eclipse.handly.examples.basic.parser.antlr.internal.InternalFooLexer.class); |
| } |
| |
| // contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment |
| public Class<? extends org.eclipse.xtext.parser.antlr.ITokenDefProvider> bindITokenDefProvider() { |
| return org.eclipse.xtext.parser.antlr.AntlrTokenDefProvider.class; |
| } |
| |
| } |