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.
-
-
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
All Methods Instance Methods Concrete Methods 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
-
-
-
-
Constructor Detail
-
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 Detail
-
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 classorg.antlr.v4.runtime.atn.LexerATNSimulator
- Parameters:
input
- the Character stream of the file we are parsing
-
-