Reduct  v1.0.4-3-gdaf0d70
A functional and immutable language.
Loading...
Searching...
No Matches
intrinsic.h File Reference

Intrinsic management. More...

#include "defs.h"
#include "native.h"
Include dependency graph for intrinsic.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define REDUCT_INTRINSIC_NONE   0
 None.
 
#define REDUCT_INTRINSIC_QUOTE   1
 Quote.
 
#define REDUCT_INTRINSIC_LIST   2
 List.
 
#define REDUCT_INTRINSIC_DO   3
 Do.
 
#define REDUCT_INTRINSIC_LAMBDA   4
 Lambda.
 
#define REDUCT_INTRINSIC_THREAD   5
 Thread.
 
#define REDUCT_INTRINSIC_DEF   6
 Def.
 
#define REDUCT_INTRINSIC_IF   7
 If.
 
#define REDUCT_INTRINSIC_COND   8
 Cond.
 
#define REDUCT_INTRINSIC_MATCH   9
 Match.
 
#define REDUCT_INTRINSIC_AND   10
 And.
 
#define REDUCT_INTRINSIC_OR   11
 Or.
 
#define REDUCT_INTRINSIC_NOT   12
 Not.
 
#define REDUCT_INTRINSIC_ADD   13
 Add.
 
#define REDUCT_INTRINSIC_SUB   14
 Sub.
 
#define REDUCT_INTRINSIC_MUL   15
 Mul.
 
#define REDUCT_INTRINSIC_DIV   16
 Div.
 
#define REDUCT_INTRINSIC_MOD   17
 Mod.
 
#define REDUCT_INTRINSIC_INC   18
 Inc.
 
#define REDUCT_INTRINSIC_DEC   19
 Dec.
 
#define REDUCT_INTRINSIC_BAND   20
 Bitwise And.
 
#define REDUCT_INTRINSIC_BOR   21
 Bitwise Or.
 
#define REDUCT_INTRINSIC_BXOR   22
 Bitwise Xor.
 
#define REDUCT_INTRINSIC_BNOT   23
 Bitwise Not.
 
#define REDUCT_INTRINSIC_SHL   24
 Bitwise Shift Left.
 
#define REDUCT_INTRINSIC_SHR   25
 Bitwise Shift Right.
 
#define REDUCT_INTRINSIC_EQ   26
 Equal.
 
#define REDUCT_INTRINSIC_NEQ   27
 Not Equal.
 
#define REDUCT_INTRINSIC_SEQ   28
 Strict Equal.
 
#define REDUCT_INTRINSIC_SNEQ   29
 Strict Not Equal.
 
#define REDUCT_INTRINSIC_LT   30
 Less.
 
#define REDUCT_INTRINSIC_LE   31
 Less Equal.
 
#define REDUCT_INTRINSIC_GT   32
 Greater.
 
#define REDUCT_INTRINSIC_GE   33
 Greater Equal.
 
#define REDUCT_INTRINSIC_MAX   34
 The amount of intrinsics.
 

Typedefs

typedef reduct_uint8_t reduct_intrinsic_t
 Intrinsic types.
 
typedef void(* reduct_intrinsic_handler_t) (struct reduct_compiler *compiler, struct reduct_item *expr, struct reduct_expr *out)
 Intrinsic handler function type.
 

Functions

REDUCT_API void reduct_intrinsic_register_all (struct reduct *reduct)
 Registers all Reduct intrinsics with the given Reduct instance.
 
void reduct_intrinsic_block_generic (struct reduct_compiler *compiler, struct reduct_item *list, reduct_uint32_t startIdx, struct reduct_expr *out)
 Compiles a block of expressions (like a do block).
 

Variables

reduct_intrinsic_handler_t reductIntrinsicHandlers [REDUCT_INTRINSIC_MAX]
 Intrinsic handler functions array.
 
reduct_native_fn reductIntrinsicNatives [REDUCT_INTRINSIC_MAX]
 Intrinsic native functions array.
 
const char * reductIntrinsics [REDUCT_INTRINSIC_MAX]
 Intrinsic names array.
 

Detailed Description

Intrinsic management.

Definition in file intrinsic.h.