tree.h 738 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. ** tree.h
  3. ** TecCGraf - PUC-Rio
  4. ** $Id: tree.h,v 1.10 1995/10/17 11:53:53 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. #endif