private HashSet<Node> successors = new HashSet<Node>();
private boolean destroyed = false;
private int usedByNonDoomedNode = 0;
+ private Pos reduction;
public GSS.Phase phase() { return pred==null ? null : pred.phase(); }
public Forest getForest() { return f; }
}
}
- public Result(Forest f, Node pred, Pos reduction) {
- this(f, pred, reduction, null);
+ public static void newResult(Forest f, Node pred, Pos reduction, GSS.Phase target) {
+ Result r = new Result(f, pred, reduction);
+ if (reduction == null) return;
+ Parser.Table.State state0 = (Parser.Table.State)pred.state().gotoSetNonTerminals.get(reduction);
+ target.newNodeFromReduction(r, state0, reduction);
}
- public Result(Forest f, Node pred, Pos reduction, GSS.Phase target) {
+ public Result(Forest f, Node pred, Pos reduction) {
this.f = f;
this.pred = pred;
+ this.reduction = reduction;
if (pred != null) pred.addSucc(this);
- if (reduction == null) return;
- Parser.Table.State state0 = (Parser.Table.State)pred.state().gotoSetNonTerminals.get(reduction);
- target.newNodeFromReduction(this, state0, reduction);
}
// GraphViz //////////////////////////////////////////////////////////////////////////////