clj-antlr icon indicating copy to clipboard operation
clj-antlr copied to clipboard

ANLTR Alternative Labels support

Open talesa opened this issue 7 years ago • 3 comments

Hi!

It seems to me that at the moment there is no support for ANTLRv4 Alternative Labels in clj-antlr. Am I wrong? Is there any hope it will be introduced? If not, what would be the best way to introduce it in given the current structure of the library?

Best, Adam

talesa avatar Aug 15 '17 08:08 talesa

Hi @talesa. Sorry, but I don't know how alternative labels work, and I haven't worked on this in three years so... your guess is as good as mine. You're welcome to make a PR though! Happy to cut a new release for ya with that feature.

aphyr avatar Aug 15 '17 14:08 aphyr

I've got it to work, but it's a rather dirty hack for now. It's using a 'heavier' ParserInterpreter, so I'd expected to be slower, but I dunno how much slower. I've uploaded the code to my fork in case someone needs it, I'll try to find time later to integrate it better and do a pull request. Thanks!

talesa avatar Aug 17 '17 16:08 talesa

👍 on the need for this. I tried the fork and it works great! @talesa , if you have the time, I strongly encourage you to PR this. It is extremely useful.

delenius avatar Jan 28 '19 23:01 delenius