Package org.eclipse.xtext.generator

Examples of org.eclipse.xtext.generator.BindFactory


    helper.discardHelper(grammar);
  }

  @Override
  public Set<Binding> getGuiceBindingsUi(final Grammar grammar) {
    BindFactory binder = new BindFactory()
        .addTypeToType(
            "org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext.Factory",
            "org.eclipse.xtext.ui.editor.contentassist.antlr.ParserBasedContentAssistContextFactory")
        .addTypeToType(
            "org.eclipse.xtext.ui.editor.contentassist.antlr.IContentAssistParser",
            getFragmentHelper().getContentAssistParserClassName(grammar))
        .addConfiguredBinding(
            "ContentAssistLexerProvider",
            "binder.bind(" + getFragmentHelper().getInternalContentAssistLexerClassName(grammar)
                + ".class)" +
                ".toProvider(org.eclipse.xtext.parser.antlr.LexerProvider.create("
                + getFragmentHelper().getInternalContentAssistLexerClassName(grammar) + ".class))")
        .addConfiguredBinding(
            "ContentAssistLexer",
            "binder.bind(org.eclipse.xtext.ui.editor.contentassist.antlr.internal.Lexer.class)" +
                ".annotatedWith(com.google.inject.name.Names.named(" +
                "org.eclipse.xtext.ui.LexerUIBindings.CONTENT_ASSIST" +
                ")).to(" + getFragmentHelper().getInternalContentAssistLexerClassName(grammar)
                + ".class)");
    if (partialParsing) {
      binder
          .addTypeToType(
              "org.eclipse.xtext.ui.editor.contentassist.antlr.ParserBasedContentAssistContextFactory.StatefulFactory",
              "org.eclipse.xtext.ui.editor.contentassist.antlr.ParserBasedContentAssistContextFactory.PartialStatefulFactory");
    }
    return binder.getBindings();
  }
View Full Code Here


        .addRegisterGeneratedEPackage("org.eclipse.xtext.common.types.TypesPackage");
  }

  @Override
  public Set<Binding> getGuiceBindingsRt(final Grammar grammar) {
    return new BindFactory()
        .addTypeToInstance(ClassLoader.class.getName(), "getClass().getClassLoader()")
        .addTypeToInstance("org.eclipse.xtext.common.types.TypesFactory",
            "org.eclipse.xtext.common.types.TypesFactory.eINSTANCE")
        .addTypeToType("org.eclipse.xtext.common.types.access.IJvmTypeProvider.Factory",
            "org.eclipse.xtext.common.types.access.ClasspathTypeProviderFactory")
View Full Code Here

    };
  }

  @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();
  }
View Full Code Here

    return factory.getBindings();
  }

  @Override
  public Set<Binding> getGuiceBindingsUi(final Grammar grammar) {
    return new BindFactory()
        .addTypeToType("org.eclipse.xtext.ui.editor.contentassist.IProposalConflictHelper",
            "org.eclipse.xtext.ui.editor.contentassist.antlr.AntlrProposalConflictHelper")
        .addConfiguredBinding("HighlightingLexer",
            "binder.bind(" + Lexer.class.getName() + ".class)" +
                ".annotatedWith(com.google.inject.name.Names.named(" +
View Full Code Here

TOP

Related Classes of org.eclipse.xtext.generator.BindFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.