View over a Qil parameter node.
Inheritance: QilIterator
Exemplo n.º 1
0
        //-----------------------------------------------
        // QilVisitor overrides
        //-----------------------------------------------

        /// <summary>
        /// Override certain node types in order to add additional attributes, suppress children, etc.
        /// </summary>
        protected override QilNode VisitChildren(QilNode node)
        {
            if (node is QilLiteral)
            {
                // If literal is not handled elsewhere, print its string value
                this.writer.WriteValue(Convert.ToString(((QilLiteral)node).Value, CultureInfo.InvariantCulture));
                return(node);
            }
            else if (node is QilReference)
            {
                QilReference reference = (QilReference)node;

                // Write the generated identifier for this iterator
                this.writer.WriteAttributeString("id", _ngen.NameOf(node));

                // Write the debug name of this reference (if it's defined) as a "name" attribute
                if (reference.DebugName != null)
                {
                    this.writer.WriteAttributeString("name", reference.DebugName.ToString());
                }

                if (node.NodeType == QilNodeType.Parameter)
                {
                    // Don't visit parameter's name, or its default value if it is null
                    QilParameter param = (QilParameter)node;

                    if (param.DefaultValue != null)
                    {
                        VisitAssumeReference(param.DefaultValue);
                    }

                    return(node);
                }
            }

            return(base.VisitChildren(node));
        }
Exemplo n.º 2
0
 protected virtual QilNode VisitParameterReference(QilParameter n)
 {
     return(n);
 }
Exemplo n.º 3
0
 protected virtual QilNode VisitParameter(QilParameter n)
 {
     return(VisitChildren(n));
 }
Exemplo n.º 4
0
 public XmlQueryType CheckParameter(QilParameter node) {
     Check(node.Binding == null || node.Binding.XmlType.IsSubtypeOf(node.XmlType), node, "Parameter binding's xml type must be a subtype of the parameter's type");
     return node.XmlType;
 }
Exemplo n.º 5
0
 public XmlQueryType CheckParameter(QilParameter node)
 {
     Check(node.Binding == null || node.Binding.XmlType.IsSubtypeOf(node.XmlType), node, "Parameter binding's xml type must be a subtype of the parameter's type");
     return(node.XmlType);
 }
Exemplo n.º 6
0
 public void StartFocus(IList<QilNode> args, XslFlags flags)
 {
     Debug.Assert(!IsFocusSet, "Focus was already set");
     int argNum = 0;
     if ((flags & XslFlags.Current) != 0)
     {
         _current = (QilParameter)args[argNum++];
         Debug.Assert(_current.Name.NamespaceUri == XmlReservedNs.NsXslDebug && _current.Name.LocalName == "current");
     }
     if ((flags & XslFlags.Position) != 0)
     {
         _position = (QilParameter)args[argNum++];
         Debug.Assert(_position.Name.NamespaceUri == XmlReservedNs.NsXslDebug && _position.Name.LocalName == "position");
     }
     if ((flags & XslFlags.Last) != 0)
     {
         _last = (QilParameter)args[argNum++];
         Debug.Assert(_last.Name.NamespaceUri == XmlReservedNs.NsXslDebug && _last.Name.LocalName == "last");
     }
     _isSet = true;
 }
Exemplo n.º 7
0
 public void StopFocus()
 {
     Debug.Assert(IsFocusSet, "Focus was not set");
     _isSet = false;
     _current = _position = _last = null;
 }
Exemplo n.º 8
0
 protected virtual QilNode VisitParameter(QilParameter n) { return VisitChildren(n); }
Exemplo n.º 9
0
 protected virtual QilNode VisitParameterReference(QilParameter n) { return n; }
Exemplo n.º 10
0
 private QilNode FindActualArg(QilParameter formalArg, IList<XslNode> actualArgs)
 {
     QilName argName = formalArg.Name;
     Debug.Assert(argName != null);
     foreach (XslNode actualArg in actualArgs)
     {
         if (actualArg.Name.Equals(argName))
         {
             return ((VarPar)actualArg).Value;
         }
     }
     return null;
 }
Exemplo n.º 11
0
 protected override QilNode VisitParameterReference(QilParameter n) { return NoReplace(n); }
Exemplo n.º 12
0
 public void StopFocus() {
     Debug.Assert(IsFocusSet, "Focus was not set");
     isSet = false;
     this.current = this.position = this.last = null;
 }
Exemplo n.º 13
0
 protected override QilNode VisitParameterReference(QilParameter n)
 {
     return(NoReplace(n));
 }
Exemplo n.º 14
0
 public QilParameter Parameter(QilNode defaultValue, QilNode name, XmlQueryType xmlType) {
     QilParameter n = new QilParameter(QilNodeType.Parameter, defaultValue, name, xmlType);
     n.XmlType = this.typeCheck.CheckParameter(n);
     TraceNode(n);
     return n;
 }
Exemplo n.º 15
0
 /// <summary>
 /// Generate code for a QilNodeType.Parameter.
 /// </summary>
 protected override QilNode VisitParameter(QilParameter ndParameter)
 {
     // Same as For
     return VisitFor(ndParameter);
 }
Exemplo n.º 16
0
 protected override QilNode VisitParameter(QilParameter n) { return NoReplace(n); }