org.exolab.castor.jdo.oql

Class Lexer

public class Lexer extends Object implements TokenTypes

Seperates an input string of OQL into a stream of {@link Token}s.

Version: $Revision: 1.1.1.1 $ $Date: 2003/03/03 07:08:22 $

Author: Nissim Karpenstein

Field Summary
booleanendOfQueryPassed
Hashtablekeywords
int_pos
String_queryString
Constructor Summary
Lexer(String oqlQueryString)
Creates a lexer which will seperate a string query into a series of tokens.
Method Summary
booleanhasMoreTokens()
Checks whether the query strin has been fully consumed.
TokennextToken()
Returns the next {@link Token} from the stream.

Field Detail

endOfQueryPassed

boolean endOfQueryPassed

keywords

Hashtable keywords

_pos

int _pos

_queryString

String _queryString

Constructor Detail

Lexer

public Lexer(String oqlQueryString)
Creates a lexer which will seperate a string query into a series of tokens.

Parameters: oqlQueryString The string representation of the OQL Query

Method Detail

hasMoreTokens

public boolean hasMoreTokens()
Checks whether the query strin has been fully consumed.

Returns: True if there is text in the query which hasn't been tokenized, otherwise false.

nextToken

public Token nextToken()
Returns the next {@link Token} from the stream.

Returns: The next token in the stream.

Throws: NoMoreTokensException if the last character was already consumed. InvalidCharException if an invalid character is found while generating the next Token.

Intalio Inc. (C) 1999-2003. All rights reserved http://www.intalio.com