summaryrefslogtreecommitdiff
path: root/J2V.java
diff options
context:
space:
mode:
Diffstat (limited to 'J2V.java')
-rw-r--r--J2V.java25
1 files changed, 25 insertions, 0 deletions
diff --git a/J2V.java b/J2V.java
new file mode 100644
index 0000000..c22ed8c
--- /dev/null
+++ b/J2V.java
@@ -0,0 +1,25 @@
+import java.io.*;
+import visitor.*;
+import syntaxtree.*;
+import java.util.*;
+// Files are stored in the vaporize directory/package.
+import vaporize.*;
+
+public class Typecheck {
+ 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,A>. R=Void, A=String.
+ PPrinter<Void,String> pp = new PPrinter<Void,String>();
+ root.accept(pp, "");
+ }
+ catch (ParseException e) {
+ System.out.println(e.toString());
+ System.exit(1);
+ }
+
+ }
+}