Source-highlight Library
parserexception.h
1 //
2 // Author: Lorenzo Bettini <http://www.lorenzobettini.it>, (C) 2004-2008
3 //
4 // Copyright: See COPYING file that comes with this distribution
5 //
6 
7 #ifndef PARSEREXCEPTION_H_
8 #define PARSEREXCEPTION_H_
9 
10 #include <ostream>
11 #include <string>
12 #include <exception>
13 
14 namespace srchilite {
15 
16 struct ParseStruct;
17 
22 struct ParserException : public std::exception {
24  std::string message;
25 
27  std::string additional;
28 
30  std::string filename;
31 
33  unsigned int line;
34 
35  ParserException(const std::string &_message,
36  const ParseStruct *parserinfo);
37  ParserException(const std::string &_message,
38  const std::string &filename = "", unsigned int line = 0);
39  virtual ~ParserException() throw ();
40 
41  virtual const char* what ( ) const throw ();
42 };
43 
44 std::ostream& operator<<(std::ostream& os, const ParserException &entry);
45 
46 }
47 
48 #endif /*PARSEREXCEPTION_H_*/
Represents an exception during parsing, for instance, syntax errors.
Definition: parserexception.h:22
STL namespace.
C++ class: doctemplate.h.
Definition: bufferedoutput.cpp:13
unsigned int line
line of the element that caused this exception
Definition: parserexception.h:33
Definition: parsestruct.h:21
std::string message
detailed message for this exception
Definition: parserexception.h:24
std::string filename
filename of the element that caused this exception
Definition: parserexception.h:30
std::string additional
additional explaining message
Definition: parserexception.h:27