本文整理汇总了C#中Microsoft.PythonTools.Parsing.Ast.PythonAst.Walk方法的典型用法代码示例。如果您正苦于以下问题:C# PythonAst.Walk方法的具体用法?C# PythonAst.Walk怎么用?C# PythonAst.Walk使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.PythonTools.Parsing.Ast.PythonAst
的用法示例。
在下文中一共展示了PythonAst.Walk方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AstPythonModule
internal AstPythonModule(IPythonInterpreter interpreter, PythonAst ast, string filePath) {
Name = ast.Name;
Documentation = ast.Documentation;
FilePath = filePath;
Locations = new[] { new LocationInfo(filePath, 1, 1) };
_properties = new Dictionary<object, object>();
_childModules = new List<string>();
_members = new Dictionary<string, IMember>();
var walker = new AstAnalysisWalker(interpreter, ast, this, filePath, _members);
ast.Walk(walker);
}
示例2: Bind
private void Bind(PythonAst unboundAst) {
_currentScope = _globalScope = unboundAst;
_finallyCount.Add(0);
// Find all scopes and variables
unboundAst.Walk(this);
// Bind
foreach (ScopeStatement scope in _scopes) {
scope.Bind(this);
}
// Finish the globals
unboundAst.Bind(this);
// Finish Binding w/ outer most scopes first.
for (int i = _scopes.Count - 1; i >= 0; i--) {
_scopes[i].FinishBind(this);
}
// Finish the globals
unboundAst.FinishBind(this);
}