public override RuntimeValueWrapper Execute(RuntimeContext context)
        {
            RuntimeInvokableValue.IncompletedExpression incompletedExpression = new RuntimeInvokableValue.IncompletedExpression()
            {
                Context = new RuntimeContext()
                {
                    PreviousContext = context
                },
                Expression = Expression,
                Patterns   = Parameters.Select(n => (Expression) new IdentifierExpression()
                {
                    Name = n
                }).ToList(),
            };
            RuntimeInvokableValue value = new RuntimeInvokableValue();

            value.IncompletedExpressions.Add(incompletedExpression);
            return(new RuntimeValueWrapper(value, context));
        }
        public override void BuildContext(RuntimeContext context)
        {
            RuntimeInvokableValue invokableValue = null;

            if (context.Values.ContainsKey(Name))
            {
                RuntimeValueWrapper valueWrapper = context.Values[Name];
                invokableValue = valueWrapper.Value as RuntimeInvokableValue;
                if (invokableValue == null || this.Patterns.Count == 0)
                {
                    throw new Exception(string.Format("{0}不可重复定义。", Name));
                }
            }
            if (this.Patterns.Count == 0)
            {
                context.Values.Add(Name, new RuntimeValueWrapper(new RuntimeUnevaluatedValue(Expression), context));
            }
            else
            {
                if (invokableValue == null)
                {
                    invokableValue = new RuntimeInvokableValue();
                    context.Values.Add(Name, new RuntimeValueWrapper(invokableValue, context));
                }

                RuntimeInvokableValue.IncompletedExpression incompletedExpression = new RuntimeInvokableValue.IncompletedExpression()
                {
                    Context = new RuntimeContext()
                    {
                        PreviousContext = context
                    },
                    Expression = Expression,
                    Patterns   = new List <Expression>(Patterns),
                };
                invokableValue.IncompletedExpressions.Add(incompletedExpression);
            }
        }