1989-02-07 11:04:05 +00:00
|
|
|
struct repl {
|
|
|
|
struct repl *next;
|
1989-09-19 16:13:23 +00:00
|
|
|
struct idf *r_idf; /* name of the macro */
|
1989-02-07 11:04:05 +00:00
|
|
|
struct args *r_args; /* replacement parameters */
|
1989-09-19 16:13:23 +00:00
|
|
|
int r_level; /* level of insertion */
|
1989-11-22 13:58:36 +00:00
|
|
|
int r_size; /* current size of replacement buffer */
|
|
|
|
char *r_ptr; /* replacement text index pointer */
|
|
|
|
char *r_text; /* replacement text */
|
1989-02-07 11:04:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* ALLOCDEF "repl" 4 */
|
|
|
|
|
|
|
|
#define NO_REPL (struct repl *)0
|
|
|
|
|
|
|
|
/* The implementation of the ## operator is currently very clumsy.
|
|
|
|
When the the ## operator is used the arguments are taken from
|
|
|
|
the raw buffer; this buffer contains a precise copy of the
|
|
|
|
original argument. The fully expanded copy is in the arg buffer.
|
|
|
|
The two copies are here explicitely because:
|
|
|
|
|
|
|
|
#define ABC f()
|
|
|
|
#define ABCD 2
|
|
|
|
#define g(x, y) x ## y + h(x)
|
|
|
|
|
|
|
|
g(ABC, D);
|
|
|
|
|
|
|
|
In this case we need two copies: one raw copy for the pasting
|
|
|
|
operator, and an expanded one as argument for h().
|
|
|
|
*/
|
|
|
|
struct args {
|
1989-11-22 13:58:36 +00:00
|
|
|
char *a_expptr; /* expanded argument index pointer */
|
|
|
|
char *a_expbuf; /* expanded argument buffer pointer */
|
|
|
|
int a_expsize; /* current size of expanded buffer */
|
1989-02-07 11:04:05 +00:00
|
|
|
char *a_expvec[NPARAMS]; /* expanded argument vector */
|
1989-11-22 13:58:36 +00:00
|
|
|
char *a_rawptr; /* raw argument index pointer */
|
|
|
|
char *a_rawbuf; /* raw argument buffer pointer */
|
|
|
|
int a_rawsize; /* current size of raw buffer */
|
1989-02-07 11:04:05 +00:00
|
|
|
char *a_rawvec[NPARAMS]; /* raw argument vector */
|
|
|
|
};
|
|
|
|
|
|
|
|
/* ALLOCDEF "args" 2 */
|
|
|
|
|
|
|
|
#define NO_ARGS (struct args *)0
|
|
|
|
|