lookup.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
  3. * See the copyright notice in the ACK home directory, in the file "Copyright".
  4. */
  5. /* $Id$ */
  6. #ifndef LANG_NCGG_LOOKUP_H
  7. #define LANG_NCGG_LOOKUP_H
  8. typedef enum {
  9. justlooking,mustexist,newsymbol,makeexist
  10. } lookupstyle;
  11. typedef enum {
  12. symany,symkeyw,symconst,symsconst,symprop,symreg,symtok,symset,symproc
  13. } symtype;
  14. typedef struct symbol {
  15. struct symbol *sy_next; /* pointer to hashchain */
  16. char *sy_name; /* symbol */
  17. symtype sy_type; /* type */
  18. union {
  19. long syv_cstval;
  20. int syv_stringno;
  21. int syv_keywno;
  22. int syv_propno;
  23. int syv_regno;
  24. int syv_tokno;
  25. int syv_setno;
  26. int syv_procoff;
  27. } sy_value;
  28. } symbol;
  29. #define NSYMHASH 61
  30. extern symbol *symhash[NSYMHASH]; /* chained hashtable */
  31. /* util/ncgg/lookup.c */
  32. symbol *lookup(char *name, symtype type, lookupstyle style);
  33. unsigned int hashvalue(char *s);
  34. #endif /* LANG_NCGG_LOOKUP_H */