|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--jreversepro.runtime.JRunTimeContext
This contains the RunTime context.
| Field Summary |
| Fields inherited from interface jreversepro.common.KeyWords |
ANY, BOOLEAN, BREAK, BYTE, CASE, CHAR, CLASS, CLASS_STRING, CLINIT, CLOSE_BRACKET, COND_AND, COND_NOT, COND_OR, CONTINUE, DEFAULT, DEFAULT_PACKAGE, DOUBLE, EQUALTO, FALSE, FLOAT, FOREIGN_CLASS, FOREIGN_OBJ, GOTO, INIT, INSTANCEOF, INT, INTERFACE, JVM_BOOLEAN, JVM_CHAR, JVM_VOID, LANG_OBJECT, LENGTH, LONG, NEW, NULL, OPEN_BRACKET, OPR_EQ, OPR_GE, OPR_GT, OPR_LE, OPR_LT, OPR_NE, OPR_NOT, REFERENCE, RET_ADDR, RETURN, SHORT, SPACE, STATIC, SUPER, SWITCH, THIS, THISCLASS, THROW, TRUE, VOID |
| Fields inherited from interface jreversepro.revengine.BranchConstants |
TYPE_BRANCH, TYPE_CASE, TYPE_CATCH, TYPE_CATCH_ANY, TYPE_DO_WHILE, TYPE_ELSE, TYPE_ELSE_IF, TYPE_GOTO, TYPE_IF, TYPE_INVALID, TYPE_JSR, TYPE_RET, TYPE_SWITCH, TYPE_SYNC, TYPE_TRY, TYPE_TRY_ANY, TYPE_WHILE |
| Constructor Summary | |
JRunTimeContext(JDecompiler decomp,
JMethod meth,
JRunTimeFrame rtf,
JOperandStack jos,
JBranchTable branches)
|
|
| Method Summary | |
void |
addCode(int sOffset,
int eOffset,
int fromPos,
int toPos)
Adds a line of code with byteoffset information |
void |
addCode(int sOffset,
int eOffset,
int fromPos,
int toPos,
java.lang.String type)
Adds a line of code with byteoffset information |
void |
addTextCode(java.lang.String txt)
Add text line to output code with indenting. |
void |
executeInstruction(JInstruction ins)
Process JVM instruction. |
void |
getBeginStmt(java.util.List listBranches,
int insIndex,
JSymbolTable symTable)
|
void |
getEndStmt(int insIndex)
Close current branch block regularly. |
void |
getFinalBlockStmt()
After all the processing of the method is over, this code generated the final block statement, if any. |
JBranchEntry |
getImmediateOuterLoop()
At any given stage this method returns the reference to while/ do..while/ switch statement that enclosed this, to the outermost reference. |
JOperandStack |
getOperandStack()
Get JVM Operand stack. |
void |
processBreakContinue(int startPc,
int targetPc)
|
void |
pushControlEntry(JBranchEntry newent)
|
void |
setBlockWrittenFlag()
In case a statement has been identified for writing for the current topmost block then that is set the written flag. |
java.lang.String |
toString()
|
void |
validatePairings(JBranchEntry ent)
Check correct branch pairings for IF/ELSEIF/ELSE/TRY/CATCH/FINALLY. |
void |
writeVariableDeclarations(JBranchEntry ent,
JSymbolTable symTable)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public JRunTimeContext(JDecompiler decomp,
JMethod meth,
JRunTimeFrame rtf,
JOperandStack jos,
JBranchTable branches)
meth - Method reference.decomp - Decompiler reference.rtf - RuntimeFrame inputjos - OperandStack referencebranches - BranchReference.| Method Detail |
public JOperandStack getOperandStack()
public void executeInstruction(JInstruction ins)
throws RevEngineException,
ClassParserException
ins - Instruction that is to be executed.
RevEngineException - thrown in case
any problem occurs while executing the instruction.
ClassParserException - Thrown in case of
an invalid reference to Constantpool.public void getFinalBlockStmt()
public void getEndStmt(int insIndex)
throws RevEngineException
insIndex - Instruction Index.
RevEngineException - Encountered while
trying to find the end statement.
public void getBeginStmt(java.util.List listBranches,
int insIndex,
JSymbolTable symTable)
throws RevEngineException
listBranches - List of branchesinsIndex - Instruction IndexsymTable - SymbolTable.
RevEngineException - thrown while generating the
beginning statement for the given block.public JBranchEntry getImmediateOuterLoop()
public void pushControlEntry(JBranchEntry newent)
throws RevEngineException
newent - NewEntry of the control block that is to be pushed
onto the stack.
RevEngineException - thrown if the end block of the entry
of the content to be pushed overlaps with the end of the entry existing
already on top of control block stack.
public void writeVariableDeclarations(JBranchEntry ent,
JSymbolTable symTable)
throws RevEngineException
ent - Entry ( Control Block ) for which all the
variable declarations are supposed to be in place.symTable - Reference to symbol table that is
necessary to get to know the names and datatypes of variables.
RevEngineException - Thrown in case of any problem
writing variable names in the table.
public void processBreakContinue(int startPc,
int targetPc)
startPc - StartpctargetPc - TargetPc
public void validatePairings(JBranchEntry ent)
throws RevEngineException
ent - This is the entry that needs to be evaluated.
If a branch of type TYPE_ELSE / TYPE_ELSE_IF is to be ended then
the last ended must be TYPE_IF.
If a branch ent is of type TYPE_CATCH then last poppped entry
must be TYPE_TRY.
RevEngineException - Thrown if these validations are not
satisfied.
public void addCode(int sOffset,
int eOffset,
int fromPos,
int toPos,
java.lang.String type)
sOffset - Offset informationeOffset - ??? Extended offsetfromPos - FromPositiontoPos - To Positiontype - ?? type.
public void addCode(int sOffset,
int eOffset,
int fromPos,
int toPos)
sOffset - Offset informationeOffset - ??? Extended offsetfromPos - FromPositiontoPos - To Positionpublic void addTextCode(java.lang.String txt)
txt - Text to be added.public void setBlockWrittenFlag()
public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||