In a nutshell it takes as input the formal specification of any text protocol in ABNF and generates the parser in C language for that grammar using lex/yacc.
XML C Parser Generator (xmlcpg) is a xml processor coupled with a flex/bison C parser generator. A DTD can be processed to build a specialized parser for the grammar.