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.