org.norecess.citkit.tir.expressions
Class SequenceETIR

java.lang.Object
  extended by org.norecess.citkit.tir.expressions.SequenceETIR
All Implemented Interfaces:
java.lang.Iterable<ExpressionTIR>, ISequenceETIR, ExpressionTIR, HobbesTIR

public class SequenceETIR
extends java.lang.Object
implements ISequenceETIR

The TIR for a sequence of expressions.

Author:
Jeremy D. Frens

Constructor Summary
SequenceETIR(IPosition position, java.util.List<ExpressionTIR> expressions)
          Constructs a sequence of expressions.
SequenceETIR(java.util.List<ExpressionTIR> expressions)
          Basic construcotr.
 
Method Summary
<T> T
accept(ExpressionTIRVisitor<T> visitor)
          Implements the visitor pattern with ExpressionTIRVisitor.
 boolean equals(java.lang.Object o)
           
 ExpressionTIR getExpression(int index)
           
 java.util.List<? extends ExpressionTIR> getExpressions()
          Returns the list of expressions in the sequence.
 IPosition getPosition()
          Retrieves the position of the code that generated the AST.
 HobbesType getType()
          Retrieves the type of the expression.
 int hashCode()
           
 java.util.Iterator<ExpressionTIR> iterator()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SequenceETIR

public SequenceETIR(IPosition position,
                    java.util.List<ExpressionTIR> expressions)
Constructs a sequence of expressions.

Parameters:
position - the position of the sequence.
expressions - the list of expression in the sequence.

SequenceETIR

public SequenceETIR(java.util.List<ExpressionTIR> expressions)
Basic construcotr.

Parameters:
expressions - the expressions of the sequence.
Method Detail

getExpressions

public java.util.List<? extends ExpressionTIR> getExpressions()
Returns the list of expressions in the sequence.

Specified by:
getExpressions in interface ISequenceETIR
Returns:
the list of expressions in the sequence.

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.

getExpression

public ExpressionTIR getExpression(int index)
Specified by:
getExpression in interface ISequenceETIR

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 AST.

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

iterator

public java.util.Iterator<ExpressionTIR> iterator()
Specified by:
iterator in interface java.lang.Iterable<ExpressionTIR>