org.ourgrid.common.spec.token
Class Token
java.lang.Object
org.ourgrid.common.spec.token.Token
- Direct Known Subclasses:
- Operator, Parenthetic, Pointing, StringToken
public class Token
- extends java.lang.Object
A token is a set of informations about the peaces read from the source to be
compiled. This is the unic structure that is understandable to the
syntactical analyzer.
Constructor Summary |
Token()
A Empty Constructor |
Token(java.lang.String symbol,
int code,
int line)
A Constructor |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Token
public Token()
- A Empty Constructor
Token
public Token(java.lang.String symbol,
int code,
int line)
- A Constructor
- Parameters:
symbol
- The token's string read from source.code
- The code of the string read. To mode informations see
CodesTable.line
- The line where the symbol was found at source.
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
- Returns:
- A string view of the token informations.
getCode
public int getCode()
- Returns:
- the code of the token read from source.
getLine
public int getLine()
- Returns:
- the line of source where the symbol was read.
getSymbol
public java.lang.String getSymbol()
- Returns:
- the token's string read from source.
setCode
public void setCode(int code)
- Parameters:
code
- the code of the token read from source.
setLine
public void setLine(int line)
- Parameters:
line
- the line of source where the symbol was read.
setSymbol
public void setSymbol(java.lang.String symbol)
- Parameters:
symbol
- the token's string read from source.