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);
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());
}
if (c != null && e==me) {