src/driver.h

Go to the documentation of this file.
00001 // $Id: driver.h 17 2007-08-19 18:51:39Z tb $   
00004 #ifndef EXAMPLE_DRIVER_H
00005 #define EXAMPLE_DRIVER_H
00006 
00007 #include <string>
00008 #include <vector>
00009 
00010 // forward declaration
00011 class CalcContext;
00012 
00015 namespace example {
00016 
00023 class Driver
00024 {
00025 public:
00027     Driver(class CalcContext& calc);
00028 
00030     bool trace_scanning;
00031 
00033     bool trace_parsing;
00034 
00036     std::string streamname;
00037 
00043     bool parse_stream(std::istream& in,
00044                       const std::string& sname = "stream input");
00045 
00051     bool parse_string(const std::string& input,
00052                       const std::string& sname = "string stream");
00053 
00059     bool parse_file(const std::string& filename);
00060 
00061     // To demonstrate pure handling of parse errors, instead of
00062     // simply dumping them on the standard error output, we will pass
00063     // them to the driver using the following two member functions.
00064 
00067     void error(const class location& l, const std::string& m);
00068 
00071     void error(const std::string& m);
00072 
00075     class Scanner* lexer;
00076 
00079     class CalcContext& calc;
00080 };
00081 
00082 } // namespace example
00083 
00084 #endif // EXAMPLE_DRIVER_H

Generated on Mon Aug 20 13:34:21 2007 for Flex Bison C++ Example by  doxygen 1.5.2