Reduct  v4.0.5-1-g4851deb
A functional and immutable language.
Loading...
Searching...
No Matches
Build

Detailed Description

The builder is responsible for converting parsed S-expressions (ASTs) into the intermediate representation (IR) used by the optimizer and compiler.

Functions

REDUCT_API reduct_handle_t reduct_build (struct reduct *reduct, reduct_handle_t ast)
 Build an IR graph from an AST (parsed S-expression).
 
REDUCT_API void reduct_build_register_intrinsics (struct reduct *reduct)
 Register the intrinsics used by the builder.
 
REDUCT_API reduct_native_fn reduct_builder_get_native_fn (reduct_opcode_t op)
 Get the native function associated with an opcode.
 

Function Documentation

◆ reduct_build()

REDUCT_API reduct_handle_t reduct_build ( struct reduct *  reduct,
reduct_handle_t  ast 
)

Build an IR graph from an AST (parsed S-expression).

Parameters
reductPointer to the Reduct structure.
astHandle to the root of the AST.
Returns
Handle to the root IR node.

◆ reduct_build_register_intrinsics()

REDUCT_API void reduct_build_register_intrinsics ( struct reduct *  reduct)

Register the intrinsics used by the builder.

Note
Will be called by reduct_new().
Parameters
reductPointer to the Reduct structure.

◆ reduct_builder_get_native_fn()

REDUCT_API reduct_native_fn reduct_builder_get_native_fn ( reduct_opcode_t  op)

Get the native function associated with an opcode.

Parameters
opThe opcode.
Returns
The native function, or NULL if not found.