X-Git-Url: http://git.megacz.com/?p=sbp.git;a=blobdiff_plain;f=src%2Fedu%2Fberkeley%2Fsbp%2FReduction.java;fp=src%2Fedu%2Fberkeley%2Fsbp%2FReduction.java;h=5eb3f63197de7d91f644d1625e1fbf8443d469c2;hp=cdf681df394110244e4640da9686f9b4074cafd0;hb=33d7b8fa4974bad96108c11e5548b354cf10ecb8;hpb=80f8bc14a13b5e4912004e081ec96dc6ed807385 diff --git a/src/edu/berkeley/sbp/Reduction.java b/src/edu/berkeley/sbp/Reduction.java index cdf681d..5eb3f63 100644 --- a/src/edu/berkeley/sbp/Reduction.java +++ b/src/edu/berkeley/sbp/Reduction.java @@ -9,22 +9,22 @@ final class Reduction implements Comparable { private Pos reduction; private GSS.Phase phase; private Forest forest; - private Node parent; + private Node pred; - public Reduction(Node parent, Pos reduction, Forest forest, GSS.Phase target) { + public Reduction(Node pred, Pos reduction, Forest forest, GSS.Phase target) { this.reduction = reduction; this.forest = forest; this.phase = target; - this.parent = parent; + this.pred = pred; target.addReduction(this); } public int compareTo(Reduction r) { - if (parent.phase()!=null || r.parent.phase()!=null) { - if (parent.phase()==null) return 1; - if (r.parent.phase()==null) return -1; - if (parent.phase().pos < r.parent.phase().pos) return 1; - if (parent.phase().pos > r.parent.phase().pos) return -1; + if (pred.phase()!=null || r.pred.phase()!=null) { + if (pred.phase()==null) return 1; + if (r.pred.phase()==null) return -1; + if (pred.phase().pos < r.pred.phase().pos) return 1; + if (pred.phase().pos > r.pred.phase().pos) return -1; } /* int master = Parser.mastercache.comparePositions(reduction(), r.reduction()); @@ -40,9 +40,9 @@ final class Reduction implements Comparable { return 1; } - public void perform() { new Result(forest, parent, reduction, phase); } - public GSS.Phase parentPhase() { return parent.phase(); } + public void perform() { new Result(forest, pred, reduction, phase); } + public GSS.Phase predPhase() { return pred.phase(); } public Pos reduction() { return reduction; } public GSS.Phase targetPhase() { return phase; } - public String toString() { return (parent.phase()==null ? 0 : parent.phase().pos) + ":"+reduction; } + public String toString() { return (pred.phase()==null ? 0 : pred.phase().pos) + ":"+reduction; } }