Lisp Interpreter for mbed LPC1768
Lisp Interpreter
(Marc Adler Lisp Interpreter, malisp)
mbed LPC1768 port by Takehisa Oneta (ohneta@gmail.com)
Diff: malisp.h
- Revision:
- 1:a2955606adef
- Parent:
- 0:e9a7a38d9ad3
--- a/malisp.h Sun Apr 17 11:59:13 2016 +0000 +++ b/malisp.h Sat May 21 22:26:40 2016 +0000 @@ -18,15 +18,15 @@ // token types -#define IATOM 6 -#define RATOM 7 -#define SATOM 8 -#define FUNC 9 -#define LST 10 -#define VARI 11 -#define QUOTE 12 -#define NILL 13 -#define T 14 +#define IATOM 6 // 整数ATOM +#define RATOM 7 // 実数ATOM (float) +#define SATOM 8 // 文字列ATOM +#define FUNC 9 // 関数 +#define LST 10 // リスト +#define VARI 11 // 変数 +#define QUOTE 12 // クオート +#define NILL 13 // nil +#define T 14 // t #define COND 15 #define DEFUN 16 #define FCAR 17 @@ -91,17 +91,16 @@ typedef struct LIST { - //uint32_t cons_num; - - //char gcbit; - uint32_t gcbit; - int32_t htype; - union { - float num; - char *pname; - } u; - struct LIST *left; - struct LIST *right; + + uint32_t gcbit; + + int32_t htype; + union { + float num; + char *pname; + } u; + struct LIST *left; + struct LIST *right; } LIST; @@ -125,6 +124,7 @@ void initialize(); LIST *init(char *name, int t); + LIST *makelist(); void lisp_print(LIST *p); LIST *eval(LIST *x, LIST *alist); @@ -138,7 +138,8 @@ int advance(); LIST *lookup(LIST *head, char *name); //LIST *install(char *name); -LIST *install(char *name, int nameConstKind); +//LIST *install(char *name, int nameConstKind); +LIST *install(char *name, bool nameCopyFlag); LIST *getnum(); LIST *getid();