pub trait BasicExprBuilder {
// Required methods
fn push(&mut self, _: Stmt);
fn emit_error_at(&mut self, _: ErrorSpan, _: Arguments<'_>);
fn bit_or(&mut self, _: Expr, _: Value) -> Option<Expr>;
fn bit_and(&mut self, _: Expr, _: Value) -> Option<Expr>;
fn bit_xor(&mut self, _: Expr, _: Value) -> Option<Expr>;
fn add(&mut self, _: Expr, _: Value) -> Option<Expr>;
fn mul(&mut self, _: Expr, _: Value) -> Option<Expr>;
fn neg(&mut self, _: Expr) -> Option<Expr>;
fn log2(&mut self, _: Expr) -> Option<Expr>;
fn mask_shift(&mut self, val: Expr, mask: u64, shift: i8) -> Option<Expr>;
}Expand description
An environment that can dynamically build expressions from values.
These are used to integrate dynamic user expression into assembled code where values appear only in a modified form.
Required Methods§
Sourcefn emit_error_at(&mut self, _: ErrorSpan, _: Arguments<'_>)
fn emit_error_at(&mut self, _: ErrorSpan, _: Arguments<'_>)
Emit an error message. When any error is generated then the instruction compilation is expected to fail.
Implementors§
impl BasicExprBuilder for State<'_>
A simple implementation of a BasicExprBuilder.
It can not combine any expressions, pushes statements into a Vec and emits errors onto
standard error directly.