Class MergingLexerAdapterBase

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 class: 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.
      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 class: Lexer
      Returns the current state of the lexer.
      Overrides:
      getState in class DelegateLexer
      Returns:
      the lexer state.
    • getTokenType

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

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

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

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

      public Lexer getOriginal()
    • restore

      public void restore(@NotNull @NotNull LexerPosition position)
      Description copied from class: Lexer
      Restores the lexer to the specified state and position.
      Overrides:
      restore in class LexerBase
      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 class: Lexer
      Returns the current position and state of the lexer.
      Overrides:
      getCurrentPosition in class LexerBase
      Returns:
      the lexer position and state.