bnfc

Generate parsers and lexers from BNF grammar specifications.

brewmacoslinux
Try with needOr install directly
Source

About

BNF Converter

Commands

bnfc

Examples

generate a parser from a grammar file$ bnfc -m MyGrammar.cf
create Haskell code from a context-free grammar$ bnfc -d MyGrammar.cf
generate Java parser and lexer from grammar$ bnfc -fjava MyGrammar.cf
create C++ implementation from BNF specification$ bnfc -fcpp MyGrammar.cf
generate parser code and show available language targets$ bnfc --help