forked from t123yh/compiler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
parser_function.h
59 lines (43 loc) · 1.41 KB
/
parser_function.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
//
// Created by t123yh on 2020/10/3.
//
#ifndef COMPILER_PARSER_FUNCTION_H
#define COMPILER_PARSER_FUNCTION_H
#include "defs.h"
#include "parser.h"
struct decl_header_parser : public parser
{
typedef function_signature return_type;
return_type parse(parsing_context &context) const;
};
struct parameter_list_parser : public parser {
typedef std::vector<var_def> return_type;
return_type parse(parsing_context &context) const;
};
struct compound_statement_parser : public parser {
typedef statement_block return_type;
return_type parse(parsing_context &context) const;
};
struct statements_parser: public parser
{
typedef std::vector<std::shared_ptr<statement>> return_type;
return_type parse(parsing_context &context) const;
};
struct arguments_parser: public parser
{
typedef std::vector<std::shared_ptr<expression>> return_type;
return_type parse(parsing_context &context) const;
};
struct calling_parser : public parser {
typedef std::shared_ptr<function_call_info> return_type;
return_type parse(parsing_context &context) const;
};
struct function_parser : public parser {
typedef std::shared_ptr<function> return_type;
return_type parse(parsing_context &context) const;
};
struct main_function_parser : public parser {
typedef statement_block return_type;
return_type parse(parsing_context &context) const;
};
#endif //COMPILER_PARSER_FUNCTION_H