tip.node
Class TNull

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

public final class TNull
extends Token

TNull represents a 'null' token from the input file.


Constructor Summary
TNull()
          Creates a new TNull token with no line and position information.
TNull(int line, int pos)
          Creates a new TNull token with the given line and position information.
TNull(Token token)
          Creates a new TNull token that is an alias of the given token.
 
Method Summary
 void apply(Analysis caller)
          Calls the Analysis.caseTNull(TNull) of the Analysis caller.
<A> A
apply(Answer<A> caller)
          Returns the answer for caller by applying this TNull node to the Answer visitor.
<Q> void
apply(Question<Q> caller, Q question)
          Applies this TNull node to the Question visitor caller.
<Q,A> A
apply(QuestionAnswer<Q,A> caller, Q question)
          Returns the answer for caller by applying this TNull node with the question to the QuestionAnswer visitor.
 TNull clone()
          Creates a clone of this TNull token.
 TNull clone(Map<Node,Node> oldToNewMap)
          Creates a deep clone of this TNull 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.
 void setText(String text)
          Implements the Token.setText(String) method.
 
Methods inherited from class tip.node.Token
checkOptionalInvariant, getChildren, getDescendants, getLine, getPos, getText, getToken, kindNode, setLine, setPos, 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

TNull

public TNull()
Creates a new TNull token with no line and position information.


TNull

public TNull(int line,
             int pos)
Creates a new TNull token with the given line and position information.

Parameters:
line - the line number information for this TNull token
pos - the line position information for this TNull token

TNull

public TNull(Token token)
Creates a new TNull token that is an alias of the given token.

Parameters:
token - the original token for this TNull token
Method Detail

clone

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

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

clone

public TNull clone(Map<Node,Node> oldToNewMap)
Creates a deep clone of this TNull 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 TNull 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

setText

public void setText(String text)
Implements the Token.setText(String) method. Since TNull represents fixed token, this method throws a RuntimeException.

Overrides:
setText in class Token
Parameters:
text - the new text of this token

apply

public void apply(Analysis caller)
Calls the Analysis.caseTNull(TNull) of the Analysis caller.

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

apply

public <A> A apply(Answer<A> caller)
Returns the answer for caller by applying this TNull 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 TNull 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 TNull 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