src/org/nutz/el/arithmetic/ShuntingYard.java
private void parseOperator(Operator current){
        //空,直接添加进操作符队列
        if(opts.isEmpty()){
            opts.addFirst(current);
            return;
        }
        //左括号
        if(current instanceof LBracketOpt){
            opts.addFirst(current);
            return;
        }
        //遇到右括号
        if(current instanceof RBracketOpt){
            while(!opts.isEmpty() && !(opts.peek() instanceof LBracketOpt)){
                rpn.add(opts.poll());
            }
            opts.poll();
            return;
        }
        
        //符号队列top元素优先级大于当前,则直接添加到
        if(!opts.isEmpty() && opts.peek().fetchPriority() > current.fetchPriority()){
            opts.addFirst(current);
            return;
        }
        //一般情况,即优先级小于栈顶,那么直接弹出来,添加到逆波兰表达式中
        while(!opts.isEmpty() && opts.peek().fetchPriority() <= current.fetchPriority()){
            //三元表达式嵌套的特殊处理
            if(opts.peek() instanceof QuestionOpt && current instanceof QuestionOpt){
                break;
            }
            if(opts.peek() instanceof QuestionOpt && current instanceof QuestionSelectOpt){
                rpn.add(opts.poll());
                break;
            }
            rpn.add(opts.poll());
        }
        opts.addFirst(current);
    }
private void parseOperator(Operator current){
        //空,直接添加进操作符队列
        if(opts.isEmpty()){
            opts.addFirst(current);
            return;
        }
        //左括号
        if(current instanceof LBracketOpt){
            opts.addFirst(current);
            return;
        }
        //遇到右括号
        if(current instanceof RBracketOpt){
            while(!opts.isEmpty() && !(opts.peek() instanceof LBracketOpt)){
                rpn.add(opts.poll());
            }
            opts.poll();
            return;
        }
        
        //符号队列top元素优先级大于当前,则直接添加到
        if(!opts.isEmpty() && opts.peek().fetchPriority() > current.fetchPriority()){
            opts.addFirst(current);
            return;
        }
        //一般情况,即优先级小于栈顶,那么直接弹出来,添加到逆波兰表达式中
        while(!opts.isEmpty() && opts.peek().fetchPriority() <= current.fetchPriority()){
            //三元表达式嵌套的特殊处理
            if(opts.peek() instanceof QuestionOpt && current instanceof QuestionOpt){
                break;
            }
            if(opts.peek() instanceof QuestionOpt && current instanceof QuestionSelectOpt){
                rpn.add(opts.poll());
                break;
            }
            rpn.add(opts.poll());
        }
        opts.addFirst(current);
    }
转换操作符.
根据 ShuntingYard 算法进行操作
@param current