I have a yacc grammar that I want to convert to ANTLR. Is there any Bison to
ANTLR converter available? Can someone help?
Thanks, Prasanth
Yes, this stuff is still used.
Bison originated as a workalike of a program called Yacc — Yet Another Compiler Compiler. 9. Yacc was written at Bell Labs as part of the very early development of Unix; one of its first uses was to develop the original Portable C Compiler, pcc. The same person, Steven C. Johnson, wrote Yacc and the original pcc.
ANTLR (ANother Tool for Language Recognition) is a powerful parser generator for reading, processing, executing, or translating structured text or binary files.
ANTLR (ANother Tool for Language Recognition) is a tool for processing structured text. It does this by giving us access to language processing primitives like lexers, grammars, and parsers as well as the runtime to process text against them. It's often used to build tools and frameworks.
Let's compare these parser generators:
LL and LALR are incompatible:
The LALR(k) parsers are incomparable with LL(k) parsers: for any j and k both greater than 0, there are LALR(j) grammars that are not LL(k) grammars and conversely. In fact, it is undecidable whether a given LL(1) grammar is LALR(k) for any k > 0.
GLR is a variant of LR. An LR parser is a bottop-up parser, while an LL parser is a top-down parser. Those are fundamentally different parsing strategies.
Conclusion: you won't find any reliable automatic converter any time soon.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With