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