We're now first building a standalone bytecode compiler `apflc` that will compile `globals.apfl` into bytecode and write it out as a C source file. When initializing a new context, that embedded bytecode will then get evaluated and the global scope will be populated from the dictionary returned by that bytecode.
25 lines
427 B
C
25 lines
427 B
C
#ifndef APFL_COMPILE_H
|
|
#define APFL_COMPILE_H
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#include "apfl.h"
|
|
|
|
#include "bytecode.h"
|
|
#include "gc.h"
|
|
|
|
bool apfl_compile(struct gc *, struct apfl_expr, struct apfl_error *, struct instruction_list *);
|
|
bool apfl_compile_whole_file(
|
|
struct gc *gc,
|
|
struct apfl_parser *parser,
|
|
struct apfl_error *error,
|
|
struct instruction_list *out
|
|
);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|