本文整理汇总了C#中IronPython.Compiler.Ast.PythonAst.Walk方法的典型用法代码示例。如果您正苦于以下问题:C# PythonAst.Walk方法的具体用法?C# PythonAst.Walk怎么用?C# PythonAst.Walk使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IronPython.Compiler.Ast.PythonAst
的用法示例。
在下文中一共展示了PythonAst.Walk方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Resolve
string Resolve(string variableName, PythonAst ast)
{
typeName = null;
this.variableName = variableName;
ast.Walk(this);
return typeName;
}
示例2: Bind
private void Bind(PythonAst unboundAst)
{
Assert.NotNull(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);
// Run flow checker
foreach (ScopeStatement scope in _scopes) {
FlowChecker.Check(scope);
}
}
示例3: ToJavaScript
public string ToJavaScript(PythonAst ast)
{
content.Clear();
tree.Clear();
scope.Clear();
indent = 0;
ast.Walk(this);
return content.Pop();
}
示例4: Bind
private void Bind(PythonAst unboundAst) {
Assert.NotNull(unboundAst);
_currentScope = _globalScope = unboundAst;
// Find all scopes and variables
unboundAst.Walk(this);
// Bind
foreach (ScopeStatement scope in _scopes) {
scope.Bind(this);
}
// Finish the globals
unboundAst.Bind(this);
// Run flow checker
foreach (ScopeStatement scope in _scopes) {
FlowChecker.Check(scope);
}
}