edu.cmu.cs.crystal.tac.model
Interface SourceVariableDeclaration

All Superinterfaces:
TACInstruction

public interface SourceVariableDeclaration
extends TACInstruction

T x. This node represents the declaration of a variable in the source, i.e. a method parameter or local variable. Notice that temporary and keyword variables do not have an explicit declaration.

Author:
Kevin Bierhoff
See Also:
VariableDeclaration

Method Summary
 SourceVariable getDeclaredVariable()
          Returns the variable being declared.
 VariableDeclaration getNode()
          Returns the node this instruction is for.
 boolean isCaughtVariable()
          Is this variable being declared as the parameter to a catch block?
 boolean isEnhancedForLoopVariable()
          Is this variable being declared as part of an enhanced for loop?
 boolean isFormalParameter()
          Is this variable being declared as a formal parameter to a method?
 IVariableBinding resolveBinding()
          Resolves the declared variable's binding.
 
Methods inherited from interface edu.cmu.cs.crystal.tac.model.TACInstruction
transfer, transfer
 

Method Detail

getNode

VariableDeclaration getNode()
Returns the node this instruction is for. Should be of type VariableDeclaration. Usually, one instruction exists per AST node, but can be more when AST nodes are desugared, such as for post-increment.

Specified by:
getNode in interface TACInstruction
Returns:
the node this instruction is for.
See Also:
TACInstruction.getNode()

resolveBinding

IVariableBinding resolveBinding()
Resolves the declared variable's binding.

Returns:
the declared variable's binding.

getDeclaredVariable

SourceVariable getDeclaredVariable()
Returns the variable being declared.

Returns:
The variable being declared.

isCaughtVariable

boolean isCaughtVariable()
Is this variable being declared as the parameter to a catch block?

Returns:
true if this variable is the parameter of a catch block.

isEnhancedForLoopVariable

boolean isEnhancedForLoopVariable()
Is this variable being declared as part of an enhanced for loop?

Returns:
true if this variable is the parameter of an enhanced for loop

isFormalParameter

boolean isFormalParameter()
Is this variable being declared as a formal parameter to a method?

Returns:
true if this is a formal parameter declaration, false otherwise.