macro.str 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. /* PREPROCESSOR: DEFINITION OF MACRO DESCRIPTOR */
  7. #include "nopp.h"
  8. #ifndef NOPP
  9. /* The flags of the mc_flag field of the macro structure. Note that
  10. these flags can be set simultaneously.
  11. */
  12. #define NOFLAG 0 /* no special flags */
  13. #define FUNC 01 /* function attached */
  14. #define NOREPLACE 02 /* don't replace */
  15. #define FORMALP 0200 /* mask for creating macro formal parameter */
  16. /* The macro descriptor is very simple, except the fact that the
  17. mc_text, which points to the replacement text, contains the
  18. non-ascii characters \201, \202, etc, indicating the position of a
  19. formal parameter in this text.
  20. */
  21. struct macro {
  22. struct macro *next;
  23. char * mc_text; /* the replacement text */
  24. int mc_nps; /* number of formal parameters */
  25. int mc_length; /* length of replacement text */
  26. int mc_count; /* # of "concurrent" invocations*/
  27. char mc_flag; /* marking this macro */
  28. };
  29. /* ALLOCDEF "macro" 20 */
  30. struct mlist {
  31. struct mlist *next;
  32. struct macro *m_mac;
  33. char *m_repl;
  34. int m_level;
  35. };
  36. /* ALLOCDEF "mlist" 20 */
  37. /* `token' numbers of keywords of command-line processor
  38. */
  39. #define K_UNKNOWN 0
  40. #define K_DEFINE 1
  41. #define K_ELIF 2
  42. #define K_ELSE 3
  43. #define K_ENDIF 4
  44. #define K_IF 5
  45. #define K_IFDEF 6
  46. #define K_IFNDEF 7
  47. #define K_INCLUDE 8
  48. #define K_LINE 9
  49. #define K_UNDEF 10
  50. #define K_PRAGMA 11
  51. #define K_FILE 100 /* for dependency generator */
  52. #endif /* NOPP */