checkpoint
authoradam <adam@megacz.com>
Sat, 15 Jul 2006 05:46:52 +0000 (01:46 -0400)
committeradam <adam@megacz.com>
Sat, 15 Jul 2006 05:46:52 +0000 (01:46 -0400)
darcs-hash:20060715054652-5007d-423be93316fc8f3d5e88aec6f3585d8cab5c9963.gz

src/edu/berkeley/sbp/Forest.java
src/edu/berkeley/sbp/Parser.java
src/edu/berkeley/sbp/Sequence.java
src/edu/berkeley/sbp/chr/CharParser.java

index 48f88a2..e7c0be4 100644 (file)
@@ -77,8 +77,8 @@ public abstract class Forest<T> /*extends PrintableTree<Forest.MyBody<T>>*/
         public InnerAmbiguous(Forest<?> f) { this.f = f; }
     }
 
-    static        <T> Forest<T> leaf(Input.Region loc, T tag, Position p) { return create(loc, tag, null, false, p); }
-    public static <T> Forest<T> create(Input.Region loc, T tag, Forest<T>[] tokens, boolean unwrap, Position p) {
+    static        <T> Forest<T> leaf(Input.Region loc, T tag) { return create(loc, tag, null, false); }
+    public static <T> Forest<T> create(Input.Region loc, T tag, Forest<T>[] tokens, boolean unwrap) {
         return new MyBody<T>(loc, tag, tokens, unwrap);
     }
     // Body //////////////////////////////////////////////////////////////////////////////
index 0d14563..357519a 100644 (file)
@@ -26,7 +26,7 @@ public abstract class Parser<Tok, Result> {
         GSS gss = new GSS();
         Input.Location loc = input.getLocation();
         GSS.Phase current = gss.new Phase<Tok>(null, this, null, input.next(), loc, null);
-        current.newNode(null, Forest.leaf(null, null, null), pt.start, true);
+        current.newNode(null, Forest.leaf(null, null), pt.start, true);
         int count = 1;
         for(int idx=0;;idx++) {
             Input.Location oldloc = loc;
index a2e6f99..c3c259f 100644 (file)
@@ -184,7 +184,7 @@ public abstract class Sequence extends Element implements Iterable<Element> {
         public Constant(Element[] e, Object result) { super(e); this.result = result; }
         Sequence _clone() { return new Constant(elements, result); }
         public <T> Forest<T> postReduce(Input.Region loc, Forest<T>[] args, Position p) {
-            return (Forest<T>)Forest.leaf(loc, result, p);
+            return (Forest<T>)Forest.leaf(loc, result);
         }
         static class Drop extends Constant {
             Sequence _clone() { return new Drop(elements, lame); }
@@ -215,13 +215,13 @@ public abstract class Sequence extends Element implements Iterable<Element> {
         Sequence _clone() { return new Unwrap(elements, drops); }
         public <T> Forest<T> postReduce(Input.Region loc, Forest<T>[] args, Position p) {
             for(int i=0; i<args.length; i++) if (args[i]==null) throw new Error();
-            if (drops==null) return Forest.create(loc, (T)tag, args, true, p);
+            if (drops==null) return Forest.create(loc, (T)tag, args, true);
             int count = 0;
             for(int i=0; i<drops.length; i++) if (!drops[i]) count++;
             Forest<T>[] args2 = new Forest[count];
             int j = 0;
             for(int i=0; i<args.length; i++) if (!drops[i]) args2[j++] = args[i];
-            return Forest.create(loc, (T)tag, args2, true, p);
+            return Forest.create(loc, (T)tag, args2, true);
         }
     }
 
@@ -258,7 +258,7 @@ public abstract class Sequence extends Element implements Iterable<Element> {
             int j = 0;
             for(int i=0; i<args.length; i++) if (!drops[i]) args2[j++] = args[i];
             //System.out.println("reduce \""+tag+"\"");
-            return Forest.create(loc, (T)tag, args2, false, p);
+            return Forest.create(loc, (T)tag, args2, false);
         }
         public StringBuffer toString(StringBuffer sb, boolean spacing) {
             int len = sb.length();
index bce5b60..8630161 100644 (file)
@@ -16,7 +16,7 @@ public class CharParser extends Parser<Character,String> {
     public CharParser(Union u) { super(u, new CharTopology()); }
 
     public Forest<String> shiftToken(Location oldloc, Character ct, Location newloc) {
-        return Forest.create(new Input.Region(oldloc, newloc), ct.toString(), null, false, null);
+        return Forest.create(new Input.Region(oldloc, newloc), ct.toString(), null, false);
     }
 
 }