Expand description
Error-resilient, event-based recursive-descent parser for Snowflake SQL.
parse turns source text into a lossless rowan CST plus a list of ParseErrors.
Parsing never fails: malformed input is wrapped in ERROR nodes and recovery continues, so
the tree always round-trips byte-for-byte (the basis for formatting and highlighting).
§Pipeline
tokenize -> Input -> Parser event stream -> build_tree.
§Modules
event/input/parser/grammar/builder— the parsing pipeline.ast— typed accessors over the untyped tree.
Structs§
- After
Match Clause - Alter
Action - Alter
Stmt - ArgList
- Array
Literal - AsOf
Travel - Assign
Stmt - Assignment
- Between
Expr - BinExpr
- Bind
Marker - Block
Stmt - Cache
Stmt - Call
Expr - Call
Stmt - Case
Expr - Case
Stmt - Case
Stmt When - Case
When - Cast
Expr - Column
Def - Column
DefList - Column
List - Comment
Stmt - Connect
ByClause - Copy
Location - Copy
Option - Copy
Stmt - Create
Stmt - Cte
- Declare
Item - Declare
Section - Define
Clause - Define
Item - Delete
Stmt - Describe
History Stmt - Describe
Stmt - Drop
Stmt - Exception
Section - Exception
When - Execute
Stmt - Exists
Expr - Expr
List - Expr
Stmt - Flow
Stmt - From
Clause - Grant
Stmt - Grant
Target - Grantee
- Group
ByClause - Grouping
Sets - Having
Clause - IfStmt
- InExpr
- Index
Expr - Insert
Stmt - Insert
When - Interval
Literal - Into
Clause - IsExpr
- Join
- Json
Access - Lambda
Expr - Lambda
Params - Lateral
View - LetStmt
- Limit
Clause - Line
Column - A one-based human-readable source position.
- Literal
- Loop
Stmt - Match
Recognize - Measures
Clause - Merge
Stmt - Merge
When - Name
- NameRef
- Named
Arg - Object
Field - Object
Literal - Object
Property - Offset
Clause - Optimize
Stmt - Order
ByClause - Order
ByItem - Paren
Expr - Parse
- The result of parsing: a lossless green tree plus any diagnostics.
- Parse
Error - A diagnostic produced while parsing, located at a byte span into the source.
- Partition
ByClause - Pattern
Body - Pattern
Clause - Pivot
Clause - Prefix
Expr - Priv
List - Qualify
Clause - Refresh
Stmt - Return
Stmt - Revoke
Stmt - Routine
Language Clause - Routine
Returns Clause - RowMatch
Clause - Script
Stmt - Select
Item - Select
List - Select
Stmt - Semantic
View Clause - Semantic
View Item - SetClause
- SetOp
- SetStmt
- Show
Stmt - Source
File - Stage
File Stmt - Stage
Ref - Star
Expr - Start
With Clause - Stmt
List - Stream
Source - Subquery
- Subset
Clause - Table
Ref - Task
After - Transaction
Stmt - Truncate
Stmt - Type
Name - Uncache
Stmt - Undrop
Stmt - Update
Stmt - UseStmt
- Vacuum
Stmt - Values
Clause - Values
Row - Where
Clause - Window
Expr - Window
Frame - Window
Spec - With
Clause - With
Query - Within
Group - Zorder
Clause
Enums§
- Dialect
- The SQL dialect a lex/parse/format request targets.
- Syntax
Kind - Every lexical token kind and syntax node kind understood by sql-dialect-fmt.
Traits§
- AstNode
- A typed view of a CST node of a particular kind.
Functions§
- parse
- Parse Snowflake SQL source into a lossless CST. Never panics; never loses input.
- parse_
with_ dialect - Parse
textasdialectinto a lossless CST. Never panics; never loses input.