本文整理汇总了C#中IAstVisitor.VisitCompilationUnit方法的典型用法代码示例。如果您正苦于以下问题:C# IAstVisitor.VisitCompilationUnit方法的具体用法?C# IAstVisitor.VisitCompilationUnit怎么用?C# IAstVisitor.VisitCompilationUnit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IAstVisitor
的用法示例。
在下文中一共展示了IAstVisitor.VisitCompilationUnit方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Parse
public void Parse(IAstVisitor visitor, string path)
{
using (TextReader reader = File.OpenText(path))
{
var parser = parserFactory.CreateCSharpParser(reader);
parser.ParseMethodBodies = true;
parser.Parse();
typeResolver.Clear();
visitor.VisitCompilationUnit(parser.CompilationUnit, null);
cache.Add(path, parser);
}
}
示例2: AcceptVisitor
// Children in C#: UsingAliasDeclaration, UsingDeclaration, AttributeSection, NamespaceDeclaration
// Children in VB: OptionStatements, ImportsStatement, AttributeSection, NamespaceDeclaration
public override object AcceptVisitor(IAstVisitor visitor, object data)
{
return visitor.VisitCompilationUnit(this, data);
}
示例3: CallVisitor
private void CallVisitor(IAstVisitor visitor, string step)
{
if (visitor is Transformer)
{
Transformer transformer = (Transformer) visitor;
transformer.CodeBase = codeBase;
transformer.Mode = Mode;
}
foreach (Source entry in Sources.Values)
{
if (!entry.CodeFile)
continue;
if (step != null)
progress.Increment(step);
parentVisitor.VisitCompilationUnit(entry.CompilationUnit, null);
visitor.VisitCompilationUnit(entry.CompilationUnit, null);
}
}