Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
75 changes: 43 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,43 @@
proparse
========

[PUG Challenge 2017 Presentation](
https://github.com/consultingwerk/proparse/files/1066604/2017.Proparse.EN.pdf)

Proparse, forked from http://www.oehive.org/proparse/

The grammar files uses ANTLR 2x syntax (compiler in lib/antlr-2.7.7.jar), use the ANTLR plugin for Eclipse
from sourceforge - http://antlreclipse.sourceforge.net/updates the newest ANTLR IDE only works with ANTLR version 3+.

As far as I can tell there are two grammar files used by proparse

- com/joanju/proparse/proparse.g
- com/joanju/proparse/proeval.g

Last one is only used if code chunk or preprocess evaluation is requested.

However, prorefactor has a number of additional grammars all looking more or less same with some extensions to the proparse one

- org/prorefactor/treeparserbase/JPTreeParser.g
- org/prorefactor/treeparser01/JPTreeParser.g
- org/prorefactor/treeparser01/expandedtreeparser01.g

Out of those only the first one seems to be used in unit test scripts.

Adding new keyword usually require:
1. add the keyword to com/joanju/proparse/BaseTokenTypes.txt (also increment Last_Token_Number)
2. add the keyword in com/joanju/proparse/NodeTypes.java (there is a long list in the static constructor)
3. depending on keyword type the grammar file might need to be updated
- SYSTEM HANDLE (SYSHDL), add the keyword on 'systemhandlename' rule
- FUNCTIONS (MAY_BE_REGULAR_FUNC or MAY_BE_NO_ARG_FUNC), add it to one of the following rules: 'builtinfunc', 'argfunc', 'recordfunc', 'noargfunc'
proparse
========

[PUG Challenge 2017 Presentation](
https://github.com/consultingwerk/proparse/files/1066604/2017.Proparse.EN.pdf)

Proparse, forked from http://www.oehive.org/proparse/

The grammar files uses ANTLR 2x syntax (compiler in lib/antlr-2.7.7.jar), use the ANTLR plugin for Eclipse
from sourceforge - http://antlreclipse.sourceforge.net/updates the newest ANTLR IDE only works with ANTLR version 3+.

As far as I can tell there are two grammar files used by proparse

- com/joanju/proparse/proparse.g
- com/joanju/proparse/proeval.g

Last one is only used if code chunk or preprocess evaluation is requested.

However, prorefactor has a number of additional grammars all looking more or less same with some extensions to the proparse one

- org/prorefactor/treeparserbase/JPTreeParser.g
- org/prorefactor/treeparser01/JPTreeParser.g
- org/prorefactor/treeparser01/expandedtreeparser01.g

Out of those only the first one seems to be used in unit test scripts.

Adding new keyword usually require:
1. add the keyword to com/joanju/proparse/BaseTokenTypes.txt (also increment Last_Token_Number)
2. add the keyword in com/joanju/proparse/NodeTypes.java (there is a long list in the static constructor)
3. depending on keyword type the grammar file might need to be updated
- SYSTEM HANDLE (SYSHDL), add the keyword on 'systemhandlename' rule
- FUNCTIONS (MAY_BE_REGULAR_FUNC or MAY_BE_NO_ARG_FUNC), add it to one of the following rules: 'builtinfunc', 'argfunc', 'recordfunc', 'noargfunc'

## Building the DLLs

To build the dlls with the newer IKVM versions using proparse.csproj run the make_dotnet_msbuild target in build.xml:
`ant -f build.xml make_dotnet_msbuild`
It will build 3 versions of the dlls:
* win-x86
* win-x64
* linux-x64

They will be located in their respective folders under the output folder with zip files containing the dlls and dependencies in the output folder.
4 changes: 2 additions & 2 deletions build.number
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#Build Number for ANT. Do not edit!
#Fri Oct 31 12:57:57 CET 2025
build.number=7
#Tue Apr 07 11:44:22 CEST 2026
build.number=9
69 changes: 63 additions & 6 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@
<project name="jars" default="main">

<property name="message" value="Building proparse..."/>
<property name="core_xclds" value="**/*.g,**/*.smap,**/*.SF,**/*.launch,**/*.testsuite,**/*.deploy,**/*.location,**/*.execution,**/*.datapool,**/*.artifact,**/*.html,**/*.svg,**/*.groovy" />
<property name="core_xclds" value="**/*.g,**/*.smap,**/*.SF,**/*.launch,**/*.testsuite,**/*.deploy,**/*.location,**/*.execution,**/*.datapool,**/*.artifact,**/*.html,**/*.svg,**/*.groovy,Release/**" />
<property name="output.dir" value="${basedir}\output"/>
<property name="output.dir.x64" value="${output.dir}\x64"/>
<property name="output.dir.x86" value="${output.dir}\x86"/>
<property name="output.dir.netcore" value="${output.dir}\netcore"/>
<property name="package.zip.win-x64" value="${output.dir}\proparse.win-x64.zip"/>
<property name="package.zip.win-x86" value="${output.dir}\proparse.win-x86.zip"/>
<property name="package.zip.netcore" value="${output.dir}\proparse.netcore-linux-x64.zip"/>
<property name="ikvm.bin.dir" value="${basedir}\ikvmbin"/>

<target name="main" depends="makeproparsejar, makeproparsezip, make_dotnet">
<echo>
Expand All @@ -15,7 +23,7 @@

<tstamp/>
<buildnumber/>

<path id="build-classpath">
<fileset dir="lib">
<include name="*.jar"/>
Expand Down Expand Up @@ -47,7 +55,7 @@

</jar>
</target>


<target name="makeproparsezip">
<delete dir="prorefactor/projects/unittest/pubs" />
Expand All @@ -56,11 +64,11 @@
<zipfileset file="proparse.jar" prefix="proparse.java" />
<zipfileset file="build.number" prefix="proparse.java" />
</zip>
</target>
</target>


<target name="make_dotnet">
<exec executable="C:\Work\Proparse\Github\proparse\ikvmbin\ikvmc.exe" dir="." failonerror="true">
<exec executable="${ikvm.bin.dir}\ikvmc.exe" dir="." failonerror="true">
<arg line="-out:proparse.net.dll -version:4.2.0.${build.number} -keyfile:proparse.snk proparse.jar lib\*.jar"/>
</exec>
<delete dir="prorefactor/projects/unittest/pubs" />
Expand All @@ -70,7 +78,56 @@
<zipfileset file="ikvmbin/IKVM.Runtime.dll" prefix="proparse.assemblies" />
<zipfileset file="ikvmbin/IKVM.OpenJDK.Text.dll" prefix="proparse.assemblies" />
</zip>
</target>
</target>

<target name="make_dotnet_msbuild" depends="makeproparsejar">
<msbuild output="${output.dir.x64}" targetVersion="net472" runtime="win-x64"/>
<delete file="${package.zip.win-x64}"/>
<zip destfile="${package.zip.win-x64}">
<zipfileset dir="${output.dir.x64}"/>
</zip>
<msbuild output="${output.dir.x86}" targetVersion="net472" runtime="win-x86"/>
<delete file="${package.zip.win-x86}"/>
<zip destfile="${package.zip.win-x86}">
<zipfileset dir="${output.dir.x86}"/>
</zip>
<msbuild output="${output.dir.netcore}" targetVersion="net8.0" runtime="linux-x64" dotnetCommand="publish" selfContainedArg="" copyDependencies="true"/>
<delete file="${package.zip.netcore}"/>
<zip destfile="${package.zip.netcore}">
<zipfileset dir="${output.dir.netcore}"/>
</zip>
</target>

<macrodef name="msbuild">
<attribute name="version" default="${build.number}"/>
<attribute name="output" default="${output.dir}"/>
<!--https://github.com/ikvmnet/ikvm?tab=readme-ov-file#support-->
<!--https://learn.microsoft.com/en-us/dotnet/standard/frameworks-->
<attribute name="targetVersion" default="net472"/>
<!--https://learn.microsoft.com/en-us/dotnet/core/rid-catalog-->
<attribute name="runtime" default="any"/>
<!--q[uiet], m[inimal], n[ormal] (default), d[etailed], and diag[nostic]-->
<attribute name="verbose" default="n"/>
<attribute name="baseDir" default="${basedir}"/>
<attribute name="IkvmVersion" default="8.15.0"/>
<attribute name="dllFileName" default="proparse.net"/>
<attribute name="copyDependencies" default="true"/>
<attribute name="dotnetCommand" default="build"/>
<attribute name="selfContainedArg" default="--self-contained"/>
<sequential>
<exec executable="dotnet" dir="." failonerror="true">
<arg line=" restore --runtime @{runtime} -p:TargetFrameworks=@{targetVersion} -p:baseDir=@{baseDir} -p:IkvmVersion=@{IkvmVersion} -p:dllFileName=@{dllFileName} -p:CopyDependencies=@{copyDependencies} -p:VersionSuffix=@{version} -v @{verbose} @{baseDir}\proparse.csproj"/>
</exec>
<exec executable="dotnet" dir="." failonerror="true">
<arg line=" clean --output @{output} --framework @{targetVersion} -p:TargetFrameworks=@{targetVersion} -p:baseDir=@{baseDir} -p:IkvmVersion=@{IkvmVersion} -p:dllFileName=@{dllFileName} -p:CopyDependencies=@{copyDependencies} -p:VersionSuffix=@{version} --runtime @{runtime} -v @{verbose} @{baseDir}\proparse.csproj"/>
</exec>
<exec executable="dotnet" dir="." failonerror="true">
<arg line=" @{dotnetCommand} --output @{output} @{selfContainedArg} --framework @{targetVersion} -p:TargetFrameworks=@{targetVersion} -p:baseDir=@{baseDir} -p:IkvmVersion=@{IkvmVersion} -p:dllFileName=@{dllFileName} -p:CopyDependencies=@{copyDependencies} -p:VersionSuffix=@{version} --runtime @{runtime} -v @{verbose} @{baseDir}\proparse.csproj"/>
</exec>
<delete file="@{output}\proparse.dll"/>
<delete file="@{output}\proparse.pdb"/>
<delete dir="${basedir}\obj"/>
</sequential>
</macrodef>

</project>
Binary file added output/netcore/IKVM.ByteCode.dll
Binary file not shown.
Binary file added output/netcore/IKVM.CoreLib.dll
Binary file not shown.
Binary file added output/netcore/IKVM.Java.dll
Binary file not shown.
Binary file added output/netcore/IKVM.Runtime.dll
Binary file not shown.
Binary file not shown.
Binary file added output/netcore/System.Data.Odbc.dll
Binary file not shown.
1 change: 1 addition & 0 deletions output/netcore/ikvm.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ikvm.home.root=ikvm
Loading