當前位置: 首頁>>代碼示例>>Java>>正文


Java IAntlrTokenFileProvider類代碼示例

本文整理匯總了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();
}
 
開發者ID:eclipse,項目名稱:xtext-extras,代碼行數:19,代碼來源:XtextAntlrGeneratorFragment.java

示例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;
}
 
開發者ID:eclipse,項目名稱:xtext-extras,代碼行數:19,代碼來源:AntlrGeneratorFragment.java

示例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();
}
 
開發者ID:eclipse,項目名稱:xtext-extras,代碼行數:24,代碼來源:AntlrGeneratorFragment.java

示例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;
}
 
開發者ID:eclipse,項目名稱:xtext-core,代碼行數:10,代碼來源:AbstractAntlrGeneratorFragment2.java

示例5: bindIAntlrTokenFileProvider

import org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider; //導入依賴的package包/類
public Class<? extends IAntlrTokenFileProvider> bindIAntlrTokenFileProvider() {
	return PkmntcgoAntlrTokenFileProvider.class;
}
 
開發者ID:rehne93,項目名稱:pokemon-tcgo-deck-generator,代碼行數:4,代碼來源:AbstractPkmntcgoRuntimeModule.java

示例6: bindIAntlrTokenFileProvider

import org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider; //導入依賴的package包/類
public Class<? extends IAntlrTokenFileProvider> bindIAntlrTokenFileProvider() {
	return TypesAntlrTokenFileProvider.class;
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:4,代碼來源:AbstractTypesRuntimeModule.java

示例7: bindIAntlrTokenFileProvider

import org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider; //導入依賴的package包/類
public Class<? extends IAntlrTokenFileProvider> bindIAntlrTokenFileProvider() {
	return RegularExpressionAntlrTokenFileProvider.class;
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:4,代碼來源:AbstractRegularExpressionRuntimeModule.java

示例8: bindIAntlrTokenFileProvider

import org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider; //導入依賴的package包/類
public Class<? extends IAntlrTokenFileProvider> bindIAntlrTokenFileProvider() {
	return N4JSAntlrTokenFileProvider.class;
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:4,代碼來源:AbstractN4JSRuntimeModule.java

示例9: bindIAntlrTokenFileProvider

import org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider; //導入依賴的package包/類
public Class<? extends IAntlrTokenFileProvider> bindIAntlrTokenFileProvider() {
	return N4MFAntlrTokenFileProvider.class;
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:4,代碼來源:AbstractN4MFRuntimeModule.java

示例10: bindIAntlrTokenFileProvider

import org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider; //導入依賴的package包/類
public Class<? extends IAntlrTokenFileProvider> bindIAntlrTokenFileProvider() {
	return MyDslAntlrTokenFileProvider.class;
}
 
開發者ID:fatalerrortan,項目名稱:Xtext_Xtend_HTML_Generator,代碼行數:4,代碼來源:AbstractMyDslRuntimeModule.java

示例11: bindIAntlrTokenFileProvider

import org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider; //導入依賴的package包/類
public Class<? extends IAntlrTokenFileProvider> bindIAntlrTokenFileProvider() {
	return BromiumAntlrTokenFileProvider.class;
}
 
開發者ID:hristo-vrigazov,項目名稱:bromium,代碼行數:4,代碼來源:AbstractBromiumRuntimeModule.java

示例12: bindIAntlrTokenFileProvider

import org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider; //導入依賴的package包/類
public Class<? extends IAntlrTokenFileProvider> bindIAntlrTokenFileProvider() {
	return DSLPoliciesAntlrTokenFileProvider.class;
}
 
開發者ID:gw4e,項目名稱:gw4e.project,代碼行數:4,代碼來源:AbstractDSLPoliciesRuntimeModule.java

示例13: bindIAntlrTokenFileProvider

import org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider; //導入依賴的package包/類
public Class<? extends IAntlrTokenFileProvider> bindIAntlrTokenFileProvider() {
	return LcDslAntlrTokenFileProvider.class;
}
 
開發者ID:mduft,項目名稱:lcdsl,代碼行數:4,代碼來源:AbstractLcDslRuntimeModule.java

示例14: bindIAntlrTokenFileProvider

import org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider; //導入依賴的package包/類
public Class<? extends IAntlrTokenFileProvider> bindIAntlrTokenFileProvider() {
	return DslAntlrTokenFileProvider.class;
}
 
開發者ID:eclipse,項目名稱:gemoc-studio,代碼行數:4,代碼來源:AbstractDslRuntimeModule.java

示例15: bindIAntlrTokenFileProvider

import org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider; //導入依賴的package包/類
public Class<? extends IAntlrTokenFileProvider> bindIAntlrTokenFileProvider() {
	return RestauranteAntlrTokenFileProvider.class;
}
 
開發者ID:vicegd,項目名稱:org.xtext.dsl.restaurante,代碼行數:4,代碼來源:AbstractRestauranteRuntimeModule.java


注:本文中的org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。