Reduct  v1.0.4-3-gdaf0d70
A functional and immutable language.
Loading...
Searching...
No Matches
compile_impl.h File Reference
#include "inst.h"
#include "compile.h"
#include "core.h"
#include "gc.h"
#include "intrinsic.h"
#include "item.h"
#include "item_impl.h"
#include "list.h"
Include dependency graph for compile_impl.h:

Go to the source code of this file.

Functions

REDUCT_API reduct_function_treduct_compile (reduct_t *reduct, reduct_handle_t *ast)
 Compiles a Reduct AST into a callable bytecode function.
 
REDUCT_API void reduct_compiler_init (reduct_compiler_t *compiler, reduct_t *reduct, reduct_function_t *function, reduct_compiler_t *enclosing)
 Initialize a compiler context.
 
REDUCT_API void reduct_compiler_deinit (reduct_compiler_t *compiler)
 Deinitialize a compiler context.
 
REDUCT_API reduct_reg_t reduct_reg_alloc (reduct_compiler_t *compiler)
 Allocate a new register.
 
REDUCT_API reduct_reg_t reduct_reg_alloc_range (reduct_compiler_t *compiler, reduct_uint32_t count)
 Allocate a range of registers.
 
REDUCT_API void reduct_reg_free (reduct_compiler_t *compiler, reduct_reg_t reg)
 Free a register.
 
REDUCT_API void reduct_reg_free_range (reduct_compiler_t *compiler, reduct_reg_t start, reduct_uint32_t count)
 Free a range of registers.
 
static void reduct_expr_build_atom (reduct_compiler_t *compiler, reduct_item_t *atom, reduct_expr_t *out)
 
static void reduct_expr_build_list (reduct_compiler_t *compiler, reduct_item_t *list, reduct_expr_t *out)
 
REDUCT_API void reduct_expr_build (reduct_compiler_t *compiler, reduct_item_t *item, reduct_expr_t *out)
 Compiles a single Reduct item into an expression descriptor.
 
REDUCT_API reduct_local_treduct_local_def (reduct_compiler_t *compiler, reduct_atom_t *name)
 Define a new local variable.
 
REDUCT_API void reduct_local_def_done (reduct_compiler_t *compiler, reduct_local_t *local, reduct_expr_t *expr)
 Finalize a local variable definition with its value expression.
 
REDUCT_API reduct_local_treduct_local_add_arg (reduct_compiler_t *compiler, reduct_atom_t *name)
 Add a function argument local to the compiler context.
 
REDUCT_API void reduct_local_pop (reduct_compiler_t *compiler, reduct_uint16_t toCount, reduct_expr_t *result)
 Pop local variables from the stack, releasing their registers if they are no longer used.
 
REDUCT_API reduct_local_treduct_local_lookup (reduct_compiler_t *compiler, reduct_atom_t *name)
 Look up a local by name and return its expression.
 

Function Documentation

◆ reduct_expr_build_atom()

static void reduct_expr_build_atom ( reduct_compiler_t compiler,
reduct_item_t atom,
reduct_expr_t out 
)
inlinestatic

Definition at line 150 of file compile_impl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reduct_expr_build_list()

static void reduct_expr_build_list ( reduct_compiler_t compiler,
reduct_item_t list,
reduct_expr_t out 
)
inlinestatic

Definition at line 188 of file compile_impl.h.

Here is the call graph for this function:
Here is the caller graph for this function: