com.jeffpalm.cop5555.tok
Class Token

java.lang.Object
  extended by com.jeffpalm.cop5555.tok.Token
Direct Known Subclasses:
EofToken, IdentToken, KeywordToken, NumberToken

public abstract class Token
extends java.lang.Object


Field Summary
static int AND
           
static int CARET
           
protected  int col
           
static int COMMA
           
static int COMMENT
           
static int CONST
           
static int DEC
           
static int DIV
           
static int ELSE
           
static int EMPTY
          Constants for the symbols
static int EOF
           
static int EQ
           
static int EQEQ
           
static int ERROR
           
static int GE
           
static int GT
           
static int IDENT
           
static int IF
           
static int INC
           
static int INT
           
static int L_SHIFT
           
static int LBRACE
           
static int LE
           
protected  int line
           
static int LPAREN
           
static int LT
           
static int MAX_TOKEN
           
static int MINUS
           
static int MOD
           
static int NE
           
static int NUMBER
           
static int OR
           
static int PLUS
           
static int PROGRAM
           
static int R_SHIFT
           
static int RBRACE
           
static int READ
           
static int RETURN
           
static int RPAREN
           
static int SEMI
           
static int STAR
           
protected  java.lang.String str
           
static java.lang.String[] syms
           
protected  int type
           
static int VAR
           
static int VOID
           
static int WHILE
           
static int WRITE
           
static int XOR
           
 
Constructor Summary
Token()
           
 
Method Summary
abstract  Token dup()
           
 int getCol()
           
 int getLine()
           
 Pos getPos()
           
 java.lang.String getString()
           
 int getType()
           
 boolean is(int type)
           
 boolean isEof()
           
 java.lang.String stringRep()
           
static java.lang.String stringRep(int num)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

type

protected int type

line

protected int line

col

protected int col

str

protected java.lang.String str

EMPTY

public static final int EMPTY
Constants for the symbols

See Also:
Constant Field Values

PROGRAM

public static final int PROGRAM
See Also:
Constant Field Values

CONST

public static final int CONST
See Also:
Constant Field Values

VAR

public static final int VAR
See Also:
Constant Field Values

INT

public static final int INT
See Also:
Constant Field Values

VOID

public static final int VOID
See Also:
Constant Field Values

READ

public static final int READ
See Also:
Constant Field Values

WRITE

public static final int WRITE
See Also:
Constant Field Values

IF

public static final int IF
See Also:
Constant Field Values

ELSE

public static final int ELSE
See Also:
Constant Field Values

WHILE

public static final int WHILE
See Also:
Constant Field Values

PLUS

public static final int PLUS
See Also:
Constant Field Values

MINUS

public static final int MINUS
See Also:
Constant Field Values

STAR

public static final int STAR
See Also:
Constant Field Values

DIV

public static final int DIV
See Also:
Constant Field Values

LT

public static final int LT
See Also:
Constant Field Values

LE

public static final int LE
See Also:
Constant Field Values

GT

public static final int GT
See Also:
Constant Field Values

GE

public static final int GE
See Also:
Constant Field Values

EQ

public static final int EQ
See Also:
Constant Field Values

EQEQ

public static final int EQEQ
See Also:
Constant Field Values

NE

public static final int NE
See Also:
Constant Field Values

LBRACE

public static final int LBRACE
See Also:
Constant Field Values

RBRACE

public static final int RBRACE
See Also:
Constant Field Values

LPAREN

public static final int LPAREN
See Also:
Constant Field Values

RPAREN

public static final int RPAREN
See Also:
Constant Field Values

SEMI

public static final int SEMI
See Also:
Constant Field Values

COMMA

public static final int COMMA
See Also:
Constant Field Values

CARET

public static final int CARET
See Also:
Constant Field Values

ERROR

public static final int ERROR
See Also:
Constant Field Values

COMMENT

public static final int COMMENT
See Also:
Constant Field Values

NUMBER

public static final int NUMBER
See Also:
Constant Field Values

IDENT

public static final int IDENT
See Also:
Constant Field Values

RETURN

public static final int RETURN
See Also:
Constant Field Values

EOF

public static final int EOF
See Also:
Constant Field Values

MOD

public static final int MOD
See Also:
Constant Field Values

L_SHIFT

public static final int L_SHIFT
See Also:
Constant Field Values

R_SHIFT

public static final int R_SHIFT
See Also:
Constant Field Values

OR

public static final int OR
See Also:
Constant Field Values

AND

public static final int AND
See Also:
Constant Field Values

XOR

public static final int XOR
See Also:
Constant Field Values

INC

public static final int INC
See Also:
Constant Field Values

DEC

public static final int DEC
See Also:
Constant Field Values

MAX_TOKEN

public static final int MAX_TOKEN
See Also:
Constant Field Values

syms

public static final java.lang.String[] syms
Constructor Detail

Token

public Token()
Method Detail

dup

public abstract Token dup()

stringRep

public static java.lang.String stringRep(int num)

stringRep

public java.lang.String stringRep()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getString

public java.lang.String getString()

isEof

public boolean isEof()

getLine

public int getLine()

getCol

public int getCol()

getType

public int getType()

getPos

public Pos getPos()

is

public boolean is(int type)