l0_check_state::CheckerState class

Defined in module l0_check_state (l0_check_state.py).

Canonical checker state, lexical/liveness stacks, and diagnostic replay.

Public static attributes

static AnalysisResult analysis

Public functions

auto __post_init__(self) -> None
Initialize checker with analysis data and cache builtin types.

Public attributes

struct_infos
enum_infos
func_types
func_envs
diagnostics
expr_types

Protected functions

auto _make_param_scope(self, FunctionEnv func_env, FuncType func_type) -> dict[str, Type]
Create a name-to-type mapping for function parameters.
auto _make_param_alive_scope(self, FunctionEnv func_env) -> dict[str, bool]
Initialize liveness tracking for function parameters.
auto _push_scope(self) -> None
Enter a new lexical scope.
auto _pop_scope(self) -> None
Exit the current lexical scope.
auto _is_guarded_cleanup_header_ref(self, str name, int scope_index) -> bool
True when a local resolves to a guarded maybe-uninitialized header let.
auto _lookup_alive(self, str name) -> bool|None
Check if a variable is currently alive (not dropped).
auto _set_alive(self, str name, bool alive) -> None
Set the liveness state of a variable.
auto _clone_alive_scopes(self) -> list[dict[str, bool]]
Clone the current definite-liveness stack.
auto _meet_alive_scopes(self, *list] states[dict[str, bool]) -> None
Keep a binding alive only when every incoming state keeps it alive.
auto _meet_alive_state(self, *list] states[dict[str, bool]) -> list[dict[str, bool]]
Return the definite-liveness meet of several states.
auto _store_var_resolution(self, VarRef expr, VarRefResolution resolution) -> None
Record stable resolution metadata outside liveness-only replay.
auto _store_sizeof_target(self, CallExpr expr, Type target_ty) -> None
Store the resolved sizeof target type for codegen.
auto _error(self, Node|None node, str message) -> None
Report an error diagnostic.
auto _warn(self, Node|None node, str message) -> None
Report a warning diagnostic.
auto _diagnostic(self, Node|None node, str message, str kind = "info") -> None
Internal helper to create and append a diagnostic.

Protected attributes

_local_scopes
_cleanup_header_ref_guard_stack
_alive_scopes