aphyr / clj-antlr

Clojure bindings for the ANTLR 4 parser
167 stars 32 forks source link

ANLTR Alternative Labels support #9

Open talesa opened 7 years ago

talesa commented 7 years ago

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

aphyr commented 7 years ago

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.

talesa commented 7 years ago

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!

delenius commented 5 years ago

👍 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.