public virtual ExecuteAction Execute(IExecutorContext context) { this._currentIndex++; if (this._currentIndex == this._node.OperandCount) { OPCTrendLib.Result[] argArray = new OPCTrendLib.Result[this._node.OperandCount]; for (int i = 0; i < this._node.OperandCount; i++) { argArray[i] = this._subVisitors[i].Result; } this.EndVisit(this._node.Expression.Eval((Evaluator)context, argArray)); return(ExecuteAction.End); } if (this._currentIndex > this._node.OperandCount) { throw new InvalidOperationException(); } ExprNode node = (ExprNode)this._node.Operands[this._currentIndex]; this._subVisitors[this._currentIndex] = context.CreateExecutor(node); context.Push(this._subVisitors[this._currentIndex]); return(ExecuteAction.Continue); }
protected void EndVisit(OPCTrendLib.Result result) { this._result = result; this._subVisitors = null; }