예제 #1
0
    def get_free_variables(self):
        sym_table = SymbolTable()
        visitor = ScopeTreeVisitor(sym_table)
        visitor.visit(self.tree)
        fill_scope_references(self.tree)

        free_var_analysis = FreeVariableAnalyzerVisitor()
        free_var_analysis.visit(self.tree)
        return free_var_analysis.free_variables
예제 #2
0
    def get_free_variables(self):
        sym_table = SymbolTable()
        visitor = ScopeTreeVisitor(sym_table)
        visitor.visit(self.tree)
        fill_scope_references(self.tree)

        free_var_analysis = FreeVariableAnalyzerVisitor()
        free_var_analysis.visit(self.tree)
        return free_var_analysis.free_variables
예제 #3
0
def mangle(tree):
    sym_table = SymbolTable()
    visitor = ScopeTreeVisitor(sym_table)
    visitor.visit(tree)

    fill_scope_references(tree)
    mangle_scope_tree(sym_table.globals)

    mangler = NameManglerVisitor()
    mangler.visit(tree)
예제 #4
0
파일: mangler.py 프로젝트: firemyst/slimit
def mangle(tree):
    sym_table = SymbolTable()
    visitor = ScopeTreeVisitor(sym_table)
    visitor.visit(tree)

    fill_scope_references(tree)
    mangle_scope_tree(sym_table.globals)

    mangler = NameManglerVisitor()
    mangler.visit(tree)
예제 #5
0
def mangle(tree, toplevel=False):
    """Mangle names.

    Args:
        toplevel: defaults to False. Defines if global
        scope should be mangled or not.
    """
    sym_table = SymbolTable()
    visitor = ScopeTreeVisitor(sym_table)
    visitor.visit(tree)

    fill_scope_references(tree)
    mangle_scope_tree(sym_table.globals, toplevel)

    mangler = NameManglerVisitor()
    mangler.visit(tree)
예제 #6
0
def mangle(tree, toplevel=False):
    """Mangle names.

    Args:
        toplevel: defaults to False. Defines if global
        scope should be mangled or not.
    """
    sym_table = SymbolTable()
    visitor = ScopeTreeVisitor(sym_table)
    visitor.visit(tree)

    fill_scope_references(tree)
    mangle_scope_tree(sym_table.globals, toplevel)

    mangler = NameManglerVisitor()
    mangler.visit(tree)