//----------------------------------------------- // 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)); }
protected virtual QilNode VisitParameterReference(QilParameter n) { return(n); }
protected virtual QilNode VisitParameter(QilParameter n) { return(VisitChildren(n)); }
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; }
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); }
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; }
public void StopFocus() { Debug.Assert(IsFocusSet, "Focus was not set"); _isSet = false; _current = _position = _last = null; }
protected virtual QilNode VisitParameter(QilParameter n) { return VisitChildren(n); }
protected virtual QilNode VisitParameterReference(QilParameter n) { return n; }
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; }
protected override QilNode VisitParameterReference(QilParameter n) { return NoReplace(n); }
public void StopFocus() { Debug.Assert(IsFocusSet, "Focus was not set"); isSet = false; this.current = this.position = this.last = null; }
protected override QilNode VisitParameterReference(QilParameter n) { return(NoReplace(n)); }
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; }
/// <summary> /// Generate code for a QilNodeType.Parameter. /// </summary> protected override QilNode VisitParameter(QilParameter ndParameter) { // Same as For return VisitFor(ndParameter); }
protected override QilNode VisitParameter(QilParameter n) { return NoReplace(n); }