3 PD m4 is based on the macro tool distributed with the software
4 tools (VOS) package, and described in the "SOFTWARE TOOLS" and
5 "SOFTWARE TOOLS IN PASCAL" books. It has been expanded to include
6 most of the command set of SysV m4, the standard UN*X macro processor.
8 Since both PD m4 and UN*X m4 are based on SOFTWARE TOOLS macro,
9 there may be certain implementation similarities between
10 the two. The PD m4 was produced without ANY references to m4
13 written by: Ozan S. Yigit
17 Software Tools distribution: macro
19 Kernighan, Brian W. and P. J. Plauger, SOFTWARE
20 TOOLS IN PASCAL, Addison-Wesley, Mass. 1981
22 Kernighan, Brian W. and P. J. Plauger, SOFTWARE
23 TOOLS, Addison-Wesley, Mass. 1976
25 Kernighan, Brian W. and Dennis M. Ritchie,
26 THE M4 MACRO PROCESSOR, Unix Programmer's Manual,
27 Seventh Edition, Vol. 2, Bell Telephone Labs, 1979
29 System V man page for M4
34 [1] PD m4 uses a different (and simpler) stack mechanism than the one
35 described in Software Tools and Software Tools in Pascal books.
36 The triple stack thing is replaced with a single stack containing
37 the call frames and the arguments. Each frame is back-linked to a
38 previous stack frame, which enables us to rewind the stack after
39 each nested call is completed. Each argument is a character pointer
40 to the beginning of the argument string within the string space.
41 The only exceptions to this are (*) arg 0 and arg 1, which are
42 the macro definition and macro name strings, stored dynamically
48 | arg 3 ------------------------------->| str |
50 | arg 2 --------------+ .
54 | plev | <-- fp +---------------->| str |
58 | prcf -----------+ plev: paren level
59 +-------+ | type: call type
60 | . | | prcf: prev. call frame