+ # Consumes an iterator of expressions and tries to map each element to
+ # its corresponding Instance.
+ #
+ # If any AExprs doesn't resolve to an Instance, then it returns null.
+ # Otherwise return an array of instances
+ fun aexprs_to_instances(aexprs: Iterator[AExpr]): nullable Array[Instance]
+ do
+ var accumulator = new Array[Instance]
+ for aexpr in aexprs do
+ var instance = expr(aexpr)
+ if instance == null then return null
+ accumulator.push(instance)
+ end
+ return accumulator
+ end
+