public QilList Sequence(IList <QilNode> values) { QilList seq = Sequence(); seq.Add(values); return(seq); }
public QilList FormalParameterList(IList <QilNode> values) { QilList seq = FormalParameterList(); seq.Add(values); return(seq); }
public QilList SortKeyList(IList <QilNode> values) { QilList seq = SortKeyList(); seq.Add(values); return(seq); }
public QilList BranchList(IList <QilNode> values) { QilList seq = BranchList(); seq.Add(values); return(seq); }
public QilList FunctionList(IList <QilNode> values) { QilList seq = FunctionList(); seq.Add(values); return(seq); }
public QilList GlobalVariableList(IList <QilNode> values) { QilList seq = GlobalVariableList(); seq.Add(values); return(seq); }
public QilNode XsltInvokeEarlyBound(QilNode name, MethodInfo d, XmlQueryType t, IList <QilNode> args) { QilList list = f.ActualParameterList(); list.Add(args); return(f.XsltInvokeEarlyBound(name, f.LiteralObject(d), list, t)); }
public QilNode XsltInvokeLateBound(QilNode name, IList <QilNode> args) { QilList list = f.ActualParameterList(); list.Add(args); return(f.XsltInvokeLateBound(name, list)); }
public QilList FormalParameterList(QilNode arg1) { QilList result = f.FormalParameterList(); result.Add(arg1); return(result); }
public QilList SortKeyList(QilSortKey key) { QilList list = f.SortKeyList(); list.Add(key); return(list); }
public QilList ActualParameterList(QilNode arg1) { QilList result = _f.ActualParameterList(); result.Add(arg1); return(result); }
public QilNode GenerateInvoke(QilFunction func, IList<XslNode> actualArgs) { _iterStack.Clear(); _formalArgs = func.Arguments; _invokeArgs = _fac.ActualParameterList(); // curArg is an instance variable used in Clone() method for (_curArg = 0; _curArg < _formalArgs.Count; _curArg++) { // Find actual value for a given formal arg QilParameter formalArg = (QilParameter)_formalArgs[_curArg]; QilNode invokeArg = FindActualArg(formalArg, actualArgs); // If actual value was not specified, use the default value and copy its debug comment if (invokeArg == null) { if (_debug) { if (formalArg.Name.NamespaceUri == XmlReservedNs.NsXslDebug) { Debug.Assert(formalArg.Name.LocalName == "namespaces", "Cur,Pos,Last don't have default values and should be always added to by caller in AddImplicitArgs()"); Debug.Assert(formalArg.DefaultValue != null, "PrecompileProtoTemplatesHeaders() set it"); invokeArg = Clone(formalArg.DefaultValue); } else { invokeArg = _fac.DefaultValueMarker(); } } else { Debug.Assert(formalArg.Name.NamespaceUri != XmlReservedNs.NsXslDebug, "Cur,Pos,Last don't have default values and should be always added to by caller in AddImplicitArgs(). We don't have $namespaces in !debug."); invokeArg = Clone(formalArg.DefaultValue); } } XmlQueryType formalType = formalArg.XmlType; XmlQueryType invokeType = invokeArg.XmlType; // Possible arg types: anyType, node-set, string, boolean, and number _fac.CheckXsltType(formalArg); _fac.CheckXsltType(invokeArg); if (!invokeType.IsSubtypeOf(formalType)) { // This may occur only if inferred type of invokeArg is XslFlags.None Debug.Assert(invokeType == T.ItemS, "Actual argument type is not a subtype of formal argument type"); invokeArg = _fac.TypeAssert(invokeArg, formalType); } _invokeArgs.Add(invokeArg); } // Create Invoke node and wrap it with previous parameter declarations QilNode invoke = _fac.Invoke(func, _invokeArgs); while (_iterStack.Count != 0) invoke = _fac.Loop(_iterStack.Pop(), invoke); return invoke; }
public void Reset() { Debug.Assert(!_inUse); _inUse = true; _builder.Length = 0; _concat = null; }
public QilList GlobalParameterList() { QilList n = new QilList(QilNodeType.GlobalParameterList); n.XmlType = QilTypeChecker.CheckGlobalParameterList(n); TraceNode(n); return(n); }
public QilList ActualParameterList() { QilList n = new QilList(QilNodeType.ActualParameterList); n.XmlType = _typeCheck.CheckActualParameterList(n); TraceNode(n); return(n); }
public QilList Sequence() { QilList n = new QilList(QilNodeType.Sequence); n.XmlType = this.typeCheck.CheckSequence(n); TraceNode(n); return(n); }
public QilNode Sequence(QilNode child1, QilNode child2) { QilList res = _f.Sequence(); res.Add(child1); res.Add(child2); return(res); }
public QilList GlobalVariableList() { QilList n = new QilList(QilNodeType.GlobalVariableList); n.XmlType = this.typeCheck.CheckGlobalVariableList(n); TraceNode(n); return(n); }
public override QilNode ShallowClone(QilFactory f) { QilList n = (QilList)MemberwiseClone(); n._members = (QilNode[])_members.Clone(); f.TraceNode(n); return(n); }
public XmlQueryType CheckFormalParameterList(QilList node) { foreach (QilNode child in node) { CheckClassAndNodeType(child, typeof(QilParameter), QilNodeType.Parameter); } return(node.XmlType); }
public XmlQueryType CheckFunctionList(QilList node) { foreach (QilNode child in node) { CheckClassAndNodeType(child, typeof(QilFunction), QilNodeType.Function); } return(node.XmlType); }
public XmlQueryType CheckGlobalVariableList(QilList node) { foreach (QilNode child in node) { CheckClassAndNodeType(child, typeof(QilIterator), QilNodeType.Let); } return(node.XmlType); }
public QilList SortKeyList() { QilList n = new QilList(QilNodeType.SortKeyList); n.XmlType = this.typeCheck.CheckSortKeyList(n); TraceNode(n); return(n); }
public QilList BranchList() { QilList n = new QilList(QilNodeType.BranchList); n.XmlType = this.typeCheck.CheckBranchList(n); TraceNode(n); return(n); }
public QilList FunctionList() { QilList n = new QilList(QilNodeType.FunctionList); n.XmlType = this.typeCheck.CheckFunctionList(n); TraceNode(n); return(n); }
public QilList FormalParameterList() { QilList n = new QilList(QilNodeType.FormalParameterList); n.XmlType = this.typeCheck.CheckFormalParameterList(n); TraceNode(n); return(n); }
public XmlQueryType CheckSortKeyList(QilList node) { foreach (QilNode child in node) { CheckClassAndNodeType(child, typeof(QilSortKey), QilNodeType.SortKey); } return(node.XmlType); }
private void FlushBuilder() { if (concat == null) { concat = f.BaseFactory.Sequence(); } if (builder.Length != 0) { concat.Add(f.String(builder.ToString())); builder.Length = 0; } }
public XmlQueryType CheckGlobalParameterList(QilList node) { foreach (QilNode child in node) { CheckClassAndNodeType(child, typeof(QilParameter), QilNodeType.Parameter); Check(((QilParameter)child).Name != null, child, "Global parameter's name is null"); } return(node.XmlType); }
public QilNode Sequence(QilNode child) { if (!_debug) { return(child); } QilList res = _f.Sequence(); res.Add(child); return(res); }
private void FlushBuilder() { if (_concat == null) { _concat = _f.BaseFactory.Sequence(); } if (_builder.Length != 0) { _concat.Add(_f.String(_builder.ToString())); _builder.Length = 0; } }
public QilNode Choice(QilNode expr, QilList branches) { if (!_debug) { switch (branches.Count) { case 1: // If expr has no side effects, it will be eliminated by optimizer return(_f.Loop(_f.Let(expr), branches[0])); case 2: return(_f.Conditional(_f.Eq(expr, _f.LiteralInt32(0)), branches[0], branches[1])); } } return(_f.Choice(expr, branches)); }
public XmlQueryType CheckInvoke(QilInvoke node) { #if DEBUG CheckClassAndNodeType(node[1], typeof(QilList), QilNodeType.ActualParameterList); QilList actualArgs = node.Arguments; QilList formalArgs = node.Function.Arguments; Check(actualArgs.Count == formalArgs.Count, actualArgs, "Invoke argument count must match function's argument count"); for (int i = 0; i < actualArgs.Count; i++) { Check(actualArgs[i].XmlType.IsSubtypeOf(formalArgs[i].XmlType), actualArgs[i], "Invoke argument must be a subtype of the invoked function's argument"); } #endif return(node.Function.XmlType); }
public QilNode Sequence(params QilNode[] args) { if (!_debug) { switch (args.Length) { case 0: return(_f.Sequence()); case 1: return(args[0]); } } QilList res = _f.Sequence(); foreach (QilNode n in args) { res.Add(n); } return(res); }
/// <summary> /// Create IteratorDescriptor for each global value. This pre-visit is necessary because a global early /// in the list may reference a global later in the list and therefore expect its IteratorDescriptor to already /// be initialized. /// </summary> private void PrepareGlobalValues(QilList globalIterators) { MethodInfo methGlobal; IteratorDescriptor iterInfo; foreach (QilIterator iter in globalIterators) { Debug.Assert(iter.NodeType == QilNodeType.Let || iter.NodeType == QilNodeType.Parameter); // Get metadata for method which computes this global's value methGlobal = XmlILAnnotation.Write(iter).FunctionBinding; Debug.Assert(methGlobal != null, "Metadata for global value should have already been computed"); // Create an IteratorDescriptor for this global value iterInfo = new IteratorDescriptor(this.helper); // Iterator items will be stored in a global location iterInfo.Storage = StorageDescriptor.Global(methGlobal, GetItemStorageType(iter), !iter.XmlType.IsSingleton); // Associate IteratorDescriptor with parameter XmlILAnnotation.Write(iter).CachedIteratorDescriptor = iterInfo; } }
public QilNode Choice(QilNode expr, QilList branches) { if (! debug) { switch (branches.Count) { case 1: // If expr has no side effects, it will be eliminated by optimizer return f.Loop(f.Let(expr), branches[0]); case 2: return f.Conditional(f.Eq(expr, f.LiteralInt32(0)), branches[0], branches[1]); } } return f.Choice(expr, branches); }
public QilFunction Function(QilList args, QilNode defn, QilNode sideEffects) { Debug.Assert(args.NodeType == QilNodeType.FormalParameterList); return f.Function(args, defn, sideEffects, defn.XmlType); }
protected virtual QilNode VisitFormalParameterList(QilList n) { return VisitChildren(n); }
public XmlQueryType CheckSequence(QilList node) { return node.XmlType; }
protected virtual QilNode VisitBranchList(QilList n) { return VisitChildren(n); }
protected override QilNode VisitGlobalVariableList(QilList n) { return NoReplace(n); }
protected override QilNode VisitSortKeyList(QilList n) { return NoReplace(n); }
public XmlQueryType CheckActualParameterList(QilList node) { return node.XmlType; }
public XmlQueryType CheckGlobalParameterList(QilList node) { foreach (QilNode child in node) { CheckClassAndNodeType(child, typeof(QilParameter), QilNodeType.Parameter); Check(((QilParameter)child).Name != null, child, "Global parameter's name is null"); } return node.XmlType; }
public XmlQueryType CheckGlobalVariableList(QilList node) { foreach (QilNode child in node) CheckClassAndNodeType(child, typeof(QilIterator), QilNodeType.Let); return node.XmlType; }
public XmlQueryType CheckFunctionList(QilList node) { foreach (QilNode child in node) CheckClassAndNodeType(child, typeof(QilFunction), QilNodeType.Function); return node.XmlType; }
protected virtual QilNode VisitSortKeyList(QilList n) { return VisitChildren(n); }
public void Reset() { Debug.Assert(! inUse); inUse = true; builder.Length = 0; concat = null; }
protected override QilNode VisitFunctionList(QilList n) { return NoReplace(n); }
protected override QilNode VisitSequence(QilList n) { return NoReplace(n); }
protected override QilNode VisitBranchList(QilList n) { return NoReplace(n); }
public XmlQueryType CheckFormalParameterList(QilList node) { foreach (QilNode child in node) CheckClassAndNodeType(child, typeof(QilParameter), QilNodeType.Parameter); return node.XmlType; }
protected override QilNode VisitFormalParameterList(QilList n) { return NoReplace(n); }
public XmlQueryType CheckSortKeyList(QilList node) { foreach (QilNode child in node) CheckClassAndNodeType(child, typeof(QilSortKey), QilNodeType.SortKey); return node.XmlType; }
public XmlQueryType CheckBranchList(QilList node) { return node.XmlType; }
protected virtual QilNode VisitSequence(QilList n) { return VisitChildren(n); }
//----------------------------------------------- // function definition and invocation //----------------------------------------------- public QilFunction Function(QilList args, QilNode sideEffects, XmlQueryType resultType) { Debug.Assert(args.NodeType == QilNodeType.FormalParameterList); return f.Function(args, sideEffects, resultType); }
protected virtual QilNode VisitFunctionList(QilList n) { return VisitChildren(n); }
public QilNode Invoke(QilFunction func, QilList args) { Debug.Assert(args.NodeType == QilNodeType.ActualParameterList); Debug.Assert(func.Arguments.Count == args.Count); return f.Invoke(func, args); }
protected virtual QilNode VisitGlobalVariableList(QilList n) { return VisitChildren(n); }