tokenname.c 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. /* TOKEN NAME DEFINITIONS */
  7. #include "idf.h"
  8. #include "LLlex.h"
  9. #include "Lpars.h"
  10. struct tokenname { /* Used for defining the name of a
  11. token as identified by its symbol
  12. */
  13. int tn_symbol;
  14. char *tn_name;
  15. };
  16. /* To centralize the declaration of %tokens, their presence in this
  17. file is taken as their declaration. The Makefile will produce
  18. a grammar file (tokenfile.g) from this file.
  19. Moreover, rather than looking up a symbol in all these lists
  20. to find its printable name, a fast version of symbol2str() is
  21. generated from these tables.
  22. Consequenty some of these tables are not referenced explicitly
  23. in the C text any more. To save space and to avoid lint confusion,
  24. these have been made pseudo-invisible by #ifdefs.
  25. */
  26. #ifdef ____
  27. struct tokenname tkspec[] = { /* the names of the special tokens */
  28. {IDENTIFIER, "identifier"},
  29. {STRING, "string"},
  30. {FILESPECIFIER, "filespecifier"},
  31. {INTEGER, "integer"},
  32. {0, ""}
  33. };
  34. struct tokenname tkcomp[] = { /* names of the composite tokens */
  35. {NOTEQUAL, "!="},
  36. {AND, "&&"},
  37. {LEFT, "<<"},
  38. {LESSEQ, "<="},
  39. {EQUAL, "=="},
  40. {GREATEREQ, ">="},
  41. {RIGHT, ">>"},
  42. {OR, "||"},
  43. {0, ""}
  44. };
  45. struct tokenname tkfunny[] = { /* internal keywords */
  46. {ERRONEOUS, "erroneous"},
  47. {0, ""}
  48. };
  49. #endif /* ____ */