org.norecess.citkit.tir.expressions
Class StringETIR

java.lang.Object
  extended by org.norecess.citkit.tir.expressions.StringETIR
All Implemented Interfaces:
DatumTIR, IStringETIR, ExpressionTIR, HobbesTIR

public class StringETIR
extends java.lang.Object
implements IStringETIR

The TIR for a literal string expression.

Author:
Jeremy D. Frens

Constructor Summary
StringETIR(IPosition position, java.lang.String value)
          Constructs a literal string expression.
StringETIR(java.lang.String value)
          Basic constructor.
 
Method Summary
<T> T
accept(ExpressionTIRVisitor<T> visitor)
          Implements the visitor pattern with ExpressionTIRVisitor.
 boolean equals(java.lang.Object o)
           
 IPosition getPosition()
          Retrieves the position of the code that generated the AST.
 StringType getType()
          Retrieves the type of the expression.
 java.lang.String getValue()
          Returns the literal value of the string expression.
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StringETIR

public StringETIR(IPosition position,
                  java.lang.String value)
Constructs a literal string expression.

Parameters:
position - the position of the string expression in the source code.
value - the literal value of the string expression.

StringETIR

public StringETIR(java.lang.String value)
Basic constructor.

Parameters:
value - the string.
Method Detail

getValue

public java.lang.String getValue()
Returns the literal value of the string expression.

Specified by:
getValue in interface IStringETIR
Returns:
the literal value of the string expression.

getType

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

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

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.