[−][src]Enum avra_lib::expr::Expr
Assembly uses constant expressions to avoid copying magic numbers around. Expr represents these constant expressions.
The run method evaluates the constant expression. The get_2bytes, get_byte and get_bit_index evaluate the constant expression but also convert to a specific low level type needed by instructions.
Variants
Ident(String)
Const(i64)
Binary(Box<BinaryExpr>)
Methods
impl Expr
[src]
pub fn binary(left: Expr, operator: BinaryOperator, right: Expr) -> Expr
[src]
pub fn unary(expr: Expr, operator: UnaryOperator) -> Expr
[src]
pub fn get_words(
&self,
constants: &dyn Context
) -> Result<[u8; 2], ExprRunError>
[src]
&self,
constants: &dyn Context
) -> Result<[u8; 2], ExprRunError>
pub fn get_double_words(
&self,
constants: &dyn Context
) -> Result<[u8; 4], ExprRunError>
[src]
&self,
constants: &dyn Context
) -> Result<[u8; 4], ExprRunError>
pub fn get_quad_words(
&self,
constants: &dyn Context
) -> Result<[u8; 8], ExprRunError>
[src]
&self,
constants: &dyn Context
) -> Result<[u8; 8], ExprRunError>
pub fn get_byte(&self, constants: &dyn Context) -> Result<u8, ExprRunError>
[src]
pub fn get_bit_index(&self, constants: &dyn Context) -> Result<u8, ExprRunError>
[src]
pub fn run(&self, constants: &dyn Context) -> Result<i64, ExprRunError>
[src]
Trait Implementations
impl Clone for Expr
[src]
impl Debug for Expr
[src]
impl Display for Expr
[src]
impl Eq for Expr
[src]
impl PartialEq<Expr> for Expr
[src]
impl StructuralEq for Expr
[src]
impl StructuralPartialEq for Expr
[src]
Auto Trait Implementations
impl RefUnwindSafe for Expr
impl Send for Expr
impl Sync for Expr
impl Unpin for Expr
impl UnwindSafe for Expr
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,