import syntaxtree.*;
import visitor.*;

public class Main {
   public static void main(String [] args) {
      try {
         Program root = new MiniJavaParser(System.in).Goal();
	 // Print the original source code from the abstact syntax tree:
	 root.accept(new PrettyPrintVisitor());
	 // Print the abstract syntax tree:
	 //root.accept(new ASTPrintVisitor());
	 // Should this have been called "UglyPrintVisitor"? :)
      }
      catch (ParseException e) {
         System.out.println(e.toString());
      }
   }
}
