Skip to main content

Expr

Enum Expr 

Source
pub enum Expr {
Show 23 variants Const(ConstVal), Local { var: u32, ty: TypeRef, }, This, New { cls: Arc<str>, ty: TypeRef, args: Vec<Expr>, raw: bool, }, NewArray { elem: TypeRef, dims: Vec<Expr>, trailing_dims: u8, init: Option<Vec<Expr>>, }, NewMultiArray { ty: TypeRef, dims: Vec<Expr>, }, Field { owner: Option<Box<Expr>>, cls: Arc<str>, name: Arc<str>, ty: TypeRef, is_static: bool, }, Method { owner: Option<Box<Expr>>, cls: Arc<str>, name: Arc<str>, desc: Arc<MethodDescriptor>, args: Vec<Expr>, is_static: bool, is_interface: bool, is_special: bool, is_super: bool, is_dynamic: bool, type_args: Vec<String>, }, ArrayIndex { array: Box<Expr>, index: Box<Expr>, }, Cast { ty: TypeRef, e: Box<Expr>, }, InstanceOf { e: Box<Expr>, ty: TypeRef, }, Un { op: UnOp, e: Box<Expr>, }, Bin { op: BinOp, l: Box<Expr>, r: Box<Expr>, ty: Option<TypeRef>, }, Cond { c: Box<Expr>, t: Box<Expr>, f: Box<Expr>, }, Assign { target: Box<Expr>, op: AssignOp, value: Box<Expr>, }, PreIncDec { e: Box<Expr>, delta: i64, wide: bool, }, PostIncDec { e: Box<Expr>, delta: i64, wide: bool, }, Lambda(Box<LambdaExpr>), StringConcat(Vec<ConcatPart>), Raw(String), RawT(String, TypeRef), Invokedynamic { name: String, desc: MethodDescriptor, args: Vec<Expr>, bsm_text: String, bsm_static_args: Vec<BsmArg>, }, AnonNew { cls: String, base: TypeRef, args: Vec<Expr>, body: String, },
}

Variants§

§

Const(ConstVal)

§

Local

Local variable by VarId, with its declared type (needed for category-1 vs category-2 stack operations like dup2/pop2).

Fields

§var: u32
§

This

§

New

new T(args) (constructor call folded with New when possible).

Fields

§cls: Arc<str>
§args: Vec<Expr>
§raw: bool

true if this is a raw new whose <init> hasn’t been folded yet.

§

NewArray

Array creation: new int[n], new int[]{...}, new int[a][b][].

Fields

§elem: TypeRef
§dims: Vec<Expr>

dimension sizes for the created dimensions

§trailing_dims: u8

trailing empty dimensions count (e.g. new int[3][] -> dims=[3], trailing=1)

§init: Option<Vec<Expr>>

initializer for new T[]{...} form

§

NewMultiArray

Multi-dimensional array creation multianewarray.

Fields

§dims: Vec<Expr>
§

Field

Fields

§owner: Option<Box<Expr>>

None = this (instance field of current class) or static import-style.

§cls: Arc<str>

Declaring class internal name.

String payloads are Arc<str>: Expr is the most-cloned node in the whole pipeline (block materialization, copy-walks, forwarding) and every clone used to allocate fresh copies of the class/method names. Front-ends back these with the dex/ constant-pool string tables, so construction is a refcount bump and clones never allocate.

§name: Arc<str>
§is_static: bool
§

Method

Fields

§owner: Option<Box<Expr>>
§cls: Arc<str>
§name: Arc<str>
§args: Vec<Expr>
§is_static: bool
§is_interface: bool
§is_special: bool

invokespecial (super call / constructor / private).

§is_super: bool

super.m(...) form.

§is_dynamic: bool

invokedynamic without recognized pattern.

§type_args: Vec<String>

Explicit type arguments (Cls.<E>m(...)) restored for generic calls in throw position, where inference would pick the bound.

§

ArrayIndex

Fields

§array: Box<Expr>
§index: Box<Expr>
§

Cast

Fields

§

InstanceOf

Fields

§

Un

Fields

§op: UnOp
§

Bin

Fields

§ty: Option<TypeRef>

Type context for + disambiguation (string vs numeric).

§

Cond

Fields

§

Assign

Fields

§target: Box<Expr>
§value: Box<Expr>
§

PreIncDec

++x / --x (delta = +1 / -1)

Fields

§delta: i64
§wide: bool
§

PostIncDec

x++ / x--

Fields

§delta: i64
§wide: bool
§

Lambda(Box<LambdaExpr>)

§

StringConcat(Vec<ConcatPart>)

String concatenation via StringConcatFactory recipe.

§

Raw(String)

Pre-rendered source fragment (used for captured expressions that are substituted across method contexts).

§

RawT(String, TypeRef)

Pre-rendered capture text WITH the captured local’s declared type: comparisons inside local-class bodies need the operand’s generic type to drive witnesses (erased val$ field types cannot).

§

Invokedynamic

Unrecognized invokedynamic fallback.

Fields

§name: String
§args: Vec<Expr>
§bsm_text: String
§bsm_static_args: Vec<BsmArg>

Resolved static bootstrap arguments (for SwitchBootstraps typeSwitch restoration).

§

AnonNew

new Anon(args) { ...class body... } — anonymous class instantiation.

Fields

§cls: String

The anonymous class itself.

§base: TypeRef

Interface being implemented, or superclass (Object suppressed).

§args: Vec<Expr>
§body: String

Decompiled class body lines (already indented relative).

Implementations§

Source§

impl Expr

Source

pub fn type_ref(&self) -> TypeRef

Best-effort static type of this expression.

Source

pub fn needs_parens(&self, outer_prec: u8, is_right: bool) -> bool

True if emitting this expression as a statement component needs parens at the given outer precedence context.

Trait Implementations§

Source§

impl Clone for Expr

Source§

fn clone(&self) -> Expr

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 Debug for Expr

Source§

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

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Expr

Source§

fn eq(&self, other: &Expr) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Expr

Auto Trait Implementations§

§

impl Freeze for Expr

§

impl RefUnwindSafe for Expr

§

impl Send for Expr

§

impl Sync for Expr

§

impl Unpin for Expr

§

impl UnsafeUnpin for Expr

§

impl UnwindSafe for Expr

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.