Codeparse group

Welcome to the Code Parse Group! Be sure to subscribe, and don't forget to click "my subscription" if you want to subscribe to the mailing list.


Version History

Version 1.7.2

  • Added fix for conflict with other plugins that use Commons Logging.
  • Added Groovy script engine and Groovy Console to the nav context devel utils menu.

Version 1.7.1

  • First pass at a new Rename Files refactoring
  • Some internal changes toward support on Tomcat

Version 1.6.1

  • Proparse 3.1 with ABL 10.1B new syntax support.

Version 1.6.0

  • Tree parser now gathers parameter information for calls and routines.

How Used Report

This report shows a snippet from each line of code where a database field is used. For example, a how-used report for sports2000.customer.custnum might show:

s2k\gui\bcust.w
define temp-table ...  like Customer.CustNum validate

s2k\gui\dcust.w
define temp-table ...  like Customer.CustNum validate

s2k\gui\dcust_cl.w
define temp-table ...  like Customer.CustNum validate

s2k\gui\orderreport.p
format ...  Customer.CustNum column-label "Cust-Num" format ">>>>9"
display ...  Customer.CustNum

s2k\gui\vcust.w
define temp-table ...  like Customer.CustNum validate

s2k\gui\vcust2.w

Where Used Report

This is not the most efficient way to find where a database field is used, but it is a useful example of using ProRefactor.

See this WebSVN link for the full source.

It prompts for a fully qualified db.table.field name, checks that it exists in ProRefactor's configured schema, and splits it into two string variables: fieldName, and dbTableName.

It then finds all parse units in the directory of your choice, and loads or builds the PUB file for each of those, and then checks to see if your field is used in that compile unit. So, for each parse unit pu:


PUB Files

In prorefactor/projects/projectname/pubs in your working directory, ProRefactor writes out a parse unit binary (PUB) file for each compile unit in your application. These will be built as needed, when you do a parse or run a report.

These PUB files contain the full syntax tree and some additional information, so that your programs do not need to be re-parsed each time ProRefactor wants to get information about them. The *.pub files can be thought of a bit like your *.r files.

Here's the important bit: These files contain a fair amount of information, and will probably require more disc space than your .r files.


Console

Using the standalone jar file, you can launch a command line console which contains one or two examples of how you can use the ProRefactor libraries. The console (org.prorefactor.Console) is the default class for the standalone jar file, so you can launch it simply with:

java -jar prorefactor.jar

Here's what its menu looks like as of Jan 2007:

h) How-used report
l) Load Settings for a project
p) Parse a directory
q) Quit
v) show proparse Version
w) Where used report

Enter selection:

Showing the Proparse version is useful for checking that the Proparse shared library can be found and loaded OK.


Standalone Jar File

ProRefactor can be used as a standalone library, entirely independently of Eclipse.

This Java archive (jar) file contains ProRefactor, as well as the third party libraries it requires.

prorefactor.oehive.org/prorefactor.jar
Last updated: June 17, 2008. About a dozen MB.

Setting Up ProRefactor

  1. See Project Config. Dump for a script which creates a prorefactor project settings directory.

1 Project Config. Dump

This small package is for generating the configuration files needed by Proparse.

The zip file contains a directory named prorefactor. Extract it somewhere into your existing PROPATH.

Start your Progress development session, as usual. Your PROPATH, configuration settings, database connections, database aliases, etc., must all be fully set up as if you were going to compile the entire application. If you don't have these settings all correct so that you can compile your application, then Proparse won't be able to parse it either.

Then,


ProRefactor bug fix release 1.5.3

ProRefactor Version 1.5.3

  • Proparse version 3.0b04.
  • Fixed bug with temp-table field being defined like another field with same name.
  • Fixed bug parsing buffer parameter with no name in function forward declaration.

ProRefactor 1.5.2 bug fix release

I posted ProRefactor version 1.5.2 to the update site:

  • Proparse version 3.0b03.
  • Fixed bug in support for classes - table defs weren't being inherited.
  • Support for DB aliases was incomplete - finished.

wait(,) of current-window.

Bugs reported in Proparse sometimes lead me to come up with some pretty funny looking but legal code. The following script displays a couple of strings and then waits for keypress of '(' or ')'.

function wait returns character:
  display "in wait()".
  return "".
end function.

display "hi".
wait().
wait(,) of current-window.

What fun. :)


Desktop search, code analysis

I've been contracted to do some analysis of the client's code. Naturally, the first thing I did was load up all their source into Callgraph, and generate HTML of all their source. :) Now I have something that is preprocessed, formatted, easy to read, and with hyperlinks between calls and procedures. The best part is, plain text searches of this output HTML are more useful and reliable than unprocessed code would be.

That leads me to my topic. I wrote a little find/grep script with generates a nice HTML list with links to files which contain my search string. It works great, but it takes about 10-20 minutes per search. The need for a desktop index/search application is something that I've avoided until right now.


Prolint group

Thomas Mercer-Hursh, Ph.D. wrote:
> Curious that there are 60 people subscribed to Codeparse, but only 3 to Prolint.

Oh dear - I see that

"registration form: Should this group be available for subscription during registration?. If checked, a corresponding checkbox will be added to the registration form."

...was disabled for the Prolint group. I assume that was a mistake (not what Jurjen wanted) and I've enabled it.

If you would like to be subscribed to the Prolint group, please visit:
http://oehive.org/prolint
and click on the "subscribe" link found in the right-hand-side column.


Prolint/Eclipse

I've started work on a Prolint plug-in for Eclipse, but just written in Java, rather than ABL. Because it relies a lot on ProRefactor, I've just included my work so far in the ProRefactor SVN repository.

The Prolint/Eclipse page in the Prolint book is where you can find a bit more information and maybe a couple of pretty pictures. :)


Prolint/Eclipse Problems View

Prolint/Eclipse Problems View

Once Prolint problems have been found, problem markers are created in Eclipse. These markers can be sorted and filtered. Clicking on a marker in the Problems view opens an editor to the right line and highlights the problem code.


Prolint/Eclipse menu choices

Prolint/Eclipse menu choices

There are two simple menu items for Prolint: one to find problems, and the other to clear the problem markers. Any combination of files, folders, and projects can be selected for these.


#
Syndicate content