filepp is a generic file preprocessor designed to allow the functionality provided by the C preprocessor to be used with any file type. It supports the full set of C preprocessor keywords (#include, #define, #if, etc.). filepp is also highly customisable and allows users to easily add their own keywords or modify the behaviour of existing keywords.
| Tags | Text Processing Markup HTML/XHTML |
|---|---|
| Licenses | GPL |
| Operating Systems | OS Independent |
| Implementation | Perl |
Recent releases


Release Notes: This release includes a rewrite of the processing chain so macros within macros behave correctly. Several other bugfixes and minor enhancements were made.


Release Notes: This release adds support for processing multiple files at once, cpp style ## concatenation, improved control over processing routines, a full test suite, and several bug fixes.


Release Notes: This release adds foreach loops, the defplus keyword, a cpp-style imacros option, support for variable number of arguments in macros, a macro prefix option, and many other minor features.


Release Notes: This version adds a regexp module which implements a Perl-style regular expression search and replace. There were also other new features and minor bugfixes.


Release Notes: This release fixes a minor bug in the processing of inputs to keywords such as #if and #for.
Recent comments
07 Feb 2002 11:52
Re: I don't understand
> Why did someone feel the need to rewrite
> the C pre-processor?
CPP is not a good general-purpose macro processor.
The question is why would one reimplement m4?
E.g.
GNU m4 (www.gnu.org/software/m4/).
26 Mar 2001 04:57
Re: I don't understand
The short answer is Perl. I wanted to write a generic file preprocessor which had a core set of keywords (same as cpp), but which was easy to modify and extend by adding further keywords. As I wanted to write the new keywords in Perl, it made sense to write it all in Perl.
12 Mar 2001 20:26
Re: I don't understand
>
> % Why did someone feel the need to
> rewrite
> % the C pre-processor? There's
> nothing
> % preventing you from using the C
> % pre-processor on files that aren't
> C
> % sources.
> %
>
>
> cpp is designed specifically to
> generate output for the C compiler.
> Yes, you can use any file type with it,
> but the output it creates includes loads
> of blank lines and lines of the style:
>
> # 1 "file.c"
>
> Obviously these lines are very useful
> to the C compiler, but no use in say an
> HTML file.
>
> Also, as filepp is written in Perl, it
> is 8-bit clean and so works on any
> character set, not just ASCII
> characters.
>
> Filepp is also customisable and
> hopefully more user friendly than cpp.
>
If the output from cpp is not what's required,
why didn't you modify cpp slightly and provide
a switch to choose the new functionality, instead
of reinventing 95% of cpp again.
20 Feb 2001 12:59
C-centricity
> % Why did someone feel the need to rewrite
> % the C pre-processor? There's nothing
> % preventing you from using the C
> % pre-processor on files that aren't C
> % sources.
> cpp is designed specifically to
> generate output for the C compiler.
> Yes, you can use any file type with it,
> but the output it creates includes loads
> of blank lines and lines of the style:
>
> # 1 "file.c"
>
> Obviously these lines are very useful
> to the C compiler, but no use in say an
> HTML file.
>
> Also, as filepp is written in Perl, it
> is 8-bit clean and so works on any
> character set, not just ASCII
> characters.
>
> Filepp is also customisable and
> hopefully more user friendly than cpp.
Also, I should point out that the C pre-processor is C-centric in other ways. For example, something like:
#if 0
"
#endif
is illegal and would cause cpp to choke. Everything must be made up of valid C pre-processor tokens, and " is not one of them (because it is an unterminated string).
19 Feb 2001 17:25
Re: I don't understand
> Why did someone feel the need to rewrite
> the C pre-processor? There's nothing
> preventing you from using the C
> pre-processor on files that aren't C
> sources.
>
cpp is designed specifically to generate output for the C compiler. Yes, you can use any file type with it, but the output it creates includes loads of blank lines and lines of the style:
# 1 "file.c"
Obviously these lines are very useful to the C compiler, but no use in say an HTML file.
Also, as filepp is written in Perl, it is 8-bit clean and so works on any character set, not just ASCII characters.
Filepp is also customisable and hopefully more user friendly than cpp.
An AJAX Webmail script for an existing POP3/IMAP/SMTP server or cPanel.