Re: script preprocessor?
| From: | Christian Reiniger | Date: | Wed, 29 Aug 2001 17:54:48 +0000 |
| Subject: | Re: script preprocessor? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-65071@lists.php.net to get a copy of this message | ||
On Wednesday 29 August 2001 12:24, alvarez@sto13.st-oneline.de wrote:
> Is there a macro preprocessor that can be used to substitute arbitrary
> sections of code with different code? define is documented as working
> for rvals only and my attempts to produce something more meaty lead to
> parse errors.
I've written one for my personal needs. Supports replacement of constants
("{{$ foobar }}") with arbitrary text, conditionals
("{{%if foobar == 42 }} ... {{%else }} ... {{%endif }}"), comment
removal, removal of unneccessary whitespace, removal of assertions and
replacement of an error handler function ("sgError ($Msg)" => "MyError
(__FILE__, __LINE__, $Msg)")
Written for Linux, needs GNU NANA
(http://wattle.cs.ntu.edu.au/homepages/pjm/nana-home/) and expat
(http://www.jclark.com/xml/expat.html).
I can send you a copy of the source if you want.
--
Christian Reiniger
LGDC Webmaster (http://lgdc.sunsite.dk/)
"use the source, luke." (obi-wan gnuobi)