tree.h 723 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. ** tree.h
  3. ** TecCGraf - PUC-Rio
  4. ** $Id: tree.h,v 1.3 1994/11/16 16:03:48 roberto Exp roberto $
  5. */
  6. #ifndef tree_h
  7. #define tree_h
  8. #include "opcode.h"
  9. #define UNMARKED_STRING 0xFFFF
  10. #define MARKED_STRING 0xFFFE
  11. #define MAX_WORD 0xFFFD
  12. typedef struct TreeNode
  13. {
  14. struct TreeNode *right;
  15. struct TreeNode *left;
  16. Word varindex; /* if this is a symbol */
  17. Word constindex; /* if this is a constant; also used for garbage collection */
  18. char str[1]; /* \0 byte already reserved */
  19. } TreeNode;
  20. #define indexstring(s) (*(((Word *)s)-1))
  21. char *lua_strcreate (char *str);
  22. TreeNode *lua_constcreate (char *str);
  23. int lua_strcollector (void);
  24. TreeNode *lua_varnext (char *n);
  25. #endif