checkpoint
[sbp.git] / src / edu / berkeley / sbp / Tree.java
index 86a2ffa..086a9bb 100644 (file)
@@ -14,7 +14,7 @@ public class Tree<T>
 
     final T           head;
           Tree<T>[]   children;
-    final Input.Location    location;
+    final Input.Region    location;
 
     public T                 head()        { return head; }
     public int               numChildren() { return children.length; }
@@ -22,10 +22,10 @@ public class Tree<T>
     public Iterator<Tree<T>> iterator()    { return new ArrayIterator(children); }
     public Tree<T>           child(int i)  { return children[i]; }
 
-    public Input.Location    getLocation() { return location; }
+    public Input.Region    getRegion() { return location; }
 
-    public Tree(Input.Location loc, T head)                   { this(loc, head, null); }
-    public Tree(Input.Location loc, T head, Tree<T>[] children) {
+    public Tree(Input.Region loc, T head)                   { this(loc, head, null); }
+    public Tree(Input.Region loc, T head, Tree<T>[] children) {
         this.location = loc;
         this.head = head;
 
@@ -36,13 +36,14 @@ public class Tree<T>
 
     protected String headToString() { return head==null?null:head.toString(); }
     protected String headToJava()   {
+      // FIXME
         if (head==null) return null;
         if (head instanceof ToJava) {
             StringBuffer sb = new StringBuffer();
             ((ToJava)head).toJava(sb);
             return sb.toString();
         }
-        return head==null?"null":("\""+StringUtil.toJavaString(head.toString())+"\"");
+        return (head==null?"null":("\""+StringUtil.toJavaString(head.toString())+"\""));
     }
     protected String left()   { return "{"; }
     protected String right()  { return "}"; }