org.apache.catalina.ssi

Class ExpressionTokenizer

public class ExpressionTokenizer extends Object

Parses an expression string to return the individual tokens. This is patterned similar to the StreamTokenizer in the JDK but customized for SSI conditional expression parsing.

Version: $Revision: 531303 $

Author: Paul Speed

Field Summary
static intTOKEN_AND
static intTOKEN_END
static intTOKEN_EQ
static intTOKEN_GE
static intTOKEN_GT
static intTOKEN_LBRACE
static intTOKEN_LE
static intTOKEN_LT
static intTOKEN_NOT
static intTOKEN_NOT_EQ
static intTOKEN_OR
static intTOKEN_RBRACE
static intTOKEN_STRING
Constructor Summary
ExpressionTokenizer(String expr)
Creates a new parser for the specified expression.
Method Summary
intgetIndex()
Returns the current index for error reporting purposes.
StringgetTokenValue()
Returns the String value of the token if it was type TOKEN_STRING.
booleanhasMoreTokens()
Returns true if there are more tokens.
protected booleanisMetaChar(char c)
intnextToken()
Returns the next token type and initializes any state variables accordingly.

Field Detail

TOKEN_AND

public static final int TOKEN_AND

TOKEN_END

public static final int TOKEN_END

TOKEN_EQ

public static final int TOKEN_EQ

TOKEN_GE

public static final int TOKEN_GE

TOKEN_GT

public static final int TOKEN_GT

TOKEN_LBRACE

public static final int TOKEN_LBRACE

TOKEN_LE

public static final int TOKEN_LE

TOKEN_LT

public static final int TOKEN_LT

TOKEN_NOT

public static final int TOKEN_NOT

TOKEN_NOT_EQ

public static final int TOKEN_NOT_EQ

TOKEN_OR

public static final int TOKEN_OR

TOKEN_RBRACE

public static final int TOKEN_RBRACE

TOKEN_STRING

public static final int TOKEN_STRING

Constructor Detail

ExpressionTokenizer

public ExpressionTokenizer(String expr)
Creates a new parser for the specified expression.

Method Detail

getIndex

public int getIndex()
Returns the current index for error reporting purposes.

getTokenValue

public String getTokenValue()
Returns the String value of the token if it was type TOKEN_STRING. Otherwise null is returned.

hasMoreTokens

public boolean hasMoreTokens()
Returns true if there are more tokens.

isMetaChar

protected boolean isMetaChar(char c)

nextToken

public int nextToken()
Returns the next token type and initializes any state variables accordingly.
Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.