Perhaps a job for Ragel, if it supports binary grammars?
Perhaps a job for Ragel, if it supports binary grammars?