aboutsummaryrefslogtreecommitdiff
path: root/tree.h
blob: 7587f4ec8cfbaa1d2e8f47f46e5f0008cbf10be2 (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.2 1994/11/14 21:40:14 roberto Exp roberto $
*/

#ifndef tree_h
#define tree_h

#include "opcode.h"


#define UNMARKED_STRING	0xFFFF
#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);
TreeNode *lua_constcreate  (char *str);
void  lua_strcollector (void);
TreeNode *lua_varnext      (char *n);

#endif