本文整理匯總了C#中AST.ToString方法的典型用法代碼示例。如果您正苦於以下問題:C# AST.ToString方法的具體用法?C# AST.ToString怎麽用?C# AST.ToString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類AST
的用法示例。
在下文中一共展示了AST.ToString方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: MismatchedTokenException
// Expected range / not range
public MismatchedTokenException(string[] tokenNames_, AST node_, int lower, int upper_, bool matchNot)
: base("Mismatched Token", "<AST>", - 1, - 1)
{
tokenNames = tokenNames_;
node = node_;
if (node_ == null)
{
tokenText = "<empty tree>";
}
else
{
tokenText = node_.ToString();
}
mismatchType = matchNot ? TokenTypeEnum.NotRangeType : TokenTypeEnum.RangeType;
expecting = lower;
upper = upper_;
}
示例2: DumpNode
private static void DumpNode(AST rootNode, int level)
{
Trace.WriteLine(new string(' ', level) + rootNode.ToString());
int numberOfChildren = rootNode.getNumberOfChildren();
if (numberOfChildren > 0)
{
AST node = rootNode.getFirstChild();
while (node != null)
{
DumpNode(node, level + 2);
node = node.getNextSibling();
}
}
}
示例3: EmitAtLevel
protected void EmitAtLevel(AST.AssociativeAST.AtLevelNode atLevel)
{
if (atLevel == null)
{
EmitInstrConsole(kw.pushlevel, "@0");
EmitPushLevel(0, false);
}
else
{
EmitInstrConsole(kw.pushlevel, atLevel.ToString());
EmitPushLevel((int)atLevel.Level, atLevel.IsDominant);
}
}
示例4: traceOut
public virtual void traceOut(string rname, AST t)
{
traceIndent();
Console.Out.WriteLine("< " + rname + "(" + ((t != null) ? t.ToString() : "null") + ")" + ((inputState.guessing > 0) ? " [guessing]" : ""));
traceDepth--;
}
示例5: Single_Tag_Node_No_Variables
public void Single_Tag_Node_No_Variables()
{
const string TEMPLATE [email protected]"<c:out value=""Hello World""/>";
var formatter = new Formatter(TEMPLATE).Parse();
var ast = new AST(formatter.ParsedTemplate, AST.Options.DontTrackContext);
var expected = new AST().Add(
new TagNode("c","out").With("Value","Hello World"));
Assert.That(ast, Deeply.Is.EqualTo(expected), ast.ToString());
}