Examples of CharStream


Examples of org.antlr.runtime.CharStream

    if( filter != null && filter.length() > 0) {

      Table table = convertToTable(mtable);

      CharStream cs = new ANTLRNoCaseStringStream(filter);
      FilterLexer lexer = new FilterLexer(cs);

      CommonTokenStream tokens = new CommonTokenStream();
      tokens.setTokenSource (lexer);
View Full Code Here

Examples of org.antlr.runtime.CharStream

   
    public static MetaData parse(String uid) throws RecognitionException {
        if (uid == null || uid.trim().length() == 0)
            return null;

        CharStream stream = new ANTLRStringStream(uid);
        UdlLexer lexer = new UdlLexer(stream);
        TokenStream tokenStream = new CommonTokenStream(lexer);
        UdlParser parser = new UdlParser(tokenStream);
        return parser.uid();
    }
View Full Code Here

Examples of org.antlr.runtime.CharStream

        return analyze( result,
                        availableIdentifiers );
    }

    private JavaParser parse(final String expr) {
        final CharStream charStream = new ANTLRStringStream(expr);
        final JavaLexer lexer = new JavaLexer( charStream );
        final TokenStream tokenStream = new CommonTokenStream( lexer );
        return new JavaParser( tokenStream );
    }
View Full Code Here

Examples of org.antlr.runtime.CharStream

    }
    return mtable;
  }

  private FilterParser getFilterParser(String filter) throws MetaException {
    CharStream cs = new ANTLRNoCaseStringStream(filter);
    FilterLexer lexer = new FilterLexer(cs);

    CommonTokenStream tokens = new CommonTokenStream();
    tokens.setTokenSource (lexer);
View Full Code Here

Examples of org.antlr.runtime.CharStream

    Grammar g = new Grammar(
      "lexer grammar t;\n"+
      "A : 'a';\n" +
      "B : 'b';\n" +
      "C : 'c';\n");
    CharStream input = new ANTLRStringStream("abcccba");
    Interpreter lexEngine = new Interpreter(g, input);
    TokenRewriteStream tokens = new TokenRewriteStream(lexEngine);
    tokens.fill();
    tokens.replace(2, 4, "x");
    tokens.insertAfter(4, "y");
View Full Code Here

Examples of org.antlr.runtime.CharStream

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

Examples of org.antlr.runtime.CharStream

    Grammar g = new Grammar(
      "lexer grammar t;\n"+
      "A : 'a';\n" +
      "B : 'b';\n" +
      "C : 'c';\n");
    CharStream input = new ANTLRStringStream("abcccba");
    Interpreter lexEngine = new Interpreter(g, input);
    TokenRewriteStream tokens = new TokenRewriteStream(lexEngine);
    tokens.fill();
    tokens.replace(2, 4, "xyz");
    String result = tokens.toString(0,6);
View Full Code Here

Examples of org.antlr.runtime.CharStream

    Grammar g = new Grammar(
      "lexer grammar t;\n"+
      "A : 'a';\n" +
      "B : 'b';\n" +
      "C : 'c';\n");
    CharStream input = new ANTLRStringStream("abcccba");
    Interpreter lexEngine = new Interpreter(g, input);
    TokenRewriteStream tokens = new TokenRewriteStream(lexEngine);
    tokens.fill();
    tokens.replace(2, 4, "xyz");
    tokens.replace(3, 5, "foo"); // overlaps, error
View Full Code Here

Examples of org.antlr.runtime.CharStream

    Grammar g = new Grammar(
      "lexer grammar t;\n"+
      "A : 'a';\n" +
      "B : 'b';\n" +
      "C : 'c';\n");
    CharStream input = new ANTLRStringStream("abcccba");
    Interpreter lexEngine = new Interpreter(g, input);
    TokenRewriteStream tokens = new TokenRewriteStream(lexEngine);
    tokens.fill();
    tokens.replace(2, 4, "xyz");
    tokens.replace(1, 3, "foo"); // overlap, error
View Full Code Here

Examples of org.antlr.runtime.CharStream

    Grammar g = new Grammar(
      "lexer grammar t;\n"+
      "A : 'a';\n" +
      "B : 'b';\n" +
      "C : 'c';\n");
    CharStream input = new ANTLRStringStream("abcba");
    Interpreter lexEngine = new Interpreter(g, input);
    TokenRewriteStream tokens = new TokenRewriteStream(lexEngine);
    tokens.fill();
    tokens.replace(2, 2, "xyz");
    tokens.replace(0, 3, "foo");
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.