Proparse TreeView

The Proparse TreeView can be launched from the SmartComponent Library Desktop and provides insight into the abstract syntax tree (AST) returned by proparse (http://www.joanju.com/proparse/http://www.oehive.org/proparse, http://oehive.github.io/proparse-javadoc/index.html). Consultingwerk maintains it's own version of proparse at https://github.com/consultingwerk/proparse to ensure the language dictionary used by proparse is always updated for the most recent OpenEdge release.  

The concept of the abstract syntax tree simplifies the analysis of existing ABL source code as proparse returns the source code structure based on its semantics without the need to pay attention to the actual formatting of the source code (e.g. indentation, line breaks or abbreviated keywords).  

Opening ABL source code

Using the Open button in the Ribbon or the list of last recently used files on the File tab of the Ribbon developers can open an file with ABL source code (.p, .w, .cls). The Proparse TreeView form will analyse the abstract syntax tree of the program and visualize the structure in the tree view control. Based on the size of the program this may take a few seconds. 

Columns in the Treeview

  1. The Proparse Node Type (NodeTypes:getTypeName(oNode:getType())
  2. The Subtype of the Node (oNode:getSubTypeIndex())
  3. The String representation of the Node (oNode:ToString())
  4. The source code represented by the Node (oNode:getText())
  5. The row of the node in the source code
  6. The column of the node in the source code

Parsing from the Windows clipboard

The Proparse TreeView form does also support parsing ABL source code from the Windows clipboard. This may be useful when it's only required to parse a small part of source code.

To parse the source code from the Windows clipboard, use the Parse from Clipboard button in the Ribbon. 

Parsing issues

Proparse is almost as strict with requiring valid ABL syntax in the routines it is parsing as the ABL compiler. When Proparse reports parsing issues this may be due to invalid syntax, missing propath entries (when include files cannot be located) or missing database connections. 

In rare cases, proparse may not be able to parse ABL source code due to legal but uncommon ABL syntax. In those cases the Proparse TreeView will report the exception thrown by the parser. This exception usually points to the exact position in the source code that is causing the problem. Slight changes like introducing an intermediate variable instead of passing a more complex expression as the argument to a function might resolve the parsing issue. 

When problems occur due to the usage of modern ABL keywords, the parser might need to be enhanced. In those cases, customers should log an enhancement request with us. 

Opening the source code

To allow direct comparison between the actual source code and how proparse views it, developers can use the Open File button in the Ribbon. Using this button the utility will open the source code in the ABL procedure editor and locate the node by it's position in the source code. 

Note, that the cursor position in the procedure editor is exactly the position of the selected "ID" note in an include file referenced by the parsed source code.

Prior to OpenEdge 11.7, the 64 bit versions of OpenEdge do not provide color-coding in the ABL source code editor. So on OpenEdge 11.0 - 11.6 we do recommend to execute the Proparse TreeView in a 32 bit OpenEdge runtime environment to provide better formatting of the ABL source code in the embedded procedure editor.