implements Iterable<Tree<NodeType>> {
private final Input.Region location;
- private final NodeType head;
+ private final NodeType ihead;
private final Tree<NodeType>[] children;
private final boolean lift;
- /** the element at the head of the tree */
- public NodeType head() { return head; }
-
private Tree<NodeType> lifted() { return children[children.length-1]; }
/** the number of children the tree has */
: children.length;
}
+ /** the element at the head of the tree */
+ public NodeType head() { return ihead; }
+ public NodeType getHead() { return ihead; }
+
/** the tree's children */
public Iterable<Tree<NodeType>> children() { return this; }
/** package-private constructor, allows setting the "lift" bit */
Tree(Input.Region loc, NodeType head, Tree<NodeType>[] children, boolean lift) {
this.location = loc;
- this.head = head;
+ this.ihead = head;
this.lift = lift && children != null && children.length > 0;
this.children = ArrayUtil.clone(children, Tree.class);
}