Search in sources :

Example 1 with AbstractAntlrParser

use of org.eclipse.xtext.parser.antlr.AbstractAntlrParser in project xtext-core by eclipse.

the class AbstractAntlrParserBasedTokenSourceProvider method createTokenSource.

@Override
public TokenSource createTokenSource(final CharStream stream) {
    if ((this.parser instanceof AbstractAntlrParser)) {
        return ((AbstractAntlrParser) this.parser).createLexer(stream);
    }
    StringConcatenation _builder = new StringConcatenation();
    String _name = this.parser.getClass().getName();
    _builder.append(_name);
    _builder.append(" should be a subclass of ");
    String _name_1 = AbstractAntlrParser.class.getName();
    _builder.append(_name_1);
    throw new IllegalStateException(_builder.toString());
}
Also used : StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) AbstractAntlrParser(org.eclipse.xtext.parser.antlr.AbstractAntlrParser)

Aggregations

StringConcatenation (org.eclipse.xtend2.lib.StringConcatenation)1 AbstractAntlrParser (org.eclipse.xtext.parser.antlr.AbstractAntlrParser)1