X-Git-Url: http://git.megacz.com/?p=sbp.git;a=blobdiff_plain;f=src%2Fedu%2Fberkeley%2Fsbp%2FWalk.java;h=b7f147d24bec667a4117b5fa1cb684fc7719ba53;hp=4f133a4d47865640ef8e73da7597b531631129a7;hb=6af4164b09ae19edb1154f5d80180eb4907fe143;hpb=6b53048f4413f3c618acc3581d0b4f60a236a9bc diff --git a/src/edu/berkeley/sbp/Walk.java b/src/edu/berkeley/sbp/Walk.java index 4f133a4..b7f147d 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; @@ -138,10 +124,10 @@ abstract class Walk { eof = false; cs = cso.empty(); - if (e instanceof Parser.Table.Top) eof = true; + if (e instanceof Parser.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 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;