-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathparser.h
More file actions
54 lines (35 loc) · 688 Bytes
/
parser.h
File metadata and controls
54 lines (35 loc) · 688 Bytes
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
#ifndef PRATT_PARSER_H
#define PRATT_PARSER_H
#include <istream>
#include "lexer.h"
// #include "production.h"
namespace pratt { namespace production {
class Production;
}}
// #include "token.h"
namespace pratt { namespace token {
class Token;
}}
namespace pratt{
enum Precedence {
BP_Assignment = 100,
BP_Or = 200,
BP_And = 300,
BP_Equality = 400,
BP_Relational = 500,
BP_Additive = 600,
BP_Multiplicative = 700,
BP_Exponential = 800,
BP_Unary = 900,
BP_Primary = 1000
};
class Parser {
public:
pratt::Lexer lex;
pratt::token::Token* tk;
Parser(std::istream&);
pratt::production::Production* Expression(int);
~Parser();
};
} // namespace pratt
#endif