X-Git-Url: http://git.megacz.com/?p=sbp.git;a=blobdiff_plain;f=src%2Fedu%2Fberkeley%2Fsbp%2FWalk.java;h=0d4233a0f80c590cf49bec0586efcebbc5e6b214;hp=f8f8d4f70b744df742237abab48c354193abffc2;hb=888e9ccbab5f458a727c16da9d9291fd8951d909;hpb=96a2822a729e563a64173f22dc184bc972a200ef diff --git a/src/edu/berkeley/sbp/Walk.java b/src/edu/berkeley/sbp/Walk.java index f8f8d4f..0d4233a 100644 --- a/src/edu/berkeley/sbp/Walk.java +++ b/src/edu/berkeley/sbp/Walk.java @@ -97,20 +97,6 @@ abstract class Walk { } } - class Last extends WalkTokenSet { - public Last(Topology cs, Walk.Cache cache) { super(cs, cache); } - public Topology sequence(Sequence seq) { sequence(seq.firstp()); return cs; } - private Topology sequence(Position p) { - if (p==null) return null; - Topology ret = sequence(p.next()); - if (ret!=null) return ret; - if (p.isLast()) return null; - if (p.element().possiblyEpsilon(c)) return null; - if (p.element()==null) return null; - return walk(p.element()); - } - } - static class Follow extends WalkTokenSet { private final Element me; private final HashSet all; @@ -135,13 +121,11 @@ abstract class Walk { Topology cso = cs; boolean eofo = eof; - eof = false; + eof = c.eof.get(e) != null && c.eof.get(e).booleanValue(); cs = cso.empty(); - if (e instanceof Parser.Top) eof = true; for(Element x : all) { boolean matched = false; - if (x instanceof Parser.Top) walk(x); // because this symbol might not appear in any other Sequence if (!(x instanceof Sequence)) continue; Sequence a = (Sequence)x; Position mp = null;