|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttip.node.Node
tip.node.Token
public abstract class Token
Token
is the superclass of all tokens is the AST.
Method Summary | ||
---|---|---|
void |
checkOptionalInvariant()
|
|
abstract Token |
clone()
Returns a deep clone of this Token node. |
|
abstract Token |
clone(Map<Node,Node> oldToNewMap)
Creates a deep clone of this Token node while putting all
old node-new node relations in the map oldToNewMap . |
|
|
getChildren(Collection<T> collection,
NodeFilter<T> filter)
Adds all children of this Token node that are
accepted by the NodeFilter filter to collection . |
|
|
getDescendants(Collection<T> collection,
NodeFilter<T> filter)
Adds all descendants of this Token node (including the node itself) that are
accepted by the NodeFilter filter to collection . |
|
int |
getLine()
Returns the line number information of this token. |
|
int |
getPos()
Returns the position information of this token. |
|
String |
getText()
Returns the text from the input file from which this token was made. |
|
Token |
getToken()
Returns the original token for this token. |
|
NodeEnum |
kindNode()
Returns the NodeEnum corresponding to the
type of this Node node. |
|
abstract TokenEnum |
kindToken()
Returns the TokenEnum corresponding to the
type of this Token node. |
|
void |
setLine(int line)
Sets the line number information of this token. |
|
void |
setPos(int pos)
Sets the position information of this token. |
|
void |
setText(String text)
Sets the text of this token. |
|
String |
toString()
Returns a textual representation of this Token node. |
Methods inherited from class tip.node.Node |
---|
apply, apply, apply, apply, 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 |
Method Detail |
---|
public abstract Token clone()
Token
node.
clone
in interface NodeInterface
clone
in class Node
Token
nodepublic abstract Token clone(Map<Node,Node> oldToNewMap)
Token
node while putting all
old node-new node relations in the map oldToNewMap
.
clone
in interface NodeInterface
clone
in class Node
oldToNewMap
- the map filled with the old node-new node relation
Token
nodepublic abstract TokenEnum kindToken()
TokenEnum
corresponding to the
type of this Token
node.
TokenEnum
for this nodepublic NodeEnum kindNode()
NodeEnum
corresponding to the
type of this Node
node.
kindNode
in class Node
NodeEnum
for this nodepublic Token getToken()
public String getText()
public void setText(String text)
text
- the new text of this tokenpublic int getLine()
public void setLine(int line)
line
- the new line number information of this tokenpublic int getPos()
public void setPos(int pos)
pos
- the new position information of this tokenpublic String toString()
Token
node.
toString
in class Object
Token
nodepublic <T extends NodeInterface> void getDescendants(Collection<T> collection, NodeFilter<T> filter)
Token
node (including the node itself) that are
accepted by the NodeFilter
filter
to collection
.
getDescendants
in interface NodeInterface
getDescendants
in class Node
collection
- the collection to which the descendants are addedfilter
- the NodeFilter
usedpublic <T extends NodeInterface> void getChildren(Collection<T> collection, NodeFilter<T> filter)
Token
node that are
accepted by the NodeFilter
filter
to collection
.
getChildren
in interface NodeInterface
getChildren
in class Node
collection
- the collection to which the children are addedfilter
- the NodeFilter
usedpublic void checkOptionalInvariant()
checkOptionalInvariant
in interface NodeInterface
checkOptionalInvariant
in class Node
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |