1 #ifndef INC_ANTLRException_hpp__
2 #define INC_ANTLRException_hpp__
4 /* ANTLR Translator Generator
5 * Project led by Terence Parr at http://www.jGuru.com
6 * Software rights: http://www.antlr.org/license.html
8 * $Id: //depot/code/org.antlr/release/antlr-2.7.7/lib/cpp/antlr/ANTLRException.hpp#2 $
11 #include <antlr/config.hpp>
14 #ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
18 class ANTLR_API ANTLRException
21 /// Create ANTLR base exception without error message
22 ANTLRException() : text("")
25 /// Create ANTLR base exception with error message
26 ANTLRException(const ANTLR_USE_NAMESPACE(std)string& s)
30 virtual ~ANTLRException() throw()
34 /** Return complete error message with line/column number info (if present)
35 * @note for your own exceptions override this one. Call getMessage from
36 * here to get the 'clean' error message stored in the text attribute.
38 virtual ANTLR_USE_NAMESPACE(std)string toString() const
43 /** Return error message without additional info (if present)
44 * @note when making your own exceptions classes override toString
45 * and call in toString getMessage which relays the text attribute
48 virtual ANTLR_USE_NAMESPACE(std)string getMessage() const
53 ANTLR_USE_NAMESPACE(std)string text;
55 #ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
59 #endif //INC_ANTLRException_hpp__