edu.cmu.cs.crystal.tac
Class ThisVariable

java.lang.Object
  extended by edu.cmu.cs.crystal.tac.Variable
      extended by edu.cmu.cs.crystal.tac.KeywordVariable
          extended by edu.cmu.cs.crystal.tac.ThisVariable

public class ThisVariable
extends KeywordVariable

This class represents the this keyword, which is treated much like any other variable. For example, if the original Java source had code that was similar to the following:
a = this;
The right-hand side would be translated as a variable of this type.

Author:
Kevin Bierhoff

Constructor Summary
ThisVariable(EclipseTAC tac)
          Creates an unqualified this variable.
ThisVariable(EclipseTAC tac, ITypeBinding typeBinding)
          Creates an implicitly qualified this variable.
ThisVariable(EclipseTAC tac, Name qualifier)
          Creates a qualified this variable.
 
Method Summary
<T> T
dispatch(IVariableVisitor<T> visitor)
           
 void explicitQualifier(Name qualifier)
           
 java.lang.String getKeyword()
          Which keyword does this variable represent?
 boolean isImplicit()
           
 boolean isQualified()
          Is this a standard keyword variable, or is it qualified?
 boolean isUnqualifiedThis()
           
 ITypeBinding resolveType()
          null or the type binding of this variable.
 
Methods inherited from class edu.cmu.cs.crystal.tac.KeywordVariable
getQualifier, toString
 
Methods inherited from class edu.cmu.cs.crystal.tac.Variable
getSourceString, isUnqualifiedSuper
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ThisVariable

public ThisVariable(EclipseTAC tac,
                    ITypeBinding typeBinding)
Creates an implicitly qualified this variable.

Parameters:
tac -
typeBinding -

ThisVariable

public ThisVariable(EclipseTAC tac)
Creates an unqualified this variable.

Parameters:
tac -

ThisVariable

public ThisVariable(EclipseTAC tac,
                    Name qualifier)
Creates a qualified this variable.

Parameters:
tac -
qualifier -
Method Detail

getKeyword

public java.lang.String getKeyword()
Description copied from class: KeywordVariable
Which keyword does this variable represent?

Specified by:
getKeyword in class KeywordVariable
Returns:
The keyword, in string form.

isQualified

public boolean isQualified()
Description copied from class: KeywordVariable
Is this a standard keyword variable, or is it qualified?

Overrides:
isQualified in class KeywordVariable
Returns:
true if the keyword is qualified, false if it is not and represents the default keyword

resolveType

public ITypeBinding resolveType()
Description copied from class: Variable
null or the type binding of this variable.

Specified by:
resolveType in class Variable
See Also:
Expression.resolveTypeBinding()

isImplicit

public boolean isImplicit()

explicitQualifier

public void explicitQualifier(Name qualifier)

dispatch

public <T> T dispatch(IVariableVisitor<T> visitor)
Specified by:
dispatch in class Variable

isUnqualifiedThis

public boolean isUnqualifiedThis()
Overrides:
isUnqualifiedThis in class Variable