示例#1
0
 private void CheckMatch(InstanceTreeNode node)
 {
     if (node is StructInstance)
     {
         var instance = (StructInstance)node;
         if (instance.Def == _def && (_expr == null || _expr.EvaluateBool(instance)))
         {
             _results.Add(instance);
         }
     }
 }
示例#2
0
        public override IConvertible Evaluate(IEvaluateContext context)
        {
            switch (_operation)
            {
            case ExprTokenType.Minus:
                return(-_operand.EvaluateInt(context));

            case ExprTokenType.NOT:
                return(!_operand.EvaluateBool(context));
            }
            throw new Exception("Unexpected unary operation " + _operation);
        }
示例#3
0
 public override IConvertible Evaluate(IEvaluateContext context)
 {
     return(_condition.EvaluateBool(context) ? _trueValue.Evaluate(context) : _falseValue.Evaluate(context));
 }