-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparser.h
More file actions
62 lines (37 loc) · 1.36 KB
/
Copy pathparser.h
File metadata and controls
62 lines (37 loc) · 1.36 KB
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
#ifndef __PARSER_H__
#define __PARSER_H__
#include <istream>
#include <map>
#include <string>
#include "ast.h"
#include "scanner.h"
class parser
{
private:
scanner scanner;
public:
parser(std::istream& in): scanner(in) {
}
const ast_program* parse_program();
protected:
std::map<std::string, expression_type> parse_parameters();
const ast_expression* parse_expression();
const ast_expression* parse_operand1();
const ast_expression* parse_separated_operands1(const ast_expression* left);
const ast_expression* parse_operand2();
const ast_expression* parse_separated_operands2(const ast_expression* left);
const ast_expression* parse_operand3();
const ast_expression* parse_operand4();
const ast_logical_expression* parse_logical_expression();
const ast_logical_expression* parse_logical_operand1();
const ast_logical_expression* parse_separated_logical_operands1(const ast_logical_expression* left);
const ast_logical_expression* parse_logical_operand2();
const ast_logical_expression* parse_separated_logical_operands2(const ast_logical_expression* left);
const ast_logical_expression* parse_logical_operand3();
const ast_logical_expression* parse_condition();
void expect(lexeme lexeme);
void expect(lexeme lexeme, std::string* buffer);
bool skip(lexeme lexeme);
bool skip(lexeme lexeme, std::string* buffer);
};
#endif