import java.io.*; import visitor.*; import parse.*; import syntaxtree.*; import java.util.*; import st.*; import misc.*; import boil.*; public class J2V { public static void main(String[] args) { Node root = null; try { root = new MiniJavaParser(System.in).Goal(); // Pretty-print the tree. PPrinter inherits from // GJDepthFirst. R=Void, A=String. // PPrinter pp = new PPrinter(); // root.accept(pp, ""); // Build the symbol table. Top-down visitor, inherits from // GJDepthFirst. R=Void, A=Integer. SymbolTable symt = new SymbolTable(); MinimalLogger.info("Populating classes..."); root.accept(new SymTableClasses(), symt); MinimalLogger.info("Populating methods..."); root.accept(new SymTableMethods(), symt); MinimalLogger.info("Populating variables..."); root.accept(new SymTableVars(), symt); MinimalLogger.info("Populating extensions..."); root.accept(new SymTableExtend(), symt); MinimalLogger.info(symt.toString()); BoilVisitor vp = new BoilVisitor(symt); root.accept(vp, null); MinimalLogger.info("==================================================="); System.out.println(vp.getVapor()); } catch (ParseException e) { System.out.println(e.toString()); System.exit(1); } } }