macro.str 1.5 KB

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