pub enum Stmt {
Show 25 variants
Block(Vec<Stmt>),
ExprStmt(Expr),
LocalDef {
var: u32,
init: Option<Expr>,
is_final: bool,
force_type: bool,
},
Return(Option<Expr>),
Throw(Expr),
If {
cond: Expr,
then_stmt: Box<Stmt>,
else_stmt: Option<Box<Stmt>>,
},
While {
cond: Expr,
body: Box<Stmt>,
},
DoWhile {
body: Box<Stmt>,
cond: Expr,
},
For {
init: Vec<Stmt>,
cond: Option<Expr>,
update: Vec<Expr>,
body: Box<Stmt>,
},
ForEach {
var: u32,
iterable: Expr,
is_array: bool,
body: Box<Stmt>,
},
Switch {
selector: Expr,
cases: Vec<CaseGroup>,
default: Option<Box<Stmt>>,
on_string: bool,
},
Try {
body: Box<Stmt>,
catches: Vec<Catch>,
finally: Option<Box<Stmt>>,
},
TryWithResources {
resources: Vec<Stmt>,
body: Box<Stmt>,
catches: Vec<Catch>,
finally: Option<Box<Stmt>>,
},
Assert {
cond: Expr,
msg: Option<Expr>,
},
Synchronized {
lock: Expr,
body: Box<Stmt>,
},
TernaryValue {
e: Expr,
},
MonitorEnter(Expr),
MonitorExit(Expr),
Label(u32),
Goto(u32),
ClassDecl {
name: String,
header: String,
body: String,
},
Labeled {
label: String,
body: Box<Stmt>,
},
Break(Option<String>),
Continue(Option<String>),
Comment(String),
}Variants§
Block(Vec<Stmt>)
A plain { ... } block (or statement sequence during construction).
ExprStmt(Expr)
Expression statement (the expression must have side effects).
LocalDef
Local variable declaration: [final] T name [= init];
Fields
Return(Option<Expr>)
Throw(Expr)
If
While
while (cond) body; cond may be true for infinite loops.
DoWhile
For
Classic for (init; cond; update) body.
ForEach
Enhanced for: for (T v : iterable) body.
Fields
Switch
Fields
Try
TryWithResources
try (resources) body — restored try-with-resources.
Fields
Assert
assert cond [: msg]; restored from the $assertionsDisabled idiom.
Synchronized
synchronized (lock) body
TernaryValue
A folded value-diamond: this “statement” represents a value left on the operand stack (consumed by the merge block). Removed after the merge statements are woven.
MonitorEnter(Expr)
Raw monitorenter (before synchronized reconstruction).
MonitorExit(Expr)
Raw monitorexit.
Label(u32)
Fallback: label (for unstructured control flow / jsr-ret leftovers).
Goto(u32)
Fallback: goto a label.
ClassDecl
Local class declaration rendered inline in a method body.
header is e.g. Local implements Runnable.
Labeled
label: statement
Break(Option<String>)
break; / break label;
Continue(Option<String>)
continue; / continue label;
Comment(String)
A raw line we could not decompile (error resilience).