Skip to main content

Parser

Struct Parser 

Source
pub struct Parser<'a> { /* private fields */ }
Expand description

The recursive-descent parser over significant tokens.

Implementations§

Source§

impl<'a> Parser<'a>

Source

pub fn new(src: &'a str, tokens: Vec<Token>) -> Self

Source

pub fn with_extended_syntax(self) -> Self

Accept the Spark/Calcite constructs listed at parse_query_extended.

Source

pub fn parse_identifier(&mut self) -> Result<Ident>

An unreserved word or a backtick-quoted name.

Source

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).

Source

pub fn parse_statement(&mut self) -> Result<Statement>

Parse one statement at the current position.

Source

pub fn parse_query(&mut self) -> Result<Query>

Parse a query at the current position.

Source

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.

Source

pub fn parse_expr(&mut self) -> Result<Expr>

Parse a full expression.

Source

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>

§

impl<'a> Move for Parser<'a>

§

impl<'a> RefUnwindSafe for Parser<'a>

§

impl<'a> Send for Parser<'a>
where &'a str: Send, RawVecInner: Send,

§

impl<'a> Sync for Parser<'a>
where RawVecInner: Sync,

§

impl<'a> Unpin for Parser<'a>
where &'a str: Unpin, *const u8 is !null: Unpin,

§

impl<'a> UnsafeUnpin for Parser<'a>

§

impl<'a> UnwindSafe for Parser<'a>
where &'a str: UnwindSafe, RawVecInner: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.