Projects / Filepp

Filepp

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
Licenses
Operating Systems
Implementation

Recent releases

  •  07 Mar 2007 13:52

    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.

    •  15 Jul 2003 12:55

      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.

      •  18 Nov 2002 12:02

        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.

        •  12 Jul 2002 09:09

          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.

          •  07 Feb 2002 10:56

            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 KernelKludge

            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 (http://www.gnu.org/software/m4/).

            26 Mar 2001 04:57 cabaret

            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 pixelbeat

            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 mikpos

            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 cabaret

            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.

            Screenshot

            Project Spotlight

            OpenStack4j

            A Fluent OpenStack client API for Java.

            Screenshot

            Project Spotlight

            TurnKey TWiki Appliance

            A TWiki appliance that is easy to use and lightweight.