Skip to main content

ExprKind

Enum ExprKind 

Source
pub enum ExprKind<'a, E: ExprNode> {
    SizedInt {
        value: u64,
        size: Option<usize>,
    },
    Ident(Ident),
    Load(LoadNode<'a, E>),
    Range(RangeNode<E>),
    SubPieceMsb {
        src: E,
        count: usize,
    },
    SubPieceLsb {
        src: E,
        count: usize,
    },
    FunctionCall {
        builtin: Builtin,
        args: E::Args,
    },
    PcodeOp {
        id: PCodeOpId,
        args: E::Args,
    },
    Unop {
        op: UnaryOperator,
        e: E,
    },
    Binop {
        op: BinaryOperator,
        lhs: E,
        rhs: E,
    },
    Internal(&'static str),
}
Expand description

The shape of one expression node. See ExpressionTy for the meaning of each variant; this is the same inventory with the children abstracted.

Variants§

§

SizedInt

An integer literal.

Fields

§value: u64

The value.

§size: Option<usize>

The width the literal was written with, if any.

§

Ident(Ident)

A named storage location.

§

Load(LoadNode<'a, E>)

*[space]:size ptr.

§

Range(RangeNode<E>)

value[start, size].

§

SubPieceMsb

src(count): drop count low bytes.

Fields

§src: E

The value truncated.

§count: usize

Bytes dropped.

§

SubPieceLsb

src:count: keep count low bytes.

Fields

§src: E

The value truncated.

§count: usize

Bytes kept.

§

FunctionCall

A built-in function.

Fields

§builtin: Builtin

Which one.

§args: E::Args

Its arguments.

§

PcodeOp

A define pcodeop call.

Fields

§id: PCodeOpId

The operation.

§args: E::Args

Its arguments.

§

Unop

A unary operator.

Fields

§op: UnaryOperator

The operator.

§e: E

Its operand.

§

Binop

A binary operator.

Fields

§op: BinaryOperator

The operator.

§lhs: E

Left operand.

§rhs: E

Right operand.

§

Internal(&'static str)

A node that has no place in a consumer-form AST: a macro call or a deferred call. The passes reject it with PcodeLowerError::InternalNode.

Trait Implementations§

Source§

impl<'a, E: Clone + ExprNode> Clone for ExprKind<'a, E>
where E::Args: Clone,

Source§

fn clone(&self) -> ExprKind<'a, E>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a, E: Debug + ExprNode> Debug for ExprKind<'a, E>
where E::Args: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, E> Freeze for ExprKind<'a, E>
where LoadNode<'a, E>: Freeze, RangeNode<E>: Freeze, E: Freeze, <E as ExprNode>::Args: Freeze,

§

impl<'a, E> RefUnwindSafe for ExprKind<'a, E>

§

impl<'a, E> Send for ExprKind<'a, E>
where LoadNode<'a, E>: Send, RangeNode<E>: Send, E: Send, <E as ExprNode>::Args: Send,

§

impl<'a, E> Sync for ExprKind<'a, E>
where LoadNode<'a, E>: Sync, RangeNode<E>: Sync, E: Sync, <E as ExprNode>::Args: Sync,

§

impl<'a, E> Unpin for ExprKind<'a, E>
where LoadNode<'a, E>: Unpin, RangeNode<E>: Unpin, E: Unpin, <E as ExprNode>::Args: Unpin,

§

impl<'a, E> UnsafeUnpin for ExprKind<'a, E>

§

impl<'a, E> UnwindSafe for ExprKind<'a, E>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.