Package: org.apache.groovy.parser.antlr4

## [Java] Class GroovyLangLexer

- org.apache.groovy.parser.antlr4.GroovyLangLexer

-     public class GroovyLangLexer
      extends GroovyLexer

  The lexer for Groovy programming language, which is based on the lexer generated by Antlr4

- - Inherited fields
    Fields inherited from class | Fields
    --- | ---
    `class GroovyLexer` | `DQ_GSTRING_MODE, StringLiteral, VOCABULARY, _ATN, _serializedATN, channelNames, modeNames, ruleNames, tokenNames`

  - ### Constructor Summary

    Constructors
    Constructor and description
    `GroovyLangLexer(Reader reader)`
    `GroovyLangLexer(CharStream input)`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public Token` | `nextToken()` Returns the next token, with a special case for EOF after a bare `$` in a GString.
    `` | `public void` | `notifyListeners(LexerNoViableAltException e)` Report a lexical error.
    `` | `public void` | `recover(LexerNoViableAltException e)` Abort lexing on the first lexical error.
    `` | `protected void` | `rollbackOneChar()`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class GroovyLexer` | `action, emit, enterParenCallback, exitParenCallback, getChannelNames, getErrorColumn, getErrorLine, getGrammarFileName, getModeNames, getRuleNames, getSerializedATN, getSyntaxErrorSource, getTokenNames, getVocabulary, handleComment, isErrorIgnored, popMode, rollbackOneChar, sempred, setErrorIgnored`

- - ### Constructor Detail

    - #### public GroovyLangLexer(Reader reader)

    - #### public GroovyLangLexer(CharStream input)

  - ### Method Detail

    - #### public Token nextToken()

      Returns the next token, with a special case for EOF after a bare `$` in a GString.

      After `GStringBegin` or `GStringPart` matches a trailing `$` at the end of input, Antlr marks `_hitEOF` and would skip GSTRING_TYPE_SELECTOR_MODE entirely on the subsequent call. Detect that situation and report the dollar-body error instead of a generic unexpected-EOF parse failure.

      Returns:
        the next token from the input

    - #### public void notifyListeners(LexerNoViableAltException e)

      Report a lexical error. When the failure is inside GSTRING_TYPE_SELECTOR_MODE (after a `$` in a GString), emit the dedicated dollar-body diagnostic instead of Antlr's generic token-recognition message.

      Parameters:
        `e` - the recognition failure raised by the ATN simulator

    - #### public void recover(LexerNoViableAltException e)

      Abort lexing on the first lexical error. For an invalid character after `$` in a GString, throw GroovySyntaxError so the parser layer can surface a source-located syntax error without retrying SLL?LL or falling back to a generic exception message.

      Parameters:
        `e` - the recognition failure raised by the ATN simulator

    - #### protected void rollbackOneChar()