tree.h 757 B

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