adjust misc for changes in meta
authoradam <adam@megacz.com>
Mon, 26 Mar 2007 05:53:54 +0000 (01:53 -0400)
committeradam <adam@megacz.com>
Mon, 26 Mar 2007 05:53:54 +0000 (01:53 -0400)
darcs-hash:20070326055354-5007d-0be2a4848b1670662f3f9a7210349d8516acd050.gz

src/edu/berkeley/sbp/misc/Demo.java
src/edu/berkeley/sbp/misc/HaskellHelper.java
src/edu/berkeley/sbp/misc/Java15.java

index 8315472..2846d7c 100644 (file)
@@ -6,14 +6,13 @@ import edu.berkeley.sbp.*;
 import edu.berkeley.sbp.chr.*;
 import edu.berkeley.sbp.misc.*;
 import edu.berkeley.sbp.meta.*;
 import edu.berkeley.sbp.chr.*;
 import edu.berkeley.sbp.misc.*;
 import edu.berkeley.sbp.meta.*;
-import edu.berkeley.sbp.bind.*;
 import edu.berkeley.sbp.util.*;
 import java.util.*;
 import java.io.*;
 
 public class Demo {
 import edu.berkeley.sbp.util.*;
 import java.util.*;
 import java.io.*;
 
 public class Demo {
-
-    /** our grammar class */
+    /*
+    // our grammar class
     public static class Math {
 
         public static @bind.as("(") Expr parenthesis(Expr e) { return e; }
     public static class Math {
 
         public static @bind.as("(") Expr parenthesis(Expr e) { return e; }
@@ -55,5 +54,5 @@ public class Demo {
         System.out.println("done!");
         System.out.println(Reflection.show(e));
     }
         System.out.println("done!");
         System.out.println(Reflection.show(e));
     }
-
+    */
 }
 }
index b94c30f..e544441 100644 (file)
@@ -18,9 +18,8 @@ public class HaskellHelper {
     public static Tree help0(String grammarFile, String targetFile) throws Throwable {
         try {
             Tree<String> res = new CharParser(MetaGrammar.newInstance()).parse(new FileInputStream(grammarFile)).expand1();
     public static Tree help0(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",
+            Union meta = Grammar.create(res, "s" /*,
                                         new Grammar.Bindings() {
                                         new Grammar.Bindings() {
-                                            
                                             public Sequence createSequence(Production p) {
                                                 Element[] els = p.elements;
                                                 if (p.tag != null)
                                             public Sequence createSequence(Production p) {
                                                 Element[] els = p.elements;
                                                 if (p.tag != null)
@@ -31,10 +30,10 @@ public class HaskellHelper {
                                                         if (idx==-1) idx = i;
                                                         else return Sequence.create(p.nonTerminal, p.elements, p.drops, false);
                                                 if (idx != -1) return Sequence.create(els, idx);
                                                         if (idx==-1) idx = i;
                                                         else return Sequence.create(p.nonTerminal, p.elements, p.drops, false);
                                                 if (idx != -1) return Sequence.create(els, idx);
-                                                else           return Sequence.create(els, null);
+                                                else           return Sequence.create(els, "");
                                             }
                                             
                                             }
                                             
-                                        });
+                                            }*/);
             System.out.println();
             System.out.println();
             CharInput input = new CharInput(new FileInputStream(targetFile), "", true);
             System.out.println();
             System.out.println();
             CharInput input = new CharInput(new FileInputStream(targetFile), "", true);
@@ -50,9 +49,8 @@ public class HaskellHelper {
     public static Tree help(String grammarFile, String targetFile) throws Throwable {
         try {
             Tree<String> res = new CharParser(MetaGrammar.newInstance()).parse(new FileInputStream(grammarFile)).expand1();
     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",
+            Union meta = Grammar.create(res, "s" /*,
                                         new Grammar.Bindings() {
                                         new Grammar.Bindings() {
-                                            
                                             public Sequence createSequence(Production p) {
                                                 Element[] els = p.elements;
                                                 if (p.tag != null && !"".equals(p.tag))
                                             public Sequence createSequence(Production p) {
                                                 Element[] els = p.elements;
                                                 if (p.tag != null && !"".equals(p.tag))
@@ -63,10 +61,10 @@ public class HaskellHelper {
                                                         if (idx==-1) idx = i;
                                                         else return Sequence.create(p.nonTerminal, p.elements, p.drops, false);
                                                 if (idx != -1) return Sequence.create(els, idx);
                                                         if (idx==-1) idx = i;
                                                         else return Sequence.create(p.nonTerminal, p.elements, p.drops, false);
                                                 if (idx != -1) return Sequence.create(els, idx);
-                                                else           return Sequence.create(els, null);
+                                                else           return Sequence.create(els, "");
                                             }
                                             
                                             }
                                             
-                                        });
+                                            }*/);
             System.out.println();
             System.out.println();
             //CharInput input = new CharInput(new FileInputStream(targetFile), "", true);
             System.out.println();
             System.out.println();
             //CharInput input = new CharInput(new FileInputStream(targetFile), "", true);
index 0e08879..9d06b8a 100644 (file)
@@ -10,19 +10,20 @@ import edu.berkeley.sbp.misc.*;
 import edu.berkeley.sbp.meta.*;
 import edu.berkeley.sbp.util.*;
 import edu.berkeley.sbp.chr.*;
 import edu.berkeley.sbp.meta.*;
 import edu.berkeley.sbp.util.*;
 import edu.berkeley.sbp.chr.*;
-import edu.berkeley.sbp.bind.*;
 import java.util.*;
 import java.io.*;
 
 public class Java15 {
 import java.util.*;
 import java.io.*;
 
 public class Java15 {
-
+    /*
     public static void main(String[] s) throws Exception {
 
         try {
             Tree<String> res = new CharParser(MetaGrammar.newInstance()).parse(new FileInputStream(s[0])).expand1();
             
             //AnnotationGrammarBindings resolver = new AnnotationGrammarBindings(Java15.class);
     public static void main(String[] s) throws Exception {
 
         try {
             Tree<String> res = new CharParser(MetaGrammar.newInstance()).parse(new FileInputStream(s[0])).expand1();
             
             //AnnotationGrammarBindings resolver = new AnnotationGrammarBindings(Java15.class);
-            Grammar.Bindings resolver = new Grammar.Bindings();
+            Grammar.Bindings resolver = new Grammar.Bindings() {
+                    public Object repeatTag() { return ""; }
+                };
             Union javaGrammar = Grammar.create(res, "s", resolver);
 
             System.err.println("parsing " + s[1]);
             Union javaGrammar = Grammar.create(res, "s", resolver);
 
             System.err.println("parsing " + s[1]);
@@ -45,5 +46,5 @@ public class Java15 {
         }
 
     }
         }
 
     }
-
+    */
 }
 }