diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1994-11-14 19:40:14 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1994-11-14 19:40:14 -0200 |
| commit | 86b35cf4f6a824880239069d0afe282e95806aaa (patch) | |
| tree | 78352c354fc6befe1af900606cb84b23a40235e0 /tree.h | |
| parent | 3b7a36653b5da227502ec5a3c677b6a351af67be (diff) | |
| download | lua-86b35cf4f6a824880239069d0afe282e95806aaa.tar.gz lua-86b35cf4f6a824880239069d0afe282e95806aaa.tar.bz2 lua-86b35cf4f6a824880239069d0afe282e95806aaa.zip | |
unification of symbol tree and constant tree
Diffstat (limited to 'tree.h')
| -rw-r--r-- | tree.h | 17 |
1 files changed, 13 insertions, 4 deletions
| @@ -1,7 +1,7 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** tree.h | 2 | ** tree.h |
| 3 | ** TecCGraf - PUC-Rio | 3 | ** TecCGraf - PUC-Rio |
| 4 | ** $Id: $ | 4 | ** $Id: tree.h,v 1.1 1994/07/19 21:24:17 celes Exp roberto $ |
| 5 | */ | 5 | */ |
| 6 | 6 | ||
| 7 | #ifndef tree_h | 7 | #ifndef tree_h |
| @@ -14,14 +14,23 @@ | |||
| 14 | #define MARKED_STRING 0xFFFE | 14 | #define MARKED_STRING 0xFFFE |
| 15 | #define MAX_WORD 0xFFFD | 15 | #define MAX_WORD 0xFFFD |
| 16 | 16 | ||
| 17 | |||
| 18 | typedef struct TreeNode | ||
| 19 | { | ||
| 20 | struct TreeNode *right; | ||
| 21 | struct TreeNode *left; | ||
| 22 | Word varindex; /* if this is a symbol */ | ||
| 23 | Word constindex; /* if this is a constant; also used for garbage collection */ | ||
| 24 | char str[1]; /* \0 byte already reserved */ | ||
| 25 | } TreeNode; | ||
| 26 | |||
| 27 | |||
| 17 | #define indexstring(s) (*(((Word *)s)-1)) | 28 | #define indexstring(s) (*(((Word *)s)-1)) |
| 18 | 29 | ||
| 19 | 30 | ||
| 20 | char *lua_strcreate (char *str); | 31 | char *lua_strcreate (char *str); |
| 21 | char *lua_constcreate (char *str); | 32 | TreeNode *lua_constcreate (char *str); |
| 22 | char *lua_varcreate (char *str); | ||
| 23 | void lua_strcollector (void); | 33 | void lua_strcollector (void); |
| 24 | char *lua_varnext (char *n); | 34 | char *lua_varnext (char *n); |
| 25 | char *lua_varname (Word index); | ||
| 26 | 35 | ||
| 27 | #endif | 36 | #endif |
