rosella/builtin.h

52 lines
1.4 KiB
C

#ifndef BUILTIN_H_85dfb9ef1b9889cd01b60306e12f5e8e
#define BUILTIN_H_85dfb9ef1b9889cd01b60306e12f5e8e
#include <assert.h>
#include <inttypes.h>
#include <stdbool.h>
#include "gc.h"
/* Names of fundamental builtin values */
#define BI_UNDEFINED "undefined"
#define BI_STRUCTURE "structure"
#define BI_TEMPLATE "template"
#define BI_LAMBDA "lambda"
/* Name of builtin function */
#define BI_STRING_TO_NUMBER "string->number"
#define STRUCTURE_SLOT_NAME 0
#define STRUCTURE_SLOT_SUPER 1
#define STRUCTURE_SLOT_SLOTS 2
#define STRUCTURE_SLOT_CALLABLE 3
#define STRUCTURE_SLOT_MUTABLE 4
#define STRUCTURE_SLOTS 5
#define TEMPLATE_SLOT_GLOBAL_VARS 0
#define TEMPLATE_SLOT_INSTANCE_VARS 1
#define TEMPLATE_SLOT_FRAME_VARS 2
#define TEMPLATE_SLOT_BYTE_CODE 3
#define TEMPLATE_SLOT_TAIL_CALL 4
#define TEMPLATE_SLOT_ARG_LIST 5
#define TEMPLATE_SLOT_CONTINUATION 6
#define TEMPLATE_SLOT_CONTEXT 7
#define TEMPLATE_SLOTS 8
#define LAMBDA_SLOT_GLOBAL_VARS 0
#define LAMBDA_SLOT_INSTANCE_VARS 1
#define LAMBDA_SLOT_FRAME_VARS 2
#define LAMBDA_SLOT_BYTE_CODE 3
#define LAMBDA_SLOT_TAIL_CALL 4
#define LAMBDA_SLOT_ARG_LIST 5
#define LAMBDA_SLOT_CONTINUATION 6
#define LAMBDA_SLOT_CONTEXT 7
#define LAMBDA_SLOTS 8
void builtin_init(void);
void register_builtin(const char *name, value_t value);
value_t lookup_builtin(const char *name);
#endif
/* vim:set sw=2 expandtab: */