unification of symbol tree and constant tree
This commit is contained in:
17
tree.h
17
tree.h
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
** tree.h
|
||||
** TecCGraf - PUC-Rio
|
||||
** $Id: $
|
||||
** $Id: tree.h,v 1.1 1994/07/19 21:24:17 celes Exp roberto $
|
||||
*/
|
||||
|
||||
#ifndef tree_h
|
||||
@@ -14,14 +14,23 @@
|
||||
#define MARKED_STRING 0xFFFE
|
||||
#define MAX_WORD 0xFFFD
|
||||
|
||||
|
||||
typedef struct TreeNode
|
||||
{
|
||||
struct TreeNode *right;
|
||||
struct TreeNode *left;
|
||||
Word varindex; /* if this is a symbol */
|
||||
Word constindex; /* if this is a constant; also used for garbage collection */
|
||||
char str[1]; /* \0 byte already reserved */
|
||||
} TreeNode;
|
||||
|
||||
|
||||
#define indexstring(s) (*(((Word *)s)-1))
|
||||
|
||||
|
||||
char *lua_strcreate (char *str);
|
||||
char *lua_constcreate (char *str);
|
||||
char *lua_varcreate (char *str);
|
||||
TreeNode *lua_constcreate (char *str);
|
||||
void lua_strcollector (void);
|
||||
char *lua_varnext (char *n);
|
||||
char *lua_varname (Word index);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user