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 TypeMethodDescriptionvoidaddParameter(int index, ICDecl param) voidaddParameter(ICDecl param) voidaddStatement(ICStatement stm) booleanDelete a statement by reference.Deep duplication of the element.voidfromFlatList(List<ICStatement> list) Regenerate the AST of this method based on a flat list of statements and pseudo-statements.voidgenerateName(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.booleaninsertAtOffset(long offset, ICStatement stm) booleanisEmpty()voidremoveParameter(int index) Flatten the abstract syntax tree.booleanvisitStatements(ICVisitor visitor) Visit allstatementsof 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, setStatusCodeMethods 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, visitDepthPreMethods 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 allstatementsof 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:ICElementDeep duplication of the element. Sub-elements are duplicated.Note:
ICClass,ICMethod,ICField,ICIdentifier,ICConstant,ICTypeandICLabelare not duplicated.- Specified by:
duplicatein interfaceICDecompilableElement- Specified by:
duplicatein interfaceICElement- Specified by:
duplicatein interfaceICSourceElement
-