本文整理汇总了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;
}
示例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;
}