org.millscript.millscript.syntax
Enum TokenType

java.lang.Object
  extended by java.lang.Enum<TokenType>
      extended by org.millscript.millscript.syntax.TokenType
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<TokenType>

public enum TokenType
extends java.lang.Enum<TokenType>

This enumeration describes the valid types of token that can be generated by the tokenizer.


Enum Constant Summary
EOF
          Used to indicate we've reached the end of file.
INTEGER
          Used to indicate the current token is an integer.
NAME
          Used to indicate the current token is a name.
NEED_NEW
          Used to indicate when we need a new token.
STRING
          Used to indicate the current token is a string.
TRADITIONAL_REGEX
          Used to indicate the current token is a traditional regular expression token.
 
Method Summary
static TokenType valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static TokenType[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

EOF

public static final TokenType EOF
Used to indicate we've reached the end of file. This is returned when the end of file is reached, but not if it is reached part way through reading a token.


INTEGER

public static final TokenType INTEGER
Used to indicate the current token is an integer.


NAME

public static final TokenType NAME
Used to indicate the current token is a name.


NEED_NEW

public static final TokenType NEED_NEW
Used to indicate when we need a new token. This is used when the current token is dropped.


STRING

public static final TokenType STRING
Used to indicate the current token is a string.


TRADITIONAL_REGEX

public static final TokenType TRADITIONAL_REGEX
Used to indicate the current token is a traditional regular expression token.

Method Detail

values

public static final TokenType[] 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(TokenType c : TokenType.values())
        System.out.println(c);

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

valueOf

public static TokenType valueOf(java.lang.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:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name


Copyright © 2001-2007 Open World Ltd. All Rights Reserved.