Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
1.3 KiB

  1. /* Copyright (C) Boris Nikolaus, Germany, 1996-1997. All rights reserved. */
  2. extern int linedirective;
  3. extern int lineno;
  4. extern char filename[];
  5. extern char outfilename[];
  6. extern char incfilename[];
  7. extern FILE *fout, *finc;
  8. extern char *startsym;
  9. extern char *prefix;
  10. typedef struct item_s {
  11. int isnonterm;
  12. int isexternal;
  13. char *tag;
  14. char *identifier;
  15. char *altidentifier;
  16. char **args;
  17. struct item_s **items;
  18. int empty;
  19. int checked;
  20. } item_t;
  21. extern item_t symbols[];
  22. extern int nsymbols;
  23. extern item_t *items[];
  24. extern int nitems;
  25. struct bounds_s {
  26. unsigned lower; /* 0 for no lower bound */
  27. unsigned upper; /* 0 for no upper bound */
  28. };
  29. struct rhs_s {
  30. enum { eCCode, eItem, eSequence, eNode, eBounded, eAlternative } type;
  31. union {
  32. struct {
  33. char *ccode;
  34. int line;
  35. int column;
  36. char *file;
  37. } ccode;
  38. struct {
  39. char *identifier;
  40. char *args;
  41. } item;
  42. struct {
  43. struct rhs_s *element;
  44. struct rhs_s *next;
  45. } sequence, alternative;
  46. struct {
  47. struct rhs_s *left;
  48. struct rhs_s *right;
  49. } node;
  50. struct {
  51. struct bounds_s bounds;
  52. struct rhs_s *items;
  53. } bounded;
  54. } u;
  55. };
  56. struct token_s {
  57. char *identifier;
  58. char *altidentifier;
  59. };
  60. struct nterm_s {
  61. char *identifier;
  62. char **tags;
  63. };
  64. struct lhs_s {
  65. char *identifier;
  66. char *args;
  67. };