// - non-doomed nodes must either:
// - be on the frontier or
// - have a non-doomed node closer to the frontier than themself
if (phase.isFrontier()) dead = false;
// - non-doomed nodes must either:
// - be on the frontier or
// - have a non-doomed node closer to the frontier than themself
if (phase.isFrontier()) dead = false;
if (state.doomed) { if (r.usedByAnyNode()) { dead = false; break; } }
else { if (r.usedByNonDoomedNode()) { dead = false; break; } }
dead |= results.size()==0;
if (!dead) return;
destroyed = true;
if (state.doomed) { if (r.usedByAnyNode()) { dead = false; break; } }
else { if (r.usedByNonDoomedNode()) { dead = false; break; } }
dead |= results.size()==0;
if (!dead) return;
destroyed = true;
private final boolean fromEmptyReduction;
//private FastSet<Result> results = new FastSet<Result>();
private HashSet<Result> results = new HashSet<Result>();
private final boolean fromEmptyReduction;
//private FastSet<Result> results = new FastSet<Result>();
private HashSet<Result> results = new HashSet<Result>();
public final void invoke(Pos r, Result only) {
boolean emptyProductions = only==null;
public final void invoke(Pos r, Result only) {
boolean emptyProductions = only==null;
if (results==null) return; // FIXME: this should not happen
for(Result res : results)
if (only == null || res == only) {
if (results==null) return; // FIXME: this should not happen
for(Result res : results)
if (only == null || res == only) {
- if (pos>0) child.reduce(r, pos-1, target, null);
+ if (pos>0) pred.reduce(r, pos-1, target, null);
- Input.Region region = child.phase().getLocation().createRegion(target.getLocation());
- new Reduction(child, r, r.rewrite(region), target);
+ Input.Region region = pred.phase().getLocation().createRegion(target.getLocation());
+ new Reduction(pred, r, r.rewrite(region), target);
- public void removeChild(Result child) {
- if (children==null) return;
- children.remove(child);
+ public void removeSucc(Result succ) {
+ if (successors==null) return;
+ successors.remove(succ);
- public void addChild(Result child) {
- if (children==null) return; // FIXME: this should not happen
- children.add(child);
+ public void addSucc(Result succ) {
+ if (successors==null) return; // FIXME: this should not happen
+ successors.add(succ);
for(Result r : results) n.edge(r, "");
n.color = state.doomed ? "red" : "green";
((GraphViz.Group)phase().toGraphViz(gv)).add(n);
for(Result r : results) n.edge(r, "");
n.color = state.doomed ? "red" : "green";
((GraphViz.Group)phase().toGraphViz(gv)).add(n);