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; }
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;
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 "}"; }