Frames and Fields in the Symbol Tables

A recent client requirement got me into ProRefactor to add some more goodies to the symbol tables. The requirement was to find all database fields that could be updated in the UI for all frames in each compile unit.

It wouldn't have been too much work to write a script to walk through the syntax tree to figure this out, but it really seemed like something that should be easily available from the symbol tables. And, it seemed like something that would be easy to add to the tree parser in ProRefactor.

This did turn out to be the case. Now from the symbol tables for any one compile unit loaded up into a ProRefactor ParseUnit, it's all simple data access. For a ParseUnit, we can find all of the FieldContainers (Frames and Browse widgets). For a FieldContainer, there are three new lists.

First, there is a new list of all the statement nodes in the syntax tree which act on the frame (DEFINE, DISPLAY, etc). Second, there is a new list of all Variable and FieldBuffer Symbols in it.

Finally, (the key bit for the analysis tools I've been asked to build) I've added a new list of *enabled* Symbols, in other words, those Variables and FieldBuffers which are in an ENABLE, UPDATE, or PROMPT-FOR statement.

We've had a recent discussion about dumping syntax trees and symbol tables to XML, and how it might be useful for loading up into OE for people building analysis tools in ABL scripts. These new lists will automagically be part of the XML that gets dumped for a ParseUnit object.