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