当前位置: 首页>>代码示例>>C#>>正文


C# AssociativeNode.ToString方法代码示例

本文整理汇总了C#中ProtoCore.AST.AssociativeAST.AssociativeNode.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# AssociativeNode.ToString方法的具体用法?C# AssociativeNode.ToString怎么用?C# AssociativeNode.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ProtoCore.AST.AssociativeAST.AssociativeNode的用法示例。


在下文中一共展示了AssociativeNode.ToString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TypedParameter

        /// <summary>
        /// This function creates TypedParameter
        /// </summary>
        /// <param name="parameter">parameter name</param>
        /// <param name="type">parameter type</param>
        /// <param name="defaultValue">parameter default value</param>
        /// <param name="shortArgumentName">short name is used as tooltip</param>
        /// <param name="summary">parameter description</param>
        public TypedParameter(string parameter, ProtoCore.Type type, AssociativeNode defaultValue = null, string shortArgumentName = null, string summary = null)
        {
            if (parameter == null)
                throw new ArgumentNullException("parameter");

            Name = parameter;
            Type = type;
            DefaultValue = defaultValue;

            if (defaultValue != null)
                defaultValueString = defaultValue.ToString();
            else
                defaultValueString = shortArgumentName;

            this.summary = summary;
        }
开发者ID:sh4nnongoh,项目名称:Dynamo,代码行数:24,代码来源:TypedParameter.cs

示例2: RewriteIdentifierListNode

        private AssociativeNode RewriteIdentifierListNode(AssociativeNode identifierList)
        {
            var resolvedName = ResolveClassName(identifierList);

            if (string.IsNullOrEmpty(resolvedName))
                return identifierList;

            var identListNode = identifierList as IdentifierListNode;

            var newIdentList = CoreUtils.CreateNodeFromString(resolvedName);

            // If the original input node matches with the resolved name, simply return 
            // the identifier list constructed from the resolved name
            var symbol = new Symbol(resolvedName);
            if (symbol.Matches(identifierList.ToString()))
                return newIdentList;

            // Remove partialName from identListNode and replace with newIdentList
            AssociativeNode leftNode = identListNode != null ? identListNode.LeftNode : identifierList;
            AssociativeNode rightNode = identListNode != null ? identListNode.RightNode : identifierList;

            var intermediateNodes = new List<AssociativeNode>();
            while (leftNode is IdentifierListNode && !symbol.Matches(leftNode.ToString()))
            {
                intermediateNodes.Insert(0, ((IdentifierListNode)leftNode).RightNode);
                leftNode = ((IdentifierListNode)leftNode).LeftNode;
            }
            intermediateNodes.Insert(0, newIdentList);

            var lNode = CoreUtils.CreateNodeByCombiningIdentifiers(intermediateNodes);

            // The last ident list for the functioncall or identifier rhs
            var lastIdentList = new IdentifierListNode
            {
                LeftNode = lNode,
                RightNode = rightNode,
                Optr = Operator.dot
            };

            return lastIdentList;
        }
开发者ID:sh4nnongoh,项目名称:Dynamo,代码行数:41,代码来源:ElementRewriter.cs


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