1 /* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. 2 * Use of this file is governed by the BSD 3-clause license that 3 * can be found in the LICENSE.txt file in the project root. 4 */ 5 6 #pragma once 7 8 #include "RecognitionException.h" 9 #include "atn/ATNConfigSet.h" 10 11 namespace antlr4 { 12 13 class ANTLR4CPP_PUBLIC LexerNoViableAltException : public RecognitionException { 14 public: 15 LexerNoViableAltException(Lexer *lexer, CharStream *input, size_t startIndex, 16 atn::ATNConfigSet *deadEndConfigs); 17 18 virtual size_t getStartIndex(); 19 virtual atn::ATNConfigSet* getDeadEndConfigs(); 20 virtual std::string toString(); 21 22 private: 23 /// Matching attempted at what input index? 24 const size_t _startIndex; 25 26 /// Which configurations did we try at input.index() that couldn't match input.LA(1)? 27 atn::ATNConfigSet *_deadEndConfigs; 28 29 }; 30 31 } // namespace antlr4 32