pub struct Compiler { /* private fields */ }Expand description
A compiler to transform a list of Tokens into a single nested Expression tree.
§Remarks
Uses a Pratt-Parser to build the AST based on the tokens Precedence.
Implementations§
Source§impl Compiler
impl Compiler
Sourcepub fn compile_ast(tokens: Vec<Token>) -> Result<Expression>
pub fn compile_ast(tokens: Vec<Token>) -> Result<Expression>
Compiles a structured Expression tree from a list of Tokens.
§Errors
Returns an Error when encountering an invalid combination of Tokens.
Auto Trait Implementations§
impl Freeze for Compiler
impl RefUnwindSafe for Compiler
impl Send for Compiler
impl Sync for Compiler
impl Unpin for Compiler
impl UnwindSafe for Compiler
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