Expand description
IR for PL/SQL statement bodies.
Adds the Statement enum and a heuristic lowering pass that
turns a raw statement-body source slice into a sequence of IR
statements. The full AST→IR lowering will wire lower_statement
against the actual parser tree once (statement-
body lowering in the parser) lands. Until then, this module
ships:
- The complete IR enum so downstream consumers (analysis passes, lineage, bindings) can program against a stable surface today.
- A line-shaped heuristic classifier used by the engine’s source-only fallback path — sufficient for the lab corpus’s common-case statements (assignment, control flow, raise, return, exit, null, EXECUTE IMMEDIATE, simple SQL).
Both surfaces honour R13 (typed UnknownReason) by emitting
Statement::Unrecognized with a reason discriminant when the
recognizer cannot classify a line.
§/oracle evidence
DATABASE-REFERENCE.mdPL/SQL Language Reference — the recognised statement shapes (IF / ELSIF / ELSE,LOOP,FOR i IN …,WHILE,RAISE,RETURN,EXECUTE IMMEDIATE, SQL statements) match the PL/SQL Language Reference chapter on statements.LOW-LEVEL-CATALOGS.md— the supplied-package bucket anchorsDBMS_OUTPUT/DBMS_SCHEDULERusage that may appear in EXECUTE IMMEDIATE bodies.
Structs§
Enums§
- SqlVerb
- Statement
- One PL/SQL statement, in source order.
- Unknown
Statement Reason
Functions§
- lower_
statement_ body - Lower a raw statement-body source slice (i.e. the bytes
between
BEGINandENDof a routine) into a vector of IR statements. The recognizer is line-shaped: