Class CrAwareLexerSimulator
java.lang.Object
org.antlr.v4.runtime.atn.ATNSimulator
org.antlr.v4.runtime.atn.LexerATNSimulator
com.puppycrawl.tools.checkstyle.grammar.CrAwareLexerSimulator
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
ConstructorDescriptionCrAwareLexerSimulator
(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 TypeMethodDescriptionvoid
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
-
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 lexeraugmented
- the augmented transition networkdecisionToDfa
- the DFA to store our states insharedContextCache
- cache of PredictionContext objects
-
-
Method Details
-
consume
Overrides the 'consume()' method to add support for '\r' (carriage return) line endings.- Overrides:
consume
in classorg.antlr.v4.runtime.atn.LexerATNSimulator
- Parameters:
input
- the Character stream of the file we are parsing
-