tree.h 780 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. ** tree.h
  3. ** TecCGraf - PUC-Rio
  4. ** $Id: tree.h,v 1.9 1995/01/12 14:19:04 roberto Exp roberto $
  5. */
  6. #ifndef tree_h
  7. #define tree_h
  8. #include "types.h"
  9. #define NOT_USED 0xFFFE
  10. typedef struct TaggedString
  11. {
  12. unsigned long hash; /* 0 if not initialized */
  13. char marked; /* for garbage collection */
  14. char str[1]; /* \0 byte already reserved */
  15. } TaggedString;
  16. typedef struct TreeNode
  17. {
  18. struct TreeNode *right;
  19. struct TreeNode *left;
  20. unsigned short varindex; /* != NOT_USED if this is a symbol */
  21. unsigned short constindex; /* != NOT_USED if this is a constant */
  22. TaggedString ts;
  23. } TreeNode;
  24. TaggedString *lua_createstring (char *str);
  25. TreeNode *lua_constcreate (char *str);
  26. Long lua_strcollector (void);
  27. TreeNode *luaI_nodebysymbol (Word symbol);
  28. #endif