Interface ICMethod
- All Superinterfaces:
ICDecompilableElement
,ICElement
,ICSourceElement
,IOptimizerTarget
C AST method objects are top-level AST objects that can be retrieved by a
ICMethodFactory
.-
Field Summary
Fields inherited from interface com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.ICDecompilableElement
STATUS_ERROR, STATUS_LIMITED, STATUS_NORMAL, STATUS_STALE, STATUS_UNINITIALIZED
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addParameter
(int index, ICDecl param) void
addParameter
(ICDecl param) void
addStatement
(ICStatement stm) boolean
Delete a statement by reference.Deep duplication of the element.void
fromFlatList
(List<ICStatement> list) Regenerate the AST of this method based on a flat list of statements and pseudo-statements.void
generateName
(COutputSink out, boolean definition) getBody()
Retrieve this method's identifier manager (local variable factory).Retrieve this method's label factory.getName()
Retrieve the primary return type, or the void type if this method does not return anything.Walk the tree and get the ordered list of all (non-pseudo) statements that make up the method.boolean
insertAtOffset
(long offset, ICStatement stm) boolean
isEmpty()
void
removeParameter
(int index) Flatten the abstract syntax tree.boolean
visitStatements
(ICVisitor visitor) Visit allstatements
of the method's body recursively.Methods inherited from interface com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.ICDecompilableElement
addDecompilationNote, getAddress, getClassFactory, getConstantFactory, getDecompilationNotes, getElementFactory, getFieldFactory, getFlags, getGlobalContext, getIndex, getMethodFactory, getOperatorFactory, getStatusCode, getStatusMessage, getTypeFactory, isExternal, reset, setStatus, setStatusCode
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.opt.IOptimizerTarget
getTargetName
-
Method Details
-
getIdentifierManager
ICIdentifierManager getIdentifierManager()Retrieve this method's identifier manager (local variable factory).- Returns:
-
getLabelFactory
ICLabelFactory getLabelFactory()Retrieve this method's label factory.- Returns:
-
getParameters
- Returns:
-
addParameter
-
addParameter
-
removeParameter
void removeParameter(int index) -
getReturnTypes
-
getReturnType
ICType getReturnType()Retrieve the primary return type, or the void type if this method does not return anything. The primary return type, if not void, is the first element returned bygetReturnTypes()
.- Returns:
- never null
-
getClassType
ICType getClassType() -
getName
String getName() -
getBody
ICBlock getBody() -
isEmpty
boolean isEmpty() -
generateName
-
getStatements
List<ICStatement> getStatements()Walk the tree and get the ordered list of all (non-pseudo) statements that make up the method.- Returns:
-
addStatement
-
getLastStatement
ICStatement getLastStatement() -
deleteStatement
Delete a statement by reference.- Parameters:
stm
- the statement to delete- Returns:
- true if the statement was found and deleted
-
insertAtOffset
-
visitStatements
Visit allstatements
of the method's body recursively. This method differs fromgetStatements()
, which simply returns the list of statements contained in the body, but not the statements contained in the statements.- Parameters:
visitor
- a visitor object- Returns:
- the success code
-
toFlatList
List<ICStatement> toFlatList()Flatten the abstract syntax tree. The returned list contains extra statements, called "pseudo-statements", needed to represent the structure of the method.
In programmer's words, all statements implementing ICoumpound in the AST are replaced by two or more appropriate objects deriving from PseudoStatement.- Returns:
- the list of all statements (including pseudo-statements) that make up the method
-
fromFlatList
Regenerate the AST of this method based on a flat list of statements and pseudo-statements.- Parameters:
list
- the list of all statements (including pseudo-statements) that make up the method
-
duplicate
ICMethod 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 interfaceICDecompilableElement
- Specified by:
duplicate
in interfaceICElement
- Specified by:
duplicate
in interfaceICSourceElement
-