All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class magician.Four11.Tokenizer

java.lang.Object
   |
   +----magician.Four11.Tokenizer

public class Tokenizer
extends Object
The Tokenizer class parses an input stream and derives tokens from the stream. This class is used by the Four11 server to read the configuration file and create an in-memory copy of the configuration. The next token in the stream is obtained by making a call to nextToken. Tokens can be of type TOK_WORD, TOK_LT_PAREN, TOK_RT_PAREN or TOK_EOM. If the tokenizer is to be used to read from a file, first use setCharAsByte(true) so that the file stream is read properly.

See Also:
Four11, Token

Variable Index

 o is
The stream used to read tokens from the configuration file
 o tok
The last Token read from the stream

Constructor Index

 o Tokenizer(InputStream)
Constructor requires an Inputstream to read the tokens from.

Method Index

 o nextToken()
returns the next token read from the input stream as an object of type Token.
 o setCharAsByte(boolean)
set this to true if reading from a filestream.

Variables

 o is
 protected PushbackInputStream is
The stream used to read tokens from the configuration file

 o tok
 protected Token tok
The last Token read from the stream

Constructors

 o Tokenizer
 public Tokenizer(InputStream iis)
Constructor requires an Inputstream to read the tokens from.

Parameters:
iis - a stream of type @see java.io.InputStream

Methods

 o setCharAsByte
 public void setCharAsByte(boolean opt)
set this to true if reading from a filestream.

Parameters:
opt - boolean value indicating if char is to be read in as a byte.
 o nextToken
 public Token nextToken()
returns the next token read from the input stream as an object of type Token. The type and value of the token can be obtained by using the methods of the Token class.


All Packages  Class Hierarchy  This Package  Previous  Next  Index
1