org.eclipse.xtext.parser.antlr.ITokenDefProvider Java Examples

The following examples show how to use org.eclipse.xtext.parser.antlr.ITokenDefProvider. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AntlrGeneratorFragment.java    From xtext-extras with Eclipse Public License 2.0 6 votes vote down vote up
@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();
}
 
Example #2
Source File: Bug313508Test.java    From xtext-core with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void setUp() throws Exception {
	super.setUp();
	with(BacktrackingLexerTestLanguageStandaloneSetup.class);
	ITokenDefProvider tokenDefProvider = get(ITokenDefProvider.class);
	map = tokenDefProvider.getTokenDefMap();
}
 
Example #3
Source File: AbstractSerializationErrorTestLanguageRuntimeModule.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends ITokenDefProvider> bindITokenDefProvider() {
	return AntlrTokenDefProvider.class;
}
 
Example #4
Source File: AbstractLookAheadContentAssistTestLanguageRuntimeModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends ITokenDefProvider> bindITokenDefProvider() {
	return AntlrTokenDefProvider.class;
}
 
Example #5
Source File: AbstractContentAssistCustomizingTestLanguageRuntimeModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends ITokenDefProvider> bindITokenDefProvider() {
	return AntlrTokenDefProvider.class;
}
 
Example #6
Source File: AbstractBug304681TestLanguageUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public void configureHighlightingTokenDefProvider(Binder binder) {
	binder.bind(ITokenDefProvider.class)
		.annotatedWith(Names.named(LexerIdeBindings.HIGHLIGHTING))
		.to(AntlrTokenDefProvider.class);
}
 
Example #7
Source File: AbstractIgnoreCaseLexerTestLanguageRuntimeModule.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends ITokenDefProvider> bindITokenDefProvider() {
	return AntlrTokenDefProvider.class;
}
 
Example #8
Source File: AbstractEnumAndReferenceTestLanguageRuntimeModule.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends ITokenDefProvider> bindITokenDefProvider() {
	return AntlrTokenDefProvider.class;
}
 
Example #9
Source File: AbstractDatatypeRulesTestLanguageRuntimeModule.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends ITokenDefProvider> bindITokenDefProvider() {
	return AntlrTokenDefProvider.class;
}
 
Example #10
Source File: AbstractBug289187TestLanguageUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public void configureHighlightingTokenDefProvider(Binder binder) {
	binder.bind(ITokenDefProvider.class)
		.annotatedWith(Names.named(LexerIdeBindings.HIGHLIGHTING))
		.to(AntlrTokenDefProvider.class);
}
 
Example #11
Source File: AbstractRefactoringTestLanguage2RuntimeModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends ITokenDefProvider> bindITokenDefProvider() {
	return AntlrTokenDefProvider.class;
}
 
Example #12
Source File: AbstractReferenceGrammarTestLanguageRuntimeModule.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends ITokenDefProvider> bindITokenDefProvider() {
	return AntlrTokenDefProvider.class;
}
 
Example #13
Source File: AbstractFowlerDslTestLanguageRuntimeModule.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends ITokenDefProvider> bindITokenDefProvider() {
	return AntlrTokenDefProvider.class;
}
 
Example #14
Source File: AbstractGrammarAccessTestLanguageRuntimeModule.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends ITokenDefProvider> bindITokenDefProvider() {
	return AntlrTokenDefProvider.class;
}
 
Example #15
Source File: AbstractNestedRefsTestLanguageRuntimeModule.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends ITokenDefProvider> bindITokenDefProvider() {
	return AntlrTokenDefProvider.class;
}
 
Example #16
Source File: AbstractHiddenTerminalsTestLanguageRuntimeModule.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends ITokenDefProvider> bindITokenDefProvider() {
	return AntlrTokenDefProvider.class;
}
 
Example #17
Source File: AbstractEncodingTestLanguageRuntimeModule.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends ITokenDefProvider> bindITokenDefProvider() {
	return AntlrTokenDefProvider.class;
}
 
Example #18
Source File: AbstractBuilderTestLanguageUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public void configureHighlightingTokenDefProvider(Binder binder) {
	binder.bind(ITokenDefProvider.class)
		.annotatedWith(Names.named(LexerIdeBindings.HIGHLIGHTING))
		.to(AntlrTokenDefProvider.class);
}
 
Example #19
Source File: AbstractXtextTerminalsTestLanguageRuntimeModule.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends ITokenDefProvider> bindITokenDefProvider() {
	return AntlrTokenDefProvider.class;
}
 
Example #20
Source File: AbstractFoldingTestLanguageRuntimeModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends ITokenDefProvider> bindITokenDefProvider() {
	return AntlrTokenDefProvider.class;
}
 
Example #21
Source File: AbstractGH341TestLanguageRuntimeModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends ITokenDefProvider> bindITokenDefProvider() {
	return AntlrTokenDefProvider.class;
}
 
Example #22
Source File: AbstractHiddenTokenSequencerTestLanguageRuntimeModule.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends ITokenDefProvider> bindITokenDefProvider() {
	return AntlrTokenDefProvider.class;
}
 
Example #23
Source File: AbstractBug347012TestLanguageUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public void configureHighlightingTokenDefProvider(Binder binder) {
	binder.bind(ITokenDefProvider.class)
		.annotatedWith(Names.named(LexerIdeBindings.HIGHLIGHTING))
		.to(AntlrTokenDefProvider.class);
}
 
Example #24
Source File: AbstractReferenceGrammarUiTestLanguageRuntimeModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends ITokenDefProvider> bindITokenDefProvider() {
	return AntlrTokenDefProvider.class;
}
 
Example #25
Source File: AbstractKeywordsUiTestLanguageUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public void configureHighlightingTokenDefProvider(Binder binder) {
	binder.bind(ITokenDefProvider.class)
		.annotatedWith(Names.named(LexerIdeBindings.HIGHLIGHTING))
		.to(AntlrTokenDefProvider.class);
}
 
Example #26
Source File: AbstractReferringTestLanguageUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public void configureHighlightingTokenDefProvider(Binder binder) {
	binder.bind(ITokenDefProvider.class)
		.annotatedWith(Names.named(LexerIdeBindings.HIGHLIGHTING))
		.to(AntlrTokenDefProvider.class);
}
 
Example #27
Source File: AbstractTreeTestLanguageRuntimeModule.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends ITokenDefProvider> bindITokenDefProvider() {
	return AntlrTokenDefProvider.class;
}
 
Example #28
Source File: AbstractConcreteSyntaxValidationTestLanguageRuntimeModule.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends ITokenDefProvider> bindITokenDefProvider() {
	return AntlrTokenDefProvider.class;
}
 
Example #29
Source File: AbstractBug305397RuntimeModule.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends ITokenDefProvider> bindITokenDefProvider() {
	return AntlrTokenDefProvider.class;
}
 
Example #30
Source File: AbstractMultiValueFeatureTestLanguageRuntimeModule.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends ITokenDefProvider> bindITokenDefProvider() {
	return AntlrTokenDefProvider.class;
}