final private Expression evaluatePostfix() throws InvalidInputException
	{
		Stack<Expression> expressionStack = new Stack<Expression>();
		while (this.m_outputQueue.hasNext())
		{
			Token nextToken = this.m_outputQueue.pop();
			if (nextToken instanceof Number)
			{
				expressionStack.push((Number) nextToken);
			} else if (nextToken instanceof Function)
			{
				int numberOfArguments = ((Function) nextToken).getNumberOfArguments();
				Expression[] arguments = new Expression[numberOfArguments];
				for (int argIndex = numberOfArguments - 1; argIndex >= 0; argIndex--)
				{
					arguments[argIndex] = expressionStack.pop();
				}
				Expression functionResult = ((Function) nextToken).evaluate(arguments);
				expressionStack.push(functionResult);
			} else if (nextToken instanceof Operator)
			{
				//should not read any opening parenthesis or else there is a syntax error
				if (nextToken instanceof OPENING_PARENTHESIS)
				{
					throw new InvalidInputException(Text.CALCULATIONS.MISSING_CLOSE_PARENTHESIS);
				}
				Expression secondOperand = expressionStack.pop();
				Expression firstOperand = expressionStack.pop();
				Expression operationResult = ((Operator) nextToken).evaluate(firstOperand, secondOperand);
				expressionStack.push(operationResult);
			}
		}
		Expression result = expressionStack.pop();
		if (expressionStack.hasNext())
		{
			throw new InvalidInputException(Text.CALCULATIONS.SYNTAX_ERROR);
		}
		return result;
	}