public void gen_for_controller(SemanticRec controllerRec, SemanticRec forDirection) {
        boolean increment = false;
        //determine whether or not to increment or decrement
        switch (forDirection.getRecType()) {
        case FOR_DIRECTION:
            if (forDirection.getDatum(0).equalsIgnoreCase(TokenType.MP_TO.toString())) {
                increment = true;
            } else if (forDirection.getDatum(0).equalsIgnoreCase(TokenType.MP_DOWNTO.toString())) {
                increment = false;
            } else {
                Parser.semanticError("Invalid FOR_DIRECTION: " + forDirection.getDatum(0));
            }
            break;
        default:
            Parser.semanticError("Cannot use non FOR_DIRECTION record type: " + forDirection.getRecType());
            break;
        }

        switch (controllerRec.getRecType()) {
        case IDENTIFIER:
            if (controllerRec.getDatum(0).equalsIgnoreCase(Classification.VARIABLE.toString())) {
                DataRow var = (DataRow) findSymbol(controllerRec.getDatum(1));
                String memLoc = generateOffset(findSymbolTable(var), var);
                if (increment) {
                    push(memLoc);
                    push("#1");
                    addStackI();
                    pop(memLoc);
                } else {
                    push(memLoc);
                    push("#1");
                    subStackI();
                    pop(memLoc);
                }
            } else {
                Parser.semanticError("Cannot use non-variable as control variable");
            }
            break;
        default:
            Parser.semanticError("Cannot use non-identifier for control variable");
            break;
        }
    }