-
Notifications
You must be signed in to change notification settings - Fork 27
/
parser.h
66 lines (54 loc) · 1.74 KB
/
parser.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// Generated by Bisonc++ V6.02.04 on Sun, 20 Oct 2019 22:27:51 +0200
#ifndef Parser_h_included
#define Parser_h_included
// $insert baseclass
#include "parserbase.h"
// $insert scanner.h
#include "scanner.h"
#undef Parser
// CAVEAT: between the baseclass-include directive and the
// #undef directive in the previous line references to Parser
// are read as ParserBase.
// If you need to include additional headers in this file
// you should do so after these comment-lines.
class Parser: public ParserBase
{
// $insert scannerobject
Scanner d_scanner;
public:
Parser(): d_scanner() {}
Parser(std::istream& in, int startState = 0): d_scanner(in)
{ d_scanner.parserStart = startState; }
int parse();
// The final result of parsing:
parse_t parseResult;
private:
#if ( BISONCPP_VERSION >= 60000LL )
void error(); // called on (syntax) errors
#else
void error(char const *msg);
#endif
int lex(); // returns the next token from the
// lexical scanner.
void print(); // use, e.g., d_token, d_loc
#if ( BISONCPP_VERSION >= 60000LL )
void exceptionHandler(std::exception const &exc);
#else
void exceptionHandler__(std::exception const &exc);
#endif
// support functions for parse():
#if ( BISONCPP_VERSION >= 60000LL )
void executeAction_(int ruleNr);
void errorRecovery_();
void nextCycle_();
void nextToken_();
void print_();
#else
void executeAction(int ruleNr);
void errorRecovery();
int lookup(bool recovery);
void nextToken();
void print__();
#endif
};
#endif