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.
8 #include "ANTLRErrorListener.h"
9 #include "Exceptions.h"
13 /// This implementation of ANTLRErrorListener dispatches all calls to a
14 /// collection of delegate listeners. This reduces the effort required to support multiple
16 class ANTLR4CPP_PUBLIC ProxyErrorListener : public ANTLRErrorListener {
18 std::set<ANTLRErrorListener *> _delegates; // Not owned.
21 void addErrorListener(ANTLRErrorListener *listener);
22 void removeErrorListener(ANTLRErrorListener *listener);
23 void removeErrorListeners();
25 void syntaxError(Recognizer *recognizer, Token *offendingSymbol, size_t line, size_t charPositionInLine,
26 const std::string &msg, std::exception_ptr e) override;
28 virtual void reportAmbiguity(Parser *recognizer, const dfa::DFA &dfa, size_t startIndex, size_t stopIndex, bool exact,
29 const antlrcpp::BitSet &ambigAlts, atn::ATNConfigSet *configs) override;
31 virtual void reportAttemptingFullContext(Parser *recognizer, const dfa::DFA &dfa, size_t startIndex, size_t stopIndex,
32 const antlrcpp::BitSet &conflictingAlts, atn::ATNConfigSet *configs) override;
34 virtual void reportContextSensitivity(Parser *recognizer, const dfa::DFA &dfa, size_t startIndex, size_t stopIndex,
35 size_t prediction, atn::ATNConfigSet *configs) override;