Often enough, it seems like you can begin working on software
project with the assumption that you won't need to, say, design a
little language and build a parser for it -- and yet, before
long, that's exactly what you end up doing.
In the case of mod_ndb, my web services gateway for MySQL
Cluster, the little language turns out to involve
page-description -- it describes how to take a table of results
from a database query and present it within an HTTP response.
Inside an httpd.conf file, it looks something like this:
<OutputFormat XML> Table scan = '<NDBScan>\n$row$\n...\n</NDBScan>\n' Row row = ' <NDBTuple> $attr$ \n ... </NDBTuple>' Record attr = '<Attr name=$name/Q$ value=$value/Qx$ />' or '<Attr name=$name/Q$ isNull="1" />' </OutputFormat> <OutputFormat JSON> Table array = '[\n …[Read more]