2.1 Proparse.Net from OpenEdge

The Proparse .Net DLL was compiled using IKVM
(ikvm.net).
The proparse.assemblies.zip archive contains proparse.net.dll as well
as the minimum two IKVM assemblies needed for running Prolint.
For uses beyond Prolint, you might require additional IKVM libraries.

If you are downloading Proparse for Prolint, then you will want to make sure you are using
Prolint release 74 or later for use with Proparse.Net.

Download and unzip proparse.assemblies.zip. The assemblies must
be in a directory where OpenEdge can find them, usually using the
"-assemblies"
startup parameter. Add proparse.net.dll to your OpenEdge "assemblies.xml" file.

I use the -assemblies startup option to specify the directory
where the assemblies.xml file is.
I use a directory named assemblies at the top of my project.
In OE Architect, Project Properties -> OpenEdge -> Startup parameters:

-assemblies assemblies

I put my assemblies (*.dll) into that assemblies directory, and my assemblies.xml file looks like the sample below.
I blank out the version number so that I don't have to update it with each new release of Proparse.

<?xml version="1.0" encoding="UTF-8"?>
<references>
<assembly name="proparse.net, Culture=neutral, PublicKeyToken=cda1b098b1034b24"/>
</references>

I found though that .r-code I built, for programs referencing proparse.net.dll, seems to require the specific assembly version. Please let me know if there is any documentation about this!

The following test.p parses itself:

using org.prorefactor.refactor.* from assembly.
using org.prorefactor.treeparser.* from assembly.
using org.prorefactor.core.* from assembly.
using java.io.* from assembly.

def var filename as char init "test.p".
def var indent as int no-undo.

def var outed as char view-as editor large scrollbar-vertical size 78 by 22.
display outed with frame f1 no-box no-labels.

def var prsession as class org.prorefactor.refactor.RefactorSession.

prsession = org.prorefactor.refactor.RefactorSession:getInstance().

def var javafile as class java.io.File.
javafile = new java.io.File(filename).
if (not javafile:exists()) then do:
  message "Could not find file: " + fileName view-as alert-box.
  return.
end.
def var pu as class org.prorefactor.treeparser.ParseUnit.
pu = new ParseUnit(javafile).
pu:treeParser01().

run walker(pu:getTopNode()).
enable outed with frame f1.
wait-for "endkey" of default-window.

procedure walker:
  def input param node as class JPNode.
  if (node eq ?) then
    return.
  outed:insert-string(fill("  ", indent) + node:ToString() + "~r~n") in frame f1.
  indent = indent + 1.
  run walker(node:firstChild()).
  indent = indent - 1.
  run walker(node:nextSibling()).
end procedure.

Note that IKVM gives us the .Net equivalent of the Java classes we need, like java.io.File. Neat, eh?