pub struct Parser { /* private fields */ }Expand description
High-level SQL parser: source text → CST.
Implementations§
Source§impl Parser
impl Parser
pub fn new(lexer_config: LexerConfig, grammar: Box<dyn Grammar>) -> Self
Sourcepub fn parse(&self, source: &str) -> Result<Segment, ParseError>
pub fn parse(&self, source: &str) -> Result<Segment, ParseError>
Parse SQL source into a CST rooted at a File segment.
Sourcepub fn parse_with_diagnostics(
&self,
source: &str,
) -> Result<ParseResult, ParseError>
pub fn parse_with_diagnostics( &self, source: &str, ) -> Result<ParseResult, ParseError>
Parse SQL source, returning both the CST and any diagnostics produced during error recovery.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Parser
impl !RefUnwindSafe for Parser
impl Send for Parser
impl Sync for Parser
impl Unpin for Parser
impl UnsafeUnpin for Parser
impl !UnwindSafe for Parser
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