Description
E.g. for user input validation in a front-end UI, it'd be valuable to parse and validate SPDX expressions directly in the front-end (typically JavaScript or TypeScript) code. While there is https://github.com/jslicense/spdx-expression-parse.js and related packages, they seem to not be well maintained, and are lacking several features / good error reporting as required by ORT-related projects.
So the idea is to turn ORT's own spdx-utils
project into a Kotlin Multiplatform Project (KMP) and transpile it to JavaScript plus TypeScript declaration files. However, this requires to get rid of any JVM-only dependencies first.
The most "problematic" JVM dependency probably is ANTLR. A solution could be to use https://github.com/Strumenta/antlr-kotlin, but maybe only do a one-time conversion of the SPDX grammar (which has never been changed since its introduction) and commit the generated Kotlin files. Going forward, we'd manually maintain / adapt the generated code to our needs instead of dealing with ANTLR at all.