Kris of wmii fame wrote a wonderful preprocessor/template in a few lines of awk. It is used in werc and I really love it, for some minimal docs see:
http://werc.cat-v.org/docs/rc_template_lang The code is included as part of the werc distribution under bin/template.awk Enjoy uriel On Mon, Apr 27, 2009 at 2:45 PM, pancake <panc...@youterm.com> wrote: > Some time ago I started to write a new program to implement a simple > preprocessor for doing > some over-cpp preprocessing allowing me to use specials preprocessor tags > inside the comments of the C code generated by Vala to add some funny hacks > on top of it. > > I was also thinking on many other applications for the same concept, so i > tried to keep the > code as minimal as possible being able to work with streams or files and in > the same time > being able to write CGI's using the same preprocessing language. > > After a month or so I think is time to make it public (it was public since > the beggining, but not published :P) So I would like to hear from you ideas, > tips, patches, simplifications, etc.. > > Actually spp works great and can partially emulate spp, pod and other > preprocessors using a simple plugin-system (maybe dwm can get some ideas > from this plugin system). > > So at the current state, spp is just a simple preprocessor engine whcih > allows to implement > different backends for multiple syntaxes or ways to parse the input in C at > compile time and then use these rules to generate new data from a set of > rules and some basic transformations. > > Actually i'm thinking on adding templates or some better way for scripting > dataj to generate for example an index for a list of items or so, but I want > first to let people play with it and the suckless community is probably the > best one for getting decent feedback with this kind of minimalistic stuff. > > hg clone http://news.nopcode.org/miau/hgi/spp/ > > Thanks for listening ;) > > > --pancake > >