1994-07-19 14:24:17 -07:00
|
|
|
/*
|
|
|
|
** tree.h
|
|
|
|
** TecCGraf - PUC-Rio
|
1994-11-17 05:58:57 -08:00
|
|
|
** $Id: tree.h,v 1.3 1994/11/16 16:03:48 roberto Exp roberto $
|
1994-07-19 14:24:17 -07:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef tree_h
|
|
|
|
#define tree_h
|
|
|
|
|
|
|
|
#include "opcode.h"
|
|
|
|
|
|
|
|
|
|
|
|
#define UNMARKED_STRING 0xFFFF
|
|
|
|
#define MARKED_STRING 0xFFFE
|
|
|
|
#define MAX_WORD 0xFFFD
|
|
|
|
|
1994-11-14 13:40:14 -08:00
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
1994-07-19 14:24:17 -07:00
|
|
|
#define indexstring(s) (*(((Word *)s)-1))
|
|
|
|
|
|
|
|
|
|
|
|
char *lua_strcreate (char *str);
|
1994-11-14 13:40:14 -08:00
|
|
|
TreeNode *lua_constcreate (char *str);
|
1994-11-17 05:58:57 -08:00
|
|
|
int lua_strcollector (void);
|
1994-11-16 08:03:48 -08:00
|
|
|
TreeNode *lua_varnext (char *n);
|
1994-07-19 14:24:17 -07:00
|
|
|
|
|
|
|
#endif
|