Classes
CompilerCoreProtocol
11
▼
Minimal contract for cross-mixin dependencies in compiler.
Contains ONLY:
1. Host class attributes…
CompilerCoreProtocol
11
▼
Minimal contract for cross-mixin dependencies in compiler.
Contains ONLY:
- Host class attributes (defined in Compiler.init)
- Core compilation methods (used by all compilation mixins)
- Operator utilities (used by expression compilation)
Individual mixin methods are NOT included—mixins declare their own methods via inline TYPE_CHECKING declarations.
Attributes
| Name | Type | Description |
|---|---|---|
_env |
Environment
|
— |
_name |
str | None
|
— |
_filename |
str | None
|
— |
_locals |
set[str]
|
— |
_blocks |
dict[str, Any]
|
— |
_block_counter |
int
|
— |
Methods
Internal Methods 5 ▼
_compile_expr
2
ast.expr
▼
Compile expression node to Python AST expression.
_compile_expr
2
ast.expr
▼
def _compile_expr(self, node: Any, store: bool = False) -> ast.expr
Parameters
| Name | Type | Description |
|---|---|---|
node |
— |
|
store |
— |
Default:False
|
Returns
ast.expr
_compile_node
1
list[ast.stmt]
▼
Compile a single AST node to Python statements.
_compile_node
1
list[ast.stmt]
▼
def _compile_node(self, node: Any) -> list[ast.stmt]
Parameters
| Name | Type | Description |
|---|---|---|
node |
— |
Returns
list[ast.stmt]
_get_binop
1
ast.operator
▼
Map operator string to AST operator.
_get_binop
1
ast.operator
▼
def _get_binop(self, op: str) -> ast.operator
Parameters
| Name | Type | Description |
|---|---|---|
op |
— |
Returns
ast.operator
_get_unaryop
1
ast.unaryop
▼
Map unary operator string to AST operator.
_get_unaryop
1
ast.unaryop
▼
def _get_unaryop(self, op: str) -> ast.unaryop
Parameters
| Name | Type | Description |
|---|---|---|
op |
— |
Returns
ast.unaryop
_get_cmpop
1
ast.cmpop
▼
Map comparison operator string to AST operator.
_get_cmpop
1
ast.cmpop
▼
def _get_cmpop(self, op: str) -> ast.cmpop
Parameters
| Name | Type | Description |
|---|---|---|
op |
— |
Returns
ast.cmpop