java.lang.Object
com.intellij.lexer.Lexer
com.intellij.lexer.LexerBase
com.intellij.lexer.DelegateLexer
com.intellij.lexer.LayeredLexer
-
Field Summary
FieldsFields inherited from class com.intellij.lexer.DelegateLexer
myDelegate -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadvance()Advances the lexer to the next token.protected @Nullable LexerfindLayerLexer(IElementType baseTokenType) @NotNull LexerPositionReturns 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 booleanvoidregisterLayer(Lexer lexer, IElementType... startTokens) voidregisterSelfStoppingLayer(Lexer lexer, IElementType[] startTokens, IElementType[] stopTokens) voidrestore(@NotNull LexerPosition position) Restores the lexer to the specified state and position.voidstart(@NotNull CharSequence buffer, int startOffset, int endOffset, int initialState) Prepare for lexing character data frombufferpassed.Methods inherited from class com.intellij.lexer.DelegateLexer
getBufferEnd, getBufferSequence, getDelegateMethods inherited from class com.intellij.lexer.Lexer
getTokenSequence, getTokenText, start, start
-
Field Details
-
ourDisableLayersFlag
-
-
Constructor Details
-
LayeredLexer
-
-
Method Details
-
registerSelfStoppingLayer
public void registerSelfStoppingLayer(Lexer lexer, IElementType[] startTokens, IElementType[] stopTokens) -
registerLayer
-
findLayerLexer
-
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.- Overrides:
startin classDelegateLexer- Parameters:
buffer- character data for lexing.startOffset- offset to start lexing fromendOffset- offset to stop lexing atinitialState- the initial state of the lexer.
-
getState
public int getState()Description copied from class:LexerReturns the current state of the lexer.- Overrides:
getStatein classDelegateLexer- Returns:
- the lexer state.
-
getTokenType
Description copied from class:LexerReturns the token at the current position of the lexer ornullif lexing is finished.- Overrides:
getTokenTypein classDelegateLexer- Returns:
- the current token.
-
getTokenStart
public int getTokenStart()Description copied from class:LexerReturns the start offset of the current token.- Overrides:
getTokenStartin classDelegateLexer- Returns:
- the current token start offset.
-
getTokenEnd
public int getTokenEnd()Description copied from class:LexerReturns the end offset of the current token.- Overrides:
getTokenEndin classDelegateLexer- Returns:
- the current token end offset.
-
advance
public void advance()Description copied from class:LexerAdvances the lexer to the next token.- Overrides:
advancein classDelegateLexer
-
getCurrentPosition
Description copied from class:LexerReturns the current position and state of the lexer.- Overrides:
getCurrentPositionin classLexerBase- Returns:
- the lexer position and state.
-
restore
Description copied from class:LexerRestores the lexer to the specified state and position. -
isLayerActive
protected boolean isLayerActive()
-