Skip to main content

Crate sql_dialect_fmt_parser

Crate sql_dialect_fmt_parser 

Source
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§

AfterMatchClause
AlterAction
AlterStmt
ArgList
ArrayLiteral
AsOfTravel
AssignStmt
Assignment
BetweenExpr
BinExpr
BindMarker
BlockStmt
CacheStmt
CallExpr
CallStmt
CaseExpr
CaseStmt
CaseStmtWhen
CaseWhen
CastExpr
ColumnDef
ColumnDefList
ColumnList
CommentStmt
ConnectByClause
CopyLocation
CopyOption
CopyStmt
CreateStmt
Cte
DeclareItem
DeclareSection
DefineClause
DefineItem
DeleteStmt
DescribeHistoryStmt
DescribeStmt
DropStmt
ExceptionSection
ExceptionWhen
ExecuteStmt
ExistsExpr
ExprList
ExprStmt
FlowStmt
FromClause
GrantStmt
GrantTarget
Grantee
GroupByClause
GroupingSets
HavingClause
IfStmt
InExpr
IndexExpr
InsertStmt
InsertWhen
IntervalLiteral
IntoClause
IsExpr
Join
JsonAccess
LambdaExpr
LambdaParams
LateralView
LetStmt
LimitClause
LineColumn
A one-based human-readable source position.
Literal
LoopStmt
MatchRecognize
MeasuresClause
MergeStmt
MergeWhen
Name
NameRef
NamedArg
ObjectField
ObjectLiteral
ObjectProperty
OffsetClause
OptimizeStmt
OrderByClause
OrderByItem
ParenExpr
Parse
The result of parsing: a lossless green tree plus any diagnostics.
ParseError
A diagnostic produced while parsing, located at a byte span into the source.
PartitionByClause
PatternBody
PatternClause
PivotClause
PrefixExpr
PrivList
QualifyClause
RefreshStmt
ReturnStmt
RevokeStmt
RoutineLanguageClause
RoutineReturnsClause
RowMatchClause
ScriptStmt
SelectItem
SelectList
SelectStmt
SemanticViewClause
SemanticViewItem
SetClause
SetOp
SetStmt
ShowStmt
SourceFile
StageFileStmt
StageRef
StarExpr
StartWithClause
StmtList
StreamSource
Subquery
SubsetClause
TableRef
TaskAfter
TransactionStmt
TruncateStmt
TypeName
UncacheStmt
UndropStmt
UpdateStmt
UseStmt
VacuumStmt
ValuesClause
ValuesRow
WhereClause
WindowExpr
WindowFrame
WindowSpec
WithClause
WithQuery
WithinGroup
ZorderClause

Enums§

Dialect
The SQL dialect a lex/parse/format request targets.
SyntaxKind
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 text as dialect into a lossless CST. Never panics; never loses input.

Type Aliases§

SyntaxNode