public final class SWITCH extends java.lang.Object implements CompoundInstruction
Modifier and Type | Field and Description |
---|---|
private Select |
instruction |
private int[] |
match |
private int |
match_length |
private InstructionHandle[] |
targets |
Constructor and Description |
---|
SWITCH(int[] match,
InstructionHandle[] targets,
InstructionHandle target) |
SWITCH(int[] match,
InstructionHandle[] targets,
InstructionHandle target,
int max_gap)
Template for switch() constructs.
|
Modifier and Type | Method and Description |
---|---|
private void |
fillup(int max_gap,
InstructionHandle target) |
Instruction |
getInstruction() |
InstructionList |
getInstructionList() |
private boolean |
matchIsOrdered(int max_gap) |
private void |
sort(int l,
int r)
Sort match and targets array with QuickSort.
|
private int[] match
private InstructionHandle[] targets
private Select instruction
private int match_length
public SWITCH(int[] match, InstructionHandle[] targets, InstructionHandle target, int max_gap)
match
- array of match values (case 2: ... case 7: ..., etc.)targets
- the instructions to be branched to for each casetarget
- the default targetmax_gap
- maximum gap that may between case branchespublic SWITCH(int[] match, InstructionHandle[] targets, InstructionHandle target)
private final void fillup(int max_gap, InstructionHandle target)
private final void sort(int l, int r)
private final boolean matchIsOrdered(int max_gap)
public final InstructionList getInstructionList()
getInstructionList
in interface CompoundInstruction
public final Instruction getInstruction()