private static Expression ReadVariable(XmlExpressionReader reader)
        {
            string name = reader.ReadInnerText();
            Type   type = reader.GetVariableType(name);

            return(Variable(type, name));
        }
        private static ParameterExpression ReadDefineVariable(XmlExpressionReader reader)
        {
            Type   type = reader.ReadAttributeValue <Type>("type");
            string name = reader.ReadInnerText();

            reader.Context.AddVariable(type, name);

            return(Variable(type, name));
        }
        private static Expression ReadConstant(XmlExpressionReader reader)
        {
            Type   type = reader.ReadAttributeValue <Type>("type");
            object value;
            var    node = reader.Node;

            value = reader.ChangeType(node, reader.ReadInnerText(), type);
            return(Constant(value, type));
        }
        private static Expression ReadType(XmlExpressionReader reader)
        {
            string typeName = reader.ReadInnerText();

            Type type = FindType(typeName);

            if (type == null)
            {
                throw new InvalidConvertReadException(reader.Node, typeName, typeof(Type));
            }
            return(Constant(type, type));
        }