ANTLR Support Libraries 2.7.1+
TokenStreamRecognitionException.hpp
Go to the documentation of this file.
1 #ifndef INC_TokenStreamRecognitionException_hpp__
2 #define INC_TokenStreamRecognitionException_hpp__
3 
4 /* ANTLR Translator Generator
5  * Project led by Terence Parr at http://www.jGuru.com
6  * Software rights: http://www.antlr.org/license.html
7  *
8  * $Id: //depot/code/org.antlr/release/antlr-2.7.7/lib/cpp/antlr/TokenStreamRecognitionException.hpp#2 $
9  */
10 
11 #include <antlr/config.hpp>
13 
14 #ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
15 namespace antlr {
16 #endif
17 
23 public:
25  : TokenStreamException(re.getMessage())
26  , recog(re)
27  {
28  }
30  {
31  }
32  virtual ANTLR_USE_NAMESPACE(std)string toString() const
33  {
34  return recog.getFileLineColumnString()+getMessage();
35  }
36 
37  virtual ANTLR_USE_NAMESPACE(std)string getFilename() const throw()
38  {
39  return recog.getFilename();
40  }
41  virtual int getLine() const throw()
42  {
43  return recog.getLine();
44  }
45  virtual int getColumn() const throw()
46  {
47  return recog.getColumn();
48  }
49 private:
51 };
52 
53 #ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
54 }
55 #endif
56 
57 #endif //INC_TokenStreamRecognitionException_hpp__
Definition: ANTLRException.hpp:15
virtual std ::string toString() const
Definition: TokenStreamRecognitionException.hpp:32
TokenStreamRecognitionException(RecognitionException &re)
Definition: TokenStreamRecognitionException.hpp:24
Definition: TokenStreamException.hpp:22
Definition: TokenStreamRecognitionException.hpp:22
virtual int getColumn() const
Definition: TokenStreamRecognitionException.hpp:45
virtual ~TokenStreamRecognitionException()
Definition: TokenStreamRecognitionException.hpp:29
RecognitionException recog
Definition: TokenStreamRecognitionException.hpp:50
virtual std ::string getFilename() const
Definition: TokenStreamRecognitionException.hpp:37
Definition: RecognitionException.hpp:18
virtual int getLine() const
Definition: TokenStreamRecognitionException.hpp:41
#define ANTLR_USE_NAMESPACE(_x_)
Definition: config.hpp:18