casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ds9parser.h
Go to the documentation of this file.
1 #ifndef DISPLAY_DS9_PARSER_H_
2 #define DISPLAY_DS9_PARSER_H_
3 
4 #include <string>
5 #include <vector>
6 #include <display/ds9/ds9lex.h>
7 
8 namespace casa {
9  namespace viewer {
10 
11  class ds9parser {
12  public:
13  ds9parser( );
14 
17 
20 
22  std::string streamname;
23 
24  // input stream, stream name for error messages, return true if successfully parsed
25  bool parse_stream(ds9context &base, std::istream& in, const std::string& sname = "stream input");
26 
27  bool parse_string(ds9context &base, const std::string& input, const std::string& sname = "string stream");
28 
29  bool parse_file(ds9context &base, const std::string& filename);
30 
31  // To demonstrate pure handling of parse errors, instead of
32  // simply dumping them on the standard error output, we will pass
33  // them to the driver using the following two member functions.
34 
37  void error(const class location& l, const std::string& m);
38 
41  void error(const std::string& m);
43 
44  };
45 
46  }
47 }
48 
49 #endif
bool trace_scanning
enable debug output in the flex scanner
Definition: ds9parser.h:16
bool parse_file(ds9context &base, const std::string &filename)
bool parse_string(ds9context &base, const std::string &input, const std::string &sname="string stream")
bool trace_parsing
enable debug output in the bison parser
Definition: ds9parser.h:19
bool parse_stream(ds9context &base, std::istream &in, const std::string &sname="stream input")
input stream, stream name for error messages, return true if successfully parsed
Scanner is a derived class to add some extra function to the scanner class.
Definition: ds9lex.h:36
std::string streamname
stream name (file or input stream) used for error messages.
Definition: ds9parser.h:22
void error(const class location &l, const std::string &m)
To demonstrate pure handling of parse errors, instead of simply dumping them on the standard error ou...