Home

Awesome

jParser

Build Build Sonatype Nexus (Snapshots) Static Badge

jParser is a small Java library that helps bind C/C++ code to desktop, mobile, and the web, allowing it to be written inline with Java source code.

It was inspired by gdx-jnigen that you add a native code into a code block. This code block will be translated to the specific code target. You can add multiple code block targets in the same java source. For each code target, it will generate a new java source code.

For the web, it needs emscripten to generate a js/wasm file and teavm. The generated classes in teavm module use JSBody to communicate with javascript.

jParser only supports JNI and TEAVM code targets.

How it works

jParser has two part.

WebIDL

To improve even more the long hours of porting each method manually, jParser also has Emscripten WebIDL support. You create a webidl file, and it will generate binding code for JNI and teaVM. It's not 100%, but it will reduce the amount of work binding big libraries. You can check the example:lib module or gdx-imgui for a complete example.

It will create the exact same method as the webidl file. If C++ is case-sensitive as in ImGui, the Java methods will be also case-sensitive. <br> C/C++ attributes are converted to methods, it starts with 'set_' or 'get_'.

Libraries usisng jParser: <br>

Requirements:

mingw64

emscripten