I looked at this a few years ago and as Michael says because of the different ways indexes can be referenced in DF code it's not possible (or so difficult no ones done it) to parse code looking for index references.