Class MergingLexerAdapterBase

java.lang.Object
com.intellij.lexer.DelegateLexer
com.intellij.lexer.MergingLexerAdapterBase
All Implemented Interfaces:
Lexer, LexerBase
Direct Known Subclasses:
MergingLexerAdapter

public abstract class MergingLexerAdapterBase extends DelegateLexer
  • Constructor Details

    • MergingLexerAdapterBase

      public MergingLexerAdapterBase(Lexer original)
  • Method Details

    • getMergeFunction

      public abstract MergeFunction getMergeFunction()
    • start

      public void start(@NotNull @NotNull CharSequence buffer, int startOffset, int endOffset, int initialState)
      Description copied from interface: Lexer
      Prepare for lexing character data from buffer 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.
      Specified by:
      start in interface Lexer
      Overrides:
      start in class DelegateLexer
      Parameters:
      buffer - character data for lexing.
      startOffset - offset to start lexing from
      endOffset - offset to stop lexing at
      initialState - the initial state of the lexer.
    • getState

      public int getState()
      Description copied from interface: Lexer
      Returns the current state of the lexer.
      Specified by:
      getState in interface Lexer
      Overrides:
      getState in class DelegateLexer
      Returns:
      the lexer state.
    • getTokenType

      public IElementType getTokenType()
      Description copied from interface: Lexer
      Returns the token at the current position of the lexer or null if lexing is finished.
      Specified by:
      getTokenType in interface Lexer
      Overrides:
      getTokenType in class DelegateLexer
      Returns:
      the current token.
    • getTokenStart

      public int getTokenStart()
      Description copied from interface: Lexer
      Returns the start offset of the current token.
      Specified by:
      getTokenStart in interface Lexer
      Overrides:
      getTokenStart in class DelegateLexer
      Returns:
      the current token start offset.
    • getTokenEnd

      public int getTokenEnd()
      Description copied from interface: Lexer
      Returns the end offset of the current token.
      Specified by:
      getTokenEnd in interface Lexer
      Overrides:
      getTokenEnd in class DelegateLexer
      Returns:
      the current token end offset.
    • advance

      public void advance()
      Description copied from interface: Lexer
      Advances the lexer to the next token.
      Specified by:
      advance in interface Lexer
      Overrides:
      advance in class DelegateLexer
    • getOriginal

      public Lexer getOriginal()
    • restore

      public void restore(@NotNull @NotNull LexerPosition position)
      Description copied from interface: Lexer
      Restores the lexer to the specified state and position.
      Parameters:
      position - the state and position to restore to.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getCurrentPosition

      @NotNull public @NotNull LexerPosition getCurrentPosition()
      Description copied from interface: Lexer
      Returns the current position and state of the lexer.
      Returns:
      the lexer position and state.