blob: 5dbd119dc00b17fc8fe89318d7a8cd419f58d67d (
plain)
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
|
#pragma once
#include "ast.h"
typedef struct InterRet{
// Exactly one of ast and errstr is non-NULL. The non-NULL member
// needs to be free'd.
AST *ast;
char *errstr;
} InterRet;
InterRet ir_ast(AST *ast);
InterRet ir_err(char *errstr);
InterRet ir_err_c(const char *errstr);
typedef struct InterState InterState;
InterState* inter_make(void);
void inter_destroy(InterState *is);
void inter_assign(InterState *is,const char *name,AST *ast); //ast is not copied
void inter_register(InterState *is,const char *name,lambdafunc_t cfunc);
void inter_register_prelude(InterState *is);
InterRet inter_runcode(InterState *is,AST *ast); //updates symbol id's
|