Package org.antlr.runtime

Examples of org.antlr.runtime.TokenStream


              "    ReturnObj = PreferenceList[i].Clone(TRUE);\r\n" +
              "    found = TRUE;\r\n" +
              "    exit;\r\n" +
              "  end if;\r\n");
        ForteLexer lexer = new ForteLexer(stream);
        TokenStream tokenStream = new CommonTokenStream(lexer);
        ForteParser parser = new ForteParser(tokenStream);
        parser.statement();
        int errors = parser.getNumberOfSyntaxErrors();
        if (errors > 0){
          Assert.fail("ifStatement_5 completed with " + errors + " errors");
View Full Code Here


  @Test
  public void startTaskStatement_simple() throws Exception{
      CharStream stream =
          new NoCaseStringStream("start task theBid.StartBid();\n");
        ForteLexer lexer = new ForteLexer(stream);
        TokenStream tokenStream = new CommonTokenStream(lexer);
        ForteParser parser = new ForteParser(tokenStream);
        parser.statement();
        int errors = parser.getNumberOfSyntaxErrors();
        if (errors > 0){
          Assert.fail("startTaskStatement_simplest completed with " + errors + " errors");
View Full Code Here

  private TokenStream getStream(File file) throws IOException{
    CharStream stream =
        new NoCaseFileStream(file.getAbsolutePath());
    ForteLexer lexer = new ForteLexer(stream);
    TokenStream tokenStream = new CommonTokenStream(lexer);
    return tokenStream;
  }
View Full Code Here

  }
  private TokenStream getStream(String source) throws IOException{
    CharStream stream =
        new NoCaseStringStream(source);
    ForteLexer lexer = new ForteLexer(stream);
    TokenStream tokenStream = new CommonTokenStream(lexer);
    return tokenStream;
  }
View Full Code Here

  private TokenStream getStream(File file) throws IOException{
    CharStream stream =
        new NoCaseFileStream(file.getAbsolutePath());
    ForteLexer lexer = new ForteLexer(stream);
    TokenStream tokenStream = new CommonTokenStream(lexer);
    return tokenStream;
  }
View Full Code Here

  }
  private TokenStream getStream(String source) throws IOException{
    CharStream stream =
        new NoCaseStringStream(source);
    ForteLexer lexer = new ForteLexer(stream);
    TokenStream tokenStream = new CommonTokenStream(lexer);
    return tokenStream;
  }
View Full Code Here

  @Test
  public void cursorFile() throws RecognitionException, IOException{
    CharStream stream =
        new NoCaseFileStream("TestSmall/WinDB/BlobCursor.cur");
    ToolSQLLexer lexer = new ToolSQLLexer(stream);
    TokenStream tokenStream = new CommonTokenStream(lexer);
    ForteParser parser = new ForteParser(tokenStream);
    CommonTree tree = (CommonTree) parser.cursorFile().getTree();
    printTree(tree);
    int errors = parser.getNumberOfSyntaxErrors();
    if (errors > 0Assert.fail() ;
View Full Code Here

    CharStream stream;
    try {
      stream = new NoCaseFileStream(source);
      FortePRXLexer lexer = new FortePRXLexer(stream);
      TokenStream tokenStream = new CommonTokenStream(lexer);
      return tokenStream;
    } catch (IOException e) {
      ToolPlugin.showError("Cannot create parser for Plan " + source.getName(), e);
    }
    return null;
View Full Code Here

  }
  public int testClassDefinitionFile(File cdf, boolean failOnError) throws IOException, RecognitionException {
    CharStream stream =
        new NoCaseFileStream(cdf.getAbsolutePath());
    ForteLexer lexer = new ForteLexer(stream);
    TokenStream tokenStream = new CommonTokenStream(lexer);
    ForteParser parser = new ForteParser(tokenStream);
    CommonTree tree = (CommonTree) parser.cdfFile().getTree();
    printTree(tree);
    int errors = parser.getNumberOfSyntaxErrors();
    int treeerrorsCDF = 0;
View Full Code Here

  }
  public int testClassImplementationFile(File cex, boolean failOnError) throws RecognitionException, IOException {
    CharStream stream =
        new NoCaseFileStream(cex.getAbsolutePath());
    ForteLexer lexer = new ForteLexer(stream);
    TokenStream tokenStream = new CommonTokenStream(lexer);
    ForteParser parser = new ForteParser(tokenStream);
    printTree(parser.implementationFile().getTree());
    int errors = parser.getNumberOfSyntaxErrors();
    if (failOnError && errors > 0Assert.fail() ;
    return errors;
View Full Code Here

TOP

Related Classes of org.antlr.runtime.TokenStream

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.