|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.ObjectToken
public class Token
Tokens returned by the scanner. CS536, Fall 2007.
| Field Summary | |
|---|---|
TokenCode |
code
A code indicating the token class of this token. |
int |
column
The column of the first character of this token. |
int |
line
The line on which this token appears. |
java.lang.Object |
value
The value of this token, if any. |
| Constructor Summary | |
|---|---|
Token(TokenCode code,
int line,
int column)
Creates a new token with null value. |
|
Token(TokenCode code,
int line,
int column,
java.lang.Object value)
Creates a new token. |
|
| Method Summary | |
|---|---|
int |
intValue()
Returns an integer code corresponding to this token. |
java.lang.String |
toString()
Returns a printable representation of this token. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public final TokenCode code
public final int line
public final int column
public final java.lang.Object value
| Constructor Detail |
|---|
public Token(TokenCode code,
int line,
int column,
java.lang.Object value)
code - the token code.line - the line on which the token appears.column - the column of the first character of the token.value - the token value.
public Token(TokenCode code,
int line,
int column)
code - the code.line - the line on which the token appears.column - the column of the first character of the token.| Method Detail |
|---|
public java.lang.String toString()
code.toString().
toString in class java.lang.Objectpublic int intValue()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||