runtimeverification / k

K Framework Tools 7.0
BSD 3-Clause "New" or "Revised" License
452 stars 150 forks source link

Migration away from JavaCC #3752

Open dwightguth opened 1 year ago

dwightguth commented 1 year ago

Right now most of our parser generator needs that are associated with Java projects go through JavaCC: https://github.com/javacc/javacc

JavaCC does not support Java 8 syntax in actions, let alone Java 11, Java 14, or Java 17: https://github.com/javacc/javacc/issues/258

This is increasingly becoming an issue. It doesn't appear that the maintainers of JavaCC have any interest in updating it, and I have now been repeatedly frustrated by the limitations of the grammar of JavaCC rejecting valid Java code.

The issue I linked refers us to this project: https://parsers.org/

This is worth a try, but it also ignores the elephant in the room: ANTLR

We should investigate migrating away from JavaCC so as to not have to deal with the problems associated with it not being actively maintained.

dwightguth commented 1 year ago

One major component that needs to be investigated as part of this task is the IDE integration associated with any particular replacement. Ideally the replacement would have the following features:

  1. Actively maintained so that it works with new versions of Java upon release.
  2. Tight integration with IntelliJ IDE. Ideally we should be able to apply code refactorings to manually written code that appears inside parser actions and classes.
Baltoli commented 1 year ago

There is another dependency that might be an issue - the Markdown selector parser + JJTree reports @radumereuta

Baltoli commented 1 year ago

We can fix this to make parser development less frustrating; not an urgent issue.