Code to XML

This script allows you to generate XML for each of your compile units. The XML contains the entire syntax tree, as well as the symbol tables. This XML is a very raw dump of Java objects from memory.

What is the benefit of this? It allows you to use OpenEdge scripts to gain access to all of the useful information that is generated by ProRefactor. For example, you might use the XML as input for ABL scripts to generate code documentation, to augment your XREF indexes, or to allow you to perform ad-hoc search and analysis.

The XML is unlikely to be self explanatory, so please feel free to post questions in the CodeParse Forum.

Ideally, this will inspire a new open-source project, written in ABL, which will read the XML and convert it to TEMP-TABLEs or some other ABL data structure. That would make the data much easier for other ABL programmers to understand it and use.

This script may require a lot of CPU, memory, and disc space. If your application is large, then the XML that gets written may require a very large amount of disk space, even though it is compressed. (For example, it might take as much as a few GB for an enormous application.)

The script writes to the prorefactor/xml directory. The script is easy to change if you want it to write its output elsewhere.

See the comments at the top of the script for usage notes.

Comparison to the Proparse API for ABL

Proparse is a DLL (.so on unix), with an API for using it from ABL(4GL) programs.

The XML generated here contains all of the data that is available in the syntax tree generated by Proparse. In addition, it contains all of the symbol tables generated in ProRefactor. Those symbol tables represent a wealth of information about your source code, far beyond what is available from Proparse alone.

This XML output could (should?) be considered a replacement for the old Proparse API. For the most part, new ABL programs should use this, rather than use Proparse directly.


AttachmentSize
ToXml.groovy6.41 KB