tip.node
Class TIdentifier

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

public final class TIdentifier
extends Token

TIdentifier represents a identifier token from the input file.


Constructor Summary
TIdentifier(String text)
          Creates a new TIdentifier token with text as text and with no line and position information.
TIdentifier(String text, int line, int pos)
          Creates a new TIdentifier token with text as text and with the given line and position information.
TIdentifier(String text, Token token)
          Creates a new TIdentifier token with text as text which is an alias of the given token.
TIdentifier(String text, Token token, PDecl _decl_, Type _type_)
          Creates a new TIdentifier token with the given nodes as children.
 
Method Summary
 void apply(Analysis caller)
          Calls the Analysis.caseTIdentifier(TIdentifier) of the Analysis caller.
<A> A
apply(Answer<A> caller)
          Returns the answer for caller by applying this TIdentifier node to the Answer visitor.
<Q> void
apply(Question<Q> caller, Q question)
          Applies this TIdentifier node to the Question visitor caller.
<Q,A> A
apply(QuestionAnswer<Q,A> caller, Q question)
          Returns the answer for caller by applying this TIdentifier node with the question to the QuestionAnswer visitor.
 TIdentifier clone()
          Creates a clone of this TIdentifier token.
 TIdentifier clone(Map<Node,Node> oldToNewMap)
          Creates a deep clone of this TIdentifier token while putting all old node-new node relations in the map oldToNewMap.
 PDecl getDecl()
          Returns the decl field of this TIdentifier node.
 Type getType()
          Returns the type field of this TIdentifier node.
 TokenEnum kindToken()
          Returns the TokenEnum corresponding to the type of this Token node.
 void setDecl(PDecl value)
          Sets the decl field of this TIdentifier node.
 void setType(Type value)
          Sets the type field of this TIdentifier 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

TIdentifier

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

Parameters:
text - the text of this TIdentifier token

TIdentifier

public TIdentifier(String text,
                   int line,
                   int pos)
Creates a new TIdentifier 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 TIdentifier token
pos - the line position information for this TIdentifier token

TIdentifier

public TIdentifier(String text,
                   Token token)
Creates a new TIdentifier 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 TIdentifier token

TIdentifier

public TIdentifier(String text,
                   Token token,
                   PDecl _decl_,
                   Type _type_)
Creates a new TIdentifier token with the given nodes as children. The basic child nodes are removed from their previous parents.

Parameters:
text - the Text child of this TIdentifier token
token - the Token child of this TIdentifier token
_decl_ - the Decl child of this TIdentifier token
_type_ - the Type child of this TIdentifier token
Method Detail

clone

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

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

clone

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

getDecl

public PDecl getDecl()
Returns the decl field of this TIdentifier node.

Returns:
the decl field of this TIdentifier node

setDecl

public void setDecl(PDecl value)
Sets the decl field of this TIdentifier node.

Parameters:
value - the new decl field of this TIdentifier node

getType

public Type getType()
Returns the type field of this TIdentifier node.

Returns:
the type field of this TIdentifier node

setType

public void setType(Type value)
Sets the type field of this TIdentifier node.

Parameters:
value - the new type field of this TIdentifier node

apply

public void apply(Analysis caller)
Calls the Analysis.caseTIdentifier(TIdentifier) of the Analysis caller.

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

apply

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