/*****************************************************************************
* Copyright (c) 2011 CEA LIST.
*
*
* 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:
* CEA LIST - Initial API and implementation
*
*****************************************************************************/
package org.eclipse.papyrus.uml.alf;
import java.util.Properties;
import org.eclipse.xtext.Constants;
import org.eclipse.xtext.service.DefaultRuntimeModule;
import com.google.inject.Binder;
import com.google.inject.name.Names;
/**
* Manual modifications go to {org.eclipse.papyrus.uml.alf.AlfRuntimeModule}
*/
@SuppressWarnings("all")
public abstract class AbstractAlfRuntimeModule extends DefaultRuntimeModule {
protected Properties properties = null;
@Override
public void configure(Binder binder) {
properties = tryBindProperties(binder, "org/eclipse/papyrus/uml/alf/Alf.properties");
super.configure(binder);
}
public void configureLanguageName(Binder binder) {
binder.bind(String.class).annotatedWith(Names.named(Constants.LANGUAGE_NAME)).toInstance("org.eclipse.papyrus.uml.alf.Alf");
}
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("alf");
}
// contributed by org.eclipse.xtext.generator.grammarAccess.GrammarAccessFragment
public Class<? extends org.eclipse.xtext.IGrammarAccess> bindIGrammarAccess() {
return org.eclipse.papyrus.uml.alf.services.AlfGrammarAccess.class;
}
// contributed by org.eclipse.xtext.generator.serializer.SerializerFragment
public Class<? extends org.eclipse.xtext.serializer.sequencer.ISemanticSequencer> bindISemanticSequencer() {
return org.eclipse.papyrus.uml.alf.serializer.AbstractAlfSemanticSequencer.class;
}
// contributed by org.eclipse.xtext.generator.serializer.SerializerFragment
public Class<? extends org.eclipse.xtext.serializer.sequencer.ISyntacticSequencer> bindISyntacticSequencer() {
return org.eclipse.papyrus.uml.alf.serializer.AbstractAlfSyntacticSequencer.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.papyrus.uml.alf.parser.antlr.AlfParser.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.papyrus.uml.alf.parser.antlr.AlfAntlrTokenFileProvider.class;
}
// contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment
public Class<? extends org.eclipse.xtext.parser.antlr.Lexer> bindLexer() {
return org.eclipse.papyrus.uml.alf.parser.antlr.internal.InternalAlfLexer.class;
}
// contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment
public com.google.inject.Provider<org.eclipse.papyrus.uml.alf.parser.antlr.internal.InternalAlfLexer> provideInternalAlfLexer() {
return org.eclipse.xtext.parser.antlr.LexerProvider.create(org.eclipse.papyrus.uml.alf.parser.antlr.internal.InternalAlfLexer.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.papyrus.uml.alf.parser.antlr.internal.InternalAlfLexer.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;
}
// contributed by org.eclipse.xtext.generator.validation.JavaValidatorFragment
@org.eclipse.xtext.service.SingletonBinding(eager=true) public Class<? extends org.eclipse.papyrus.uml.alf.validation.AlfJavaValidator> bindAlfJavaValidator() {
return org.eclipse.papyrus.uml.alf.validation.AlfJavaValidator.class;
}
// contributed by org.eclipse.xtext.generator.scoping.AbstractScopingFragment
public Class<? extends org.eclipse.xtext.scoping.IScopeProvider> bindIScopeProvider() {
return org.eclipse.papyrus.uml.alf.scoping.AlfScopeProvider.class;
}
// contributed by org.eclipse.xtext.generator.scoping.AbstractScopingFragment
public void configureIScopeProviderDelegate(com.google.inject.Binder binder) {
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);
}
// contributed by org.eclipse.xtext.generator.scoping.AbstractScopingFragment
public Class<? extends org.eclipse.xtext.scoping.IGlobalScopeProvider> bindIGlobalScopeProvider() {
return org.eclipse.xtext.scoping.impl.ImportUriGlobalScopeProvider.class;
}
// contributed by org.eclipse.xtext.generator.scoping.AbstractScopingFragment
public void configureIgnoreCaseLinking(com.google.inject.Binder binder) {
binder.bindConstant().annotatedWith(org.eclipse.xtext.scoping.IgnoreCaseLinking.class).to(false);
}
// contributed by org.eclipse.xtext.generator.exporting.SimpleNamesFragment
public Class<? extends org.eclipse.xtext.naming.IQualifiedNameProvider> bindIQualifiedNameProvider() {
return org.eclipse.xtext.naming.SimpleNameProvider.class;
}
// contributed by org.eclipse.xtext.generator.generator.GeneratorFragment
public Class<? extends org.eclipse.xtext.generator.IGenerator> bindIGenerator() {
return org.eclipse.papyrus.uml.alf.generator.AlfGenerator.class;
}
// contributed by org.eclipse.xtext.generator.formatting.FormatterFragment
public Class<? extends org.eclipse.xtext.formatting.IFormatter> bindIFormatter() {
return org.eclipse.papyrus.uml.alf.formatting.AlfFormatter.class;
}
}