ANTLR Support Libraries 2.7.1+
RecognitionException.hpp
Go to the documentation of this file.
1#ifndef INC_RecognitionException_hpp__
2# define INC_RecognitionException_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/RecognitionException.hpp#2 $
9 */
10
11# include <antlr/config.hpp>
13
14# ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
15namespace antlr
16{
17# endif
18 class ANTLR_API RecognitionException : public ANTLRException
19 {
20 public:
22 RecognitionException(const ANTLR_USE_NAMESPACE(std)string& s);
23 RecognitionException(const ANTLR_USE_NAMESPACE(std)string& s,
24 const ANTLR_USE_NAMESPACE(std)string& fileName,
25 int line, int column );
26
27 virtual ~RecognitionException() throw()
28 {
29 }
30
32 virtual ANTLR_USE_NAMESPACE(std)string getFilename() const throw()
33 {
34 return fileName;
35 }
39 virtual int getLine() const throw()
40 {
41 return line;
42 }
46 virtual int getColumn() const throw()
47 {
48 return column;
49 }
50
52 virtual ANTLR_USE_NAMESPACE(std)string toString() const;
53
55 virtual ANTLR_USE_NAMESPACE(std)string getFileLineColumnString() const;
56 protected:
57 ANTLR_USE_NAMESPACE(std)string fileName; // not used by treeparsers
58 int line; // not used by treeparsers
59 int column; // not used by treeparsers
60 };
61
62# ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
63}
64# endif
65
66#endif //INC_RecognitionException_hpp__
Definition: RecognitionException.hpp:19
int line
Definition: RecognitionException.hpp:58
std::string fileName
Definition: RecognitionException.hpp:57
virtual ~RecognitionException()
Definition: RecognitionException.hpp:27
int column
Definition: RecognitionException.hpp:59
virtual std::string getFilename() const
Return file where mishap occurred.
Definition: RecognitionException.hpp:32
virtual int getColumn() const
Definition: RecognitionException.hpp:46
virtual int getLine() const
Definition: RecognitionException.hpp:39
#define ANTLR_USE_NAMESPACE(_x_)
Definition: config.hpp:18
#define ANTLR_API
Definition: config.hpp:22
Definition: ANTLRException.hpp:15