terp - the Codemesh Modular
Template Interpreter v1.3.309

com.codemesh.terp.api
Enum TokenizerState

java.lang.Object
  extended by java.lang.Enum<TokenizerState>
      extended by com.codemesh.terp.api.TokenizerState
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<TokenizerState>

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

The supported tokenizer states. Tokenizer states are used to switch between different interpretations of the same character depending on the mode or state that the tokenizer is in.

When the tokenizer is in EXPRESSION mode, the input 3+4 will result in three tokens (numeric literal, plus, numeric literal). When the tokenizer is in TEXT mode, the result will be one text token containing the full expression "3+4" as a string. SCRIPT mode is an extension of EXPRESSION mode. In SCRIPT mode, the semicolon is interpreted as an expression terminator that may preceed an additional expression (list).


Enum Constant Summary
EXPRESSION
           
SCRIPT
           
TEXT
           
 
Method Summary
static TokenizerState valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static TokenizerState[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

TEXT

public static final TokenizerState TEXT

EXPRESSION

public static final TokenizerState EXPRESSION

SCRIPT

public static final TokenizerState SCRIPT
Method Detail

values

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

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

valueOf

public static TokenizerState 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
java.lang.NullPointerException - if the argument is null

terp - the Codemesh Modular
Template Interpreter v1.3.309

Copyright © 2008-2012 by Codemesh, Inc. All Rights Reserved.