ml_switcheroo.core.engine¶

Orchestration Engine for AST Transformations.

This module provides the ASTEngine, generating code via: 1. Compiler Pipeline: For ISA/Visuals (Source -> Graph -> Backend -> Target). 2. Rewriter Pipeline: For High-Level Frameworks (Source -> CST -> Pipeline(Structure, API, Aux) -> Target).

  • Supports optional Graph-Guided Rewriting (Loopback).

Classes¶

ASTEngine

The main driver for the conversion process.

Module Contents¶

class ml_switcheroo.core.engine.ASTEngine(semantics: ml_switcheroo.semantics.manager.SemanticsManager | None = None, config: ml_switcheroo.config.RuntimeConfig | None = None, source: str | None = None, target: str | None = None, strict_mode: bool = False, enable_graph_optimization: bool = False, plugin_config: Dict[str, Any] | None = None, intermediate: str | None = None)[source]¶

The main driver for the conversion process.

semantics: ml_switcheroo.semantics.manager.SemanticsManager¶
source¶
target¶
run(code: str) → ml_switcheroo.core.conversion_result.ConversionResult[source]¶

Main execution point.

parse(code: str) → libcst.Module[source]¶

Parses python string to CST Module.

to_source(tree: libcst.Module) → str[source]¶

Converts CST Module back to string.

property strict_mode: bool¶

Helper property for strict mode config.