aboutsummaryrefslogtreecommitdiff
path: root/include/eval.h
blob: 5f1927147f417aac564ee87ed89f3ff11094f65d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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