|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Token
This is the interface for a token. A token is a pair of catcode and value. In most cases the value is a single character. Nevertheless it is also possible to store a complete string in the value – e.g. for control sequence tokens.
Tokens are immutable. Thus no setters for the attributes are provided.
| Method Summary | |
|---|---|
boolean |
eq(Catcode cc,
char c)
Compare the current token with a pair of catcode and character value. |
boolean |
eq(Catcode cc,
java.lang.String s)
Compare the current token with a pair of catcode and String value. |
boolean |
eq(char c)
Compare the current token with a character value. |
boolean |
equals(java.lang.Object t)
Compare the current token to another token. |
Catcode |
getCatcode()
Getter for the catcode. |
UnicodeChar |
getChar()
Getter for the value. |
boolean |
isa(Catcode cc)
Check if the current token has a specified catcode. |
void |
toString(java.lang.StringBuffer sb)
Print the token into a StringBuffer. |
void |
toString(java.lang.StringBuilder sb)
Print the token into a StringBuilder. |
java.lang.String |
toText()
This method returns the textual representation for the Token. |
java.lang.String |
toText(UnicodeChar esc)
Return the printable representation of this token as it can be read back in. |
java.lang.Object |
visit(TokenVisitor visitor,
java.lang.Object arg1)
Invoke the appropriate visit method for the current class. |
| Method Detail |
|---|
boolean eq(Catcode cc,
char c)
cc - the catcodec - the value
true iff the tokens are equal
boolean eq(Catcode cc,
java.lang.String s)
cc - the catcodes - the value
true iff the tokens are equalboolean eq(char c)
c - the value
true iff the tokens are equalboolean equals(java.lang.Object t)
equals in class java.lang.Objectt - the token to compare to
true iff the tokens are equalCatcode getCatcode()
UnicodeChar getChar()
boolean isa(Catcode cc)
cc - the catcode to compare against
true iff the category codes coincidevoid toString(java.lang.StringBuffer sb)
sb - the target string buffervoid toString(java.lang.StringBuilder sb)
sb - the target string builderjava.lang.String toText()
toString().
java.lang.String toText(UnicodeChar esc)
esc - the escape character
java.lang.Object visit(TokenVisitor visitor,
java.lang.Object arg1)
throws java.lang.Exception
visitor - the calling visitorarg1 - the first argument to pass
java.lang.Exception - in case of an error
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||