ANTLR Support Libraries 2.7.1+
 All Classes Namespaces Files Functions Variables Typedefs Friends Defines
antlr/ANTLRException.hpp
Go to the documentation of this file.
00001 #ifndef INC_ANTLRException_hpp__
00002 #define INC_ANTLRException_hpp__
00003 
00004 /* ANTLR Translator Generator
00005  * Project led by Terence Parr at http://www.jGuru.com
00006  * Software rights: http://www.antlr.org/license.html
00007  *
00008  * $Id: //depot/code/org.antlr/release/antlr-2.7.7/lib/cpp/antlr/ANTLRException.hpp#2 $
00009  */
00010 
00011 #include <antlr/config.hpp>
00012 #include <string>
00013 
00014 #ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
00015 namespace antlr {
00016 #endif
00017 
00018 class ANTLR_API ANTLRException
00019 {
00020 public:
00022    ANTLRException() : text("")
00023    {
00024    }
00026    ANTLRException(const ANTLR_USE_NAMESPACE(std)string& s)
00027    : text(s)
00028    {
00029    }
00030    virtual ~ANTLRException() throw()
00031    {
00032    }
00033 
00038    virtual ANTLR_USE_NAMESPACE(std)string toString() const
00039    {
00040       return text;
00041    }
00042 
00048    virtual ANTLR_USE_NAMESPACE(std)string getMessage() const
00049    {
00050       return text;
00051    }
00052 private:
00053    ANTLR_USE_NAMESPACE(std)string text;
00054 };
00055 #ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
00056 }
00057 #endif
00058 
00059 #endif //INC_ANTLRException_hpp__