Expand description
Recursive-descent parser for GoogleSQL (BigQuery) statements, queries and expressions.
Expressions use precedence climbing with BigQuery’s operator precedence. Statements the AST
does not model (GRANT, CREATE MODEL, …) parse to Statement::Raw holding their text;
a statement the parser does model but cannot read is an error.
Structs§
- Parsed
Script - Statements with the tokens they were read from.
- Parser
- The recursive-descent parser over significant tokens.
Enums§
- Token
Role - What a significant token turned out to be, as the parser read it. Used by the formatter to change the case of keywords, function names, type names and literals only.
Functions§
- parse_
data_ type - Parse one data type (
ARRAY<STRUCT<a INT64>>). - parse_
expr - Parse one expression.
- parse_
query - Parse exactly one query (a trailing semicolon is allowed).
- parse_
query_ extended - Parse exactly one query accepting the constructs of
parse_statements_extended. - parse_
script - Parse
sqlkeeping its tokens, their roles and each statement’s span. - parse_
statement - Parse exactly one statement.
- parse_
statements - Parse every statement of
sql(separated by semicolons; a trailing one is optional). - parse_
statements_ extended - Parse every statement of
sqlaccepting the Spark/Calcite constructs BigQuery lacks, each desugared to plain BigQuery syntax with the same meaning: