本文整理匯總了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;
}