Skip to main content

Module stmt

Module stmt 

Source
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:

  1. The complete IR enum so downstream consumers (analysis passes, lineage, bindings) can program against a stable surface today.
  2. 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.md PL/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 anchors DBMS_OUTPUT / DBMS_SCHEDULER usage that may appear in EXECUTE IMMEDIATE bodies.

Structs§

IfArm

Enums§

SqlVerb
Statement
One PL/SQL statement, in source order.
UnknownStatementReason

Functions§

lower_statement_body
Lower a raw statement-body source slice (i.e. the bytes between BEGIN and END of a routine) into a vector of IR statements. The recognizer is line-shaped: