View over a Qil parameter node.
상속: QilIterator
예제 #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));
        }
예제 #2
0
 protected virtual QilNode VisitParameterReference(QilParameter n)
 {
     return(n);
 }
예제 #3
0
 protected virtual QilNode VisitParameter(QilParameter n)
 {
     return(VisitChildren(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;
 }
예제 #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);
 }
예제 #6
0
파일: Focus.cs 프로젝트: geoffkizer/corefx
 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;
 }
예제 #7
0
파일: Focus.cs 프로젝트: geoffkizer/corefx
 public void StopFocus()
 {
     Debug.Assert(IsFocusSet, "Focus was not set");
     _isSet = false;
     _current = _position = _last = null;
 }
예제 #8
0
 protected virtual QilNode VisitParameter(QilParameter n) { return VisitChildren(n); }
예제 #9
0
 protected virtual QilNode VisitParameterReference(QilParameter n) { return 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;
 }
예제 #11
0
 protected override QilNode VisitParameterReference(QilParameter n) { return NoReplace(n); }
예제 #12
0
 public void StopFocus() {
     Debug.Assert(IsFocusSet, "Focus was not set");
     isSet = false;
     this.current = this.position = this.last = null;
 }
예제 #13
0
 protected override QilNode VisitParameterReference(QilParameter n)
 {
     return(NoReplace(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;
 }
예제 #15
0
 /// <summary>
 /// Generate code for a QilNodeType.Parameter.
 /// </summary>
 protected override QilNode VisitParameter(QilParameter ndParameter)
 {
     // Same as For
     return VisitFor(ndParameter);
 }
예제 #16
0
 protected override QilNode VisitParameter(QilParameter n) { return NoReplace(n); }