current = current.getNextLexicalUnit();
continue inputTermLoop;
}
}
throw new ArithmeticException();
}
if (current.getLexicalUnitType() == SCSSLexicalUnit.SCSS_OPERATOR_LEFT_PAREN) {
operators.push(Parentheses.LEFT);
current = current.getNextLexicalUnit();
continue;
}
afterOperand = true;
operands.push(current);
current = current.getNextLexicalUnit();
}
while (!operators.isEmpty()) {
Object operator = operators.pop();
if (operator == Parentheses.LEFT) {
throw new ArithmeticException("Unexpected \"(\" found");
}
createNewOperand((BinaryOperator) operator, operands);
}
Object expression = operands.pop();
if (!operands.isEmpty()) {
LexicalUnitImpl operand = (LexicalUnitImpl) operands.peek();
throw new ArithmeticException("Unexpected operand "
+ operand.toString() + " found");
}
return expression;
}