public Forest.Ref finalResult = null;
/** all nodes, keyed by the value returned by code() */
- private HashMap<Long,Phase.Node> hash = new HashMap<Long,Phase.Node>(); /* ALLOC */
+ /*private*/ HashMap<Long,Phase.Node> hash = new HashMap<Long,Phase.Node>(); /* ALLOC */
/** the number of nodes in this phase */
private int numNodes = 0;
private String error = "generic syntax error";
public void checkFailure() throws Parser.Failed {
+ if (token==null && finalResult==null)
+ throw new Parser.Failed(error, getLocation());
if (numNodes <= 0)
throw new Parser.Failed(error, getLocation());
}
private void newNode2(Node p, Node parent, Forest pending, Parser.Table.State state, boolean fromEmptyReduction) {
p.holder.merge(pending);
if (p.parents().contains(parent)) return;
- if (p.fe && p.phase() != parent.phase()) throw new Error("yep yep");
- if (!p.fe && p.phase() == parent.phase()) throw new Error("yep yep2");
+ //if (p.fe && p.phase() != parent.phase()) throw new Error("yep yep");
+ //if (!p.fe && p.phase() == parent.phase()) throw new Error("yep yep2");
p.parents().add(parent, true);
if (p!=parent && !fromEmptyReduction) p.queueReductions(parent);
}