if (operatorStack.isEmpty())
throw new ParseException("Miss left parenthesis", offset);
Operator operator = operatorStack.pop(); // 将优先级高于及等于当前操作符的弹出
if (operator instanceof BinaryOperator) {
Token token = operatorTokens.get(operator);
BinaryOperator binaryOperator = (BinaryOperator) operator;
if (parameterStack.isEmpty())
throw new ParseException("Binary operator " + binaryOperator.getName() + " miss parameter", token == null ? offset : getTokenOffset(token));
binaryOperator.setRightParameter(parameterStack.pop()); // right first
if (parameterStack.isEmpty())
throw new ParseException("Binary operator " + binaryOperator.getName() + " miss parameter", token == null ? offset : getTokenOffset(token));
binaryOperator.setLeftParameter(parameterStack.pop());
parameterStack.push(operator);
} else if (operator instanceof UnaryOperator) {
Token token = operatorTokens.get(operator);
UnaryOperator unaryOperator = (UnaryOperator) operator;
if (parameterStack.isEmpty())