Package org.antlr.runtime

Examples of org.antlr.runtime.CommonTokenStream.LT()


      "WS : (' ')+ {channel=99;};\n");
    CharStream input = new ANTLRStringStream("123 139.52");
    Interpreter lexEngine = new Interpreter(g, input);

    CommonTokenStream tokens = new CommonTokenStream(lexEngine);
        tokens.LT(5); // make sure it grabs all tokens
    String result = tokens.toString();
    //System.out.println(result);
    String expecting = "123 139.52";
    assertEquals(expecting, result);
  }
View Full Code Here


      "WS : (' ')+ {channel=99;};\n");
    CharStream input = new ANTLRStringStream("123 139.52");
    Interpreter lexEngine = new Interpreter(g, input);

    CommonTokenStream tokens = new CommonTokenStream(lexEngine);
        tokens.LT(5); // make sure it grabs all tokens
    String result = tokens.toString();
    //System.out.println(result);
    String expecting = "123 139.52";
    assertEquals(expecting, result);
  }
View Full Code Here

      lexer.setCharStream(new ANTLRFileStream(f));
      CommonTokenStream tokens = new CommonTokenStream();
      tokens.discardOffChannelTokens(true);
      tokens.setTokenSource(lexer);
      long start = System.currentTimeMillis();
      tokens.LT(1); // force load
      long stop = System.currentTimeMillis();
      lexerTime += stop-start;

      /*
      long t1 = System.currentTimeMillis();
View Full Code Here

      lexer.setCharStream(new ANTLRFileStream(f));
      CommonTokenStream tokens = new CommonTokenStream();
//      tokens.discardOffChannelTokens(true);
      tokens.setTokenSource(lexer);
      long start = System.currentTimeMillis();
      tokens.LT(1); // force load
      long stop = System.currentTimeMillis();
      lexerTime += stop-start;

      /*
      long t1 = System.currentTimeMillis();
View Full Code Here

      }
      lexer.setCharStream(new ANTLRFileStream(f));
      CommonTokenStream tokens = new CommonTokenStream();
      tokens.setTokenSource(lexer);
      long start = System.currentTimeMillis();
      tokens.LT(1); // force load
      long stop = System.currentTimeMillis();
      lexerTime += stop-start;

      /*
      long t1 = System.currentTimeMillis();
View Full Code Here

      }
      lexer.setCharStream(new ANTLRFileStream(f));
      CommonTokenStream tokens = new CommonTokenStream(lexer);
      tokens.fill();
      long start = System.currentTimeMillis();
      tokens.LT(1); // force load
      long stop = System.currentTimeMillis();
      lexerTime += stop-start;

      /*
      long t1 = System.currentTimeMillis();
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.