I have a number of packet formats that are bit-oriented. Rather than writing many fairly complex lexer by hand I am looking for a bit-level lexer generator, a bit-oriented version of flex/lex say. Obviously I could just write straight C, but I was wondering whether such a bit-level lexer generator exists. After a quick Google, I found a number of media decoders and such, however, I am not parsing media files, but network packets.
Alternatively is there a way to run flex in a bit-oriented made?