pub struct Parser<'a> { /* private fields */ }Expand description
The recursive-descent parser over significant tokens.
Implementations§
Source§impl<'a> Parser<'a>
impl<'a> Parser<'a>
pub fn new(src: &'a str, tokens: Vec<Token>) -> Self
Sourcepub fn with_extended_syntax(self) -> Self
pub fn with_extended_syntax(self) -> Self
Accept the Spark/Calcite constructs listed at parse_query_extended.
Sourcepub fn parse_identifier(&mut self) -> Result<Ident>
pub fn parse_identifier(&mut self) -> Result<Ident>
An unreserved word or a backtick-quoted name.
Sourcepub fn parse_object_name(&mut self, table: bool) -> Result<ObjectName>
pub fn parse_object_name(&mut self, table: bool) -> Result<ObjectName>
A dotted name. With table, the first part may hold dashes (my-project.ds.t).
Sourcepub fn parse_statement(&mut self) -> Result<Statement>
pub fn parse_statement(&mut self) -> Result<Statement>
Parse one statement at the current position.
Sourcepub fn parse_query(&mut self) -> Result<Query>
pub fn parse_query(&mut self) -> Result<Query>
Parse a query at the current position.
Sourcepub fn parse_table_factor(&mut self) -> Result<TableFactor>
pub fn parse_table_factor(&mut self) -> Result<TableFactor>
One FROM item: a table, subquery, UNNEST, table function or parenthesized join, with
any PIVOT, UNPIVOT and TABLESAMPLE after it.
Sourcepub fn parse_expr(&mut self) -> Result<Expr>
pub fn parse_expr(&mut self) -> Result<Expr>
Parse a full expression.
Sourcepub fn parse_data_type(&mut self) -> Result<DataType>
pub fn parse_data_type(&mut self) -> Result<DataType>
Parse a data type at the current position.
Auto Trait Implementations§
impl<'a> Forget for Parser<'a>
impl<'a> Freeze for Parser<'a>where
&'a str: Freeze,
*const u8 is !null: Freeze,
PhantomData<Token>: Freeze,
PhantomData<TokenRole>: Freeze,
PhantomData<(usize, Token)>: Freeze,
impl<'a> Move for Parser<'a>
impl<'a> RefUnwindSafe for Parser<'a>
impl<'a> Send for Parser<'a>
impl<'a> Sync for Parser<'a>where
RawVecInner: Sync,
impl<'a> Unpin for Parser<'a>
impl<'a> UnsafeUnpin for Parser<'a>where
&'a str: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<Token>: UnsafeUnpin,
PhantomData<TokenRole>: UnsafeUnpin,
PhantomData<(usize, Token)>: UnsafeUnpin,
impl<'a> UnwindSafe for Parser<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more