|
CS 536 Fall 2007, Project 5 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
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. |
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,
Object value)
Creates a new token. |
|
| Method Summary | |
|---|---|
int |
intValue()
Returns an integer code corresponding to this token. |
String |
toString()
Returns a printable representation of this token. |
| Methods inherited from class 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 Object value
| Constructor Detail |
|---|
public Token(TokenCode code,
int line,
int column,
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 String toString()
code.toString().
toString in class Objectpublic int intValue()
|
CS 536 Fall 2007, Project 5 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||