-
Notifications
You must be signed in to change notification settings - Fork 2
/
nil.llh
71 lines (53 loc) · 1.92 KB
/
nil.llh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#ifndef NIL_LLH
#define NIL_LLH
;**********************************************************************
; nil.llh
;
; Nil global definitions.
;
; Copyright 2009-2010 by Dustin Laurence. Distributed under the terms of
; the LGPLv3.
;
;**********************************************************************
#include "c_defs.llh"
;**********************************************************************
; Global definitions
;
;**********************************************************************
; Calling convention for all internal functions
#define NILCC fastcc
; A small attempt to be machine word independent. Here I assume that
; on modern machines a word is exactly the size of a generic pointer;
; this isn't true on ancient architectures, but who is going to run
; this code on anything that old?
%Word = type %c_intptr_t
#define WORD_SIZEOF C_INTPTR_T_SIZEOF
#define WORD_BITSOF C_INTPTR_T_BITSOF
; Codes common to multiple modules
; Nil defines its own values independent of what libc or system
; return--this is tedious but safer because it decouples the code.
; I/O Exceptions
#define NIL_EOF -1
#define NIL_IOERROR -2
; Lexer Exceptions
; NIL_EXCEPTION should go away once the parser uses the separate
; exception type
#define NIL_EXCEPTION -11
#define NIL_BADCHAR -12
; Parser Exceptions
#define NIL_EXTRA_RPAREN -21
; Normal Parsed Expressions
; These will go away when the parser uses the exception type
#define NIL_SYMBOL -31
#define NIL_CELL -32
; Evaluator Exceptions
#define NIL_UNKNOWN_SYMBOL 0
#define NIL_EVAL_DOTPAIR 1
#define NIL_CANNOT_APPLY 2
#define NIL_EXPECTED_LIST 3
#define NIL_BAD_ARG_NUM 4
#define NIL_MALFORMED_ARGS 5
; Evaluator Types
; Code for 'any number of arguments
#define NIL_ARGS_ANY -1
#endif