Skip to content

Dialect

FromPythonAST dataclass

FromPythonAST()

Bases: ABC


              flowchart TD
              kirin.lowering.python.dialect.FromPythonAST[FromPythonAST]

              

              click kirin.lowering.python.dialect.FromPythonAST href "" "kirin.lowering.python.dialect.FromPythonAST"
            

callee_table class-attribute

callee_table: dict[object, Transform]

a table of lowering transforms for ast.Call based on the callable object if avaiable as a global value.

lower

lower(state: State[AST], node: AST) -> Result

Entry point of dialect specific lowering.

Source code in src/kirin/lowering/python/dialect.py
70
71
72
73
74
def lower(self, state: State[ast.AST], node: ast.AST) -> Result:
    """Entry point of dialect specific lowering."""
    return getattr(self, f"lower_{node.__class__.__name__}", self.unreachable)(
        state, node
    )