IronPython.Compiler.Ast.PythonNameBinder.Bind C# (CSharp) Метод

Bind() приватный Метод

private Bind ( IronPython.Compiler.Ast.PythonAst unboundAst ) : void
unboundAst IronPython.Compiler.Ast.PythonAst
Результат void
        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);
            }
        }

Usage Example

Пример #1
0
        internal static void BindAst(PythonAst ast, CompilerContext context)
        {
            Assert.NotNull(ast, context);

            PythonNameBinder binder = new PythonNameBinder(context);

            binder.Bind(ast);
        }
All Usage Examples Of IronPython.Compiler.Ast.PythonNameBinder::Bind