本文整理汇总了C#中AST类的典型用法代码示例。如果您正苦于以下问题:C#AST类的具体用法?C#AST怎么用?C#AST使用的例子?这里精选的类代码示例或许可以为您提供帮助。
示例1:Visit
publicoverridevoidVisit(AST.MethodDeclNodenode)
{
MethodBeingVisited=ClassBeingVisited.Methods.Lookup(node.methodName.name);
if(node.paramDeclList!=null)
foreach(AST.ParamDeclNodeparamDeclinnode.paramDeclList)
paramDecl.Accept(this);
if(node.variableDeclList!=null)
foreach(AST.VariableDeclNodevariableDeclinnode.variableDeclList)
variableDecl.Accept(this);
if(node.statementList!=null)
{
varreverseList=node.statementList.statementList;
reverseList.Reverse();
HashSet
afterLiveness=newHashSet();
foreach(AST.StatementNodestatementinreverseList)
{
m_R.Clear();
m_W.Clear();
statement.Accept(this);
afterLiveness.ExceptWith(m_W);
afterLiveness.UnionWith(m_R);
m_livenessAtNode[statement]=newHashSet(afterLiveness);
}
}
}
原文链接:http://www.jxszl.com/biancheng/C/556583.html