summary patch for Nov->Jan work
[sbp.git] / src / edu / berkeley / sbp / misc / HaskellHelper.java
index d4f43a7..18f5f6a 100644 (file)
@@ -10,7 +10,11 @@ import java.io.*;
 
 public class HaskellHelper {
 
-    public static Tree main(String grammarFile, String targetFile) throws Throwable {
+    public static void main(String[] argv) throws Throwable {
+        help(argv[0], argv[1]);
+    }
+    public static boolean isNull(Object o) { return o==null; }
+    public static Tree help(String grammarFile, String targetFile) throws Throwable {
         try {
             Tree<String> res = new CharParser(MetaGrammar.newInstance()).parse(new FileInputStream(grammarFile)).expand1();
             Union meta = Grammar.create(res, "s",
@@ -23,7 +27,11 @@ public class HaskellHelper {
                                             }
                                             */
                                         });
-            Tree ret = new CharParser(meta).parse(new FileInputStream(targetFile)).expand1();
+            System.out.println();
+            System.out.println();
+            System.out.println();
+            CharInput input = new CharInput(new FileInputStream(targetFile), "", true);
+            Tree ret = new CharParser(meta).parse(input).expand1();
             if (ret==null) throw new NullPointerException("CharParser returned null");
             return ret;
         } catch (Throwable e) {