News for hackers. Stuff that matters.

Ask HN: Writing parsers that run in multiple languages

I wrote a sort of natural language parser for electronic component descriptions [1] and am interested in porting it to multiple languages. I have a way to port it to Python but the solution involves translating JS to Python using Js2Py which is quite ugly and probably a bit brittle.

I want to re-implement it, and define the grammar in EBNF (or similar) but have it run in multiple languages. I am especially interested in JS, Python, Go and Java but as many languages as possible would be good. Is there a parser generator that can do that?

[1]: https://monostable.github.io/electro-grammar

( 2 comments | 2 points | on HN )
Re:Ask HN: Writing parsers that run in multiple languages by bd82 on Sunday December 31, 2017 @02:48PM (#16042434)
Perhaps Antlr?
Re:Ask HN: Writing parsers that run in multiple languages by kasbah on Monday January 01, 2018 @02:54PM (#16047692)
Thanks for your answer. I'll look into it though I haven't met anyone that has used Antlr and was happy with it.