X-Git-Url: http://git.megacz.com/?p=sbp.git;a=blobdiff_plain;f=src%2Fedu%2Fberkeley%2Fsbp%2FRepeat.java;fp=src%2Fedu%2Fberkeley%2Fsbp%2FRepeat.java;h=037e67d58b06571328e674d05eb0cbe2cd8fbacb;hp=2028847687365b575cde41122a3ea98405bf2280;hb=173e1696d10a91db6f5a919dbb2b2ed2c6e2a227;hpb=0e17670bcfa7b0fe8eb3a2cac81f4b080a09fc98 diff --git a/src/edu/berkeley/sbp/Repeat.java b/src/edu/berkeley/sbp/Repeat.java index 2028847..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 */ - 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; } - } }