/** * A primitive tester to verify that the parser * works as expected. * * @author P. Tellenbach * @version 16. Dec. 2007 */ public class Main { /** * Traverses the parse tree and prints the * nodes in post order * @param n root of the tree */ public static void traverse( Node n ) { if( n != null ) { traverse( n.getLeft() ) ; traverse( n.getRight() ) ; System.out.print( " " + n.getString() ) ; } } /** * Instantiates the parser and lets it parse * the command line arguments * @param args command line arguments */ public static void main( String args[] ) { Parser parser = new Parser() ; for( int i = 0; i < args.length; i++ ) { try { traverse( parser.parse(args[i]) ) ; System.out.println() ; } catch( Exception e ) { e.printStackTrace( ) ; } } } }