java.lang.Object
com.thoughtworks.qdox.parser.impl.JFlexLexer
- 所有已实现的接口:
CommentScanner,JavaLexer,Lexer
-
字段概要
字段修饰符和类型字段说明static final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intThis character denotes the end of file.static final int -
构造器概要
构造器构造器说明JFlexLexer(InputStream stream) JFlexLexer(InputStream stream, Writer writer) JFlexLexer(Reader in) Creates a new scannerJFlexLexer(Reader reader, Writer writer) -
方法概要
修饰符和类型方法说明voidaddCommentHandler(CommentHandler handler) Register this handler as a comment-listener.intintgetLine()intlex()text()final booleanyyatEOF()Returns whether the scanner has reached the end of the reader it reads from.final voidyybegin(int newState) Enters a new lexical state.final charyycharat(int position) Returns the character at the given position from the matched text.final voidyyclose()Closes the input reader.final intyylength()How many characters were matched.intyylex()Resumes scanning until the next regular expression is matched, the end of input is encountered or an I/O-Error occurs.voidyypushback(int number) Pushes the specified amount of characters back into the input stream.final voidResets the scanner to read from a new input stream.final intyystate()Returns the current lexical state.final Stringyytext()Returns the text matched by the current regular expression.
-
字段详细资料
-
YYEOF
public static final int YYEOFThis character denotes the end of file.- 另请参阅:
-
YYINITIAL
public static final int YYINITIAL- 另请参阅:
-
JAVADOC
public static final int JAVADOC- 另请参阅:
-
JAVADOCTAG
public static final int JAVADOCTAG- 另请参阅:
-
JAVADOCLINE
public static final int JAVADOCLINE- 另请参阅:
-
CODEBLOCK
public static final int CODEBLOCK- 另请参阅:
-
PARENBLOCK
public static final int PARENBLOCK- 另请参阅:
-
ASSIGNMENT
public static final int ASSIGNMENT- 另请参阅:
-
STRING
public static final int STRING- 另请参阅:
-
CHAR
public static final int CHAR- 另请参阅:
-
SINGLELINECOMMENT
public static final int SINGLELINECOMMENT- 另请参阅:
-
MULTILINECOMMENT
public static final int MULTILINECOMMENT- 另请参阅:
-
ANNOTATION
public static final int ANNOTATION- 另请参阅:
-
ANNOSTRING
public static final int ANNOSTRING- 另请参阅:
-
ANNOCHAR
public static final int ANNOCHAR- 另请参阅:
-
ARGUMENTS
public static final int ARGUMENTS- 另请参阅:
-
NAME
public static final int NAME- 另请参阅:
-
ANNOTATIONTYPE
public static final int ANNOTATIONTYPE- 另请参阅:
-
ENUM
public static final int ENUM- 另请参阅:
-
MODULE
public static final int MODULE- 另请参阅:
-
RECORD
public static final int RECORD- 另请参阅:
-
TYPE
public static final int TYPE- 另请参阅:
-
ANNOTATIONNOARG
public static final int ANNOTATIONNOARG- 另请参阅:
-
ATANNOTATION
public static final int ATANNOTATION- 另请参阅:
-
NAME_OR_MODIFIER
public static final int NAME_OR_MODIFIER- 另请参阅:
-
-
构造器详细资料
-
JFlexLexer
-
JFlexLexer
-
JFlexLexer
-
JFlexLexer
Creates a new scanner- 参数:
in- the java.io.Reader to read input from.
-
-
方法详细资料
-
text
-
lex
- 指定者:
lex在接口中Lexer- 抛出:
IOException
-
getLine
public int getLine() -
getColumn
public int getColumn() -
getCodeBody
- 指定者:
getCodeBody在接口中Lexer
-
addCommentHandler
从接口复制的说明:CommentScannerRegister this handler as a comment-listener. If scanner hits a comment, all handlers will be triggered.- 指定者:
addCommentHandler在接口中CommentScanner- 参数:
handler- the commentHandler to add to the CommentScanner
-
yyclose
Closes the input reader.- 抛出:
IOException- if the reader could not be closed.
-
yyreset
Resets the scanner to read from a new input stream.Does not close the old reader.
All internal variables are reset, the old input stream cannot be reused (internal buffer is discarded and lost). Lexical state is set to
ZZ_INITIAL.Internal scan buffer is resized down to its initial length, if it has grown.
- 参数:
reader- The new input stream.
-
yyatEOF
public final boolean yyatEOF()Returns whether the scanner has reached the end of the reader it reads from.- 返回:
- whether the scanner has reached EOF.
-
yystate
public final int yystate()Returns the current lexical state.- 返回:
- the current lexical state.
-
yybegin
public final void yybegin(int newState) Enters a new lexical state.- 参数:
newState- the new lexical state
-
yytext
Returns the text matched by the current regular expression.- 返回:
- the matched text.
-
yycharat
public final char yycharat(int position) Returns the character at the given position from the matched text.It is equivalent to
yytext().charAt(pos), but faster.- 参数:
position- the position of the character to fetch. A value from 0 toyylength()-1.- 返回:
- the character at
position.
-
yylength
public final int yylength()How many characters were matched.- 返回:
- the length of the matched text region.
-
yypushback
public void yypushback(int number) Pushes the specified amount of characters back into the input stream.They will be read again by then next call of the scanning method.
- 参数:
number- the number of characters to be read again. This number must not be greater thanyylength().
-
yylex
Resumes scanning until the next regular expression is matched, the end of input is encountered or an I/O-Error occurs.- 返回:
- the next token.
- 抛出:
IOException- if any I/O-Error occurs.
-