forked from Conedy/Conedy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathParser.h
60 lines (43 loc) · 1.25 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
// Generated by Bisonc++ V2.7.0 on Sun, 13 May 2012 17:10:52 +0200
#ifndef Parser_h_included
#define Parser_h_included
// $insert baseclass
#include "Parserbase.h"
// $insert scanner.h
#include "Scanner.h"
#undef Parser
class Parser: public ParserBase
{
// $insert scannerobject
Scanner d_scanner;
public:
int parse();
Parser() : d_scanner(d_val__) {}
private:
void error(char const *msg); // called on (syntax) errors
int lex(); // returns the next token from the
// lexical scanner.
void print(); // use, e.g., d_token, d_loc
// support functions for parse():
void executeAction(int ruleNr);
void errorRecovery();
int lookup(bool recovery);
void nextToken();
void print__();
void exceptionHandler__(std::exception const &exc);
};
inline void Parser::error(char const *msg)
{
std::cerr << "Zeilennummer:"<< d_scanner.lineno() << std::endl;
std::cerr << "Lasttoken:"<< d_scanner.YYText() << std::endl;
std::cerr << msg << std::endl;
}
// $insert lex
inline int Parser::lex()
{
return d_scanner.yylex();
}
// $insert print
inline void Parser::print()
{}
#endif