added arbitrary expression inversion, lookforward, and syntax for lookback
[sbp.git] / src / edu / berkeley / sbp / Sequence.java
index 9586f72..e18f5ef 100644 (file)
@@ -35,8 +35,11 @@ public abstract class Sequence extends Element implements Iterable<Element> {
 
     ////////////////////////////////////////////////////////////////////////////////
 
+    public Element noFollow = null;
+    public final Topology noFollow() { return noFollow==null ? null : noFollow.toAtom(); }
+
     Topology toAtom() {
-        if (elements.length!=1) return null;
+        if (elements.length!=1) throw new RuntimeException("cannot invoke toAtom() on a Sequence with " + elements.length + " elements: " + this);
         return elements[0].toAtom();
     }