public override CalcExpression Optimize()
 {
     _expr = _expr.Optimize();
     return(_expr._token.Type == Tktype.LITERAL
         ? new CalcExpression(this.Evaluate())
         : this);
 }
Ejemplo n.º 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);
        }
 public CalcUnaryExpression(Token tk, CalcExpression expr) : base(tk)
 {
     _expr = expr;
 }
Ejemplo n.º 4
0
 public CalcBinaryExpression(Token tk, CalcExpression exprLeft, CalcExpression exprRight) : base(tk)
 {
     _lft = exprLeft;
     _rgt = exprRight;
 }