| java.lang.Object example.Parser
Parser | public class Parser (Code) | | Parse a request made using the magic8ball protocol, returning
appropriate objects that are instances of AbstractCommand.
This class is both a parser and a command factory.
|
Constructor Summary | |
public | Parser() |
eatWhitespace | int eatWhitespace() throws IOException(Code) | | Eat whitespace characters out of readStream
the first non-whitespace character (whichis still in the _readStream), or -1 if end of stream encountered. |
init | public void init(ReadStream readStream)(Code) | | |
isEOS | boolean isEOS(int ch)(Code) | | true if ch is an indication that the end-of-stream was reached |
isError | public boolean isError()(Code) | | |
isWhitespace | boolean isWhitespace(int ch)(Code) | | true if ch is a whitespace character or end-of-stream indicator |
nextCommand | public AbstractCommand nextCommand() throws IOException(Code) | | Parse one command out of the ReadStream.
Once the last command is encountered, null is returned.
null if there were no more commands to parse, or there is a parseerror. |
parseToken | String parseToken() throws IOException(Code) | | Parse optional whitespace then a token containing no whitespace.
the token, or null if there are no tokens left on the stream |
|
|