CS 536 Fall 2007, Project 5

Enum TokenCode

Object
  extended by Enum<TokenCode>
      extended by TokenCode
All Implemented Interfaces:
Serializable, Comparable<TokenCode>

 enum TokenCode
extends Enum<TokenCode>


Enum Constant Summary
AND
           
ARRAY
           
ASSIGN
           
BEGIN
           
BOOLEAN
           
CHAR_40
           
CHAR_41
           
CHAR_42
           
CHAR_43
           
CHAR_44
           
CHAR_45
           
CHAR_47
           
CHAR_58
           
CHAR_59
           
CHAR_60
           
CHAR_61
           
CHAR_62
           
DOTDOT
           
ELSE
           
ELSIF
           
END
           
EXIT
           
FALSE
           
FOR
           
FUNCTION
           
GE
           
ID
           
IF
           
IN
           
INTEGER
           
INTLITERAL
           
IS
           
LE
           
LOOP
           
NE
           
NOT
           
NULL
           
OF
           
OR
           
OUT
           
PROCEDURE
           
READ
           
RETURN
           
STRING
           
STRLITERAL
           
THEN
           
TRUE
           
UMINUS
           
WHEN
           
WHILE
           
WRITE
           
 
Field Summary
 int value
          Internal value for this token code.
 
Method Summary
 String toString()
          Returns a string representation for this token code.
static TokenCode valueOf(int value)
          Returns the TokenCode corresponding to a particular value.
static TokenCode valueOf(String name)
          Returns the enum constant of this type with the specified name.
static TokenCode[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

ID

public static final TokenCode ID

INTLITERAL

public static final TokenCode INTLITERAL

STRLITERAL

public static final TokenCode STRLITERAL

ASSIGN

public static final TokenCode ASSIGN

AND

public static final TokenCode AND

OR

public static final TokenCode OR

CHAR_60

public static final TokenCode CHAR_60

LE

public static final TokenCode LE

CHAR_62

public static final TokenCode CHAR_62

GE

public static final TokenCode GE

CHAR_61

public static final TokenCode CHAR_61

NE

public static final TokenCode NE

CHAR_43

public static final TokenCode CHAR_43

CHAR_45

public static final TokenCode CHAR_45

CHAR_42

public static final TokenCode CHAR_42

CHAR_47

public static final TokenCode CHAR_47

UMINUS

public static final TokenCode UMINUS

NOT

public static final TokenCode NOT

BOOLEAN

public static final TokenCode BOOLEAN

INTEGER

public static final TokenCode INTEGER

STRING

public static final TokenCode STRING

ARRAY

public static final TokenCode ARRAY

OF

public static final TokenCode OF

DOTDOT

public static final TokenCode DOTDOT

TRUE

public static final TokenCode TRUE

FALSE

public static final TokenCode FALSE

PROCEDURE

public static final TokenCode PROCEDURE

FUNCTION

public static final TokenCode FUNCTION

IS

public static final TokenCode IS

BEGIN

public static final TokenCode BEGIN

END

public static final TokenCode END

IN

public static final TokenCode IN

OUT

public static final TokenCode OUT

RETURN

public static final TokenCode RETURN

IF

public static final TokenCode IF

THEN

public static final TokenCode THEN

ELSIF

public static final TokenCode ELSIF

ELSE

public static final TokenCode ELSE

WHILE

public static final TokenCode WHILE

FOR

public static final TokenCode FOR

LOOP

public static final TokenCode LOOP

EXIT

public static final TokenCode EXIT

WHEN

public static final TokenCode WHEN

READ

public static final TokenCode READ

WRITE

public static final TokenCode WRITE

NULL

public static final TokenCode NULL

CHAR_59

public static final TokenCode CHAR_59

CHAR_40

public static final TokenCode CHAR_40

CHAR_41

public static final TokenCode CHAR_41

CHAR_58

public static final TokenCode CHAR_58

CHAR_44

public static final TokenCode CHAR_44
Field Detail

value

public final int value
Internal value for this token code. For tokens corresponding to a single character, the value is the ASCII code for that character. Other tokens are assigned arbitrary codes greater than 256.

Method Detail

values

public static final TokenCode[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(TokenCode c : TokenCode.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf

public static TokenCode valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name

toString

public String toString()
Returns a string representation for this token code. For a token corresponding to the single character c, the representation is "'c'". For others, it's the name of the token, such as BOOL or WHILE.

Overrides:
toString in class Enum<TokenCode>
Returns:
the string representation.

valueOf

public static TokenCode valueOf(int value)
Returns the TokenCode corresponding to a particular value.

Parameters:
value - the value.
Returns:
the instance corresponding to value.

CS 536 Fall 2007, Project 5