- /** after matching the sequence, place the result of the <tt>idx</tt>th match in the output tree */
- public static Sequence singleton(Element[] e, int idx) { return new Singleton(e, idx); }
+ Atom follow = null;
+
+ // Static Constructors //////////////////////////////////////////////////////////////////////////////
+
+ /** create a sequence of one element */
+ public static Sequence create(Element e) { return create(new Element[] { e }, 0); }
+
+ /** create a sequence which drops the result of all but one of its element */
+ public static Sequence create(Element[] e, int which) { return new Singleton(e, which); }
+
+ /** create a sequence which always evaluates to a constant result */
+ public static Sequence create(Element[] e, Object result) { return new Constant(e, result); }