00001
00004 #ifndef EXAMPLE_DRIVER_H
00005 #define EXAMPLE_DRIVER_H
00006
00007 #include <string>
00008 #include <vector>
00009
00010
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
00062
00063
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 }
00083
00084 #endif // EXAMPLE_DRIVER_H