aboutsummaryrefslogtreecommitdiff
path: root/tree.h
blob: 149819e9c3a5935dd8a00571a32eff772e5a03e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
** tree.h
** TecCGraf - PUC-Rio
** $Id: tree.h,v 1.6 1994/11/23 14:31:11 roberto Stab roberto $
*/

#ifndef tree_h
#define tree_h


#define NOT_USED  0xFFFE


typedef struct TaggedString
{
  unsigned long hash;  /* 0 if not initialized */
  char marked;   /* for garbage collection */
  char str[1];   /* \0 byte already reserved */
} TaggedString;
 
typedef struct TreeNode
{
 struct TreeNode *right;
 struct TreeNode *left;
 unsigned short varindex;  /* != NOT_USED  if this is a symbol */
 unsigned short constindex;  /* != NOT_USED  if this is a constant */
 TaggedString ts;
} TreeNode;


TaggedString *lua_createstring (char *str);
TreeNode *lua_constcreate  (char *str);
int  lua_strcollector (void);
TreeNode *lua_varnext      (char *n);

#endif