[PATCH] Print entire AST when "-p" option used

Tom Copeland <[email protected]> Sun, 14 Jan 2007 17:53:03 -0500
Newsgroups gmane.comp.java.beanshell.devel
Message-ID <[email protected]>
Hello all -

Here's a small patch to the grammar which causes it to print the entire
AST when the "-p" parameter is passed in.

Yours,

tom

$ svn diff src/bsh/bsh.jjt
Index: src/bsh/bsh.jjt
===================================================================
--- src/bsh/bsh.jjt     (revision 41)
+++ src/bsh/bsh.jjt     (working copy)
@@ -159,7 +159,7 @@
                        parser.setRetainComments(true);
                        while( !parser.Line()/*eof*/ )
                                if ( print )
-
System.out.println( parser.popNode() );
+                                       parser.popNode().dump("");
                }
        }



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV