{start = args[arg].getStringValue();}
final FunctionReference ref = (FunctionReference) args[++arg].itemAt(0);
final int max = ((IntegerValue) args[++arg].itemAt(0)).getInt();
final Sequence result = new ValueSequence();
try {
Occurrences occur[] = context.getBroker().getTextEngine().scanIndexTerms(docs, nodes, qnames, start, null);
if (args.length == 4) {
Occurrences occur2[] = context.getBroker().getTextEngine().scanIndexTerms(docs, nodes, start, null);
if (occur == null || occur.length == 0)
{occur = occur2;}
else {
Occurrences t[] = new Occurrences[occur.length + occur2.length];
System.arraycopy(occur, 0, t, 0, occur.length);
System.arraycopy(occur2, 0, t, occur.length, occur2.length);
occur = t;
}
}