pub struct Parser { /* private fields */ }Expand description
A parser for converting tokens into an AST.
Implementations§
Source§impl Parser
impl Parser
pub fn new(tokens: Vec<Token>, include_whitespace: bool) -> Self
pub fn new_with_dialect( tokens: Vec<Token>, include_whitespace: bool, dialect: FormulaDialect, ) -> Self
Sourcepub fn with_volatility_classifier<F>(self, f: F) -> Self
pub fn with_volatility_classifier<F>(self, f: F) -> Self
Provide a function-volatility classifier for this parser. If set, the parser will annotate ASTs with a contains_volatile bit.
Sourcepub fn new_with_classifier<F>(
tokens: Vec<Token>,
include_whitespace: bool,
f: F,
) -> Self
pub fn new_with_classifier<F>( tokens: Vec<Token>, include_whitespace: bool, f: F, ) -> Self
Convenience constructor to set a classifier alongside other options.
pub fn new_with_classifier_and_dialect<F>( tokens: Vec<Token>, include_whitespace: bool, dialect: FormulaDialect, f: F, ) -> Self
Sourcepub fn parse(&mut self) -> Result<ASTNode, ParserError>
pub fn parse(&mut self) -> Result<ASTNode, ParserError>
Parse the tokens into an AST.
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 !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