elements.add(0,
elements.add(elements.size(),
    private List stmtsForConstructor(FEContext ctx, Expression name,                                     Type type, Expression init,                                      boolean arrayConstructor)    {        List result = new java.util.ArrayList();        // If the type doesn't involve a constructor, there are no        // generated statements.                String field_name = null;        if (name instanceof ExprVar)            field_name = ((ExprVar) name).getName();        if (!needsConstructor(type, init))            return result;        // No; generate the constructor.        if (!libraryFormat || (arrayConstructor || !(type instanceof TypeArray)))             {                // Instead of constructing here, as in new int[][],                // it should just assign the variable to reference                // a global copy initialized to zero.                if (libraryFormat &&                     !special_global &&                     type instanceof TypeArray &&                     field_name != null &&                      activeStreamName != null &&                     immutableDetector.isImmutable(activeStreamName, field_name))                    {                        String tempVar = varGen.nextVar();                        Expression varExp = new ExprVar(ctx, tempVar);                        List elements = new ArrayList();                        Type base = type;                        while (base instanceof TypeArray)                         {                            elements.add(0,                                          ((TypeArray) base).getLength()                                );                            base = ((TypeArray) base).getBase();                        }                        result.add(                            new StmtVarDecl(                                ctx,                                new TypeArray(new TypePrimitive(TypePrimitive.TYPE_INT),                                              new ExprConstInt(elements.size())),                                tempVar,                                new ExprArrayInit(ctx,                                                  elements))                            );                        result.add(                            new StmtAssign(                                ctx,                                name,                                new ExprTypeCast(                                    ctx,                                    type,                                    new ExprFunCall(                                        ctx,                                        "ArrayMemoizer.initArray",                                        new ExprJavaConstructor(                                            ctx,                                            new TypeArray(((TypeArray) type).getComponent(), new ExprConstInt(0))                                            ),                                        varExp                                        )                                    )                                )                            );                    }                else                    {                        result.add(new StmtAssign(ctx, name,                                                  new ExprJavaConstructor(ctx, type)));                    }            }        // Now, if this is a structure type, we might need to        // recursively generate constructors for the structure        // members.        if (type instanceof TypeStruct)            {                TypeStruct ts = (TypeStruct)type;                for (int i = 0; i < ts.getNumFields(); i++)                    {                        String fname = ts.getField(i);                        Type ftype = ts.getType(fname);                        if (needsConstructor(ftype))                            {                                // Construct the new left-hand side:                                Expression lhs = new ExprField(ctx, name, fname);                                // Get child constructors and add them:                                result.addAll(stmtsForConstructor(ctx, lhs, ftype, null, true));                            }                    }            }        // Or, if this is an array of structures, we might need to        // recursively generate constructors.        if (libraryFormat && (type instanceof TypeArray))            {                TypeArray ta = (TypeArray) type;                Type base = ta.getBase();                if (needsConstructor(base))                    {                        // The length might be non-constant.  This means that                        // we need to do this by looping through the array.                        String tempVar = varGen.nextVar();                        Expression varExp = new ExprVar(ctx, tempVar);                        Statement decl =                            new StmtVarDecl(ctx,                                            new TypePrimitive(TypePrimitive.TYPE_INT),                                            tempVar,                                            new ExprConstInt(ctx, 0));                        Expression cond =                            new ExprBinary(ctx,                                           ExprBinary.BINOP_LT,                                           varExp,                                           ta.getLength());                        Statement incr =                            new StmtExpr(ctx,                                         new ExprUnary(ctx,                                                       ExprUnary.UNOP_POSTINC,                                                       varExp));                        Expression lhs = new ExprArray(ctx, name, varExp);                        Statement body =                            new StmtBlock(ctx,                                          stmtsForConstructor(ctx, lhs, base, null, false));                        Statement loop =                            new StmtFor(ctx, decl, cond, incr, body);                        result.add(loop);                    }            }                return result;    }