projects
/
sbp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
checkpoint
[sbp.git]
/
src
/
edu
/
berkeley
/
sbp
/
Walk.java
diff --git
a/src/edu/berkeley/sbp/Walk.java
b/src/edu/berkeley/sbp/Walk.java
index
8c6ecae
..
b3432a9
100644
(file)
--- a/
src/edu/berkeley/sbp/Walk.java
+++ b/
src/edu/berkeley/sbp/Walk.java
@@
-37,7
+37,13
@@
abstract class Walk<T> {
else if (e instanceof Sequence) return sequence((Sequence)e);
else if (e instanceof Union) {
T ret = bottom(e);
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);
return ret;
} else {
throw new Error("unknown element of class " + e.getClass().getName() + ": " + e);
@@
-82,7
+88,7
@@
abstract class Walk<T> {
public WalkTokenSet(Topology<Tok> cs) { this.cs = cs; }
public WalkTokenSet(Topology<Tok> cs, Cache c) { super(c); this.cs = cs; }
public Topology<Tok> bottom(Element e) { return cs; }
public WalkTokenSet(Topology<Tok> cs) { this.cs = cs; }
public WalkTokenSet(Topology<Tok> cs, Cache c) { super(c); this.cs = cs; }
public Topology<Tok> bottom(Element e) { return cs; }
- public Topology<Tok> walkAtom(Atom r) { cs = cs.union(r); return cs; }
+ public Topology<Tok> walkAtom(Atom r) { cs = cs.union(r.underlying()); return cs; }
}
static class First<Tok extends Input> extends WalkTokenSet<Tok> {
}
static class First<Tok extends Input> extends WalkTokenSet<Tok> {
@@
-149,7
+155,7
@@
abstract class Walk<T> {
if (e instanceof Sequence) {
Sequence s = (Sequence)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().underlying());
}
if (c != null && e==me) {
}
if (c != null && e==me) {