Trait cpclib_asm::implementation::expression::ExprEvaluationExt
source · [−]pub trait ExprEvaluationExt: Display {
fn resolve(&self, env: &Env) -> Result<ExprResult, AssemblerError>;
fn symbols_used(&self) -> Vec<&str>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator, ;
fn eval(&self) -> Result<ExprResult, AssemblerError> { ... }
}Expand description
! Add all important methods to expresison-like structure sthat are not availalbe in the cpclib_tokens crate. The result of expression (without taking into account the strings) is either a int (no complex mathematical expression) or a float (division/sinus and so on) Evaluate an aexpression
Required Methods
fn resolve(&self, env: &Env) -> Result<ExprResult, AssemblerError>
fn resolve(&self, env: &Env) -> Result<ExprResult, AssemblerError>
Resolve the expression base on the env context
Provided Methods
fn eval(&self) -> Result<ExprResult, AssemblerError>
fn eval(&self) -> Result<ExprResult, AssemblerError>
Simple evaluation without context => can only evaluate number based operations.