Search in sources :

Example 1 with InternalXtextGrammarTestLanguageParser

use of org.eclipse.xtext.testlanguages.xtextgrammar.ide.contentassist.antlr.internal.InternalXtextGrammarTestLanguageParser in project xtext-core by eclipse.

the class InternalParserTest method testSetup.

@Test
public void testSetup() {
    String input = "";
    InternalXtextGrammarTestLanguageParser parser = createParser(input);
    assertNotNull(parser);
}
Also used : InternalXtextGrammarTestLanguageParser(org.eclipse.xtext.testlanguages.xtextgrammar.ide.contentassist.antlr.internal.InternalXtextGrammarTestLanguageParser) AbstractParserTest(org.eclipse.xtext.ide.tests.editor.contentassist.antlr.AbstractParserTest) Test(org.junit.Test)

Example 2 with InternalXtextGrammarTestLanguageParser

use of org.eclipse.xtext.testlanguages.xtextgrammar.ide.contentassist.antlr.internal.InternalXtextGrammarTestLanguageParser 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)

Example 3 with InternalXtextGrammarTestLanguageParser

use of org.eclipse.xtext.testlanguages.xtextgrammar.ide.contentassist.antlr.internal.InternalXtextGrammarTestLanguageParser in project xtext-core by eclipse.

the class XtextGrammarTestLanguageParser method createParser.

@Override
protected InternalXtextGrammarTestLanguageParser createParser() {
    InternalXtextGrammarTestLanguageParser result = new InternalXtextGrammarTestLanguageParser(null);
    result.setGrammarAccess(grammarAccess);
    return result;
}
Also used : InternalXtextGrammarTestLanguageParser(org.eclipse.xtext.testlanguages.xtextgrammar.ide.contentassist.antlr.internal.InternalXtextGrammarTestLanguageParser)

Example 4 with InternalXtextGrammarTestLanguageParser

use of org.eclipse.xtext.testlanguages.xtextgrammar.ide.contentassist.antlr.internal.InternalXtextGrammarTestLanguageParser in project xtext-core by eclipse.

the class InternalParserTest method getFollowSet.

@Override
protected Set<FollowElement> getFollowSet(String input) throws RecognitionException {
    InternalXtextGrammarTestLanguageParser parser = createParser(input);
    parser.entryRuleGrammar();
    return parser.getFollowElements();
}
Also used : InternalXtextGrammarTestLanguageParser(org.eclipse.xtext.testlanguages.xtextgrammar.ide.contentassist.antlr.internal.InternalXtextGrammarTestLanguageParser)

Aggregations

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