Replies: 3 comments 3 replies
-
No. Somebody suggested the similar feature some time ago: #1045 (comment) |
Beta Was this translation helpful? Give feedback.
-
You can do this easily right now by preprocessing with a few tree rewrites with Trash. You'd have to create a syntax that fits the
Voila. You have an Antlr grammar per target of choice. Really, we should not be using Antlr visitors and listeners. Way too slow. At some point, you have to decide whether these little extensions are worth the effort of adding code into the Antlr parser generator itself, vs creating an extension that can be refactored into Antlr code. |
Beta Was this translation helpful? Give feedback.
-
I devised a simpler workaround, I need only Java and C# to be generated:
That is pure, standard Java but C# has no Now that generated code above compiles fine for Java and C#. |
Beta Was this translation helpful? Give feedback.
-
Does the Antlr4 grammar allow me to specify
lexer
orparser
code on a per-language basis?e.g., consider:
Is there any way to do this:
and
or something like that?
Beta Was this translation helpful? Give feedback.
All reactions