com.ibm.wala.ssa
Class SymbolTable

java.lang.Object
  extended by com.ibm.wala.ssa.SymbolTable

public class SymbolTable
extends java.lang.Object

By convention, symbol numbers start at 1 ... the "this" parameter will be symbol number 1 in a virtual method.


Constructor Summary
SymbolTable(int numberOfParameters)
          Constructor.
 
Method Summary
 void ensureSymbol(int i)
          ensure that the symbol table has allocated space for the particular value number
 int getConstant(boolean b)
           
 int getConstant(double d)
           
 int getConstant(float f)
           
 int getConstant(int i)
           
 int getConstant(long l)
           
 int getConstant(java.lang.String s)
           
 java.lang.Object getConstantValue(int v)
           
 double getDoubleValue(int v)
           
 float getFloatValue(int v)
           
 int getIntValue(int v)
           
 long getLongValue(int v)
           
 int getMaxValueNumber()
           
 int getNullConstant()
           
 int getNumberOfParameters()
           
 int getParameter(int i)
          Return the value number of the ith parameter By convention, for a non-static method, the 0th parameter is 'this'
 int[] getParameterValueNumbers()
           
 PhiValue getPhiValue(int valueNumber)
          Return the PhiValue that is associated with a given value number
 java.lang.String getStringValue(int v)
           
 Value getValue(int valueNumber)
           
 java.lang.String getValueString(int valueNumber)
           
 boolean isBooleanConstant(int v)
           
 boolean isBooleanOrZeroOneConstant(int v)
           
 boolean isConstant(int v)
           
 boolean isDoubleConstant(int v)
           
 boolean isFalse(int v)
           
 boolean isFloatConstant(int v)
           
 boolean isIntegerConstant(int v)
           
 boolean isLongConstant(int v)
           
 boolean isNullConstant(int v)
           
 boolean isNumberConstant(int v)
           
 boolean isOne(int v)
           
 boolean isOneOrTrue(int v)
           
 boolean isParameter(int valueNumber)
           
 boolean isStringConstant(int v)
           
 boolean isTrue(int v)
           
 boolean isZero(int v)
           
 boolean isZeroOrFalse(int v)
           
 int newPhi(int[] rhs)
           
 int newSymbol()
          Method newSymbol.
 void setConstantValue(int vn, ConstantValue val)
           
 void setDefaultValue(int vn, java.lang.Object defaultValue)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SymbolTable

public SymbolTable(int numberOfParameters)
Constructor.

Parameters:
numberOfParameters - in the IR .. should be ir.getNumberOfParameters()
Method Detail

newSymbol

public int newSymbol()
Method newSymbol.

Returns:
int

setConstantValue

public void setConstantValue(int vn,
                             ConstantValue val)

setDefaultValue

public void setDefaultValue(int vn,
                            java.lang.Object defaultValue)

getNullConstant

public int getNullConstant()

getConstant

public int getConstant(boolean b)

getConstant

public int getConstant(int i)

getConstant

public int getConstant(long l)

getConstant

public int getConstant(float f)

getConstant

public int getConstant(double d)

getConstant

public int getConstant(java.lang.String s)

getParameter

public int getParameter(int i)
                 throws java.lang.IllegalArgumentException
Return the value number of the ith parameter By convention, for a non-static method, the 0th parameter is 'this'

Parameters:
i -
Returns:
int
Throws:
java.lang.IllegalArgumentException

ensureSymbol

public void ensureSymbol(int i)
ensure that the symbol table has allocated space for the particular value number

Parameters:
i - a value number

getValueString

public java.lang.String getValueString(int valueNumber)

isConstant

public boolean isConstant(int v)

isZero

public boolean isZero(int v)

isOne

public boolean isOne(int v)

isTrue

public boolean isTrue(int v)

isZeroOrFalse

public boolean isZeroOrFalse(int v)

isOneOrTrue

public boolean isOneOrTrue(int v)

isFalse

public boolean isFalse(int v)

isBooleanOrZeroOneConstant

public boolean isBooleanOrZeroOneConstant(int v)

isBooleanConstant

public boolean isBooleanConstant(int v)

isIntegerConstant

public boolean isIntegerConstant(int v)

isLongConstant

public boolean isLongConstant(int v)

isFloatConstant

public boolean isFloatConstant(int v)

isDoubleConstant

public boolean isDoubleConstant(int v)

isNumberConstant

public boolean isNumberConstant(int v)

isStringConstant

public boolean isStringConstant(int v)

isNullConstant

public boolean isNullConstant(int v)

newPhi

public int newPhi(int[] rhs)
           throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException - if rhs is null

getPhiValue

public PhiValue getPhiValue(int valueNumber)
Return the PhiValue that is associated with a given value number


getMaxValueNumber

public int getMaxValueNumber()

getParameterValueNumbers

public int[] getParameterValueNumbers()

getNumberOfParameters

public int getNumberOfParameters()

getStringValue

public java.lang.String getStringValue(int v)
                                throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

getFloatValue

public float getFloatValue(int v)
                    throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

getDoubleValue

public double getDoubleValue(int v)
                      throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

getIntValue

public int getIntValue(int v)
                throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

getLongValue

public long getLongValue(int v)
                  throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

getConstantValue

public java.lang.Object getConstantValue(int v)
                                  throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

getValue

public Value getValue(int valueNumber)
Returns:
the Value object for given value number or null if we have no special information about the value

isParameter

public boolean isParameter(int valueNumber)
Parameters:
valueNumber -
Returns:
true iff this valueNumber is a parameter