pub struct Parser {
pub current_token: Token,
/* private fields */
}Fields§
§current_token: TokenImplementations§
Source§impl Parser
impl Parser
pub fn new(input: &str) -> Self
Sourcepub fn with_mode(input: &str, mode: ParserMode) -> Self
pub fn with_mode(input: &str, mode: ParserMode) -> Self
Create a new parser with explicit mode for comment preservation
pub fn with_config(input: &str, config: ParserConfig) -> Self
pub fn with_columns(self, columns: Vec<String>) -> Self
pub fn with_debug_trace(self, enabled: bool) -> Self
pub fn with_function_registry(self, registry: Arc<FunctionRegistry>) -> Self
pub fn with_generator_registry(self, registry: Arc<GeneratorRegistry>) -> Self
pub fn consume(&mut self, expected: Token) -> Result<(), String>
pub fn advance(&mut self)
pub fn parse(&mut self) -> Result<SelectStatement, String>
pub fn get_position(&self) -> usize
Trait Implementations§
Source§impl ExpressionParser for Parser
impl ExpressionParser for Parser
Source§impl ParseArithmetic for Parser
impl ParseArithmetic for Parser
fn current_token(&self) -> &Token
fn advance(&mut self)
fn consume(&mut self, expected: Token) -> Result<(), String>
fn parse_primary(&mut self) -> Result<SqlExpression, String>
fn parse_multiplicative(&mut self) -> Result<SqlExpression, String>
fn parse_method_args(&mut self) -> Result<Vec<SqlExpression>, String>
Source§impl ParseComparison for Parser
impl ParseComparison for Parser
fn current_token(&self) -> &Token
fn advance(&mut self)
fn consume(&mut self, expected: Token) -> Result<(), String>
fn parse_primary(&mut self) -> Result<SqlExpression, String>
fn parse_additive(&mut self) -> Result<SqlExpression, String>
fn parse_expression_list(&mut self) -> Result<Vec<SqlExpression>, String>
fn parse_subquery(&mut self) -> Result<SelectStatement, String>
Source§impl ParseLogical for Parser
impl ParseLogical for Parser
fn current_token(&self) -> &Token
fn advance(&mut self)
fn consume(&mut self, expected: Token) -> Result<(), String>
fn parse_logical_and(&mut self) -> Result<SqlExpression, String>
fn parse_base_logical_expression(&mut self) -> Result<SqlExpression, String>
fn parse_comparison(&mut self) -> Result<SqlExpression, String>
fn parse_expression_list(&mut self) -> Result<Vec<SqlExpression>, String>
Source§impl ParsePrimary for Parser
impl ParsePrimary for Parser
fn current_token(&self) -> &Token
fn advance(&mut self)
fn consume(&mut self, expected: Token) -> Result<(), String>
fn parse_case_expression(&mut self) -> Result<SqlExpression, String>
fn parse_function_args(&mut self) -> Result<(Vec<SqlExpression>, bool), String>
fn parse_window_spec(&mut self) -> Result<WindowSpec, String>
fn parse_logical_or(&mut self) -> Result<SqlExpression, String>
fn parse_comparison(&mut self) -> Result<SqlExpression, String>
fn parse_expression_list(&mut self) -> Result<Vec<SqlExpression>, String>
fn parse_subquery(&mut self) -> Result<SelectStatement, String>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more