public void expand(HashSet<Tree<NodeType>> ht) { expand(ht, new HashSet<Forest<NodeType>>(), null); }
static <NodeType> Forest<NodeType> create(Input.Region loc, NodeType head, Forest<NodeType>[] children, boolean lift) {
+ if (loc == null) throw new Error();
return new One<NodeType>(loc, head, children, lift);
}
abstract void gather(HashSet<Forest<NodeType>> ignore);
abstract void edges(GraphViz.Node n);
boolean ambiguous() { return false; }
-
+
+ abstract Input.Region getRegion();
// One //////////////////////////////////////////////////////////////////////////////
/** if true, the last child's children are considered children of this node */
private final boolean lift;
+ Input.Region getRegion() { return location; }
+
private One(Input.Region loc, NodeType head, Forest<NodeType>[] children, boolean lift) {
this.location = loc;
this.head = head;
public Many() { }
+ Input.Region getRegion() { return hp.iterator().next().getRegion(); } // all should be identical
+
public Tree<NodeType> expand1() throws Ambiguous {
touched();
if (hp.size() > 1) {