]> git.saurik.com Git - bison.git/blob - examples/calc++/calc++-driver.hh
* data/glr.c (yyFail): Drastically simplify; since the format argument
[bison.git] / examples / calc++ / calc++-driver.hh
1 #line 7036 "../../doc/bison.texinfo"
2 #ifndef CALCXX_DRIVER_HH
3 # define CALCXX_DRIVER_HH
4 # include <string>
5 # include <map>
6 #line 7051 "../../doc/bison.texinfo"
7 // Forward declarations.
8 union YYSTYPE;
9 namespace yy
10 {
11 class location;
12 class calcxx_parser;
13 }
14 class calcxx_driver;
15 #line 7069 "../../doc/bison.texinfo"
16 // Announce to Flex the prototype we want for lexing function, ...
17 # define YY_DECL \
18 int yylex (YYSTYPE* yylval, yy::location* yylloc, calcxx_driver& driver)
19 // ... and declare it for the parser's sake.
20 YY_DECL;
21 #line 7082 "../../doc/bison.texinfo"
22 // Conducting the whole scanning and parsing of Calc++.
23 class calcxx_driver
24 {
25 public:
26 calcxx_driver ();
27 virtual ~calcxx_driver ();
28
29 std::map<std::string, int> variables;
30
31 int result;
32 #line 7101 "../../doc/bison.texinfo"
33 // Handling the scanner.
34 void scan_begin ();
35 void scan_end ();
36 bool trace_scanning;
37 #line 7112 "../../doc/bison.texinfo"
38 // Handling the parser.
39 void parse (const std::string& f);
40 std::string file;
41 bool trace_parsing;
42 #line 7126 "../../doc/bison.texinfo"
43 // Error handling.
44 void error (const yy::location& l, const std::string& m);
45 void error (const std::string& m);
46 };
47 #endif // ! CALCXX_DRIVER_HH