當前位置: 首頁>>代碼示例>>C#>>正文


C# XPath2.XQueryASTCompiler類代碼示例

本文整理匯總了C#中Mono.Xml.XPath2.XQueryASTCompiler的典型用法代碼示例。如果您正苦於以下問題:C# XQueryASTCompiler類的具體用法?C# XQueryASTCompiler怎麽用?C# XQueryASTCompiler使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


XQueryASTCompiler類屬於Mono.Xml.XPath2命名空間,在下文中一共展示了XQueryASTCompiler類的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: CompileCore

		internal override ExprSingle CompileCore (XQueryASTCompiler compiler)
		{
			if (Content != null)
				for (int i = 0; i < Content.Count; i++)
					Content [i] = Content [i].Compile (compiler);
			return this;
		}
開發者ID:Profit0004,項目名稱:mono,代碼行數:7,代碼來源:XQueryExpression.cs

示例2: Create

		/*
		internal static DefaultFunctionCall Create (
			XmlQualifiedName name,
			ExprSingle [] args,
			XQueryStaticContext ctx)
		{
			switch (name.Namespace) {
			case XQueryFunction.Namespace:
				switch (name.Name) {
				case "node-name":
					return new FnNodeNameCall (ctx, args);
				case "nilled":
					return new FnNilledCall (ctx, args);
				case "string":
					return new FnStringCall (ctx, args);
				case "data":
					return new FnDataCall (ctx, args);
				case "base-uri":
					return new FnBaseUriCall (ctx, args);
				case "document-uri":
					return new FnDocumentUriCall (ctx, args);
				case "error":
					return new FnErrorCall (ctx, args);
				case "trace":
					return new FnTraceCall (ctx, args);
				case "abs":
					return new FnAbsCall (ctx, args);
				case "ceiling":
					return new FnCeilingCall (ctx, args);
				case "floor":
					return new FnFloorCall (ctx, args);
				case "round":
					return new FnRoundCall (ctx, args);
				case "round-half-to-even":
					return new FnRoundHalfToEvenCall (ctx, args);
				case "codepoints-to-string":
					return new FnCodepointsToStringCall (ctx, args);
				case "string-to-codepoints":
					return new FnStringCallToCodepointsCall (ctx, args);
				}
				goto default;
			case InternalPool.XdtNamespace:
			case XmlSchema.Namespace:
				XmlSchemaType type = XmlSchemaType.GetBuiltInSimpleType (name);
				if (type != null)
					return new AtomicConstructorCall (ctx, SequenceType.Create (type, Occurence.One), args);
				type = XmlSchemaType.GetBuiltInComplexType (name);
				if (type == null)
					goto default;
				return null;
			default:
				XQueryFunction func = ctx.CompileContext.InEffectFunctions [name];
				if (func != null)
					return new CustomFunctionCallExpression (ctx, args, func);
				return null;
			}
		}
		*/

		internal void CheckArguments (XQueryASTCompiler compiler)
		{
			if (args.Count < MinArgs || args.Count > MaxArgs)
				// FIXME: add more info
				throw new XmlQueryCompileException (String.Format ("{0} is invalid for the number of {1} function argument. MinArgs = {2}, MaxArgs = {3}.", args.Count, name, MinArgs, MaxArgs));
		}
開發者ID:nlhepler,項目名稱:mono,代碼行數:65,代碼來源:XPath2Expression.cs

示例3: CheckReference

		internal override void CheckReference (XQueryASTCompiler compiler)
		{
			if (nameExpr != null)
				nameExpr.CheckReference (compiler);
			if (Content != null)
				Content.CheckReference (compiler);
		}
開發者ID:Profit0004,項目名稱:mono,代碼行數:7,代碼來源:XQueryExpression.cs

示例4: Compile

		internal override void Compile (XQueryASTCompiler compiler)
		{
		}
開發者ID:nlhepler,項目名稱:mono,代碼行數:3,代碼來源:SequenceType.cs

示例5: CompileProlog

		private void CompileProlog ()
		{
			Prolog p = module.Prolog;

			// resolve external modules
			// FIXME: check if external queries are allowed by default.
			// FIXME: check recursion
			XmlUrlResolver res = new XmlUrlResolver ();
			foreach (ModuleImport modimp in p.ModuleImports) {
				foreach (string uri in modimp.Locations) {
					Stream s = res.GetEntity (res.ResolveUri (null, uri), null, typeof (Stream)) as Stream;
					XQueryLibraryModule ext = Mono.Xml.XQuery.Parser.Parser.Parse (new StreamReader (s)) as XQueryLibraryModule;
					if (ext == null)
						throw new XmlQueryCompileException (String.Format ("External module {0} is resolved as a main module, while it should be a library module."));
					XQueryStaticContext sctx = new XQueryASTCompiler (ext, options, compileContext, evidence, commandImpl).Compile ();
					libModuleContexts.Add (sctx);
				}
			}

			// resolve and compile in-scope schemas
			foreach (SchemaImport xsimp in p.SchemaImports) {
				foreach (string uri in xsimp.Locations) {
					XmlSchema schema = inScopeSchemas.Add (xsimp.Namespace, uri);
					compileContext.InEffectSchemas.Add (schema);
				}
			}
			inScopeSchemas.Compile ();

			CheckReferences ();

			ResolveVariableReferences ();

			// compile FunctionDeclaration into XQueryFunction
			foreach (FunctionDeclaration func in p.Functions.Values) {
				XQueryFunction cfunc = CompileFunction (func);
				localFunctions.Add (cfunc);
			}
		}
開發者ID:nlhepler,項目名稱:mono,代碼行數:38,代碼來源:XQueryASTCompiler.cs

示例6: CompileCore

		// If internal&&protected is available in C#, it is the best signature.
		internal abstract ExprSingle CompileCore (XQueryASTCompiler compiler);
開發者ID:nlhepler,項目名稱:mono,代碼行數:2,代碼來源:XPath2Expression.cs

示例7: CheckReference

		internal override void CheckReference (XQueryASTCompiler compiler)
		{
			foreach (QuantifiedExprBody one in body) {
				if (one.Type != null)
					compiler.CheckSchemaType (one.Type);
				one.Expression.CheckReference (compiler);
			}
			Satisfies.CheckReference (compiler);
		}
開發者ID:nlhepler,項目名稱:mono,代碼行數:9,代碼來源:XPath2Expression.cs

示例8: CheckReference

		internal virtual void CheckReference (XQueryASTCompiler compiler)
		{
		}
開發者ID:nlhepler,項目名稱:mono,代碼行數:3,代碼來源:SequenceType.cs

示例9: Compile

		internal ExprSingle Compile (XQueryASTCompiler compiler)
		{
			this.ctx = ctx;
			return CompileCore (compiler);
		}
開發者ID:nlhepler,項目名稱:mono,代碼行數:5,代碼來源:XPath2Expression.cs


注:本文中的Mono.Xml.XPath2.XQueryASTCompiler類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。