Skip to main content

Module lower

Module lower 

Source
Expand description

AST → IR lowering for top-level declarations.

Walks plsql_parser::Ast::root.declarations and produces a LoweredFile containing one Declaration per recognized AstDecl variant plus a Vec<Diagnostic> for unclassified rows (R13 — typed uncertainty, never silent drops).

Pipeline:

  1. Iterate ast.root.declarations.
  2. For each variant emit a Declaration with the source name interned into the supplied SymbolInterner.
  3. AstDecl::Unknown becomes a typed parser-recovery-region diagnostic so the engine’s CompletenessReport reflects the unclassified region instead of dropping it.
  4. AstDecl::Ddl is currently informational — the rule engine that classifies CREATE / ALTER / DROP / GRANT lives in the catalog + ChangeSet layers; here we record the verb in a diagnostic and let callers decide.

Structs§

LoweredFile
Bundle of declarations + diagnostics produced by lower_top_level.

Functions§

lower_top_level
Lower every top-level AstDecl in ast to an IR Declaration.