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;
		}
示例#2
0
		// 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;
		}
示例#3
0
		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);
		}
示例#4
0
		public FilterStepExpr (ExprSingle expr, ExprSequence predicate)
		{
			this.expr = expr;
			this.predicate = predicate;
		}
示例#5
0
		private FilteredIterator (FilteredIterator other)
			: base (other)
		{
			left = other.left.Clone ();
			filter = other.filter;
		}
示例#6
0
		public XmlCommentConstructor (ExprSequence content)
			: base (content)
		{
		}
示例#7
0
		public XmlPIConstructor (ExprSequence name, ExprSequence content)
			: base (content)
		{
			this.nameExpr = name;
		}
示例#8
0
		public ParenthesizedExpr (ExprSequence expr)
		{
			if (expr == null)
				expr = new ExprSequence ();
			this.expr = expr;
		}
示例#9
0
		public XmlDocConstructor (ExprSequence content)
			: base (content)
		{
		}
示例#10
0
		public IfExpr (ExprSequence condition, ExprSingle trueExpr, ExprSingle falseExpr)
		{
			this.condition = new ParenthesizedExpr (condition);
			this.trueExpr = trueExpr;
			this.falseExpr = falseExpr;
		}
示例#11
0
		public XQueryVariable (XmlQualifiedName name, SequenceType type, ExprSequence varBody)
		{
			this.name = name;
			this.type = type;
			this.varBody = varBody; // might be null (just declaration).
		}
示例#12
0
		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;
		}
示例#13
0
		public TypeswitchExpr (ExprSequence switchExpr, CaseClauseList caseList, XmlQualifiedName defaultVarName, ExprSingle defaultReturn)
		{
			this.switchExpr = switchExpr;
			this.caseList = caseList;
			this.defaultVarName = defaultVarName;
			this.defaultReturn = defaultReturn;
		}
示例#14
0
		public OrderSpecifiedExpr (ExprSequence expr, bool ordered)
		{
			this.ordered = ordered;
			this.expr = expr;
		}
示例#15
0
		public FunctionCallExpr (XmlQualifiedName name, ExprSequence args)
			: base (name, args)
		{
		}
示例#16
0
		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;
		}
示例#17
0
		internal XQueryUserFunction (XmlQualifiedName name,
			XQueryFunctionArgument [] parameters,
			ExprSequence expr,
			SequenceType returnType)
			: base (name, parameters, returnType)
		{
			this.expr = expr;
		}
示例#18
0
		public XmlAttrConstructor (XmlQualifiedName name, ExprSequence content)
			: base (content)
		{
			this.name = name;
		}
示例#19
0
		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;
		}
示例#20
0
		public EnclosedExpr (ExprSequence expr)
		{
			this.expr = expr;
		}
示例#21
0
		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)
		{
		}
示例#23
0
		public XmlNSConstructor (string prefix, ExprSequence content)
			: base (content)
		{
		}
示例#24
0
		private ExprSequence CompileExprSequence (ExprSequence expr)
		{
			for (int i = 0; i < expr.Count; i++)
				expr [i] = expr [i].Compile (this);
			return expr;
		}
示例#25
0
		public XmlConstructorExpr (ExprSequence content)
		{
			this.content = content;
		}
示例#26
0
		public ExprSequenceIterator (XPathSequence iter, ExprSequence expr)
			: base (iter.Context)
		{
			contextSequence = iter;
			this.expr = expr;
		}
示例#27
0
		public XmlPIConstructor (string name, ExprSequence content)
			: base (content)
		{
			this.name = name;
		}
示例#28
0
		private ExprSequenceIterator (ExprSequenceIterator other)
			: base (other)
		{
			if (other.iter != null)
				iter = other.iter.Clone ();
			expr = other.expr;
			contextSequence = other.contextSequence;
			currentExprIndex = other.currentExprIndex;
		}
示例#29
0
		public FilteredIterator (XPathSequence iter, FilterStepExpr source)
			: base (iter.Context)
		{
			left = source.Expr.Evaluate (iter);
			filter = source.Predicate;
		}
示例#30
0
		public ValidateExpr (XmlSchemaContentProcessing schemaMode, ExprSequence expr)
		{
			this.schemaMode = schemaMode;
			this.expr = expr;
		}