[][src]Enum cpclib_asm::preamble::tokens::Expr

pub enum Expr {
    Value(i32),
    String(String),
    Label(String),
    Duration(Box<Token>),
    OpCode(Box<Token>),
    Add(Box<Expr>, Box<Expr>),
    Sub(Box<Expr>, Box<Expr>),
    Mul(Box<Expr>, Box<Expr>),
    Div(Box<Expr>, Box<Expr>),
    Mod(Box<Expr>, Box<Expr>),
    BinaryAnd(Box<Expr>, Box<Expr>),
    BinaryOr(Box<Expr>, Box<Expr>),
    BinaryXor(Box<Expr>, Box<Expr>),
    Neg(Box<Expr>),
    Paren(Box<Expr>),
    Equal(Box<Expr>, Box<Expr>),
    LowerOrEqual(Box<Expr>, Box<Expr>),
    GreaterOrEqual(Box<Expr>, Box<Expr>),
    StrictlyGreater(Box<Expr>, Box<Expr>),
    StrictlyLower(Box<Expr>, Box<Expr>),
    UnaryFunction(UnaryFunctionBox<Expr>),
    BinaryFunction(BinaryFunctionBox<Expr>, Box<Expr>),
}

Expression nodes.

Variants

Value(i32)

32 bits integer value (should be able to include any integer value manipulated by the assember.

String(String)

String (for db directive)

Label(String)

Label

Duration(Box<Token>)

This expression node represents the duration of an instruction. The duration is compute at assembling and not at parsing in order to benefit of the symbol table

OpCode(Box<Token>)
Add(Box<Expr>, Box<Expr>)
Sub(Box<Expr>, Box<Expr>)
Mul(Box<Expr>, Box<Expr>)
Div(Box<Expr>, Box<Expr>)
Mod(Box<Expr>, Box<Expr>)
BinaryAnd(Box<Expr>, Box<Expr>)
BinaryOr(Box<Expr>, Box<Expr>)
BinaryXor(Box<Expr>, Box<Expr>)
Neg(Box<Expr>)
Paren(Box<Expr>)
Equal(Box<Expr>, Box<Expr>)
LowerOrEqual(Box<Expr>, Box<Expr>)
GreaterOrEqual(Box<Expr>, Box<Expr>)
StrictlyGreater(Box<Expr>, Box<Expr>)
StrictlyLower(Box<Expr>, Box<Expr>)
UnaryFunction(UnaryFunctionBox<Expr>)
BinaryFunction(BinaryFunctionBox<Expr>, Box<Expr>)

Methods

impl Expr[src]

pub fn is_negated(&self) -> bool[src]

pub fn neg(&self) -> Expr[src]

pub fn is_context_independant(&self) -> bool[src]

Check if it is necessary to read within a symbol table

Trait Implementations

impl Clone for Expr[src]

impl Debug for Expr[src]

impl Display for Expr[src]

impl Eq for Expr[src]

impl ExprEvaluationExt for Expr[src]

impl<'_> From<&'_ str> for Expr[src]

impl From<Expr> for DataAccess[src]

impl From<Expr> for FormattedExpr[src]

impl From<i16> for Expr[src]

impl From<i32> for Expr[src]

impl From<i8> for Expr[src]

impl From<u16> for Expr[src]

impl From<u32> for Expr[src]

impl From<u8> for Expr[src]

impl From<usize> 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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.