I have to edit lots of grammar files in .bnf format. Is there a mode for this in Emacs?
I\'ve looked at CEDET\'s semantic package, and it seems that it USED to have
To be more readable and findable as an answer, jmmcd answered his own question with the following. You can find more in the emacs Help > elisp > 23.2.6 Generic Modes.
"I put this in my .emacs and it seems to work."
(define-generic-mode 'bnf-mode
'("#")
nil
'(("^<.*?>" . 'font-lock-variable-name-face)
("<.*?>" . 'font-lock-keyword-face)
("::=" . 'font-lock-warning-face)
("\|" . 'font-lock-warning-face))
'("\\.bnf\\.pybnf\\'")
nil
"Major mode for BNF highlighting.")