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