|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.pz.platypus.Token
public class Token
The token that is parsed from input lines and via TokenList is passed to the output plugin.
Field Summary | |
---|---|
private java.lang.String |
content
what would be called the lexeme in a language parser. |
private CommandParameter |
parameter
possible list of parameters for a command |
private java.lang.String |
root
token root, used only in commands |
private Source |
source
the file number and line number of the this token. |
private TokenType |
type
token type |
Constructor Summary | |
---|---|
Token(Source source,
TokenType type,
java.lang.String content)
|
|
Token(Source source,
TokenType type,
java.lang.String root,
java.lang.String content,
CommandParameter parameter)
|
Method Summary | |
---|---|
boolean |
equals(java.lang.Object tok)
Complicated equals due to optional fields and embedded objects |
(package private) java.lang.String |
getCommandData(GDD gdd)
Convert command data into dumpable strings |
java.lang.String |
getContent()
|
CommandParameter |
getParameter()
|
java.lang.String |
getRoot()
|
Source |
getSource()
|
TokenType |
getType()
|
int |
hashCode()
|
void |
setContent(java.lang.String newContent)
|
boolean |
sourceEquals(Token t2)
Determines whether another Token has the same file # and line # as this |
java.lang.String |
toString(GDD gdd)
Generates a formatted string version of the contents of a token, including parameter details for a command token. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private Source source
private TokenType type
private java.lang.String root
private java.lang.String content
private CommandParameter parameter
Constructor Detail |
---|
public Token(Source source, TokenType type, java.lang.String root, java.lang.String content, CommandParameter parameter)
public Token(Source source, TokenType type, java.lang.String content)
Method Detail |
---|
public java.lang.String toString(GDD gdd)
gdd
- the GDD
java.lang.String getCommandData(GDD gdd)
gdd
- the GDD (used for Literals lookup)
public boolean equals(java.lang.Object tok)
equals
in class java.lang.Object
tok
- the compared-to token
public int hashCode()
hashCode
in class java.lang.Object
public boolean sourceEquals(Token t2)
t2
- the other token
public java.lang.String getContent()
public void setContent(java.lang.String newContent)
public Source getSource()
public CommandParameter getParameter()
public java.lang.String getRoot()
public TokenType getType()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |