Пример #1
0
        private bool TryBinaryOperator(string word)
        {
            BinaryOperatorDef def = this.ctx.GetBinaryOperator(word);

            if (def == null)
            {
                return(false);
            }

            IExpressionElement left = this.stk_parse.PopOperand(def.prioL, def.assocR);

            if (left == null)
            {
                return(false);
            }

            this.stk_parse.Push(new BinaryPrefixElement(def, left));
            return(true);
        }
Пример #2
0
 public BinaryPrefixElement(BinaryOperatorDef def, IExpressionElement left)
 {
     this.priority = def.prioR;
     this.op       = def.word;
     this.left     = left.Expression;
 }