analysis
¶
Modules:
-
context– -
diagnostics– -
facade– -
normalization– -
resolved_nodes– -
scopes– -
symbols– -
types– -
typing– -
validation–
Classes:
-
Diagnostic– -
DiagnosticBag– -
ResolvedAssignment– -
ResolvedOperator– -
SemanticError– -
SemanticFlags– -
SemanticFunction– -
SemanticInfo– -
SemanticSymbol–
Functions:
Diagnostic
dataclass
¶
Diagnostic(
message: str,
node: AST | None = None,
code: str | None = None,
severity: str = "error",
)
Methods:
-
format–
format
¶
format() -> str
Source code in src/irx/analysis/diagnostics.py
36 37 38 39 40 41 42 43 44 45 46 47 48 | |
DiagnosticBag
¶
DiagnosticBag()
Methods:
-
add– -
extend– -
format– -
has_errors– -
raise_if_errors–
Source code in src/irx/analysis/diagnostics.py
60 61 62 63 64 | |
add
¶
Source code in src/irx/analysis/diagnostics.py
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | |
extend
¶
extend(diagnostics: Iterable[Diagnostic]) -> None
Source code in src/irx/analysis/diagnostics.py
87 88 89 90 91 92 93 94 | |
format
¶
format() -> str
Source code in src/irx/analysis/diagnostics.py
104 105 106 107 108 109 110 | |
has_errors
¶
has_errors() -> bool
Source code in src/irx/analysis/diagnostics.py
96 97 98 99 100 101 102 | |
raise_if_errors
¶
raise_if_errors() -> None
Source code in src/irx/analysis/diagnostics.py
112 113 114 115 116 117 | |
ResolvedOperator
dataclass
¶
ResolvedOperator(
op_code: str,
result_type: DataType | None = None,
lhs_type: DataType | None = None,
rhs_type: DataType | None = None,
flags: SemanticFlags = SemanticFlags(),
)
SemanticError
¶
SemanticError(diagnostics: DiagnosticBag)
Bases: Exception
Source code in src/irx/analysis/diagnostics.py
131 132 133 134 135 136 137 138 139 | |
SemanticFlags
dataclass
¶
SemanticFlags(
unsigned: bool = False,
fast_math: bool = False,
fma: bool = False,
fma_rhs: AST | None = None,
)
SemanticFunction
dataclass
¶
SemanticFunction(
symbol_id: str,
name: str,
return_type: DataType,
args: tuple[SemanticSymbol, ...],
prototype: FunctionPrototype,
definition: FunctionDef | None = None,
)
SemanticInfo
dataclass
¶
SemanticInfo(
resolved_type: DataType | None = None,
resolved_symbol: SemanticSymbol | None = None,
resolved_function: SemanticFunction | None = None,
resolved_operator: ResolvedOperator | None = None,
resolved_assignment: ResolvedAssignment | None = None,
semantic_flags: SemanticFlags = SemanticFlags(),
extras: dict[str, Any] = dict(),
)
SemanticSymbol
dataclass
¶
SemanticSymbol(
symbol_id: str,
name: str,
type_: DataType,
is_mutable: bool,
kind: str,
declaration: AST | None = None,
)
analyze
¶
analyze(node: AST) -> AST
Source code in src/irx/analysis/facade.py
1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 | |
analyze_module
¶
analyze_module(module: Module) -> Module
Source code in src/irx/analysis/facade.py
1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 | |