Is there a good Emacs mode or method for lex/flex/yacc/bison files?

emacs, lex, yacc

Solution

It's not entirely what you want but there is a very excelent Bison mode for Emacs.

http://www.emacswiki.org/emacs/BisonMode

This is a better link:

http://ftp.lip6.fr/pub/emacs/elisp-archive/incoming/bison-mode.el.gz

Since Yacc and bison are so closely related I don't find it lacking too much. Though I do most of my work with Antlr anymore.

Problem

Editing lex or yacc files with Emacs is a nuisance: if I use C mode the indenting goes wrong, and if I don't use C mode I can't use indenting. Does anyone have a trick, a method, or an editing mode to get around it?

Original source