1994-07-19 14:24:17 -07:00
|
|
|
/*
|
|
|
|
** tree.h
|
|
|
|
** TecCGraf - PUC-Rio
|
1994-12-20 13:20:36 -08:00
|
|
|
** $Id: tree.h,v 1.7 1994/11/25 19:27:03 roberto Exp roberto $
|
1994-07-19 14:24:17 -07:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef tree_h
|
|
|
|
#define tree_h
|
|
|
|
|
1994-12-20 13:20:36 -08:00
|
|
|
#include "types.h"
|
1994-07-19 14:24:17 -07:00
|
|
|
|
1994-11-23 06:32:00 -08:00
|
|
|
#define NOT_USED 0xFFFE
|
1994-07-19 14:24:17 -07:00
|
|
|
|
|
|
|
|
1994-11-23 06:32:00 -08:00
|
|
|
typedef struct TaggedString
|
|
|
|
{
|
1994-11-25 11:27:03 -08:00
|
|
|
unsigned long hash; /* 0 if not initialized */
|
1994-11-23 06:32:00 -08:00
|
|
|
char marked; /* for garbage collection */
|
|
|
|
char str[1]; /* \0 byte already reserved */
|
|
|
|
} TaggedString;
|
1994-11-14 13:40:14 -08:00
|
|
|
|
|
|
|
typedef struct TreeNode
|
|
|
|
{
|
|
|
|
struct TreeNode *right;
|
|
|
|
struct TreeNode *left;
|
1994-11-23 06:32:00 -08:00
|
|
|
unsigned short varindex; /* != NOT_USED if this is a symbol */
|
|
|
|
unsigned short constindex; /* != NOT_USED if this is a constant */
|
|
|
|
TaggedString ts;
|
1994-11-14 13:40:14 -08:00
|
|
|
} TreeNode;
|
|
|
|
|
|
|
|
|
1994-11-23 06:32:00 -08:00
|
|
|
TaggedString *lua_createstring (char *str);
|
1994-11-14 13:40:14 -08:00
|
|
|
TreeNode *lua_constcreate (char *str);
|
1994-12-20 13:20:36 -08:00
|
|
|
Word 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
|