jfun.parsec.tokens

Class TokenType

public class TokenType extends Enum<TokenType>

This represents all pre-built token types.

Author: Ben Yu Apr 27, 2006 8:59:13 PM

Field Summary
static TokenTypeDecimal
decimal number literal
static TokenTypeInteger
integral number literal
static TokenTypeReserved
reserved word
static List<TokenType>VALUES
An immutable list containing the values comprising this enum class in the order they're declared.
static TokenTypeWord
regular word
Method Summary
List<TokenType>family()
Returns an immutable list containing the values comprising this enum class in the order they're declared.
static TokenTypevalueOf(String name)
Static factory to return the enum constant pertaining to the given string name.

Field Detail

Decimal

public static final TokenType Decimal
decimal number literal

Integer

public static final TokenType Integer
integral number literal

Reserved

public static final TokenType Reserved
reserved word

VALUES

public static final List<TokenType> VALUES
An immutable list containing the values comprising this enum class in the order they're declared. This field may be used to iterate over the constants as follows:
for(TokenType c : TokenType.VALUES)
    System.out.println(c);

Word

public static final TokenType Word
regular word

Method Detail

family

public final List<TokenType> family()
Returns an immutable list containing the values comprising this enum class in the order they're declared. This instance method simply returns VALUES. Few programmers should have any need to use this method. It is provided for use by sophisticated enum-based data structures to prevent the need for reflective access to VALUES.

Returns: an immutable list containing the values comprising this enum class, in the order they're declared.

valueOf

public static final TokenType valueOf(String name)
Static factory to return the enum constant pertaining to the given string name. The string must match exactly an identifier used to declare an enum constant in this type.

Throws: IllegalArgumentException if this enum class has no constant with the specified name.