private static Initializer makeInitializer(BasicType baseType,
ArrayInfo arrayInfo,
List<Number> args) {
if (arrayInfo != null) {
assert arrayInfo.getSize() * baseType.getNumElements() == args.size();
List<Expr> argExprs = new ArrayList<>();
for (int index = 0; index < arrayInfo.getSize(); index++) {
argExprs.add(getBasicTypeLiteralExpr(baseType,
args.subList(index * baseType.getNumElements(),
(index + 1) * baseType.getNumElements())));
}
return new ScalarInitializer(new ArrayConstructorExpr(
new ArrayType(baseType.getWithoutQualifiers(), arrayInfo.clone()),
argExprs));
}
return new ScalarInitializer(getBasicTypeLiteralExpr(baseType, args));
}