ml_switcheroo.core.rewriter.context =================================== .. py:module:: ml_switcheroo.core.rewriter.context .. autoapi-nested-parse:: Rewriter Context Module. This module provides the `RewriterContext` container, which holds the shared state for the transpilation pipeline. It decouples state management (Symbol Tables, Scopes, Configuration) from the logic transformers (RewriterStages), enabling a composition-based architecture. Classes ------- .. autoapisummary:: ml_switcheroo.core.rewriter.context.RewriterContext Module Contents --------------- .. py:class:: RewriterContext(semantics: ml_switcheroo.semantics.manager.SemanticsManager, config: ml_switcheroo.config.RuntimeConfig, symbol_table: Optional[ml_switcheroo.analysis.symbol_table.SymbolTable] = None, arg_injector: Optional[Callable[[str, Optional[str]], None]] = None, preamble_injector: Optional[Callable[[str], None]] = None) Shared state container for the rewriting pipeline. Encapsulates all mutable state required during the AST traversal, allowing multiple `RewriterStage` passes to operate on a consistent context. .. py:attribute:: semantics .. py:attribute:: config .. py:attribute:: symbol_table :value: None .. py:attribute:: scope_stack :type: List[Set[str]] .. py:attribute:: signature_stack :type: List[ml_switcheroo.core.rewriter.types.SignatureContext] :value: [] .. py:attribute:: alias_map :type: Dict[str, str] .. py:attribute:: current_stmt_errors :type: List[str] :value: [] .. py:attribute:: current_stmt_warnings :type: List[str] :value: [] .. py:attribute:: module_preamble :type: List[str] :value: [] .. py:attribute:: in_module_class :type: bool :value: False .. py:attribute:: hook_context .. py:property:: source_fw :type: str Returns effective source framework string. .. py:property:: target_fw :type: str Returns effective target framework string.