Interface ICBlock
- All Superinterfaces:
ICCompound
,ICElement
,ICStatement
,Iterable<ICStatement>
C AST interface to represent a sequence of
statements
.
Example:
{ stm0; stm1; stm2; }
Statements cannot be null. An exception will be raised if an attempt to insert a null statement is made.
-
Method Summary
Modifier and TypeMethodDescriptionadd
(ICStatement stm) addAll
(ICStatement... stms) void
clear()
Remove all statements of the block, making the block effectively empty: {}.Deep duplication of the element.void
generateBody
(COutputSink out, boolean methodBody) Raw body generation, the caller is responsible for calling generateEnter/generateExitvoid
void
get
(int index) getAll()
getLast()
void
insert
(int index, ICStatement stm) void
Insert all statements of a source block into this block.boolean
isEmpty()
remove
(int index) boolean
remove
(ICStatement stm) Remove a statement from the block.void
set
(int index, ICStatement stm) int
size()
Methods inherited from interface com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.ICCompound
generateFlatList, getBlocks, insertAt, reset
Methods inherited from interface com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.ICElement
addPhysicalOffset, addPhysicalOffsets, evaluate, format, generate, getData, getElementType, getPhysicalOffset, getPhysicalOffsets, getSubElements, replaceSubElement, setData, setPhysicalOffsets, toString, visitDepthPost, visitDepthPost, visitDepthPost, visitDepthPre, visitDepthPre, visitDepthPre
Methods inherited from interface com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.ICStatement
getIntermediateOffset, setIntermediateOffset
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Method Details
-
generateHeader
-
generateBody
Raw body generation, the caller is responsible for calling generateEnter/generateExit- Parameters:
out
-
-
clear
void clear()Remove all statements of the block, making the block effectively empty: {}. Do not confuse this method withICCompound.reset()
. -
size
int size() -
isEmpty
boolean isEmpty() -
getAll
List<ICStatement> getAll() -
get
-
getLast
ICStatement getLast() -
set
-
insert
-
insertAll
Insert all statements of a source block into this block. The source block is left untouched.- Parameters:
index
- 0-based insertion index into this blocksrcblk
- source block
-
add
-
addAll
-
addAll
-
remove
-
removeLast
ICStatement removeLast() -
remove
Remove a statement from the block. Does not throw if the statement is not found.- Parameters:
stm
- mandatory statement- Returns:
- indicates success
-
duplicate
ICBlock duplicate()Description copied from interface:ICElement
Deep duplication of the element. Sub-elements are duplicated.Note:
ICClass
,ICMethod
,ICField
,ICIdentifier
,ICConstant
,ICType
andICLabel
are not duplicated.- Specified by:
duplicate
in interfaceICCompound
- Specified by:
duplicate
in interfaceICElement
- Specified by:
duplicate
in interfaceICStatement
-