Package antlr.collections

Examples of antlr.collections.AST.toStringTree()


        InputStream stream = new FileInputStream(env.get(ToolCorbaConstants.CFG_IDLFILE).toString());
        IDLParser parser = new IDLParser(new IDLLexer(stream));
        parser.specification();
        AST idlTree = parser.getAST();

        System.out.println(idlTree.toStringTree());
       
        Object obj = env.get(ToolConstants.CFG_OUTPUTDIR);
        String outputDir = ".";
        if (obj != null) {
            outputDir = obj.toString();
View Full Code Here


    parser.setFilter( false );
    parser.statement();
    AST ast = parser.getAST();

    if ( logging ) {
      System.out.println( "AST  :  " + ast.toStringTree() + "" );
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      parser.showAst( ast, new PrintStream( baos ) );
      System.out.println( baos.toString() );
    }
View Full Code Here

      }

      final AST ast = parser.getAST();
     
      if (LOG.isDebugEnabled())
        {LOG.debug("generated AST: " + ast.toStringTree());}

      final PathExpr expr = new PathExpr(context);
      treeParser.xpath(ast, expr);
      if (treeParser.foundErrors()) {
        throw new SAXException(treeParser.getErrorMessage());
View Full Code Here

            if (parser.foundErrors()) {
                //TODO : error ?
                LOG.debug(parser.getErrorMessage());
            }
            final AST ast = parser.getAST();
            LOG.debug("generated AST: " + ast.toStringTree());
            expr = new PathExpr(context);
            treeParser.xpath(ast, expr);
            if (treeParser.foundErrors()) {
                LOG.debug(treeParser.getErrorMessage());
            }
View Full Code Here

          System.err.println(xparser.getErrorMessage());
          return;
        }
 
        AST ast = xparser.getAST();
        System.out.println("generated AST: " + ast.toStringTree());
 
        PathExpr expr = new PathExpr(context);
        treeParser.xpath(ast, expr);
        if (treeParser.foundErrors()) {
          System.err.println(treeParser.getErrorMessage());
View Full Code Here

    parser.setFilter( false );
    parser.statement();
    AST ast = parser.getAST();

    if ( logging ) {
      System.out.println( "AST  :  " + ast.toStringTree() + "" );
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      parser.showAst( ast, new PrintStream( baos ) );
      System.out.println( baos.toString() );
    }
View Full Code Here

    System.out.println( "input: ->" + ASTPrinter.escapeMultibyteChars(input) + "<-" );
    HqlParser parser = HqlParser.getInstance( input );
    parser.setFilter( filter );
    parser.statement();
    AST ast = parser.getAST();
    System.out.println( "AST  :  " + ast.toStringTree() + "" );
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    parser.showAst( ast, new PrintStream( baos ) );
    System.out.println( baos.toString() );
    assertEquals( "At least one error occurred during parsing!", 0, parser.getParseErrorHandler().getErrorCount() );
    return ast;
View Full Code Here

    System.out.println( "input: ->" + ASTPrinter.escapeMultibyteChars(input) + "<-" );
    HqlParser parser = HqlParser.getInstance( input );
    parser.setFilter( filter );
    parser.statement();
    AST ast = parser.getAST();
    System.out.println( "AST  :  " + ast.toStringTree() + "" );
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    parser.showAst( ast, new PrintStream( baos ) );
    System.out.println( baos.toString() );
    assertEquals( "At least one error occurred during parsing!", 0, parser.getParseErrorHandler().getErrorCount() );
    return ast;
View Full Code Here

    parser.setFilter( false );
    parser.statement();
    AST ast = parser.getAST();

    if ( logging ) {
      System.out.println( "AST  :  " + ast.toStringTree() + "" );
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      parser.showAst( ast, new PrintStream( baos ) );
      System.out.println( baos.toString() );
    }
View Full Code Here

    System.out.println( "input: ->" + ASTPrinter.escapeMultibyteChars(input) + "<-" );
    HqlParser parser = HqlParser.getInstance( input );
    parser.setFilter( filter );
    parser.statement();
    AST ast = parser.getAST();
    System.out.println( "AST  :  " + ast.toStringTree() + "" );
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    parser.showAst( ast, new PrintStream( baos ) );
    System.out.println( baos.toString() );
    assertEquals( "At least one error occurred during parsing!", 0, parser.getParseErrorHandler().getErrorCount() );
    return ast;
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.