|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface LexerI
Generic lexical analyzer (lexer) interface.
This interface is used to implement any kind of lexical analyzer (lexer),
which reads characters from an input source stream (implementing the
java.io.Reader class) and converts it into a stream of tokens
(which implement the TokenI
interface). Such a lexer stream can be
used to read the underlying source text for a parser, such as those
implementing the ParserI
interface.
CharInputStreamI
,
ParserI
,
TokenI
Field Summary | |
---|---|
static java.lang.String |
REV
Revision information. |
Method Summary | |
---|---|
void |
close()
Close the input stream. |
TokenI |
getToken()
Read the next token from the input stream. |
boolean |
getToken(TokenI tok)
Read the next token from the lexer input stream. |
void |
setInput(java.io.Reader in)
Establish the input stream from which to read tokens. |
void |
setSourceName(java.lang.String fname)
Establish the input source filename. |
Field Detail |
---|
static final java.lang.String REV
Method Detail |
---|
void setInput(java.io.Reader in)
in
- A character input stream from which to read tokens.void setSourceName(java.lang.String fname)
fname
- The source filename.void close() throws java.io.IOException
java.io.IOException
TokenI getToken() throws java.io.IOException
Either this method or getToken(TokenI)
may be used
interchangeably.
java.io.IOException
- Thrown if an I/O error or parsing error occurs.boolean getToken(TokenI tok) throws java.io.IOException
Either this method or getToken()
may be used interchangeably.
This method might be more efficient, since a new token object does not
need to be allocated on each call.
tok
- The token object which is filled in with the next token read from the
input stream.
java.io.IOException
- Thrown if an I/O error or parsing error occurs.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |