| 1 |
// Generated by Bisonc++ V3.00.00 on Fri, 24 Feb 2012 15:09:41 +0100 |
| 2 |
|
| 3 |
#ifndef Parser_h_included |
| 4 |
#define Parser_h_included |
| 5 |
|
| 6 |
// $insert baseclass |
| 7 |
#include "parserbase.h" |
| 8 |
// $insert scanner.h |
| 9 |
#include "../scanner/scanner.h" |
| 10 |
|
| 11 |
|
| 12 |
#undef Parser |
| 13 |
class Parser: public ParserBase |
| 14 |
{ |
| 15 |
// $insert scannerobject |
| 16 |
Scanner d_scanner; |
| 17 |
|
| 18 |
public: |
| 19 |
int parse(); |
| 20 |
|
| 21 |
private: |
| 22 |
void error(char const *msg); // called on (syntax) errors |
| 23 |
int lex(); // returns the next token from the |
| 24 |
// lexical scanner. |
| 25 |
void print(); // use, e.g., d_token, d_loc |
| 26 |
|
| 27 |
void display(STYPE__ const &id, STYPE__ &vect); |
| 28 |
|
| 29 |
// support functions for parse(): |
| 30 |
void executeAction(int ruleNr); |
| 31 |
void errorRecovery(); |
| 32 |
int lookup(bool recovery); |
| 33 |
void nextToken(); |
| 34 |
void print__(); |
| 35 |
}; |
| 36 |
|
| 37 |
inline void Parser::error(char const *msg) |
| 38 |
{ |
| 39 |
std::cerr << msg << '\n'; |
| 40 |
} |
| 41 |
|
| 42 |
// $insert lex |
| 43 |
inline int Parser::lex() |
| 44 |
{ |
| 45 |
return d_scanner.lex(); |
| 46 |
} |
| 47 |
|
| 48 |
inline void Parser::print() |
| 49 |
{ |
| 50 |
print__(); // displays tokens if --print was specified |
| 51 |
} |
| 52 |
|
| 53 |
|
| 54 |
#endif |