pub struct Grammar;Expand description
Grammar provides methods to parse SQL constructs into CST segments.
Each parse method returns Option<Segment> — None means the
construct was not found at the current position, and the cursor
is left unchanged (backtracking).
Implementations§
Source§impl Grammar
impl Grammar
Sourcepub fn parse_file<'a>(ctx: &mut ParseContext<'a>) -> Segment
pub fn parse_file<'a>(ctx: &mut ParseContext<'a>) -> Segment
Parse a complete SQL file: zero or more statements.
Sourcepub fn parse_statement<'a>(ctx: &mut ParseContext<'a>) -> Option<Segment>
pub fn parse_statement<'a>(ctx: &mut ParseContext<'a>) -> Option<Segment>
Parse a single statement (terminated by ; or EOF).
Sourcepub fn parse_expression<'a>(ctx: &mut ParseContext<'a>) -> Option<Segment>
pub fn parse_expression<'a>(ctx: &mut ParseContext<'a>) -> Option<Segment>
Parse an expression. This uses a simple precedence climbing approach.
Auto Trait Implementations§
impl Freeze for Grammar
impl RefUnwindSafe for Grammar
impl Send for Grammar
impl Sync for Grammar
impl Unpin for Grammar
impl UnsafeUnpin for Grammar
impl UnwindSafe for Grammar
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