java.lang.Object
com.intellij.lexer.LookAheadLexer
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface com.intellij.lexer.Lexer
LEXER_START_THRESHOLD -
Constructor Summary
ConstructorsConstructorDescriptionLookAheadLexer(@NotNull Lexer baseLexer) LookAheadLexer(@NotNull Lexer baseLexer, int capacity) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddToken(int endOffset, IElementType type) protected voidaddToken(IElementType type) voidadvance()Advances the lexer to the next token.protected final voidadvanceAs(@NotNull Lexer lexer, IElementType type) protected final voidadvanceLexer(@NotNull Lexer lexer) intReturns the offset at which the lexer will stop lexing.@NotNull CharSequenceReturns the buffer sequence over which the lexer is running.protected final intgetCachedOffset(int index) protected final IElementTypegetCachedType(int index) protected intReturns the current position and state of the lexer.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 voidreplaceCachedType(int index, IElementType token) protected voidresetCacheSize(int size) final voidrestore(@NotNull LexerPosition _position) Restores the lexer to the specified state and position.protected voidrestore(@NotNull LookAheadLexer.LookAheadLexerPosition position) voidstart(@NotNull CharSequence buffer, int startOffset, int endOffset, int initialState) Prepare for lexing character data frombufferpassed.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.intellij.lexer.Lexer
getTokenSequence, getTokenText, start, start
-
Constructor Details
-
LookAheadLexer
-
LookAheadLexer
-
-
Method Details
-
addToken
-
addToken
-
lookAhead
-
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
-
getCacheSize
protected int getCacheSize() -
resetCacheSize
protected void resetCacheSize(int size) -
replaceCachedType
-
getCachedType
-
getCachedOffset
protected final int getCachedOffset(int index) -
getState
public int getState()Description copied from interface:LexerReturns the current state of the lexer. -
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.
-
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.
-
getCurrentPosition
Description copied from interface:LexerReturns the current position and state of the lexer.- Specified by:
getCurrentPositionin interfaceLexer- Specified by:
getCurrentPositionin interfaceLexerBase- Returns:
- the lexer position and state.
-
restore
Description copied from interface:LexerRestores the lexer to the specified state and position. -
restore
-
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.
-
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. -
advanceLexer
-
advanceAs
-