Examples of ANTLRStringStream


Examples of org.antlr.runtime.ANTLRStringStream

    Grammar g = new Grammar(
      "lexer grammar t;\n"+
      "A : 'a';\n" +
      "B : 'b';\n" +
      "C : 'c';\n");
    CharStream input = new ANTLRStringStream("abc");
    Interpreter lexEngine = new Interpreter(g, input);
    TokenRewriteStream tokens = new TokenRewriteStream(lexEngine);
    tokens.insertBefore(0, "0");
    String result = tokens.toString();
    String expecting = "0abc";
View Full Code Here

Examples of org.skife.jdbi.org.antlr.runtime.ANTLRStringStream

    }

    String parseString(final String sql, final ParsedStatement stmt) throws IllegalArgumentException {
        StringBuilder b = new StringBuilder();
        ColonStatementLexer lexer = new ColonStatementLexer(new ANTLRStringStream(sql));
        Token t = lexer.nextToken();
        while (t.getType() != ColonStatementLexer.EOF) {
            switch(t.getType()) {
                case LITERAL:
                    b.append(t.getText());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.