for(Sequence s : needs) { ret.needs.add(s); s.needed.add(ret); }
for(Sequence s : hates) { ret.hates.add(s); s.hated.add(ret); }
ret.follow = follow;
+ ret.lame = lame;
return ret;
}
* after matching the sequence, create the specified output tree
* @param tag the tag for the output tree
* @param e the elements to match
- * @param drops only elements of <tt>e</tt> whose corresponding <tt>boolean</tt> in <tt>drops</tt> is <i>false</i> will be included in the output tree
+ * @param drops only elements of <tt>e</tt> whose corresponding <tt>boolean</tt> in <tt>drops</tt>
+ * is <i>false</i> will be included in the output tree
**/
public static Sequence rewritingSequence(Object tag, Element[] e, Object[] labs, boolean[] drops) {
return new RewritingSequence(tag, e, labs, drops); }
public final Topology follow() { return follow==null ? null : Atom.toAtom(follow); }
Topology toAtom() {
- if (elements.length!=1) throw new RuntimeException("cannot invoke toAtom() on a Sequence with " + elements.length + " elements: " + this);
+ if (elements.length!=1)
+ throw new RuntimeException("cannot invoke toAtom() on a Sequence with " + elements.length + " elements: " + this);
return Atom.toAtom(elements[0]);
}
protected final Element[] elements;
final HashSet<Sequence> needed = new HashSet<Sequence>();
- final HashSet<Sequence> hated = new HashSet<Sequence>();
- final HashSet<Sequence> needs = new HashSet<Sequence>();
- final HashSet<Sequence> hates = new HashSet<Sequence>();
+ final HashSet<Sequence> hated = new HashSet<Sequence>();
+ final HashSet<Sequence> needs = new HashSet<Sequence>();
+ final HashSet<Sequence> hates = new HashSet<Sequence>();
public boolean lame = false;
final Position firstp;
if (holder[i]==null) throw new Error("bad " + i);
}
Forest<T> ret = Sequence.this.postReduce(loc, holder, this);
- for(int k=0; k<pos; k++) holder[k] = null; // to help GC
+ //for(int k=0; k<pos; k++) holder[k] = null; // to help GC
return ret;
}