public interface Lexer
LexerTokenizer
. You can put a Reader
inside
a Lexer with the yyreset(java.io.Reader)
method. An easy way to build classes implementing this
interface is with JFlex (http://jflex.de). Just make sure to include the following in the
JFlex source file
In the Options and Macros section of the source file, include
%class JFlexDummyLexerModifier and Type | Method and Description |
---|---|
int |
getYYEOF()
returns value for YYEOF
|
void |
pushBack(int length)
Pushes back
length character positions in the
lexer. |
int |
yylex()
Gets the next token from input and returns an integer value
signalling what to do with the token.
|
void |
yyreset(java.io.Reader r)
put a
Reader inside the Lexer. |
java.lang.String |
yytext()
returns the matched input text region
|
static final int ACCEPT
static final int IGNORE
int yylex() throws java.io.IOException
java.io.IOException
java.lang.String yytext()
void pushBack(int length)
length
character positions in the
lexer. Conventionally used to push back exactly one token.int getYYEOF()
void yyreset(java.io.Reader r) throws java.io.IOException
Reader
inside the Lexer.java.io.IOException