wizx.lang
Class ExpressionTokenizer
java.lang.Object
wizx.lang.ExpressionTokenizer
- public class ExpressionTokenizer
- extends java.lang.Object
Tokenizes expression text.
Each call to nextToken returns one of the following:
- a number literal - an openning # and any text up to and including a matching #
- a boolean literal - an openning * and any text up to and including a matching *
- a string literal - an openning " and any text up to and including a matching "
- a name token - a string of consecutive letters, numbers underscores and dashes
- a list construction delimiter - '{' or '}'
- a record construction delimiter - '[' or ']'
- a grouping delimiter - '(' or ')'
- a record deconstruction delimiter - .
- a pair construction delimiter - ,
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ExpressionTokenizer
public ExpressionTokenizer(java.lang.String s)
- Parameters:
s - the string to parse.
- Throws:
java.lang.NullPointerException - if s is null.
hasMoreTokens
public boolean hasMoreTokens()
peek
public char peek()
nextToken
public java.lang.String nextToken()
throws java.text.ParseException
- Returns the next token or null.
- Throws:
java.text.ParseException - if an illegal token is encountered.
isNameChar
public boolean isNameChar(char c)
fail
public void fail(java.lang.String message)
throws java.text.ParseException
- Throws:
java.text.ParseException
© 2001-2005 University of Oregon.
Eugene OR 97403, U.S.A. All Rights Reserved.