This directory contains code generation templates.

The format of each template is regular Java code with embedded formal
parameter references.  Parameter specifications are of the form '#D', where
'D' is the "parameter id" ranging from 0 to 9.  There is an optional
synopsis line, which is preceded by '// SYNOPSIS: ' (spaces are significant).

The templates are expanded by the HjPrettyPrinterVisitor.dump() method,
which takes a template name and a list of parameters.  Each parameter is
either an AST node or a template action.  The non-parameter parts of the
template are transferred to the output verbatim, except that all the content
in the synopsis line (including the trailing newline) is ignored (this means
that if you want a newline in the output code before the template
instantiation, there needs to be a blank line after the synopsis line).
HjPrettyPrinterVisitor.dump() also puts comments before and after each
template expansion that indicate which template is being expanded (and wrap
the expansion in balancing braces).

Each formal parameter reference outside of the synopsis line is replaced by
the expansion of the actual parameter with the index corresponding to the
parameter id of the formal.

LIMITATION: There is currently no way of creating a template with more than
10 parameters.

AST nodes are pretty-printed into the output file (which may change the
current scope -- the compiler code is responsible for adjusting the AST node
properly).  Template actions are executed, with the result going into the
output file.

LIMITATION: There is currently no way of typechecking parameters.

There are two template actions currently defined: Loop and Join.  Loop
takes the name of a template and a list of parameter lists, and expands
the template once for each group of parameters.  Join takes a list of
parameters and expands them with a specified delimiter string in between.
Both of these actions are described in more detail in the Javadoc comments
for the corresponding classes (inner classes of HjPrettyPrinterVisitor).

