July 2010
Intermediate to advanced
360 pages
11h 12m
English
Now we consider the recursive nature of the M4 input stream. Whenever a name token is expanded by a macro definition, the expansion text is pushed back onto the input stream for complete reprocessing. This recursive reprocessing continues to occur as long as there are macro calls found in the input stream that generate text.
For example:
$m4define(`macro', `expansion')dnlmacro ``quoted' text'expansion `quoted' text<ctrl-d>$
Here, I define a macro called macro, and then present this macro name on the input stream, followed by additional text, some of which is quoted, and some of which is double quoted.
The process used by M4 to parse this example is shown in Figure 10-1.
Figure 10-1. The procedure used by M4 to process ...
Read now
Unlock full access