The devel/bison port
bison-3.7.6 – GNU parser generator
"Bison" is a general-purpose parser generator that converts a grammar
description for an LALR(1) context-free grammar into a C program
to parse that grammar. Once you are proficient with Bison, you may
use it to develop a wide range of language parsers, from those used
in simple desk calculators to complex programming languages.
Bison is upward compatible with Yacc: all properly-written Yacc
grammars ought to work with Bison with no change. Anyone familiar
with Yacc should be able to use Bison with little trouble. You
need to be fluent in C programming in order to use Bison.