* @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
**/
- public static Sequence rewritingSequence(Object tag, Element[] e, boolean[] drops, HashSet<Sequence> and, HashSet<Sequence> not) {
- return new RewritingSequence(tag, e, drops, and, not); }
+ public static Sequence rewritingSequence(Object tag, Element[] e, boolean[] drops) { return new RewritingSequence(tag, e, drops, null, null); }
////////////////////////////////////////////////////////////////////////////////
for(Sequence s : not) ret = ret.not(s);
}
else if (unwrap) ret = new Sequence.Unwrap(expansion, drops, and, not);
- else if (tag!=null) ret = Sequence.rewritingSequence(tag, expansion, drops, and, not);
- else {
+ else if (tag!=null) {
+ ret = Sequence.rewritingSequence(tag, expansion, drops);
+ for(Sequence s : and) ret = ret.and(s);
+ for(Sequence s : not) ret = ret.not(s);
+ } else {
int idx = -1;
for(int i=0; i<expansion.length; i++)
if (!drops[i])