macro.str 1.3 KB

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