X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Fedu%2Fberkeley%2Fsbp%2FWalk.java;h=b3432a906b5cd536894cfe895f60dfbb27799e11;hb=8c293278cc3351b872f691c0b866367747bad44a;hp=8c6ecae17d897509e18d764dddb2346275f46135;hpb=5d18f5606c9296e6b0c5749f05fc68f358ace2f6;p=sbp.git diff --git a/src/edu/berkeley/sbp/Walk.java b/src/edu/berkeley/sbp/Walk.java index 8c6ecae..b3432a9 100644 --- a/src/edu/berkeley/sbp/Walk.java +++ b/src/edu/berkeley/sbp/Walk.java @@ -37,7 +37,13 @@ abstract class Walk { else if (e instanceof Sequence) return sequence((Sequence)e); else if (e instanceof Union) { T ret = bottom(e); - for(Sequence s : (Union)e) ret = union((Union)e, ret, walk(s)); + for(Sequence s : (Union)e) { + ret = union((Union)e, ret, walk(s)); + + // FIXME + for(Sequence ss : s.needs()) ret = union((Union)e, ret, walk(ss)); + for(Sequence ss : s.hates()) ret = union((Union)e, ret, walk(ss)); + } return ret; } else { throw new Error("unknown element of class " + e.getClass().getName() + ": " + e); @@ -82,7 +88,7 @@ abstract class Walk { public WalkTokenSet(Topology cs) { this.cs = cs; } public WalkTokenSet(Topology cs, Cache c) { super(c); this.cs = cs; } public Topology bottom(Element e) { return cs; } - public Topology walkAtom(Atom r) { cs = cs.union(r); return cs; } + public Topology walkAtom(Atom r) { cs = cs.union(r.underlying()); return cs; } } static class First extends WalkTokenSet { @@ -149,7 +155,7 @@ abstract class Walk { if (e instanceof Sequence) { Sequence s = (Sequence)e; - if (s.noFollow() != null) cs = cs.minus(s.noFollow()); + if (s.follow() != null) cs = cs.intersect(s.follow().underlying()); } if (c != null && e==me) {