edu.cmu.cs.crystal.tac
Class KeywordVariable

java.lang.Object
  extended by edu.cmu.cs.crystal.tac.Variable
      extended by edu.cmu.cs.crystal.tac.KeywordVariable
Direct Known Subclasses:
SuperVariable, ThisVariable

public abstract class KeywordVariable
extends Variable

Java and our three address code contain two 'special' variables that correspond with Java keywords and must be treated in a different manner than traditional source code variables. These two variables are super and this. At the very minimum, these variables are interesting in the sense that their type changes depending upon which class the method we are examining is contained within. super and this can be qualified, so methods for returning this information are included as well. this could be an implicit; in this case, the qualifier information is not guaranteed to be available.

Author:
Kevin Bierhoff

Method Summary
abstract  java.lang.String getKeyword()
          Which keyword does this variable represent?
 Name getQualifier()
          Returns the qualifier.
 boolean isQualified()
          Is this a standard keyword variable, or is it qualified?
 java.lang.String toString()
           
 
Methods inherited from class edu.cmu.cs.crystal.tac.Variable
dispatch, getSourceString, isUnqualifiedSuper, isUnqualifiedThis, resolveType
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

isQualified

public boolean isQualified()
Is this a standard keyword variable, or is it qualified?

Returns:
true if the keyword is qualified, false if it is not and represents the default keyword

getQualifier

public Name getQualifier()
Returns the qualifier.

Returns:
The qualifier or null if not qualified or qualifier not available (implicit qualification).

getKeyword

public abstract java.lang.String getKeyword()
Which keyword does this variable represent?

Returns:
The keyword, in string form.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object