return make(first, next, annos);
}
protected boolean match(ATerm pattern, List<Object> list) {
if (pattern.getType() == LIST) {
ATermList l = (ATermList) pattern;
if (l.isEmpty()) {
return this.isEmpty();
}
if (l.getFirst().getType() == PLACEHOLDER) {
ATerm ph_type = ((ATermPlaceholder) l.getFirst()).getPlaceholder();
if (ph_type.getType() == APPL) {
ATermAppl appl = (ATermAppl) ph_type;
if (appl.getName().equals("list")
&& appl.getArguments().isEmpty()) {
list.add(this);
return true;
}
}
}
if (!isEmpty()) {
List<Object> submatches = first.match(l.getFirst());
if (submatches == null) {
return false;
}
list.addAll(submatches);
submatches = next.match(l.getNext());
if (submatches == null) {
return false;
}
list.addAll(submatches);
return true;
}
return l.isEmpty();
}
return super.match(pattern, list);
}