diff options
Diffstat (limited to 'include/eval.h')
-rw-r--r-- | include/eval.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/eval.h b/include/eval.h new file mode 100644 index 0000000..5f19271 --- /dev/null +++ b/include/eval.h @@ -0,0 +1,20 @@ +#ifndef CMONKEY_EVAL_H +#define CMONKEY_EVAL_H + +#include "ast.h" +#include "parser.h" +#include "object.h" + +struct object *eval_program(struct environment *, struct program *); + +struct object *eval_statement(struct environment *, struct statement *); + +struct object *eval_expression(struct environment *, struct expression *); + +#define eval(e, n) _Generic((n), \ + struct program *: eval_program, \ + struct statement *: eval_statement, \ + struct expression *: eval_expression \ + )(e, n) + +#endif |