Exemplo n.º 1
0
 @Override
 public Set<Binding> getGuiceBindingsRt(Grammar grammar) {
   BindFactory factory =
       new BindFactory()
           .addTypeToType(
               IScopeProvider.class.getName(), getScopeProviderName(grammar, getNaming()))
           .addConfiguredBinding(
               IScopeProvider.class.getName() + "Delegate",
               "binder.bind("
                   + IScopeProvider.class.getName()
                   + ".class"
                   + ").annotatedWith(com.google.inject.name.Names.named("
                   + AbstractDeclarativeScopeProvider.class.getName()
                   + ".NAMED_DELEGATE"
                   + ")).to("
                   + getLocalScopeProvider().getName()
                   + ".class)")
           .addTypeToType(
               IGlobalScopeProvider.class.getName(), getGlobalScopeProvider().getName());
   factory.addConfiguredBinding(
       IgnoreCaseLinking.class.getSimpleName(),
       "binder.bindConstant().annotatedWith("
           + IgnoreCaseLinking.class.getName()
           + ".class).to("
           + isIgnoreCase()
           + ")");
   return factory.getBindings();
 }
 @Override
 public Set<Binding> getGuiceBindingsRt(final Grammar grammar) {
   BindFactory factory =
       new BindFactory()
           .addTypeToType(IParser.class.getName(), getFragmentHelper().getParserClassName(grammar))
           .addTypeToType(
               ITokenToStringConverter.class.getName(),
               AntlrTokenToStringConverter.class.getName())
           .addTypeToType(
               IAntlrTokenFileProvider.class.getName(),
               getFragmentHelper().getAntlrTokenFileProviderClassName(grammar))
           .addTypeToType(Lexer.class.getName(), getFragmentHelper().getLexerClassName(grammar))
           .addTypeToProviderInstance(
               getFragmentHelper().getLexerClassName(grammar),
               "org.eclipse.xtext.parser.antlr.LexerProvider.create("
                   + getFragmentHelper().getLexerClassName(grammar)
                   + ".class)")
           .addConfiguredBinding(
               "RuntimeLexer",
               "binder.bind("
                   + Lexer.class.getName()
                   + ".class)"
                   + ".annotatedWith(com.google.inject.name.Names.named("
                   + "org.eclipse.xtext.parser.antlr.LexerBindings.RUNTIME"
                   + ")).to("
                   + getFragmentHelper().getLexerClassName(grammar)
                   + ".class)")
           .addTypeToType(
               ITokenDefProvider.class.getName(), AntlrTokenDefProvider.class.getName());
   if (containsUnorderedGroup(grammar)) {
     factory =
         factory.addTypeToType(
             IUnorderedGroupHelper.class.getName(), UnorderedGroupHelper.class.getName());
   }
   if (getOptions().isIgnoreCase()) {
     factory =
         factory
             .addTypeToType(
                 ITokenSerializer.IKeywordSerializer.class.getName(),
                 IgnoreCaseKeywordSerializer.class.getName())
             .addTypeToType(
                 AbstractIDValueConverter.class.getName(),
                 IgnoreCaseIDValueConverter.class.getName());
   }
   return factory.getBindings();
 }
Exemplo n.º 3
0
 @Override
 public Set<Binding> getGuiceBindingsRt(final Grammar grammar) {
   Set<Binding> _xblockexpression = null;
   {
     final BindFactory bindFactory = new BindFactory();
     if (this.generateStub) {
       String _validatorName = this._validatorNaming.getValidatorName(grammar);
       String _validatorName_1 = this._validatorNaming.getValidatorName(grammar);
       bindFactory.addTypeToTypeEagerSingleton(_validatorName, _validatorName_1);
     } else {
       String _abstractValidatorName = this._validatorNaming.getAbstractValidatorName();
       String _abstractValidatorName_1 = this._validatorNaming.getAbstractValidatorName();
       bindFactory.addTypeToTypeEagerSingleton(_abstractValidatorName, _abstractValidatorName_1);
     }
     _xblockexpression = bindFactory.getBindings();
   }
   return _xblockexpression;
 }