X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=src%2Fedu%2Fberkeley%2Fsbp%2FRepeat.java;h=037e67d58b06571328e674d05eb0cbe2cd8fbacb;hb=173e1696d10a91db6f5a919dbb2b2ed2c6e2a227;hp=c85bfc6497dd140ab22b891e0e00a37e47a8c151;hpb=0c29e5bd879906ec108db3216c0f4979ed8315fb;p=sbp.git diff --git a/src/edu/berkeley/sbp/Repeat.java b/src/edu/berkeley/sbp/Repeat.java index c85bfc6..037e67d 100644 --- a/src/edu/berkeley/sbp/Repeat.java +++ b/src/edu/berkeley/sbp/Repeat.java @@ -41,21 +41,13 @@ class Repeat extends Union { if (zeroOkay && separator != null) throw new RuntimeException("cannot create a maximal repetition of zero or more items with a separator (yet): " + this); for(Sequence s : this) - s.follow = new Invert(separator); + s.follow = (Atom)separator.complement(); } public Maximal(final Atom e, boolean zeroOkay, boolean manyOkay, Object tag) { super(e, zeroOkay, manyOkay, null, true, tag); for(Sequence s : this) - s.follow = new Invert(e); + s.follow = (Atom)e.complement(); } } - - /** an atom which tracks the inverse of some other atom */ - private static class Invert extends Atom { - private final Atom a; - public Invert(Atom a) { this.a = a; } - public Topology top() { return a.complement(); } - public String toString() { return "~"+a; } - } }