declarator.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /* $Header$ */
  2. /* DEFINITION OF DECLARATOR DESCRIPTORS */
  3. /* A 'declarator' consists of an idf and a linked list of
  4. language-defined unary operations: *, [] and (), called
  5. decl_unary's.
  6. */
  7. struct declarator {
  8. struct declarator *next;
  9. struct idf *dc_idf;
  10. struct decl_unary *dc_decl_unary;
  11. struct idstack_item *dc_fparams; /* params for function */
  12. };
  13. /* allocation definitions of struct declarator */
  14. /* ALLOCDEF "declarator" */
  15. extern char *st_alloc();
  16. extern struct declarator *h_declarator;
  17. #define new_declarator() ((struct declarator *) \
  18. st_alloc((char **)&h_declarator, sizeof(struct declarator)))
  19. #define free_declarator(p) st_free(p, h_declarator, sizeof(struct declarator))
  20. #define NO_PARAMS ((struct idstack_item *) 0)
  21. struct decl_unary {
  22. struct decl_unary *next;
  23. int du_fund; /* POINTER, ARRAY or FUNCTION */
  24. arith du_count; /* for ARRAYs only */
  25. };
  26. /* allocation definitions of struct decl_unary */
  27. /* ALLOCDEF "decl_unary" */
  28. extern char *st_alloc();
  29. extern struct decl_unary *h_decl_unary;
  30. #define new_decl_unary() ((struct decl_unary *) \
  31. st_alloc((char **)&h_decl_unary, sizeof(struct decl_unary)))
  32. #define free_decl_unary(p) st_free(p, h_decl_unary, sizeof(struct decl_unary))
  33. extern struct type *declare_type();
  34. extern struct declarator null_declarator;