diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/doer.h | 35 | ||||
-rw-r--r-- | src/include/main.h | 1 |
2 files changed, 24 insertions, 12 deletions
diff --git a/src/include/doer.h b/src/include/doer.h index a672f88..8f51266 100644 --- a/src/include/doer.h +++ b/src/include/doer.h @@ -4,7 +4,6 @@ #include "util.h" #include "tree.h" -/* Doer? I 'ardly know 'er! */ typedef struct DOER { tree_t* tree; } doer_t; @@ -18,16 +17,28 @@ doer_t* doer_init(tree_t* tree); */ void doer_destroy(doer_t* doer); -void doer_do_blin_print(char* s); - -void doer_do_block(tree_t* tree); -void doer_do_expr(tree_t* tree); -void doer_do_lint(tree_t* tree); -void doer_do_lstr(tree_t* tree); -void doer_do_tag(tree_t* tree); -void doer_do_darg(tree_t* tree); -void doer_do_carg(tree_t* tree); -void doer_do_def(tree_t* tree); -void doer_do_call(tree_t* tree); +/* Built-in function. */ +typedef struct BLINF { + void (*fp)(doer_t*); + char name[24]; +} blinf_t; + +void doer_do_blin_print(doer_t* tree); // Built-in function `print`. +void doer_do_blin_printl(doer_t* tree); // Built-in function `print`. + +void doer_do_block(doer_t* tree); +void doer_do_expr(doer_t* tree); +void doer_do_lint(doer_t* tree); +void doer_do_lstr(doer_t* tree); +void doer_do_tag(doer_t* tree); +void doer_do_darg(doer_t* tree); +void doer_do_carg(doer_t* tree); +void doer_do_def(doer_t* tree); +void doer_do_call(doer_t* tree); + +const static blinf_t blinfs[] = { + { doer_do_blin_print, "print" }, + { doer_do_blin_printl, "printl" } +}; #endif diff --git a/src/include/main.h b/src/include/main.h index 63dd15c..d4f98dd 100644 --- a/src/include/main.h +++ b/src/include/main.h @@ -10,5 +10,6 @@ #include "pp.h" #include "lexer.h" #include "parser.h" +#include "doer.h" #endif |