public class JavaLexer extends LexerBase
| Constructor and Description |
|---|
JavaLexer(LanguageLevel level) |
| Modifier and Type | Method and Description |
|---|---|
void |
advance()
Advances the lexer to the next token.
|
int |
getBufferEnd()
Returns the offset at which the lexer will stop lexing.
|
java.lang.CharSequence |
getBufferSequence()
Returns the buffer sequence over which the lexer is running.
|
int |
getState()
Returns the current state of the lexer.
|
int |
getTokenEnd()
Returns the end offset of the current token.
|
int |
getTokenStart()
Returns the start offset of the current token.
|
IElementType |
getTokenType()
Returns the token at the current position of the lexer or
null if lexing is finished. |
static boolean |
isKeyword(java.lang.String id,
LanguageLevel level) |
static boolean |
isSoftKeyword(java.lang.CharSequence id,
LanguageLevel level) |
void |
start(java.lang.CharSequence buffer,
int startOffset,
int endOffset,
int initialState)
Prepare for lexing character data from
buffer passed. |
getCurrentPosition, restoregetTokenSequence, getTokenText, start, startpublic JavaLexer(LanguageLevel level)
public static boolean isKeyword(java.lang.String id,
LanguageLevel level)
public static boolean isSoftKeyword(java.lang.CharSequence id,
LanguageLevel level)
public final void start(java.lang.CharSequence buffer,
int startOffset,
int endOffset,
int initialState)
Lexerbuffer passed. Internal lexer state is supposed to be initialState. It is guaranteed
that the value of initialState is the same as returned by Lexer.getState() method of this lexer at condition startOffset=getTokenStart().
This method is used to incrementally re-lex changed characters using lexing data acquired from this particular lexer sometime in the past.public int getState()
Lexerpublic final IElementType getTokenType()
Lexernull if lexing is finished.getTokenType in class Lexerpublic final int getTokenStart()
LexergetTokenStart in class Lexerpublic final int getTokenEnd()
LexergetTokenEnd in class Lexerpublic final void advance()
Lexerpublic java.lang.CharSequence getBufferSequence()
Lexerstart() method.getBufferSequence in class Lexerpublic final int getBufferEnd()
LexerendOffset parameter
to the start() method.getBufferEnd in class Lexer