private AssignmentStatement createAssignment(String name, Expression expr) {
            // get info
            Type type = expr.getType();
            SourceInfo info = expr.getSourceInfo();

            // create variable
            Variable var = new Variable(info, name, type);
            generate(var);

            // create reference
            VariableRef ref = new VariableRef(info, name);
            ref.setVariable(var);

            // create assignment
            AssignmentStatement stmt = new AssignmentStatement(info, ref, expr);
            generate(stmt);

            // return assignment
            return stmt;
        }