antlr4 icon indicating copy to clipboard operation
antlr4 copied to clipboard

[Feature Request] Enable In-Memory Code Generation in `Tool` Class

Open volodya-lombrozo opened this issue 11 months ago • 0 comments
trafficstars

It was mentioned several years ago in #3874 that the Tool class writes generated source code to the filesystem without an option to generate it in memory. I’ve encountered a similar issue several times already. Therefore, I have a few options: create a fork of ANTLR, develop a separate library, or contribute changes to ANTLR itself. While the first two options are feasible, it would be preferable to have this capability in the main repository.

I’ve seen responses related to attempts to mitigate this problem (#2774, #3924):

We really need to have a good reason to change something for fear we might break somebody's code that relies on the tool.

This is a valid point. However, one possible solution might be to add a new class that reuses Tool (or inherits from it).

Would these changes have a chance to be merged if we don’t modify any existing code and simply add new functionality? Or would this be a waste of time? If there is at least some chance, I can work on addressing this problem.

volodya-lombrozo avatar Dec 20 '24 15:12 volodya-lombrozo