• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #line 10057 "../../doc/bison.texi"
2 #ifndef CALCXX_DRIVER_HH
3 # define CALCXX_DRIVER_HH
4 # include <string>
5 # include <map>
6 # include "calc++-parser.hh"
7 #line 10073 "../../doc/bison.texi"
8 // Tell Flex the lexer's prototype ...
9 # define YY_DECL                                        \
10   yy::calcxx_parser::token_type                         \
11   yylex (yy::calcxx_parser::semantic_type* yylval,      \
12          yy::calcxx_parser::location_type* yylloc,      \
13          calcxx_driver& driver)
14 // ... and declare it for the parser's sake.
15 YY_DECL;
16 #line 10089 "../../doc/bison.texi"
17 // Conducting the whole scanning and parsing of Calc++.
18 class calcxx_driver
19 {
20 public:
21   calcxx_driver ();
22   virtual ~calcxx_driver ();
23 
24   std::map<std::string, int> variables;
25 
26   int result;
27 #line 10107 "../../doc/bison.texi"
28   // Handling the scanner.
29   void scan_begin ();
30   void scan_end ();
31   bool trace_scanning;
32 #line 10118 "../../doc/bison.texi"
33   // Run the parser.  Return 0 on success.
34   int parse (const std::string& f);
35   std::string file;
36   bool trace_parsing;
37 #line 10132 "../../doc/bison.texi"
38   // Error handling.
39   void error (const yy::location& l, const std::string& m);
40   void error (const std::string& m);
41 };
42 #endif // ! CALCXX_DRIVER_HH
43