Skip to main content

rudb_parse/
lib.rs

1//! The SQL lexer, parser and AST, with a textual form that round trips.
2//!
3//! Rank 1 in the layer rule. See `xtask/layers.toml` and `spec/18-package-layout.md`.
4//!
5//! The grammar under `grammar/` is DuckDB's own, vendored verbatim and checked by
6//! `cargo xtask grammar`. Everything derived from it lands in `generated` and is written by
7//! `cargo xtask gen-grammar`. `spec/20-the-grammar.md` is the argument for doing it that way and
8//! the list of what it does and does not buy.
9
10#![forbid(unsafe_code)]
11
12pub mod ast;
13#[cfg(test)]
14mod corpus;
15pub mod deparse;
16pub mod dialect;
17pub mod generate;
18pub mod generated;
19pub mod matcher;
20pub mod rules;
21pub mod token;
22pub mod tokenize;
23pub mod transform;
24
25pub use ast::Ast;
26pub use generate::{Catalog, Generator, Table};
27pub use generated::keywords::{
28    COLUMN_NAME, FUNC_NAME, KEYWORDS, LONGEST, RESERVED, TYPE_NAME, UNRESERVED,
29};
30pub use matcher::{NONE, ParseNode, Tree, parse, parse_from, parse_tokens};
31pub use rules::{Node, Op, Rule, Suggestion, alternatives, rule, token_key};
32pub use token::{Flags, Kind, NOT_A_KEYWORD, Token};
33pub use tokenize::{classes, hints, identifier_parts, lookup, quoted, tokenize};
34pub use transform::{parse_ast, transform};