pub enum Expression {
Normal(String),
Conditional(Box<Conditional>),
FunctionCall(Box<DebugFunction>),
}Expand description
A variable representing a PDSC Expression
Variants§
Normal(String)
An arithmetic, bitwise, or comparison expression, e.g. 2 + 2, reg & 0xFF, x == 1, or a bare variable reference
Conditional(Box<Conditional>)
An expression representing an inline if statement, e.g. (x < y) ? a : b
§Note
The parser currently does not handle nested conditionals, e.g. (x < y) ? ( (a < b) ? c : d ) : e
I hope noone has written a PDSC file which does this, if so this can be implemented.
FunctionCall(Box<DebugFunction>)
A call to a predefined PDSC debug access function,
e.g. Read32(0x40000000) or Sequence("ResetAndHalt")
Trait Implementations§
Source§impl Clone for Expression
impl Clone for Expression
Source§fn clone(&self) -> Expression
fn clone(&self) -> Expression
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Expression
impl Debug for Expression
Source§impl Default for Expression
impl Default for Expression
Source§impl<'de> Deserialize<'de> for Expression
impl<'de> Deserialize<'de> for Expression
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Expression
Source§impl PartialEq for Expression
impl PartialEq for Expression
Source§impl Serialize for Expression
impl Serialize for Expression
impl StructuralPartialEq for Expression
Source§impl TryFrom<&str> for Expression
impl TryFrom<&str> for Expression
Auto Trait Implementations§
impl Freeze for Expression
impl RefUnwindSafe for Expression
impl Send for Expression
impl Sync for Expression
impl Unpin for Expression
impl UnsafeUnpin for Expression
impl UnwindSafe for Expression
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