public SemanticRec gen_addOp(SemanticRec left, SemanticRec addOp, SemanticRec right)
    {

        SemanticRec[] results = gen_cast(left, right); //generates casting operations if needed
        Type resultType = getTypeFromSR(results[0]); //both sides should have equal types
        String op = addOp.getDatum(0);
        switch (resultType)
        {
        case INTEGER:
            switch (op)
            {
            case "MP_MINUS":
                subStackI();
                break;
            case "MP_PLUS":
                addStackI();
                break;
            default:
                Parser.semanticError(op + " is not a adding operator for type " + resultType);
            }
            break;
        case FLOAT:
            switch (op)
            {
            case "MP_MINUS":
                subStackF();
                break;
            case "MP_PLUS":
                addStackF();
                break;
            default:
                Parser.semanticError(op + " is not a adding operator for type " + resultType);
            }
            break;
        case BOOLEAN:
            switch (op)
            {
            case "MP_OR":
                or();
                break;
            default:
                Parser.semanticError(op + " is not a adding operator for type " + resultType);
            }
            break;
        default:
            Parser.semanticError(resultType + "does not have an adding operation");
        }
        return new SemanticRec(RecordType.LITERAL, resultType.toString());
    }