The header file to be output has the structure shown in Figure 2. Each box represents a component of the kind named in the box. The children of a box, taken in order, constitute the sub-components of that box. If a box contains an asterisk, it represents an arbitrary number of components of the given kind. You should convince yourself that Figure 2 does, indeed, describe the structure of the header file presented above.
We can describe the text associated with each node of Figure 2 by the following declarative specification:
From this declarative specification, Eli will generate a module that exports functions named PTGHeaderFile, PTGSet, PTGName, PTGQuoted, PTGList and PTGSeq. PTGSet (for example) would be called with two arguments, one a PTGNode representing the name of the set and the other a PTGNode representing the list of quoted elements.
In addition to these functions, the module exports an output function PTGOut that takes a PTGNode as its argument and writes the text represented by that PTGNode on standard output. (Other output functions are also exported by the module.)