return new CFListIterator(TreeAdapter.getArgs(tree), 1);
}
}
}
throw new NotEnumerable(subjectType.toString(), ctx.getCurrentAST());
// Node and ADT
} else if(subjectType.isNode() || subjectType.isAbstractData()){
if (shallow){
if(subjectType.isAbstractData())
checkMayOccur(patType, subjectType, ctx);
return new NodeChildIterator((INode) subjectValue);
}
return new DescendantReader(subjectValue, false);
} else if(subjectType.isTuple()){
if(shallow){
Type lub = TypeFactory.getInstance().voidType();
int nElems = subjectType.getArity();
for(int i = 0; i < nElems; i++)
lub = lub.lub(subjectType.getFieldType(i));
if(!lub.comparable(patType))
throw new UnexpectedType(patType, subjectType, ctx.getCurrentAST());
return new TupleElementIterator((ITuple)subjectValue);
}
return new DescendantReader(subjectValue, false);
} else if(subjectType.isBool() ||
subjectType.isInteger() ||
subjectType.isReal() ||
subjectType.isString() ||
subjectType.isSourceLocation() ||
subjectType.isRational() ||
subjectType.isDateTime())
{
if (shallow) {
throw new NotEnumerable(subjectType.toString(), ctx.getCurrentAST());
}
return new SingleIValueIterator(subjectValue);
} else {
throw new UnsupportedOperation("makeIterator", subjectType, ctx.getCurrentAST());
}