• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Model.ASTNode类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中HeD.Engine.Model.ASTNode的典型用法代码示例。如果您正苦于以下问题:C# ASTNode类的具体用法?C# ASTNode怎么用?C# ASTNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ASTNode类属于HeD.Engine.Model命名空间,在下文中一共展示了ASTNode类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Translate

		public object Translate(TranslationContext context, ASTNode node)
		{
			var result = new SQLModel.TableExpression();
			var sqlContext = (SQLTranslationContext)context;
			result.TableName = sqlContext.GetExpressionObjectName(String.Format("{0}.{1}", node.GetAttribute<string>("libraryName", sqlContext.ArtifactName), node.GetAttribute<string>("name")));

			// If the expression being referenced is scalar, it will be automatically promoted to a query by the expression def translation
			// In this case, it must be demoted back to a scalar expression with a subquery access.
			if (!(node.ResultType is ListType) && !(node.ResultType is ObjectType))
			{
				var selectExpression = new SQLModel.SelectExpression();
				selectExpression.SelectClause = new SQLModel.SelectClause();
				selectExpression.SelectClause.Columns.Add(new SQLModel.ColumnExpression(new SQLModel.QualifiedFieldExpression("value")));
				selectExpression.FromClause = new SQLModel.CalculusFromClause(new SQLModel.TableSpecifier(result));

				// If the result type is also boolean, the expression will be converted to a 1 or 0, so it must be demoted back to an actual boolean-valued expression
				if (DataTypes.Equal(node.ResultType, DataTypes.Boolean))
				{
					return SQLTranslationUtilities.DemoteBooleanValuedExpression(selectExpression);
				}

				return selectExpression;
			}

			return result;
		}
开发者ID:GuntherM1466,项目名称:healthedecisions,代码行数:26,代码来源:Translators.cs


示例2: InternalVerify

		protected virtual void InternalVerify(VerificationContext context, ASTNode node)
		{
			foreach (var child in node.Children)
			{
				Verifier.Verify(context, child);
			}
		}
开发者ID:GuntherM1466,项目名称:healthedecisions,代码行数:7,代码来源:Verifiers.cs


示例3: TranslateCriteria

		private CREFModel.DynamicRuleDynamicRuleCriteria TranslateCriteria(TranslationContext context, ASTNode condition)
		{
			var result = new CREFModel.DynamicRuleDynamicRuleCriteria();

			result.Item = context.TranslateNode(condition);

			return result;
		}
开发者ID:GuntherM1466,项目名称:healthedecisions,代码行数:8,代码来源:CREFTranslator.cs


示例4: ReadNode

		public static Node ReadNode(XElement element)
		{
			var nodeName = element.Name.LocalName;
			var nodeType = element.GetSchemaInfo().SchemaType;

			Node result = null;
			ASTNode astResult = null;

			if (IsExpression(nodeType))
			{
				astResult = new ASTNode();
				result = astResult;
			}
			else
			{
				result = new Node();
			}

			result.Name = nodeName;
			result.NodeType = nodeType.QualifiedName.ToString();
			var lineInfo = element as IXmlLineInfo;
			if (lineInfo != null && lineInfo.HasLineInfo())
			{
				result.Line = lineInfo.LineNumber;
				result.LinePos = lineInfo.LinePosition;
			}

			result.Attributes = new Dictionary<string, object>();
			foreach (var a in element.Attributes())
			{
				var schemaInfo = a.GetSchemaInfo();
				if (schemaInfo != null && schemaInfo.SchemaType != null && schemaInfo.SchemaType.QualifiedName != null && schemaInfo.SchemaType.QualifiedName.Name == "QName")
				{
					result.Attributes.Add(a.Name.LocalName, element.ExpandName(a.Value));
				}
				else
				{
					result.Attributes.Add(a.Name.LocalName, a.Value);
				}
			}

			result.Children = new List<Node>();
			foreach (var e in element.Elements())
			{
				if (e.Name.LocalName == "description" && astResult != null)
				{
					astResult.Description = e.Value;
				}
				else
				{
					result.Children.Add(ReadNode(e));
				}
			}

			return result;
		}
开发者ID:GuntherM1466,项目名称:healthedecisions,代码行数:56,代码来源:NodeReader.cs


示例5: Verify

		public void Verify(VerificationContext context, ASTNode node)
		{
			var expressionType = context.ResolveExpressionRef(node.GetAttribute<string>("libraryName"), node.GetAttribute<string>("name"));
			if (expressionType.Expression.ResultType == null)
			{
				throw new InvalidOperationException("Invalid forward reference.");
			}

			node.ResultType = expressionType.Expression.ResultType;
		}
开发者ID:GuntherM1466,项目名称:healthedecisions,代码行数:10,代码来源:Verifiers.cs


示例6: TranslateCodeReference

		protected object TranslateCodeReference(TranslationContext context, ObjectType sourceType, ASTNode node, string path)
		{
			// Reference the Codes property with a First expression
			var result = GetPropertyExpression(context, node, "Codes");

			result = GetFirstExpression(context, result);

			// TODO: Issue a warning that an arbitrary Code is being selected

			return result;
		}
开发者ID:GuntherM1466,项目名称:healthedecisions,代码行数:11,代码来源:ModelTranslators.cs


示例7: GetPropertyExpression

		protected object GetPropertyExpression(TranslationContext context, ASTNode node, string path)
		{
			var result = new SQLModel.PropertyExpression();
			result.Path = path;

			if (node.Children.Count > 0)
			{
				result.Item = context.TranslateNode(node.Children[0]);
			}

			return result;
		}
开发者ID:GuntherM1466,项目名称:healthedecisions,代码行数:12,代码来源:ModelTranslators.cs


示例8: Translate

        public object Translate(TranslationContext context, ASTNode node)
        {
            var result = new CREFModel.BinaryExpression();
            result.Operator = GetOperator();
            result.OperatorSpecified = true;

            foreach (var child in node.Children)
            {
                result.Items.Add(context.TranslateNode(child));
            }

            return result;
        }
开发者ID:suesse,项目名称:healthedecisions,代码行数:13,代码来源:Translators.cs


示例9: Verify

		public static void Verify(VerificationContext context, ASTNode node)
		{
			try
			{
				var verifier = NodeVerifierFactory.GetHandler(node.NodeType);

				// Traversal occurs within the verify, because traversal may happen differently depending on the operation.
				verifier.Verify(context, node);
			}
			catch (Exception e)
			{
                context.ReportMessage(e, node);
			}
		}
开发者ID:GuntherM1466,项目名称:healthedecisions,代码行数:14,代码来源:Verifier.cs


示例10: GetResultType

        protected override DataType GetResultType(ASTNode node)
        {
            var listType = node.ResultType as ListType;
            if (!(listType.ElementType is IntervalType))
            {
                throw new InvalidOperationException("Collapse operator must be invoked on a list of intervals.");
            }

            return listType;
        }
开发者ID:GuntherM1466,项目名称:healthedecisions,代码行数:10,代码来源:Verifiers.cs


示例11: TransformModelPath

		public object TransformModelPath(ObjectType type, ASTNode node, string path)
		{
			var translator = ModelTranslatorFactory.GetHandler(type.Name);

			return translator.TransformModelPath(this, type, node, path);
		}
开发者ID:GuntherM1466,项目名称:healthedecisions,代码行数:6,代码来源:TranslationContext.cs


示例12: TranslateNode

		public object TranslateNode(ASTNode node)
		{
			var translator = NodeTranslatorFactory.GetHandler(node.NodeType);

			return translator.Translate(this, node);
		}
开发者ID:GuntherM1466,项目名称:healthedecisions,代码行数:6,代码来源:TranslationContext.cs


示例13: TranslateCondition

		private Model.Statement TranslateCondition(SQLTranslationContext context, string artifactName, string conditionName, ASTNode condition)
		{
			var result = new SQLModel.CreateViewStatement();
			result.ViewName = context.GetExpressionObjectName(String.Format("{0}.{1}", artifactName, conditionName));
			result.Expression = SQLTranslationUtilities.EnsureSelectExpression(context.TranslateNode(condition));
			return result;
		}
开发者ID:GuntherM1466,项目名称:healthedecisions,代码行数:7,代码来源:SQLTranslator.cs



注:本文中的HeD.Engine.Model.ASTNode类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Translation.TranslationContext类代码示例发布时间:2022-05-26
下一篇:
C# TaskbarNotification.TaskbarIcon类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap