Search in sources :

Example 1 with ObservableXtextTokenStream

use of org.eclipse.xtext.ide.editor.contentassist.antlr.ObservableXtextTokenStream in project xtext-core by eclipse.

the class InternalParserTest method createParser.

protected InternalXtextGrammarTestLanguageParser createParser(String input) {
    CharStream stream = new ANTLRStringStream(input);
    InternalXtextGrammarTestLanguageLexer lexer = new InternalXtextGrammarTestLanguageLexer(stream);
    InternalXtextGrammarTestLanguageParser result = new InternalXtextGrammarTestLanguageParser(null);
    ObservableXtextTokenStream tokenStream = new ObservableXtextTokenStream(lexer, result);
    tokenStream.setInitialHiddenTokens("RULE_WS", "RULE_ML_COMMENT", "RULE_SL_COMMENT");
    tokenStream.setListener(result);
    result.setGrammarAccess(grammarAccess);
    result.setTokenStream(tokenStream);
    return result;
}
Also used : ANTLRStringStream(org.antlr.runtime.ANTLRStringStream) ObservableXtextTokenStream(org.eclipse.xtext.ide.editor.contentassist.antlr.ObservableXtextTokenStream) InternalXtextGrammarTestLanguageLexer(org.eclipse.xtext.testlanguages.xtextgrammar.ide.contentassist.antlr.internal.InternalXtextGrammarTestLanguageLexer) CharStream(org.antlr.runtime.CharStream) InternalXtextGrammarTestLanguageParser(org.eclipse.xtext.testlanguages.xtextgrammar.ide.contentassist.antlr.internal.InternalXtextGrammarTestLanguageParser)

Aggregations

ANTLRStringStream (org.antlr.runtime.ANTLRStringStream)1 CharStream (org.antlr.runtime.CharStream)1 ObservableXtextTokenStream (org.eclipse.xtext.ide.editor.contentassist.antlr.ObservableXtextTokenStream)1 InternalXtextGrammarTestLanguageLexer (org.eclipse.xtext.testlanguages.xtextgrammar.ide.contentassist.antlr.internal.InternalXtextGrammarTestLanguageLexer)1 InternalXtextGrammarTestLanguageParser (org.eclipse.xtext.testlanguages.xtextgrammar.ide.contentassist.antlr.internal.InternalXtextGrammarTestLanguageParser)1