本文整理汇总了Java中org.eclipse.xtext.parser.antlr.AntlrTokenToStringConverter类的典型用法代码示例。如果您正苦于以下问题:Java AntlrTokenToStringConverter类的具体用法?Java AntlrTokenToStringConverter怎么用?Java AntlrTokenToStringConverter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AntlrTokenToStringConverter类属于org.eclipse.xtext.parser.antlr包,在下文中一共展示了AntlrTokenToStringConverter类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getGuiceBindingsRt
import org.eclipse.xtext.parser.antlr.AntlrTokenToStringConverter; //导入依赖的package包/类
@Override
public Set<Binding> getGuiceBindingsRt(Grammar grammar) {
BindFactory factory = new BindFactory()
.addTypeToType(IParser.class.getName(),getParserClassName(grammar, getNaming()))
.addTypeToType(ITokenToStringConverter.class.getName(),AntlrTokenToStringConverter.class.getName())
.addTypeToType(IAntlrTokenFileProvider.class.getName(),getAntlrTokenFileProviderClassName(grammar, getNaming()))
.addTypeToType(Lexer.class.getName(), getLexerClassName(grammar, getNaming()))
.addTypeToProviderInstance(getLexerClassName(grammar, getNaming()), "org.eclipse.xtext.parser.antlr.LexerProvider.create(" + getLexerClassName(grammar, getNaming()) + ".class)")
.addConfiguredBinding("RuntimeLexer",
"binder.bind(" + Lexer.class.getName() + ".class)"+
".annotatedWith(com.google.inject.name.Names.named(" +
"org.eclipse.xtext.parser.antlr.LexerBindings.RUNTIME" +
")).to(" + getLexerClassName(grammar, getNaming()) +".class)")
.addTypeToType(ITokenDefProvider.class.getName(), AntlrTokenDefProvider.class.getName());
if (containsUnorderedGroup(grammar))
factory = factory.addTypeToType(IUnorderedGroupHelper.class.getName(), UnorderedGroupHelper.class.getName());
return factory.getBindings();
}
示例2: getGuiceBindingsRt
import org.eclipse.xtext.parser.antlr.AntlrTokenToStringConverter; //导入依赖的package包/类
@Override
public Set<Binding> getGuiceBindingsRt(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();
}
示例3: bindITokenToStringConverter
import org.eclipse.xtext.parser.antlr.AntlrTokenToStringConverter; //导入依赖的package包/类
public Class<? extends ITokenToStringConverter> bindITokenToStringConverter() {
return AntlrTokenToStringConverter.class;
}
示例4: bindITokenToStringConverter
import org.eclipse.xtext.parser.antlr.AntlrTokenToStringConverter; //导入依赖的package包/类
public Class<? extends org.eclipse.xtext.parser.ITokenToStringConverter> bindITokenToStringConverter() {
return AntlrTokenToStringConverter.class;
}