GPP is a general-purpose preprocessor with customizable syntax, suitable for a wide range of preprocessing tasks. Its independence from any one programming language makes it much more versatile than the C preprocessor (cpp), while its syntax is lighter and more flexible than that of GNU m4. There are built-in macros for use with C/C++, LaTeX, HTML, XHTML, and Prolog files.
GPP is Free Software. It is distributed under the terms of the GNU Lesser General Public Licence.
Use cmake to generate a makefile, then run make to compile.
Extensive documentation, including usage examples, is included in the portable source package and should get installed automatically as a man page and an HTML file. The HTML version is also available online on the GPP home page.
Note that the documentation itself is generated by GPP using an input
file (gpp.pp
) with macros that can automatically
produce HTML, LaTeX, or troff (man page) output. Studying this file
should prove instructive, and manually running it through GPP can
serve as a basic test of the program's functionality. Once you have
installed GPP, you can invoke it as follows to get instructions on how
to manually generate the documentation: gpp -H /path/to/gpp.pp
To refer to GPP in a publication, please use the following citation:
Tristan Miller and Denis Auroux. GPP, the generic preprocessor. Journal of Open Source Software, 5(51), July 2020. ISSN 2475-9066. DOI: 10.21105/joss.02400.