Package: org.codehaus.groovy.antlr.parser

## [Java] Class GroovyLexer

- org.codehaus.groovy.antlr.parser.GroovyLexer

- All Implemented Interfaces and Traits:
    GroovyTokenTypes, TokenStream

      public class GroovyLexer
      extends antlrCharScanner

- - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `protected static int` | `SCS_SQ_TYPE` |
    `protected static int` | `SCS_TYPE` |
    `static BitSet` | `_tokenSet_0` |
    `static BitSet` | `_tokenSet_1` |
    `static BitSet` | `_tokenSet_10` |
    `static BitSet` | `_tokenSet_11` |
    `static BitSet` | `_tokenSet_12` |
    `static BitSet` | `_tokenSet_13` |
    `static BitSet` | `_tokenSet_2` |
    `static BitSet` | `_tokenSet_3` |
    `static BitSet` | `_tokenSet_4` |
    `static BitSet` | `_tokenSet_5` |
    `static BitSet` | `_tokenSet_6` |
    `static BitSet` | `_tokenSet_7` |
    `static BitSet` | `_tokenSet_8` |
    `static BitSet` | `_tokenSet_9` |
    `protected int` | `lastSigTokenType` |
    `protected int` | `parenLevel` | Bumped when inside '[x]' or '(x)', reset inside '{x}'.
    `protected ArrayList` | `parenLevelStack` | Push parenLevel here and reset whenever inside '{x}'.
    `protected GroovyRecognizer` | `parser` |
    `protected int` | `stringCtorState` |
    `protected int` | `suppressNewline` |
    `static boolean` | `tracing` |

  - ### Constructor Summary

    Constructors
    Constructor and description
    `GroovyLexer (InputStream in)`
    `GroovyLexer (Reader in)`
    `GroovyLexer (InputBuffer ib)`
    `GroovyLexer (LexerSharedInputState state)`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `protected boolean` | `allowRegexpLiteral()`
    `` | `protected boolean` | `atDollarDollarEscape()`
    `` | `protected boolean` | `atDollarSlashEscape()`
    `` | `protected boolean` | `atMultiCommentStart()`
    `` | `protected boolean` | `atValidDollarEscape()`
    `` | `void` | `enableAssert(boolean shouldEnable)` Enable the "assert" keyword
    `` | `void` | `enableEnum(boolean shouldEnable)` Enable the "enum" keyword
    `` | `boolean` | `isAssertEnabled()` Query the "assert" keyword state
    `` | `boolean` | `isEnumEnabled()` Query the "enum" keyword state
    `` | `protected static boolean` | `isExpressionEndingToken(int ttype)`
    `` | `boolean` | `isWhitespaceIncluded()` Are whitespace tokens included?
    `` | `void` | `mASSIGN(boolean _createToken)`
    `` | `void` | `mAT(boolean _createToken)`
    `` | `void` | `mBAND(boolean _createToken)`
    `` | `void` | `mBAND_ASSIGN(boolean _createToken)`
    `` | `protected void` | `mBIG_SUFFIX(boolean _createToken)`
    `` | `void` | `mBNOT(boolean _createToken)`
    `` | `void` | `mBOR(boolean _createToken)`
    `` | `void` | `mBOR_ASSIGN(boolean _createToken)`
    `` | `void` | `mBSR(boolean _createToken)`
    `` | `void` | `mBSR_ASSIGN(boolean _createToken)`
    `` | `void` | `mBXOR(boolean _createToken)`
    `` | `void` | `mBXOR_ASSIGN(boolean _createToken)`
    `` | `void` | `mCLOSABLE_BLOCK_OP(boolean _createToken)`
    `` | `void` | `mCOLON(boolean _createToken)`
    `` | `void` | `mCOMMA(boolean _createToken)`
    `` | `void` | `mCOMPARE_TO(boolean _createToken)`
    `` | `void` | `mDEC(boolean _createToken)`
    `` | `protected void` | `mDIGIT(boolean _createToken)`
    `` | `protected void` | `mDIGITS_WITH_UNDERSCORE(boolean _createToken)`
    `` | `protected void` | `mDIGITS_WITH_UNDERSCORE_OPT(boolean _createToken)`
    `` | `protected void` | `mDIV(boolean _createToken)`
    `` | `protected void` | `mDIV_ASSIGN(boolean _createToken)`
    `` | `protected void` | `mDOLLAR(boolean _createToken)`
    `` | `protected int` | `mDOLLAR_REGEXP_CTOR_END(boolean _createToken, boolean fromStart)`
    `` | `void` | `mDOLLAR_REGEXP_LITERAL(boolean _createToken)`
    `` | `protected void` | `mDOLLAR_REGEXP_SYMBOL(boolean _createToken)`
    `` | `void` | `mDOT(boolean _createToken)`
    `` | `void` | `mELVIS_OPERATOR(boolean _createToken)`
    `` | `void` | `mEQUAL(boolean _createToken)`
    `` | `protected void` | `mESC(boolean _createToken)`
    `` | `protected void` | `mESCAPED_DOLLAR(boolean _createToken)`
    `` | `protected void` | `mESCAPED_SLASH(boolean _createToken)`
    `` | `protected void` | `mEXPONENT(boolean _createToken)`
    `` | `protected void` | `mFLOAT_SUFFIX(boolean _createToken)`
    `` | `void` | `mGE(boolean _createToken)`
    `` | `void` | `mGT(boolean _createToken)`
    `` | `protected void` | `mHEX_DIGIT(boolean _createToken)`
    `` | `void` | `mIDENT(boolean _createToken)`
    `` | `void` | `mIDENTICAL(boolean _createToken)`
    `` | `void` | `mINC(boolean _createToken)`
    `` | `void` | `mLAND(boolean _createToken)`
    `` | `void` | `mLBRACK(boolean _createToken)`
    `` | `void` | `mLCURLY(boolean _createToken)`
    `` | `void` | `mLE(boolean _createToken)`
    `` | `protected void` | `mLETTER(boolean _createToken)`
    `` | `void` | `mLNOT(boolean _createToken)`
    `` | `void` | `mLOR(boolean _createToken)`
    `` | `void` | `mLPAREN(boolean _createToken)`
    `` | `void` | `mLT(boolean _createToken)`
    `` | `void` | `mMEMBER_POINTER(boolean _createToken)`
    `` | `void` | `mMINUS(boolean _createToken)`
    `` | `void` | `mMINUS_ASSIGN(boolean _createToken)`
    `` | `void` | `mML_COMMENT(boolean _createToken)`
    `` | `void` | `mMOD(boolean _createToken)`
    `` | `void` | `mMOD_ASSIGN(boolean _createToken)`
    `` | `void` | `mNLS(boolean _createToken)`
    `` | `void` | `mNOT_EQUAL(boolean _createToken)`
    `` | `void` | `mNOT_IDENTICAL(boolean _createToken)`
    `` | `void` | `mNUM_INT(boolean _createToken)`
    `` | `protected void` | `mONE_NL(boolean _createToken, boolean check)`
    `` | `void` | `mOPTIONAL_DOT(boolean _createToken)`
    `` | `void` | `mPLUS(boolean _createToken)`
    `` | `void` | `mPLUS_ASSIGN(boolean _createToken)`
    `` | `void` | `mQUESTION(boolean _createToken)`
    `` | `void` | `mRANGE_EXCLUSIVE(boolean _createToken)`
    `` | `void` | `mRANGE_INCLUSIVE(boolean _createToken)`
    `` | `void` | `mRBRACK(boolean _createToken)`
    `` | `void` | `mRCURLY(boolean _createToken)`
    `` | `protected int` | `mREGEXP_CTOR_END(boolean _createToken, boolean fromStart)`
    `` | `void` | `mREGEXP_LITERAL(boolean _createToken)`
    `` | `protected void` | `mREGEXP_SYMBOL(boolean _createToken)`
    `` | `void` | `mREGEX_FIND(boolean _createToken)`
    `` | `void` | `mREGEX_MATCH(boolean _createToken)`
    `` | `void` | `mRPAREN(boolean _createToken)`
    `` | `void` | `mSEMI(boolean _createToken)`
    `` | `void` | `mSH_COMMENT(boolean _createToken)`
    `` | `void` | `mSL(boolean _createToken)`
    `` | `void` | `mSL_ASSIGN(boolean _createToken)`
    `` | `void` | `mSL_COMMENT(boolean _createToken)`
    `` | `void` | `mSPREAD_DOT(boolean _createToken)`
    `` | `void` | `mSR(boolean _createToken)`
    `` | `void` | `mSR_ASSIGN(boolean _createToken)`
    `` | `void` | `mSTAR(boolean _createToken)`
    `` | `void` | `mSTAR_ASSIGN(boolean _createToken)`
    `` | `void` | `mSTAR_STAR(boolean _createToken)`
    `` | `void` | `mSTAR_STAR_ASSIGN(boolean _createToken)`
    `` | `protected void` | `mSTRING_CH(boolean _createToken)`
    `` | `protected int` | `mSTRING_CTOR_END(boolean _createToken, boolean fromStart, boolean tripleQuote)`
    `` | `void` | `mSTRING_LITERAL(boolean _createToken)`
    `` | `protected void` | `mSTRING_NL(boolean _createToken, boolean allowNewline)`
    `` | `void` | `mTRIPLE_DOT(boolean _createToken)`
    `` | `protected void` | `mVOCAB(boolean _createToken)`
    `` | `void` | `mWS(boolean _createToken)`
    `` | `protected Token` | `makeToken(int t)`
    `` | `protected void` | `newlineCheck(boolean check)`
    `` | `Token` | `nextToken()`
    `` | `Token` | `nextToken()`
    `` | `TokenStream` | `plumb()` This is a bit of plumbing which resumes collection of string constructor bodies, after an embedded expression has been parsed.
    `` | `protected void` | `popParenLevel()`
    `` | `protected void` | `pushParenLevel()`
    `` | `protected void` | `restartStringCtor(boolean expectLiteral)`
    `` | `void` | `setTokenObjectClass(String name)`
    `` | `void` | `setWhitespaceIncluded(boolean z)` Include whitespace tokens.
    `` | `void` | `traceIn(String rname)`
    `` | `void` | `traceOut(String rname)`

- - ### Field Detail

    - #### protected static final int SCS_SQ_TYPE

    - #### protected static final int SCS_TYPE

    - #### public static final BitSet _tokenSet_0

    - #### public static final BitSet _tokenSet_1

    - #### public static final BitSet _tokenSet_10

    - #### public static final BitSet _tokenSet_11

    - #### public static final BitSet _tokenSet_12

    - #### public static final BitSet _tokenSet_13

    - #### public static final BitSet _tokenSet_2

    - #### public static final BitSet _tokenSet_3

    - #### public static final BitSet _tokenSet_4

    - #### public static final BitSet _tokenSet_5

    - #### public static final BitSet _tokenSet_6

    - #### public static final BitSet _tokenSet_7

    - #### public static final BitSet _tokenSet_8

    - #### public static final BitSet _tokenSet_9

    - #### protected int lastSigTokenType

    - #### protected int parenLevel

      Bumped when inside '[x]' or '(x)', reset inside '{x}'. See ONE_NL.

    - #### protected ArrayList parenLevelStack

      Push parenLevel here and reset whenever inside '{x}'.

    - #### protected GroovyRecognizer parser

    - #### protected int stringCtorState

    - #### protected int suppressNewline

    - #### public static boolean tracing

  - ### Constructor Detail

    - #### public GroovyLexer(InputStream in)

    - #### public GroovyLexer(Reader in)

    - #### public GroovyLexer(InputBuffer ib)

    - #### public GroovyLexer(LexerSharedInputState state)

  - ### Method Detail

    - #### protected boolean allowRegexpLiteral()

    - #### protected boolean atDollarDollarEscape()

    - #### protected boolean atDollarSlashEscape()

    - #### protected boolean atMultiCommentStart()

    - #### protected boolean atValidDollarEscape()

    - #### public void enableAssert(boolean shouldEnable)

      Enable the "assert" keyword

    - #### public void enableEnum(boolean shouldEnable)

      Enable the "enum" keyword

    - #### public boolean isAssertEnabled()

      Query the "assert" keyword state

    - #### public boolean isEnumEnabled()

      Query the "enum" keyword state

    - #### protected static boolean isExpressionEndingToken(int ttype)

    - #### public boolean isWhitespaceIncluded()

      Are whitespace tokens included?

    - #### public final void mASSIGN(boolean _createToken)

    - #### public final void mAT(boolean _createToken)

    - #### public final void mBAND(boolean _createToken)

    - #### public final void mBAND_ASSIGN(boolean _createToken)

    - #### protected final void mBIG_SUFFIX(boolean _createToken)

    - #### public final void mBNOT(boolean _createToken)

    - #### public final void mBOR(boolean _createToken)

    - #### public final void mBOR_ASSIGN(boolean _createToken)

    - #### public final void mBSR(boolean _createToken)

    - #### public final void mBSR_ASSIGN(boolean _createToken)

    - #### public final void mBXOR(boolean _createToken)

    - #### public final void mBXOR_ASSIGN(boolean _createToken)

    - #### public final void mCLOSABLE_BLOCK_OP(boolean _createToken)

    - #### public final void mCOLON(boolean _createToken)

    - #### public final void mCOMMA(boolean _createToken)

    - #### public final void mCOMPARE_TO(boolean _createToken)

    - #### public final void mDEC(boolean _createToken)

    - #### protected final void mDIGIT(boolean _createToken)

    - #### protected final void mDIGITS_WITH_UNDERSCORE(boolean _createToken)

    - #### protected final void mDIGITS_WITH_UNDERSCORE_OPT(boolean _createToken)

    - #### protected final void mDIV(boolean _createToken)

    - #### protected final void mDIV_ASSIGN(boolean _createToken)

    - #### protected final void mDOLLAR(boolean _createToken)

    - #### protected final int mDOLLAR_REGEXP_CTOR_END(boolean _createToken, boolean fromStart)

    - #### public final void mDOLLAR_REGEXP_LITERAL(boolean _createToken)

    - #### protected final void mDOLLAR_REGEXP_SYMBOL(boolean _createToken)

    - #### public final void mDOT(boolean _createToken)

    - #### public final void mELVIS_OPERATOR(boolean _createToken)

    - #### public final void mEQUAL(boolean _createToken)

    - #### protected final void mESC(boolean _createToken)

    - #### protected final void mESCAPED_DOLLAR(boolean _createToken)

    - #### protected final void mESCAPED_SLASH(boolean _createToken)

    - #### protected final void mEXPONENT(boolean _createToken)

    - #### protected final void mFLOAT_SUFFIX(boolean _createToken)

    - #### public final void mGE(boolean _createToken)

    - #### public final void mGT(boolean _createToken)

    - #### protected final void mHEX_DIGIT(boolean _createToken)

    - #### public final void mIDENT(boolean _createToken)

    - #### public final void mIDENTICAL(boolean _createToken)

    - #### public final void mINC(boolean _createToken)

    - #### public final void mLAND(boolean _createToken)

    - #### public final void mLBRACK(boolean _createToken)

    - #### public final void mLCURLY(boolean _createToken)

    - #### public final void mLE(boolean _createToken)

    - #### protected final void mLETTER(boolean _createToken)

    - #### public final void mLNOT(boolean _createToken)

    - #### public final void mLOR(boolean _createToken)

    - #### public final void mLPAREN(boolean _createToken)

    - #### public final void mLT(boolean _createToken)

    - #### public final void mMEMBER_POINTER(boolean _createToken)

    - #### public final void mMINUS(boolean _createToken)

    - #### public final void mMINUS_ASSIGN(boolean _createToken)

    - #### public final void mML_COMMENT(boolean _createToken)

    - #### public final void mMOD(boolean _createToken)

    - #### public final void mMOD_ASSIGN(boolean _createToken)

    - #### public final void mNLS(boolean _createToken)

    - #### public final void mNOT_EQUAL(boolean _createToken)

    - #### public final void mNOT_IDENTICAL(boolean _createToken)

    - #### public final void mNUM_INT(boolean _createToken)

    - #### protected final void mONE_NL(boolean _createToken, boolean check)

    - #### public final void mOPTIONAL_DOT(boolean _createToken)

    - #### public final void mPLUS(boolean _createToken)

    - #### public final void mPLUS_ASSIGN(boolean _createToken)

    - #### public final void mQUESTION(boolean _createToken)

    - #### public final void mRANGE_EXCLUSIVE(boolean _createToken)

    - #### public final void mRANGE_INCLUSIVE(boolean _createToken)

    - #### public final void mRBRACK(boolean _createToken)

    - #### public final void mRCURLY(boolean _createToken)

    - #### protected final int mREGEXP_CTOR_END(boolean _createToken, boolean fromStart)

    - #### public final void mREGEXP_LITERAL(boolean _createToken)

    - #### protected final void mREGEXP_SYMBOL(boolean _createToken)

    - #### public final void mREGEX_FIND(boolean _createToken)

    - #### public final void mREGEX_MATCH(boolean _createToken)

    - #### public final void mRPAREN(boolean _createToken)

    - #### public final void mSEMI(boolean _createToken)

    - #### public final void mSH_COMMENT(boolean _createToken)

    - #### public final void mSL(boolean _createToken)

    - #### public final void mSL_ASSIGN(boolean _createToken)

    - #### public final void mSL_COMMENT(boolean _createToken)

    - #### public final void mSPREAD_DOT(boolean _createToken)

    - #### public final void mSR(boolean _createToken)

    - #### public final void mSR_ASSIGN(boolean _createToken)

    - #### public final void mSTAR(boolean _createToken)

    - #### public final void mSTAR_ASSIGN(boolean _createToken)

    - #### public final void mSTAR_STAR(boolean _createToken)

    - #### public final void mSTAR_STAR_ASSIGN(boolean _createToken)

    - #### protected final void mSTRING_CH(boolean _createToken)

    - #### protected final int mSTRING_CTOR_END(boolean _createToken, boolean fromStart, boolean tripleQuote)

    - #### public final void mSTRING_LITERAL(boolean _createToken)

    - #### protected final void mSTRING_NL(boolean _createToken, boolean allowNewline)

    - #### public final void mTRIPLE_DOT(boolean _createToken)

    - #### protected final void mVOCAB(boolean _createToken)

    - #### public final void mWS(boolean _createToken)

    - #### protected Token makeToken(int t)

    - #### protected void newlineCheck(boolean check)

    - #### public Token nextToken()

    - #### public TokenStream plumb()

      This is a bit of plumbing which resumes collection of string constructor bodies, after an embedded expression has been parsed. Usage: new GroovyRecognizer(new GroovyLexer(in).plumb()).

    - #### protected void popParenLevel()

    - #### protected void pushParenLevel()

    - #### protected void restartStringCtor(boolean expectLiteral)

    - #### public void setTokenObjectClass(String name)

    - #### public void setWhitespaceIncluded(boolean z)

      Include whitespace tokens. Note that this breaks the parser.

    - #### public void traceIn(String rname)

    - #### public void traceOut(String rname)