Class CrAwareLexerSimulator

java.lang.Object
org.antlr.v4.runtime.atn.ATNSimulator
org.antlr.v4.runtime.atn.LexerATNSimulator
com.puppycrawl.tools.checkstyle.grammar.CrAwareLexerSimulator

public class CrAwareLexerSimulator extends org.antlr.v4.runtime.atn.LexerATNSimulator
Extends the LexerATNSimulator class in order to override the 'consume()' method so that we can handle '\r' line endings (pre-OSX macOS line endings) correctly in the ANTLR lexer.
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.antlr.v4.runtime.atn.LexerATNSimulator

    org.antlr.v4.runtime.atn.LexerATNSimulator.SimState
  • Field Summary

    Fields inherited from class org.antlr.v4.runtime.atn.LexerATNSimulator

    charPositionInLine, debug, decisionToDFA, dfa_debug, line, MAX_DFA_EDGE, MIN_DFA_EDGE, mode, prevAccept, recog, startIndex

    Fields inherited from class org.antlr.v4.runtime.atn.ATNSimulator

    atn, ERROR, sharedContextCache
  • Constructor Summary

    Constructors
    Constructor
    Description
    CrAwareLexerSimulator(org.antlr.v4.runtime.Lexer lexer, org.antlr.v4.runtime.atn.ATN augmented, org.antlr.v4.runtime.dfa.DFA[] decisionToDfa, org.antlr.v4.runtime.atn.PredictionContextCache sharedContextCache)
    Constructs a CrAwareLexerSimulator to interpret the input from the lexer.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    consume(org.antlr.v4.runtime.CharStream input)
    Overrides the 'consume()' method to add support for '\r' (carriage return) line endings.

    Methods inherited from class org.antlr.v4.runtime.atn.LexerATNSimulator

    accept, addDFAEdge, addDFAEdge, addDFAState, captureSimState, clearDFA, closure, computeStartState, computeTargetState, copyState, evaluatePredicate, execATN, failOrAccept, getCharPositionInLine, getDFA, getEpsilonTarget, getExistingTargetState, getLine, getReachableConfigSet, getReachableTarget, getText, getTokenName, match, matchATN, reset, setCharPositionInLine, setLine

    Methods inherited from class org.antlr.v4.runtime.atn.ATNSimulator

    getCachedContext, getSharedContextCache

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CrAwareLexerSimulator

      public CrAwareLexerSimulator(org.antlr.v4.runtime.Lexer lexer, org.antlr.v4.runtime.atn.ATN augmented, org.antlr.v4.runtime.dfa.DFA[] decisionToDfa, org.antlr.v4.runtime.atn.PredictionContextCache sharedContextCache)
      Constructs a CrAwareLexerSimulator to interpret the input from the lexer.
      Parameters:
      lexer - the current lexer
      augmented - the augmented transition network
      decisionToDfa - the DFA to store our states in
      sharedContextCache - cache of PredictionContext objects
  • Method Details

    • consume

      public void consume(org.antlr.v4.runtime.CharStream input)
      Overrides the 'consume()' method to add support for '\r' (carriage return) line endings.
      Overrides:
      consume in class org.antlr.v4.runtime.atn.LexerATNSimulator
      Parameters:
      input - the Character stream of the file we are parsing