public class Typecheck {
    public static void main(String[] args) throws ParseException {
        // According to the instruction: "java Typecheck < P.java"
        // We use `System.in` as the input stream.
        try {
            new MiniJavaParser(System.in);
            MiniJavaParser.Goal();

            System.out.println("Program type checked successfully");
        } catch (ParseException e) {
            System.out.println("Type error");
        }
    }
}
@@ -1,12 +1,52 @@
+import syntaxtree.*;%0Aimport visitor.*;%0A%0A
 public class
@@ -333,16 +333,48 @@
 r.Goal()
+.accept(new DepthFirstVisitor())
 ;%0A%0A     

apply DepthFirstVisitor to parser goal.