public override CalcExpression Optimize()
 {
     _expr = _expr.Optimize();
     return(_expr._token.Type == Tktype.LITERAL
         ? new CalcExpression(this.Evaluate())
         : this);
 }
Пример #2
0
        public override CalcExpression Optimize()
        {
            _lft = _lft.Optimize();
            _rgt = _rgt.Optimize();

            return(_lft._token.Type == Tktype.LITERAL && _rgt._token.Type == Tktype.LITERAL
                ? new CalcExpression(this.Evaluate())
                : this);
        }