| 1 | /* |
|---|
| 2 | * generated by Xtext |
|---|
| 3 | */ |
|---|
| 4 | package de.ugoe.cs.swe.bnftools; |
|---|
| 5 | |
|---|
| 6 | import java.util.Properties; |
|---|
| 7 | |
|---|
| 8 | import org.eclipse.xtext.Constants; |
|---|
| 9 | import org.eclipse.xtext.service.DefaultRuntimeModule; |
|---|
| 10 | |
|---|
| 11 | import com.google.inject.Binder; |
|---|
| 12 | import com.google.inject.name.Names; |
|---|
| 13 | |
|---|
| 14 | /** |
|---|
| 15 | * Manual modifications go to {de.ugoe.cs.swe.bnftools.EbnfRuntimeModule} |
|---|
| 16 | */ |
|---|
| 17 | @SuppressWarnings("all") |
|---|
| 18 | public abstract class AbstractEbnfRuntimeModule extends DefaultRuntimeModule { |
|---|
| 19 | |
|---|
| 20 | protected Properties properties = null; |
|---|
| 21 | |
|---|
| 22 | @Override |
|---|
| 23 | public void configure(Binder binder) { |
|---|
| 24 | properties = tryBindProperties(binder, "de/ugoe/cs/swe/bnftools/Ebnf.properties"); |
|---|
| 25 | super.configure(binder); |
|---|
| 26 | } |
|---|
| 27 | |
|---|
| 28 | public void configureLanguageName(Binder binder) { |
|---|
| 29 | binder.bind(String.class).annotatedWith(Names.named(Constants.LANGUAGE_NAME)).toInstance("de.ugoe.cs.swe.bnftools.Ebnf"); |
|---|
| 30 | } |
|---|
| 31 | |
|---|
| 32 | public void configureFileExtensions(Binder binder) { |
|---|
| 33 | if (properties == null || properties.getProperty(Constants.FILE_EXTENSIONS) == null) |
|---|
| 34 | binder.bind(String.class).annotatedWith(Names.named(Constants.FILE_EXTENSIONS)).toInstance("bnf"); |
|---|
| 35 | } |
|---|
| 36 | |
|---|
| 37 | // contributed by org.eclipse.xtext.generator.grammarAccess.GrammarAccessFragment |
|---|
| 38 | public java.lang.ClassLoader bindClassLoaderToInstance() { |
|---|
| 39 | return getClass().getClassLoader(); |
|---|
| 40 | } |
|---|
| 41 | |
|---|
| 42 | // contributed by org.eclipse.xtext.generator.grammarAccess.GrammarAccessFragment |
|---|
| 43 | public Class<? extends org.eclipse.xtext.IGrammarAccess> bindIGrammarAccess() { |
|---|
| 44 | return de.ugoe.cs.swe.bnftools.services.EbnfGrammarAccess.class; |
|---|
| 45 | } |
|---|
| 46 | |
|---|
| 47 | // contributed by org.eclipse.xtext.generator.serializer.SerializerFragment |
|---|
| 48 | public Class<? extends org.eclipse.xtext.serializer.sequencer.ISemanticSequencer> bindISemanticSequencer() { |
|---|
| 49 | return de.ugoe.cs.swe.bnftools.serializer.EbnfSemanticSequencer.class; |
|---|
| 50 | } |
|---|
| 51 | |
|---|
| 52 | // contributed by org.eclipse.xtext.generator.serializer.SerializerFragment |
|---|
| 53 | public Class<? extends org.eclipse.xtext.serializer.sequencer.ISyntacticSequencer> bindISyntacticSequencer() { |
|---|
| 54 | return de.ugoe.cs.swe.bnftools.serializer.EbnfSyntacticSequencer.class; |
|---|
| 55 | } |
|---|
| 56 | |
|---|
| 57 | // contributed by org.eclipse.xtext.generator.serializer.SerializerFragment |
|---|
| 58 | public Class<? extends org.eclipse.xtext.serializer.ISerializer> bindISerializer() { |
|---|
| 59 | return org.eclipse.xtext.serializer.impl.Serializer.class; |
|---|
| 60 | } |
|---|
| 61 | |
|---|
| 62 | // contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment |
|---|
| 63 | public Class<? extends org.eclipse.xtext.parser.IParser> bindIParser() { |
|---|
| 64 | return de.ugoe.cs.swe.bnftools.parser.antlr.EbnfParser.class; |
|---|
| 65 | } |
|---|
| 66 | |
|---|
| 67 | // contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment |
|---|
| 68 | public Class<? extends org.eclipse.xtext.parser.ITokenToStringConverter> bindITokenToStringConverter() { |
|---|
| 69 | return org.eclipse.xtext.parser.antlr.AntlrTokenToStringConverter.class; |
|---|
| 70 | } |
|---|
| 71 | |
|---|
| 72 | // contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment |
|---|
| 73 | public Class<? extends org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider> bindIAntlrTokenFileProvider() { |
|---|
| 74 | return de.ugoe.cs.swe.bnftools.parser.antlr.EbnfAntlrTokenFileProvider.class; |
|---|
| 75 | } |
|---|
| 76 | |
|---|
| 77 | // contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment |
|---|
| 78 | public Class<? extends org.eclipse.xtext.parser.antlr.Lexer> bindLexer() { |
|---|
| 79 | return de.ugoe.cs.swe.bnftools.parser.antlr.internal.InternalEbnfLexer.class; |
|---|
| 80 | } |
|---|
| 81 | |
|---|
| 82 | // contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment |
|---|
| 83 | public com.google.inject.Provider<de.ugoe.cs.swe.bnftools.parser.antlr.internal.InternalEbnfLexer> provideInternalEbnfLexer() { |
|---|
| 84 | return org.eclipse.xtext.parser.antlr.LexerProvider.create(de.ugoe.cs.swe.bnftools.parser.antlr.internal.InternalEbnfLexer.class); |
|---|
| 85 | } |
|---|
| 86 | |
|---|
| 87 | // contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment |
|---|
| 88 | public void configureRuntimeLexer(com.google.inject.Binder binder) { |
|---|
| 89 | binder.bind(org.eclipse.xtext.parser.antlr.Lexer.class).annotatedWith(com.google.inject.name.Names.named(org.eclipse.xtext.parser.antlr.LexerBindings.RUNTIME)).to(de.ugoe.cs.swe.bnftools.parser.antlr.internal.InternalEbnfLexer.class); |
|---|
| 90 | } |
|---|
| 91 | |
|---|
| 92 | // contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment |
|---|
| 93 | public Class<? extends org.eclipse.xtext.parser.antlr.ITokenDefProvider> bindITokenDefProvider() { |
|---|
| 94 | return org.eclipse.xtext.parser.antlr.AntlrTokenDefProvider.class; |
|---|
| 95 | } |
|---|
| 96 | |
|---|
| 97 | // contributed by org.eclipse.xtext.generator.validation.ValidatorFragment |
|---|
| 98 | @org.eclipse.xtext.service.SingletonBinding(eager=true) public Class<? extends de.ugoe.cs.swe.bnftools.validation.EbnfValidator> bindEbnfValidator() { |
|---|
| 99 | return de.ugoe.cs.swe.bnftools.validation.EbnfValidator.class; |
|---|
| 100 | } |
|---|
| 101 | |
|---|
| 102 | // contributed by org.eclipse.xtext.generator.scoping.AbstractScopingFragment |
|---|
| 103 | public Class<? extends org.eclipse.xtext.scoping.IScopeProvider> bindIScopeProvider() { |
|---|
| 104 | return de.ugoe.cs.swe.bnftools.scoping.EbnfScopeProvider.class; |
|---|
| 105 | } |
|---|
| 106 | |
|---|
| 107 | // contributed by org.eclipse.xtext.generator.scoping.AbstractScopingFragment |
|---|
| 108 | public void configureIScopeProviderDelegate(com.google.inject.Binder binder) { |
|---|
| 109 | binder.bind(org.eclipse.xtext.scoping.IScopeProvider.class).annotatedWith(com.google.inject.name.Names.named(org.eclipse.xtext.scoping.impl.AbstractDeclarativeScopeProvider.NAMED_DELEGATE)).to(org.eclipse.xtext.scoping.impl.SimpleLocalScopeProvider.class); |
|---|
| 110 | } |
|---|
| 111 | |
|---|
| 112 | // contributed by org.eclipse.xtext.generator.scoping.AbstractScopingFragment |
|---|
| 113 | public Class<? extends org.eclipse.xtext.scoping.IGlobalScopeProvider> bindIGlobalScopeProvider() { |
|---|
| 114 | return org.eclipse.xtext.scoping.impl.ImportUriGlobalScopeProvider.class; |
|---|
| 115 | } |
|---|
| 116 | |
|---|
| 117 | // contributed by org.eclipse.xtext.generator.scoping.AbstractScopingFragment |
|---|
| 118 | public void configureIgnoreCaseLinking(com.google.inject.Binder binder) { |
|---|
| 119 | binder.bindConstant().annotatedWith(org.eclipse.xtext.scoping.IgnoreCaseLinking.class).to(false); |
|---|
| 120 | } |
|---|
| 121 | |
|---|
| 122 | // contributed by org.eclipse.xtext.generator.exporting.SimpleNamesFragment |
|---|
| 123 | public Class<? extends org.eclipse.xtext.naming.IQualifiedNameProvider> bindIQualifiedNameProvider() { |
|---|
| 124 | return org.eclipse.xtext.naming.SimpleNameProvider.class; |
|---|
| 125 | } |
|---|
| 126 | |
|---|
| 127 | // contributed by org.eclipse.xtext.generator.generator.GeneratorFragment |
|---|
| 128 | public Class<? extends org.eclipse.xtext.generator.IGenerator> bindIGenerator() { |
|---|
| 129 | return de.ugoe.cs.swe.bnftools.generator.EbnfGenerator.class; |
|---|
| 130 | } |
|---|
| 131 | |
|---|
| 132 | // contributed by org.eclipse.xtext.generator.formatting.FormatterFragment |
|---|
| 133 | public Class<? extends org.eclipse.xtext.formatting.IFormatter> bindIFormatter() { |
|---|
| 134 | return de.ugoe.cs.swe.bnftools.formatting.EbnfFormatter.class; |
|---|
| 135 | } |
|---|
| 136 | |
|---|
| 137 | } |
|---|