tip.node
Class TIntegerConst

java.lang.Object
  extended by tip.node.Node
      extended by tip.node.Token
          extended by tip.node.TIntegerConst
All Implemented Interfaces:
Cloneable, NodeInterface

public final class TIntegerConst
extends Token

TIntegerConst represents a integer const token from the input file.


Constructor Summary
TIntegerConst(String text)
          Creates a new TIntegerConst token with text as text and with no line and position information.
TIntegerConst(String text, int line, int pos)
          Creates a new TIntegerConst token with text as text and with the given line and position information.
TIntegerConst(String text, Token token)
          Creates a new TIntegerConst token with text as text which is an alias of the given token.
 
Method Summary
 void apply(Analysis caller)
          Calls the Analysis.caseTIntegerConst(TIntegerConst) of the Analysis caller.
<A> A
apply(Answer<A> caller)
          Returns the answer for caller by applying this TIntegerConst node to the Answer visitor.
<Q> void
apply(Question<Q> caller, Q question)
          Applies this TIntegerConst node to the Question visitor caller.
<Q,A> A
apply(QuestionAnswer<Q,A> caller, Q question)
          Returns the answer for caller by applying this TIntegerConst node with the question to the QuestionAnswer visitor.
 TIntegerConst clone()
          Creates a clone of this TIntegerConst token.
 TIntegerConst clone(Map<Node,Node> oldToNewMap)
          Creates a deep clone of this TIntegerConst token while putting all old node-new node relations in the map oldToNewMap.
 TokenEnum kindToken()
          Returns the TokenEnum corresponding to the type of this Token node.
 
Methods inherited from class tip.node.Token
checkOptionalInvariant, getChildren, getDescendants, getLine, getPos, getText, getToken, kindNode, setLine, setPos, setText, toString
 
Methods inherited from class tip.node.Node
getAncestor, getAncestor, getAncestor, getChildren, getChildren, getDescendants, getDescendants, getDescendants, isOptionalInvariant, parent, replaceBy, setOptionalInvariant
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TIntegerConst

public TIntegerConst(String text)
Creates a new TIntegerConst token with text as text and with no line and position information.

Parameters:
text - the text of this TIntegerConst token

TIntegerConst

public TIntegerConst(String text,
                     int line,
                     int pos)
Creates a new TIntegerConst token with text as text and with the given line and position information.

Parameters:
text - the text of this token
line - the line number information for this TIntegerConst token
pos - the line position information for this TIntegerConst token

TIntegerConst

public TIntegerConst(String text,
                     Token token)
Creates a new TIntegerConst token with text as text which is an alias of the given token.

Parameters:
text - the text of this token
token - the original token for this TIntegerConst token
Method Detail

clone

public TIntegerConst clone()
Creates a clone of this TIntegerConst token.

Specified by:
clone in interface NodeInterface
Specified by:
clone in class Token
Returns:
a clone of this TIntegerConst token

clone

public TIntegerConst clone(Map<Node,Node> oldToNewMap)
Creates a deep clone of this TIntegerConst token while putting all old node-new node relations in the map oldToNewMap.

Specified by:
clone in interface NodeInterface
Specified by:
clone in class Token
Parameters:
oldToNewMap - the map filled with the old node-new node relation
Returns:
a clone of this TIntegerConst token

kindToken

public TokenEnum kindToken()
Returns the TokenEnum corresponding to the type of this Token node.

Specified by:
kindToken in class Token
Returns:
the TokenEnum for this node

apply

public void apply(Analysis caller)
Calls the Analysis.caseTIntegerConst(TIntegerConst) of the Analysis caller.

Specified by:
apply in interface NodeInterface
Specified by:
apply in class Node
Parameters:
sw - the Analysis to which this TIntegerConst node is applied

apply

public <A> A apply(Answer<A> caller)
Returns the answer for caller by applying this TIntegerConst node to the Answer visitor.

Specified by:
apply in interface NodeInterface
Specified by:
apply in class Node
Parameters:
caller - the Answer to which this node is applied
Returns:
the answer as returned from caller

apply

public <Q> void apply(Question<Q> caller,
                      Q question)
Applies this TIntegerConst node to the Question visitor caller.

Specified by:
apply in interface NodeInterface
Specified by:
apply in class Node
Parameters:
caller - the Question to which this node is applied
question - the question provided to caller

apply

public <Q,A> A apply(QuestionAnswer<Q,A> caller,
                     Q question)
Returns the answer for caller by applying this TIntegerConst node with the question to the QuestionAnswer visitor.

Specified by:
apply in interface NodeInterface
Specified by:
apply in class Node
Parameters:
caller - the QuestionAnswer to which this node is applied
question - the question provided to caller
Returns:
the answer as returned from caller