public DefaultFunctionCall (XQueryStaticContext ctx, string name, int minArgs, int maxArgs, SequenceType type, ExprSequence args) : base (GetName (name), args) { this.type = type; this.minArgs = minArgs; this.maxArgs = maxArgs; }
// Don't keep XQueryCompileOptions and XQueryMainModule // inside this class. I don't want them affect this instance // by being modified externally after the compilation. public XQueryStaticContext ( XQueryCompileOptions options, XQueryCompileContext compileContext, ExprSequence queryBody, XmlSchemaSet inScopeSchemas, IDictionary inScopeVariables, XQueryFunctionTable functionSignatures, IXmlNamespaceResolver nsResolver, string defaultFunctionNamespace, bool preserveWhitespace, bool constructionSpace, bool defaultOrdered, string baseUri, Evidence evidence, XQueryCommandImpl commandImpl) { // Initialization phase. compat = options.Compatibility; nameTable = options.NameTable; this.queryBody = queryBody; this.nsResolver = nsResolver; this.defaultFunctionNamespace = defaultFunctionNamespace; // elemNSManager = new XmlNamespaceManager (nameTable); // funcNSManager = new XmlNamespaceManager (nameTable); xqueryFlagger = options.XQueryFlagger; xqueryStaticFlagger = options.XQueryStaticFlagger; // xqueryResolver = options.KnownDocumentResolver; knownCollections = (IDictionary) options.KnownCollections.Clone (); functions = functionSignatures; this.compileContext = compileContext; this.inScopeSchemas = inScopeSchemas; this.inScopeVariables = inScopeVariables; this.preserveWhitespace = preserveWhitespace; this.preserveConstructionSpace = constructionSpace; this.defaultOrdered = defaultOrdered; this.baseUri = baseUri; this.defaultCollation = options.DefaultCollation; // FIXME: set contextItemStaticType // FIXME: set extDocResolver this.evidence = evidence; this.commandImpl = commandImpl; }
public virtual XPathSequence Evaluate (XPathSequence iter, ExprSequence args) { object [] instParams = new object [args.Count]; for (int i = 0; i < args.Count; i++) { XPathSequence val = args [i].Evaluate (iter); instParams [i] = Args [i].Type.ToRuntimeType (val); } object o = Invoke (iter, instParams); if (o == null) return new XPathEmptySequence (iter.Context); if (o is XPathSequence) return (XPathSequence) o; XPathItem item = o as XPathItem; if (item == null) item = new XPathAtomicValue (o, ReturnType.SchemaType); return new SingleItemIterator (item, iter.Context); }
public FilterStepExpr (ExprSingle expr, ExprSequence predicate) { this.expr = expr; this.predicate = predicate; }
private FilteredIterator (FilteredIterator other) : base (other) { left = other.left.Clone (); filter = other.filter; }
public XmlCommentConstructor (ExprSequence content) : base (content) { }
public XmlPIConstructor (ExprSequence name, ExprSequence content) : base (content) { this.nameExpr = name; }
public ParenthesizedExpr (ExprSequence expr) { if (expr == null) expr = new ExprSequence (); this.expr = expr; }
public XmlDocConstructor (ExprSequence content) : base (content) { }
public IfExpr (ExprSequence condition, ExprSingle trueExpr, ExprSingle falseExpr) { this.condition = new ParenthesizedExpr (condition); this.trueExpr = trueExpr; this.falseExpr = falseExpr; }
public XQueryVariable (XmlQualifiedName name, SequenceType type, ExprSequence varBody) { this.name = name; this.type = type; this.varBody = varBody; // might be null (just declaration). }
public FLWORExpr (ForLetClauseCollection forlet, ExprSequence whereClause, OrderSpecList orderBy, ExprSingle ret) { this.fl = forlet; if (whereClause != null) this.whereClause = new ParenthesizedExpr (whereClause); this.orderBy = orderBy; this.ret = ret; }
public TypeswitchExpr (ExprSequence switchExpr, CaseClauseList caseList, XmlQualifiedName defaultVarName, ExprSingle defaultReturn) { this.switchExpr = switchExpr; this.caseList = caseList; this.defaultVarName = defaultVarName; this.defaultReturn = defaultReturn; }
public OrderSpecifiedExpr (ExprSequence expr, bool ordered) { this.ordered = ordered; this.expr = expr; }
public FunctionCallExpr (XmlQualifiedName name, ExprSequence args) : base (name, args) { }
public FunctionCallExprBase (XmlQualifiedName name, ExprSequence args) { if (args == null) throw new ArgumentNullException (String.Format ("Function argument expressions for {0} is null.", name)); this.name = name; this.args = args; }
internal XQueryUserFunction (XmlQualifiedName name, XQueryFunctionArgument [] parameters, ExprSequence expr, SequenceType returnType) : base (name, parameters, returnType) { this.expr = expr; }
public XmlAttrConstructor (XmlQualifiedName name, ExprSequence content) : base (content) { this.name = name; }
public override XPathSequence Evaluate (XPathSequence iter, ExprSequence args) { for (int i = 0; i < Args.Length; i++) iter.Context.PushVariable (Args [i].Name, args [i].Evaluate (iter)); XPathSequence seq = new ExprSequenceIterator (iter, expr); for (int i = 0; i < Args.Length; i++) iter.Context.PopVariable (); return seq; }
public EnclosedExpr (ExprSequence expr) { this.expr = expr; }
public XmlElemConstructor (ExprSequence name, ExprSequence content) : base (content) { this.name = XmlQualifiedName.Empty; this.nameExpr = name; }
public FnNodeNameCall (XQueryStaticContext ctx, ExprSequence args) : base (ctx, "node-name", 1, 1, SequenceType.Create (XmlSchemaSimpleType.XsQName, Occurence.Optional), args) { }
public XmlNSConstructor (string prefix, ExprSequence content) : base (content) { }
private ExprSequence CompileExprSequence (ExprSequence expr) { for (int i = 0; i < expr.Count; i++) expr [i] = expr [i].Compile (this); return expr; }
public XmlConstructorExpr (ExprSequence content) { this.content = content; }
public ExprSequenceIterator (XPathSequence iter, ExprSequence expr) : base (iter.Context) { contextSequence = iter; this.expr = expr; }
public XmlPIConstructor (string name, ExprSequence content) : base (content) { this.name = name; }
private ExprSequenceIterator (ExprSequenceIterator other) : base (other) { if (other.iter != null) iter = other.iter.Clone (); expr = other.expr; contextSequence = other.contextSequence; currentExprIndex = other.currentExprIndex; }
public FilteredIterator (XPathSequence iter, FilterStepExpr source) : base (iter.Context) { left = source.Expr.Evaluate (iter); filter = source.Predicate; }
public ValidateExpr (XmlSchemaContentProcessing schemaMode, ExprSequence expr) { this.schemaMode = schemaMode; this.expr = expr; }