|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdspl.intermediate.instructions.Instruction
public abstract class Instruction
Basic Abstract class for all other Abstract classes which represent the various kinds of 3-operand intermediary instructions generated from the AST
| Field Summary | |
|---|---|
static int |
INST_TYPE_ARITHMATIC
type for ArithmaticInstruction |
static int |
INST_TYPE_BRANCH
type for BranchInstruction |
static int |
INST_TYPE_CCALL
type for CCallInstruction |
static int |
INST_TYPE_FORLOOP
type for LoopInstruction |
Instruction |
lastInstruction
Valid only in the first instruction (head of the list), the lastInstruction points to the Instruction at the end of the list |
Instruction |
nextInstruction
The next instruction to be executed after this one Note in the case of branches, this is the next instruction to be executed after all of the instructions in a particular path of the branch are executed. |
Instruction |
prevInstruction
The previous instruction executed, or in the case of the instruction following an if { } else { } block, it would refer to the BranchInstruction, rather than the previous instruction actually executed. |
| Constructor Summary | |
|---|---|
Instruction()
|
|
| Method Summary | |
|---|---|
abstract int |
getInstType()
|
void |
setNextInstruction(Instruction next)
|
abstract boolean |
usesVariable(Variable v)
Designed to be a recursive call to see if a given variable is used anymore within a code block, after the current instruction. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public Instruction nextInstruction
public Instruction prevInstruction
public Instruction lastInstruction
public static final int INST_TYPE_BRANCH
public static final int INST_TYPE_ARITHMATIC
public static final int INST_TYPE_CCALL
public static final int INST_TYPE_FORLOOP
| Constructor Detail |
|---|
public Instruction()
| Method Detail |
|---|
public abstract int getInstType()
public abstract boolean usesVariable(Variable v)
v - the variable to search for to see if it is used
public void setNextInstruction(Instruction next)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||