org.norecess.citkit.tir.expressions
Class CallETIR

java.lang.Object
  extended by org.norecess.citkit.tir.expressions.CallETIR
All Implemented Interfaces:
ICallETIR, ExpressionTIR, HobbesTIR

public class CallETIR
extends java.lang.Object
implements ICallETIR

The TIR for a function invocation.

Author:
Jeremy D. Frens

Constructor Summary
CallETIR(ExpressionTIR function, java.util.List<? extends ExpressionTIR> arguments)
          Basic constructor.
CallETIR(ExpressionTIR function, java.util.List<? extends ExpressionTIR> arguments, HobbesType type)
          Basic constructor.
CallETIR(IPosition position, ExpressionTIR function, java.util.List<? extends ExpressionTIR> arguments, HobbesType type)
          Constructs a function invocation.
 
Method Summary
<T> T
accept(ExpressionTIRVisitor<T> visitor)
          Implements the visitor pattern with ExpressionTIRVisitor.
 boolean equals(java.lang.Object o)
           
 java.util.List<? extends ExpressionTIR> getArguments()
          Returns the arguments of the function call.
 ExpressionTIR getFunction()
          Returns the function of the function call.
 IPosition getPosition()
          Retrieves the position of the code that generated the TIR.
 HobbesType getType()
          Retrieves the type of the expression.
 int hashCode()
           
 void setType(HobbesType type)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CallETIR

public CallETIR(IPosition position,
                ExpressionTIR function,
                java.util.List<? extends ExpressionTIR> arguments,
                HobbesType type)
Constructs a function invocation.

Parameters:
position - the position of the invocation in the source code.
function - the name of the function.
arguments - the list of arguments, as expressions.
type - the type of the expression.

CallETIR

public CallETIR(ExpressionTIR function,
                java.util.List<? extends ExpressionTIR> arguments)
Basic constructor.

Parameters:
function - the function to call.
arguments - the arguments to pass in.

CallETIR

public CallETIR(ExpressionTIR function,
                java.util.List<? extends ExpressionTIR> arguments,
                HobbesType type)
Basic constructor.

Parameters:
function - the function to call.
arguments - the arguments to pass in.
type - the type of the function.
Method Detail

getArguments

public java.util.List<? extends ExpressionTIR> getArguments()
Returns the arguments of the function call.

Specified by:
getArguments in interface ICallETIR
Returns:
the arguments of the function call.

getFunction

public ExpressionTIR getFunction()
Returns the function of the function call.

Specified by:
getFunction in interface ICallETIR
Returns:
the function of the function call.

getType

public HobbesType getType()
Description copied from interface: ExpressionTIR
Retrieves the type of the expression.

Specified by:
getType in interface ExpressionTIR
Returns:
the type of the code.

setType

public void setType(HobbesType type)
Specified by:
setType in interface ICallETIR

accept

public <T> T accept(ExpressionTIRVisitor<T> visitor)
Description copied from interface: ExpressionTIR
Implements the visitor pattern with ExpressionTIRVisitor.

Specified by:
accept in interface ExpressionTIR
Parameters:
visitor - the visitor object.
Returns:
the result of visiting the AST with the visitor.

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

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

getPosition

public IPosition getPosition()
Retrieves the position of the code that generated the TIR.

Specified by:
getPosition in interface HobbesTIR
Returns:
the position of the code in the source code.