X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Fedu%2Fberkeley%2Fsbp%2FAtom.java;h=cb7a379fd4748eaf9532c6eb804b4c75bc0d7d81;hb=a7b84506c2e1ed63343db215f76afced082e2826;hp=2589ddeabb9d435ff5e47a09531175b3d6a0d98f;hpb=b409afa0cf6d72a23703d9172812ab4fcd6a969b;p=sbp.git diff --git a/src/edu/berkeley/sbp/Atom.java b/src/edu/berkeley/sbp/Atom.java index 2589dde..cb7a379 100644 --- a/src/edu/berkeley/sbp/Atom.java +++ b/src/edu/berkeley/sbp/Atom.java @@ -8,7 +8,7 @@ import edu.berkeley.sbp.*; import edu.berkeley.sbp.*; /** an element which matches exactly one input token */ -public abstract class Atom extends Element implements Topology { +public abstract class Atom extends Element implements Topology { protected abstract Topology top(); public abstract String toString(); @@ -31,28 +31,18 @@ public abstract class Atom extends Element implements Topology< // Subclasses ////////////////////////////////////////////////////////////////////////////// - public static class Infer extends Atom { + public static class Infer extends Atom { private final Element e; public Infer(Element e) { this.e = e; } public Topology top() { return (Topology)e.toAtom(); } public String toString() { return e.toString(); /* FIXME should be toAtom() */ } } - public static class Invert extends Atom { + public static class Invert extends Atom { private final Atom a; public Invert(Atom a) { this.a = a; } public Topology top() { return ((Topology)a.top()).complement(); } public String toString() { return "~"+a; } } - - public static class Hack extends Atom { - private final Atom a; - static final Topology leftright = - edu.berkeley.sbp.misc.CharToken.rightBrace.union(edu.berkeley.sbp.misc.CharToken.leftBrace); - public Hack(Atom a) { this.a = a; } - public Topology top() { return ((Topology)a.top()).minus(leftright); } - public String toString() { return "~"+a; } - } - }