bnfc

Generates compilers and interpreters from BNF grammar specifications

brewmacoslinux
Try with needOr install directly
Source

About

BNF Converter

Commands

bnfc

Examples

Generate a Haskell compiler from a BNF grammar file$ bnfc -m MyGrammar.cf
Generate a Java parser and lexer from grammar$ bnfc -fjava MyLanguage.cf
Generate C++ code with a specified output directory$ bnfc -m -cpp -d output/ grammar.cf