summaryrefslogtreecommitdiffstats
path: root/lib/antlr/antlr/ANTLRException.h
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2020-12-17 20:50:19 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2020-12-17 23:51:16 +0900
commit4ae7b32dc09eb7acd9411a8af63a767660aa64ec (patch)
tree3d150131675502f5d5a3ff054ec6fc3dbe4e78fd /lib/antlr/antlr/ANTLRException.h
parent25071ecede33675972c3163f4b46df964a06dadf (diff)
downloadtdevelop-4ae7b32dc09eb7acd9411a8af63a767660aa64ec.tar.gz
tdevelop-4ae7b32dc09eb7acd9411a8af63a767660aa64ec.zip
Renaming of files in preparation for code style tools.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it> (cherry picked from commit 3e3d9eda9d1dd8c67c1c27c6a9bdc68bdecfcc30)
Diffstat (limited to 'lib/antlr/antlr/ANTLRException.h')
-rw-r--r--lib/antlr/antlr/ANTLRException.h59
1 files changed, 59 insertions, 0 deletions
diff --git a/lib/antlr/antlr/ANTLRException.h b/lib/antlr/antlr/ANTLRException.h
new file mode 100644
index 00000000..b67f5771
--- /dev/null
+++ b/lib/antlr/antlr/ANTLRException.h
@@ -0,0 +1,59 @@
+#ifndef INC_ANTLRException_h__
+#define INC_ANTLRException_h__
+
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include <antlr/config.h>
+#include <string>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+class ANTLR_API ANTLRException
+{
+public:
+ /// Create ANTLR base exception without error message
+ ANTLRException() : text("")
+ {
+ }
+ /// Create ANTLR base exception with error message
+ ANTLRException(const ANTLR_USE_NAMESPACE(std)string& s)
+ : text(s)
+ {
+ }
+ virtual ~ANTLRException() throw()
+ {
+ }
+
+ /** Return complete error message with line/column number info (if present)
+ * @note for your own exceptions override this one. Call getMessage from
+ * here to get the 'clean' error message stored in the text attribute.
+ */
+ virtual ANTLR_USE_NAMESPACE(std)string toString() const
+ {
+ return text;
+ }
+
+ /** Return error message without additional info (if present)
+ * @note when making your own exceptions classes override toString
+ * and call in toString getMessage which relays the text attribute
+ * from here.
+ */
+ virtual ANTLR_USE_NAMESPACE(std)string getMessage() const
+ {
+ return text;
+ }
+private:
+ ANTLR_USE_NAMESPACE(std)string text;
+};
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
+#endif //INC_ANTLRException_h__