Skip to main content

Crate plsql_parser

Crate plsql_parser 

Source
Expand description

PL/SQL parser frontend.

This crate defines the backend-independent parsing API that all downstream crates consume. No ANTLR-generated types or grammar rule names escape this boundary (R2 / R20).

§Design

A ParseBackend implementation converts raw source text into a BackendParseResult containing the lossless token tape, a CST (concrete syntax tree), and a typed AST (abstract syntax tree).

The public parse_file / parse_with_backend functions wrap BackendParseResult into a ParseResult that pairs the output with the originating FileId.

§Lossless contract

The token tape is the source of truth for round-tripping. Every token and trivia element carries a byte-offset span. The AST is a semantic projection — it is NOT required to preserve whitespace or comments.

Re-exports§

pub use dialect::UNSUPPORTED_DIALECT_FEATURE_CODE;
pub use dialect::unsupported_dialect_feature_diagnostic;
pub use dialect::unsupported_dialect_feature_remediation;
pub use ast::Ast;
pub use ast::AstDecl;
pub use ast::AstExpr;
pub use ast::AstStatement;
pub use ast::AstTypeDecl;
pub use ast::ConcreteSyntaxTree;
pub use ast::CstNodeId;
pub use ast::SourceFile;
pub use ast::SourceMap;
pub use ast::Spanned;
pub use tokens::Token;
pub use tokens::TokenKind;
pub use tokens::TokenTape;
pub use tokens::Trivia;
pub use tokens::TriviaTable;

Modules§

ast
Concrete syntax tree and abstract syntax tree types.
dialect
Dialect-mismatch diagnostics for the parser.
tokens
Token tape types.
visit
AST visitor and walker traits.

Structs§

BackendParseResult
Raw output from a ParseBackend implementation.
ParseMetrics
Observability counters emitted alongside every parse result.
ParseOptions
Configuration knobs passed to every parse invocation.
ParseResult
Public-facing parse result, paired with the file that produced it.

Enums§

OracleTargetVersion
Simplified Oracle version targeting for the parser.
RecoveryMode
Error-recovery strategy.

Traits§

ParseBackend
Backend-independent parser interface (R2 / R20).

Functions§

parse_file
Parse a single file with the given backend, using default ParseOptions.
parse_with_backend
Parse a single file with the given backend and options.