X-Git-Url: http://git.megacz.com/?p=sbp.git;a=blobdiff_plain;f=src%2Fedu%2Fberkeley%2Fsbp%2FWalk.java;h=0d4233a0f80c590cf49bec0586efcebbc5e6b214;hp=4f133a4d47865640ef8e73da7597b531631129a7;hb=888e9ccbab5f458a727c16da9d9291fd8951d909;hpb=6b53048f4413f3c618acc3581d0b4f60a236a9bc diff --git a/src/edu/berkeley/sbp/Walk.java b/src/edu/berkeley/sbp/Walk.java index 4f133a4..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.Table.Top) eof = true; for(Element x : all) { boolean matched = false; - if (x instanceof Parser.Table.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;