|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.multijava.mjc.CVariableInfoTable
This class stores information about the set of local variables in a given context. This information is collected during typechecking. It includes the information necessary to replace the source code's variable identifiers with references to the appropriately numbered positions in a bytecode method's frame (JVM2, 3.6.1). The information also includes whether the variable has been assigned to (JLS2 16).
CFlowControlContextType| Field Summary | |
private static int |
DEFAULT_SIZE
The default size of the array constructed to hold local variable information. |
private CVariableState[] |
states
The states of the variables represented by this information table. |
| Constructor Summary | |
|
CVariableInfoTable()
|
private |
CVariableInfoTable(CVariableState[] states)
|
| Method Summary | |
Object |
clone()
|
CVariableInfoTable |
duplicate()
|
private void |
expandArrayToInclude(int pos)
Expands the states array to hold state information for at least pos variables. |
CVariableState |
getState(int pos)
Returns the state of the variable at the given position in the local frame. |
void |
initialize(VariableDescriptor varDesc)
|
void |
mergeState(int pos,
CVariableState state)
Merges the given state information with the stored information in the given position. |
void |
mergeUpTo(int numberOfPos,
CVariableInfoTable other)
Merges the state information from other into this for positions from 0 to numberOfPos - 1. |
void |
replaceState(int pos,
CVariableState state)
Replaces the state information for the variable at the given position with the given state information. |
void |
replaceUpTo(int numberOfPos,
CVariableInfoTable other)
Replaces the state information of this with information from other for positions from 0 to numberOfPos - 1. |
String |
toString()
|
private void |
tryFinallyMergeState(int pos,
CVariableState tryVariableState)
|
void |
tryFinallyMergeUpTo(int numberOfPos,
CVariableInfoTable tryInfoTable)
Merges the state information from other into this for positions from 0 to numberOfPos - 1 using the function for merging a finally block
(this) with a try block. |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
private static final int DEFAULT_SIZE
private CVariableState[] states
private invariant states != null && (\forall int i; 0 <= i && i < states.length; states[i]==null ==> (* the corresponding variable is definitely not assigned *));
| Constructor Detail |
public CVariableInfoTable()
private CVariableInfoTable(CVariableState[] states)
| Method Detail |
public Object clone()
clone in class Objectpublic String toString()
toString in class Objectpublic CVariableInfoTable duplicate()
public void initialize(VariableDescriptor varDesc)
public CVariableState getState(int pos)
public void mergeState(int pos,
CVariableState state)
private void tryFinallyMergeState(int pos,
CVariableState tryVariableState)
public void mergeUpTo(int numberOfPos,
CVariableInfoTable other)
numberOfPos - 1.
public void tryFinallyMergeUpTo(int numberOfPos,
CVariableInfoTable tryInfoTable)
numberOfPos - 1 using the function for merging a finally block
(this) with a try block.
numberOfPos - number of positions that should be mergedtryInfoTable - the variable state information for the try block
public void replaceState(int pos,
CVariableState state)
public void replaceUpTo(int numberOfPos,
CVariableInfoTable other)
numberOfPos - 1.
private void expandArrayToInclude(int pos)
pos variables.
pos - the highest position for variable that this table needs to
accomodate (so far)
requires pos >= states.length; ensures states.length > pos; ensures (\forall int i; 0<=i && i<\old(states.length); states[i] == \old(states[i]) );
|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||