Package antlr

Examples of antlr.CharScanner


public abstract class GrammarTestCase extends TestCase
{

    public void expect(String s, int... tokens) throws Exception
    {
        CharScanner lexer = createLexer(new StringReader(s));
        for (int token : tokens) {
            Token t = lexer.nextToken();
            assertEquals(String.format("Expected %s, got %s, with '%s'", nameOf(token), nameOf(t.getType()), t.getText()),
                         token, t.getType());
        }
    }
View Full Code Here

TOP

Related Classes of antlr.CharScanner

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.