The question was raised about what I meant when describing XML as "first class data", and scripting languages as "second class data". What I meant is that there are plenty of software tools for processing XML as data. I'm less convinced that most scripting languages are as easily parsed as data (rather than parsed purely for the purposes of a compiler/interpreter). However, I'm happy to be educated about this.
I come back to my example of Ant build files. With XML tools (XSLT, in my case), it's not hard to generate documentation of the flow of control for an Ant build. My question is how easy it is to use a scripting language parser (they are commonly built-in, according to Steven's reply) to do the same kind of analysis of a scripting language build script, perhaps of the sort used by SCons. Maybe it's easier than I imagine, but having written a build system in the past in a scripting language (NetRexx), I'm not convinced that it wouldn't be an order of magnitude harder. Mind you, that probably has as much to do with the discipline that Ant imposes, as it has to do with the ease of processing that comes with XML.
Has anyone else had experience with this kind of issue, wanting to be able to treat code and control files as data so that you can generate statistics, documentation, etc.?