00001 #ifndef INC_RecognitionException_hpp__ 00002 # define INC_RecognitionException_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/RecognitionException.hpp#2 $ 00009 */ 00010 00011 # include <antlr/config.hpp> 00012 # include <antlr/ANTLRException.hpp> 00013 00014 # ifdef ANTLR_CXX_SUPPORTS_NAMESPACE 00015 namespace antlr 00016 { 00017 # endif 00018 class ANTLR_API RecognitionException : public ANTLRException 00019 { 00020 public: 00021 RecognitionException(); 00022 RecognitionException(const ANTLR_USE_NAMESPACE(std)string& s); 00023 RecognitionException(const ANTLR_USE_NAMESPACE(std)string& s, 00024 const ANTLR_USE_NAMESPACE(std)string& fileName, 00025 int line, int column ); 00026 00027 virtual ~RecognitionException() throw() 00028 { 00029 } 00030 00032 virtual ANTLR_USE_NAMESPACE(std)string getFilename() const throw() 00033 { 00034 return fileName; 00035 } 00039 virtual int getLine() const throw() 00040 { 00041 return line; 00042 } 00046 virtual int getColumn() const throw() 00047 { 00048 return column; 00049 } 00050 00052 virtual ANTLR_USE_NAMESPACE(std)string toString() const; 00053 00055 virtual ANTLR_USE_NAMESPACE(std)string getFileLineColumnString() const; 00056 protected: 00057 ANTLR_USE_NAMESPACE(std)string fileName; // not used by treeparsers 00058 int line; // not used by treeparsers 00059 int column; // not used by treeparsers 00060 }; 00061 00062 # ifdef ANTLR_CXX_SUPPORTS_NAMESPACE 00063 } 00064 # endif 00065 00066 #endif //INC_RecognitionException_hpp__