// getValue
// Gets the value of the number/expression at the current position
// If the current value is an integer, return it
// If it's a parenthetical expression, evaluate, and return
// evalMultiplication is a flag used to ensure multiplication happens before addition
// If true, it will handle any multiplication that is applied to the current value
// That way, what is returned to the addition function is what we actually want to add
// Parameters:
//     iter  - the iterator for the list of tokens
//     postExpr - the postfix expression we are converting to
//     evalMultiplication (input boolean) whether to evaluate multiplication, see above
// Pre-condition:  expr[pos] is an int or parenthesis
// Post-condition: expr[pos] is the end of the value
//                     If it was an int, it's on the int
//                     If it was a parenthesis, it's on the end parenthesis
//                     If handling multiplication, it's on the last multiplied int
//                 postExpr has the values handled here pushed to it
void getValue(ListIterator& iter, TokenList& postExpr, bool evalMultiplication)
{
    bool negative = false;

    if (!iter.currentIsInteger() && iter.tokenChar() == '-')
    {
        negative = true;
        iter.advance();
    }

    if (iter.currentIsInteger())
    {
        postExpr.push_back(iter.integerValue());

        if (negative)
        {
            postExpr.push_back(Token('~'));
        }

        while (evalMultiplication && isNextOperatorMultiplication(iter))
        {
            iter.advance();
            handleMultiplyLevelOperation(iter, postExpr);
        }
    }
    else
    {
        handleParenthesis(iter, postExpr);

        if (negative)
        {
            postExpr.push_back(Token('~'));
        }
    }
}