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); } } }
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); }
public override IConvertible Evaluate(IEvaluateContext context) { return(_condition.EvaluateBool(context) ? _trueValue.Evaluate(context) : _falseValue.Evaluate(context)); }