|
ESBMC
Efficient SMT-based Context-Bounded Model Checker
|
Classes | |
| class | _QualifyImportedNestedClasses |
Functions | |
| list[ast.AST] | _binders (ast.AST tree, str name) |
| bool | _imports_module (ast.AST binder, set[int] imports, str root, str module_name) |
| set[str] | _module_paths (ast.Module tree, str module_name) |
| dict[str, tuple[str, ast.ImportFrom]] | _from_imported (ast.Module tree, str module_name, set[str] outers) |
| bool | _has_star_import (ast.AST tree) |
| set[str] | _identifiers (ast.AST tree) |
| set[str]|None | _stored_attributes (list[tuple[str|None, ast.Module]] importers) |
| dict[str, dict] | _safe_renames (dict[str, dict] hoisted, list[tuple[str|None, ast.Module]] importers) |
| dict | qualify_imported_nested_classes (dict[str, dict] hoisted, Iterable[tuple[str|None, ast.Module]] importers) |
Name an imported module's nested class by the name it was hoisted to. The preprocessor lifts a class nested in a module-level class to module level as ``Outer__Inner`` and rewrites ``Outer.Inner`` within that module (#8256). An importing module still reads ``mod.Outer.Inner``, or ``Outer.Inner`` after ``from mod import Outer``, so those reads are rewritten here too (#9047). Only names bound by nothing but the import are rewritten, and only classes that no module stores to through an attribute or names otherwise.
|
protected |
The nodes of ``tree`` that bind ``name``.
|
protected |
The names ``tree`` binds to a class in ``outers`` by ``from module_name import``, and only so.
|
protected |
|
protected |
|
protected |
Whether ``binder`` is an ``import`` binding ``root`` to ``module_name`` or to the package it is in.
|
protected |
The dotted names through which ``tree`` reaches ``module_name`` by ``import``, when nothing else in ``tree`` binds their first part.
|
protected |
The renames in ``hoisted`` whose classes no module stores to through an attribute, and whose hoisted name no other module mentions: that name could resolve to the other module's binding, since ESBMC keys a class by its name alone.
|
protected |
The attribute names the modules store to or delete, or None when one may name an attribute only at run time, through setattr or delattr.
| dict parser.nested_class_imports.qualify_imported_nested_classes | ( | dict[str, dict] | hoisted, |
| Iterable[tuple[str | None, ast.Module]] | importers ) |
Rewrite each importer's reads of a class hoisted out of a module; ``hoisted`` maps a module to its ``(outer, inner) -> name`` renames. Returns the hoisted names each module must now export, per module.