Expand description
IR for PL/SQL expressions and name references.
Sibling of stmt: where statements carry raw
rhs_text / cond_text slices, the expression IR shipped
here lets downstream passes (lineage, bindgen, SAST) reason
about expression structure without re-tokenising.
The expression grammar is intentionally conservative — every
shape recognised here is one we’ve found in the lab corpus
and the synthetic L1 / L2 fixtures. Anything outside this set
lowers to Expr::Raw with the original text, mirroring the
Statement::Unrecognized posture from.
§/oracle evidence
DATABASE-REFERENCE.mdPL/SQL Language Reference — the recognised reference shapes (<ident>,<schema>.<obj>,<schema>.<obj>.<member>,<table>(<args>)for function calls and array access) and the operator precedence table for binary ops come from the PL/SQL Language Reference chapter on expressions.LOW-LEVEL-CATALOGS.mdData Dictionary View Families —ALL_IDENTIFIERSis the PL/Scope-side view that later passes cross-check our reference resolution against.
Structs§
Enums§
- Expr
- One PL/SQL expression node.
- Unknown
Expr Reason
Constants§
- MAX_
EXPR_ DEPTH - Maximum expression-lowering recursion depth. Real well-formed
PL/SQL expressions nest far below this; the cap exists only so a
crafted flat binary chain or pathologically-nested paren / call /
unary spine cannot drive
lower_expression(and the secondary tree-walk consumers that re-walk the producedBox<Expr>chain to identical depth —collect_calls,collect_expr_flow,canonicalize_expr) into a stack-overflow / SIGABRT. Chosen high enough that it never clips genuine expressions and low enough that 256 frames of the walk cannot overflow even a 2 MiB tokio worker stack. Mirrors the honest-degradation posture ofcrate::MAX_RELOWER_DEPTH.
Functions§
- lower_
expression - Lower a raw expression-source slice into an
Expr. Errors surface asExpr::Rawwith a typed reason — never panic.