Package org.antlr.runtime

Examples of org.antlr.runtime.TokenStream


 
  private TokenStream getStream(String source){
    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

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

  public void testPRX(File project) throws IOException, RecognitionException{
    File prx = new File(project, project.getName() + ".prx");
    if (!prx.exists())
      return;
    System.out.println("===== PRX: " + prx.getName() + " =====");
    TokenStream tokens = getStream(prx);
    parser.setTokenStream(tokens);
    parser.setTreeAdaptor(adaptor);
    project_return result = parser.project();
    CommonTree tree = (CommonTree) result.getTree();
    ForteAST walker = null;
View Full Code Here

    failOnSyntaxError("Project File: " + prx.getName(), parser, walker);

  }
  public int testPEX(File project) throws IOException, RecognitionException{
    System.out.println("===== PEX: " + project.getName() + " =====");
    TokenStream tokens = getStream(project);
    parser.setTokenStream(tokens);
    parser.setTreeAdaptor(adaptor);
    projectFile_return result = parser.projectFile();
    CommonTree tree = (CommonTree) result.getTree();
    int errors = parser.getNumberOfSyntaxErrors();
View Full Code Here

              "    bidValue = theBidValue,\n" +
              "    lastBidTime = theLastBidTime,\n" +
              "    bidInProgress = theBidInProgress)\n" +
              "  where completion = event;\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_simple completed with " + errors + " errors");
View Full Code Here

              "    bidValue = self.theBidValue,\n" +
              "    lastBidTime = self.theLastBidTime,\n" +
              "    bidInProgress = self.theBidInProgress)\n" +
              "  where completion = event, transaction = dependent;\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 completed with " + errors + " errors");
View Full Code Here

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

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

 
  private TokenStream getStream(String source){
    CharStream stream =
        new NoCaseStringStream(source);
    ForteLexer lexer = new ForteLexer(stream);
    TokenStream tokenStream = new CommonTokenStream(lexer);
    return tokenStream;
  }
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.