-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunction.h
More file actions
42 lines (30 loc) · 747 Bytes
/
function.h
File metadata and controls
42 lines (30 loc) · 747 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
#ifndef FUNCTION_H_
#define FUNCTION_H_
#include "symbol.h"
#include "as_tree.h"
struct function;
typedef int (*lib_handler_type_t)(struct function *, value_t *, void **);
struct function {
char *name;
unsigned int is_lib;
unsigned int nargs;
struct symbol **args;
struct symbol_table *scope;
struct ast_node *body;
lib_handler_type_t handler;
};
void
function_table_create(void);
struct function*
function_table_lookup(char *name);
int
function_table_insert(struct function *function);
struct function*
function_new(char *name);
void
function_destroy(struct function *func);
void
function_add_arg(struct function *function, struct symbol *arg);
void
function_table_delete_function(char *name);
#endif /*FUNCTION_H_*/