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".
5 /* $Id: replace.str,v 1.5 1994/06/27 08:02:13 ceriel Exp $ */
6 /* DEFINITIONS FOR THE MACRO REPLACEMENT ROUTINES */
10 struct idf *r_idf; /* name of the macro */
11 struct args *r_args; /* replacement parameters */
12 int r_level; /* level of insertion */
13 int r_size; /* current size of replacement buffer */
14 char *r_ptr; /* replacement text index pointer */
15 char *r_text; /* replacement text */
18 /* ALLOCDEF "repl" 4 */
20 #define NO_REPL (struct repl *)0
22 /* The implementation of the ## operator is currently very clumsy.
23 When the the ## operator is used the arguments are taken from
24 the raw buffer; this buffer contains a precise copy of the
25 original argument. The fully expanded copy is in the arg buffer.
26 The two copies are here explicitely because:
30 #define g(x, y) x ## y + h(x)
32 g(ABC, D); // gives: 2 + h(f())
34 In this case we need two copies: one raw copy for the pasting
35 operator, and an expanded one as argument for h().
38 char *a_expptr; /* expanded argument index pointer */
39 char *a_expbuf; /* expanded argument buffer pointer */
40 int a_expsize; /* current size of expanded buffer */
41 char *a_expvec[NPARAMS]; /* expanded argument vector */
42 char *a_rawptr; /* raw argument index pointer */
43 char *a_rawbuf; /* raw argument buffer pointer */
44 int a_rawsize; /* current size of raw buffer */
45 char *a_rawvec[NPARAMS]; /* raw argument vector */
48 /* ALLOCDEF "args" 2 */
50 #define NO_ARGS (struct args *)0