本文整理匯總了Java中org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider類的典型用法代碼示例。如果您正苦於以下問題:Java IAntlrTokenFileProvider類的具體用法?Java IAntlrTokenFileProvider怎麽用?Java IAntlrTokenFileProvider使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
IAntlrTokenFileProvider類屬於org.eclipse.xtext.parser.antlr包,在下文中一共展示了IAntlrTokenFileProvider類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getGuiceBindingsRt
import org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider; //導入依賴的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: createLexerTokensProvider
import org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider; //導入依賴的package包/類
/**
* @since 2.7
*/
protected MutableTokenDefProvider createLexerTokensProvider(final String lexerBaseFileName, KeywordHelper helper, Charset encoding) {
MutableTokenDefProvider provider = new MutableTokenDefProvider(helper, encoding);
provider.setAntlrTokenFileProvider(new IAntlrTokenFileProvider() {
@Override
public InputStream getAntlrTokenFile() {
try {
return new FileInputStream(lexerBaseFileName + ".tokens");
}
catch (FileNotFoundException e) {
throw new RuntimeException(e);
}
}
});
return provider;
}
示例3: getGuiceBindingsRt
import org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider; //導入依賴的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();
}
示例4: createLexerTokensProvider
import org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider; //導入依賴的package包/類
protected MutableTokenDefProvider createLexerTokensProvider(final AntlrGrammar lexerGrammar, final KeywordHelper helper, final IXtextGeneratorFileSystemAccess fsa) {
Charset _forName = Charset.forName(this.codeConfig.getEncoding());
final MutableTokenDefProvider provider = new MutableTokenDefProvider(helper, _forName);
final IAntlrTokenFileProvider _function = () -> {
return fsa.readBinaryFile(lexerGrammar.getTokensFileName());
};
provider.setAntlrTokenFileProvider(_function);
return provider;
}
示例5: bindIAntlrTokenFileProvider
import org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider; //導入依賴的package包/類
public Class<? extends IAntlrTokenFileProvider> bindIAntlrTokenFileProvider() {
return PkmntcgoAntlrTokenFileProvider.class;
}
示例6: bindIAntlrTokenFileProvider
import org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider; //導入依賴的package包/類
public Class<? extends IAntlrTokenFileProvider> bindIAntlrTokenFileProvider() {
return TypesAntlrTokenFileProvider.class;
}
示例7: bindIAntlrTokenFileProvider
import org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider; //導入依賴的package包/類
public Class<? extends IAntlrTokenFileProvider> bindIAntlrTokenFileProvider() {
return RegularExpressionAntlrTokenFileProvider.class;
}
示例8: bindIAntlrTokenFileProvider
import org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider; //導入依賴的package包/類
public Class<? extends IAntlrTokenFileProvider> bindIAntlrTokenFileProvider() {
return N4JSAntlrTokenFileProvider.class;
}
示例9: bindIAntlrTokenFileProvider
import org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider; //導入依賴的package包/類
public Class<? extends IAntlrTokenFileProvider> bindIAntlrTokenFileProvider() {
return N4MFAntlrTokenFileProvider.class;
}
示例10: bindIAntlrTokenFileProvider
import org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider; //導入依賴的package包/類
public Class<? extends IAntlrTokenFileProvider> bindIAntlrTokenFileProvider() {
return MyDslAntlrTokenFileProvider.class;
}
示例11: bindIAntlrTokenFileProvider
import org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider; //導入依賴的package包/類
public Class<? extends IAntlrTokenFileProvider> bindIAntlrTokenFileProvider() {
return BromiumAntlrTokenFileProvider.class;
}
示例12: bindIAntlrTokenFileProvider
import org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider; //導入依賴的package包/類
public Class<? extends IAntlrTokenFileProvider> bindIAntlrTokenFileProvider() {
return DSLPoliciesAntlrTokenFileProvider.class;
}
示例13: bindIAntlrTokenFileProvider
import org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider; //導入依賴的package包/類
public Class<? extends IAntlrTokenFileProvider> bindIAntlrTokenFileProvider() {
return LcDslAntlrTokenFileProvider.class;
}
示例14: bindIAntlrTokenFileProvider
import org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider; //導入依賴的package包/類
public Class<? extends IAntlrTokenFileProvider> bindIAntlrTokenFileProvider() {
return DslAntlrTokenFileProvider.class;
}
示例15: bindIAntlrTokenFileProvider
import org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider; //導入依賴的package包/類
public Class<? extends IAntlrTokenFileProvider> bindIAntlrTokenFileProvider() {
return RestauranteAntlrTokenFileProvider.class;
}