java.lang.Object
com.intellij.lexer.FlexAdapter
-
Field Summary
Fields inherited from interface com.intellij.lexer.Lexer
LEXER_START_THRESHOLD -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadvance()Advances the lexer to the next token.intReturns the offset at which the lexer will stop lexing.@NotNull CharSequenceReturns the buffer sequence over which the lexer is running.getFlex()intgetState()Returns the current state of the lexer.intReturns the end offset of the current token.intReturns the start offset of the current token.Returns the token at the current position of the lexer ornullif lexing is finished.protected voidvoidstart(@NotNull CharSequence buffer, int startOffset, int endOffset, int initialState) Prepare for lexing character data frombufferpassed.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.intellij.lexer.Lexer
getTokenSequence, getTokenText, start, startMethods inherited from interface com.intellij.lexer.LexerBase
getCurrentPosition, restore
-
Constructor Details
-
FlexAdapter
-
-
Method Details
-
getFlex
-
start
public void start(@NotNull @NotNull CharSequence buffer, int startOffset, int endOffset, int initialState) Description copied from interface:LexerPrepare for lexing character data frombufferpassed. Internal lexer state is supposed to beinitialState. It is guaranteed that the value of initialState is the same as returned byLexer.getState()method of this lexer at conditionstartOffset=getTokenStart(). This method is used to incrementally re-lex changed characters using lexing data acquired from this particular lexer sometime in the past. -
getState
public int getState()Description copied from interface:LexerReturns the current state of the lexer. -
getTokenType
Description copied from interface:LexerReturns the token at the current position of the lexer ornullif lexing is finished.- Specified by:
getTokenTypein interfaceLexer- Returns:
- the current token.
-
getTokenStart
public int getTokenStart()Description copied from interface:LexerReturns the start offset of the current token.- Specified by:
getTokenStartin interfaceLexer- Returns:
- the current token start offset.
-
getTokenEnd
public int getTokenEnd()Description copied from interface:LexerReturns the end offset of the current token.- Specified by:
getTokenEndin interfaceLexer- Returns:
- the current token end offset.
-
advance
public void advance()Description copied from interface:LexerAdvances the lexer to the next token. -
getBufferSequence
Description copied from interface:LexerReturns the buffer sequence over which the lexer is running. This method should return the same buffer instance which was passed to thestart()method.- Specified by:
getBufferSequencein interfaceLexer- Returns:
- the lexer buffer.
-
getBufferEnd
public int getBufferEnd()Description copied from interface:LexerReturns the offset at which the lexer will stop lexing. This method should return the length of the buffer or the value passed in theendOffsetparameter to thestart()method.- Specified by:
getBufferEndin interfaceLexer- Returns:
- the lexing end offset
-
locateToken
protected void locateToken() -
toString
-