-
- public static class Hack<T extends Token> extends Atom<T> {
- private final Atom<T> a;
- static final Topology leftright =
- edu.berkeley.sbp.misc.CharToken.rightBrace.union(edu.berkeley.sbp.misc.CharToken.leftBrace);
- public Hack(Atom<T> a) { this.a = a; }
- public Topology<T> top() { return ((Topology<T>)a.top()).minus(leftright); }
- public String toString() { return "~"+a; }
+
+ static Topology toAtom(Element e) {
+ if (e instanceof Atom) return (Atom)e;
+ if (e instanceof Sequence) return ((Sequence)e).toAtom();
+ Topology ret = null;
+ for(Sequence s : (Union)e)
+ ret = ret==null ? toAtom(s) : ret.union(s.toAtom());
+ return ret;