X-Git-Url: http://git.megacz.com/?p=sbp.git;a=blobdiff_plain;f=src%2Fedu%2Fberkeley%2Fsbp%2FRepeat.java;h=037e67d58b06571328e674d05eb0cbe2cd8fbacb;hp=2028847687365b575cde41122a3ea98405bf2280;hb=b8a597c8d1a29afc24f9b89f726d5b1a9b9aeec1;hpb=23091054a6842031d168c2628216c2310149cc5d 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; } - } }