java.lang.Object
com.intellij.lexer.Lexer
com.intellij.lexer.LexerBase
com.intellij.lexer.DelegateLexer
- Direct Known Subclasses:
LayeredLexer,MergingLexerAdapterBase
-
Field Summary
Fields -
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.final @NotNull CharSequenceReturns the buffer sequence over which the lexer is running.final LexerintgetState()Returns the current state of the lexer.intReturns the end offset of the current token.intReturns the start offset of the current token.@Nullable IElementTypeReturns the token at the current position of the lexer ornullif lexing is finished.voidstart(@NotNull CharSequence buffer, int startOffset, int endOffset, int initialState) Prepare for lexing character data frombufferpassed.Methods inherited from class com.intellij.lexer.LexerBase
getCurrentPosition, restoreMethods inherited from class com.intellij.lexer.Lexer
getTokenSequence, getTokenText, start, start
-
Field Details
-
myDelegate
-
-
Constructor Details
-
DelegateLexer
-
-
Method Details
-
getDelegate
-
start
public void start(@NotNull @NotNull CharSequence buffer, int startOffset, int endOffset, int initialState) Description copied from class: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 class:LexerReturns the current state of the lexer. -
getTokenType
Description copied from class:LexerReturns the token at the current position of the lexer ornullif lexing is finished.- Specified by:
getTokenTypein classLexer- Returns:
- the current token.
-
getTokenStart
public int getTokenStart()Description copied from class:LexerReturns the start offset of the current token.- Specified by:
getTokenStartin classLexer- Returns:
- the current token start offset.
-
getTokenEnd
public int getTokenEnd()Description copied from class:LexerReturns the end offset of the current token.- Specified by:
getTokenEndin classLexer- Returns:
- the current token end offset.
-
advance
public void advance()Description copied from class:LexerAdvances the lexer to the next token. -
getBufferSequence
Description copied from class: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 classLexer- Returns:
- the lexer buffer.
-
getBufferEnd
public int getBufferEnd()Description copied from class: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 classLexer- Returns:
- the lexing end offset
-