tags:

views:

759

answers:

4

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?

A: 

I generally toggle between Makefile mode, text mode, and C mode depending on which line I am on. If you want better, you should write the mode!

vy32
I don't know Emacs lisp so I can't do that.
Kinopiko
Good time to learn.
vy32
+1  A: 

Looks like Matz (of Ruby fame) wrote a yacc(/bison) mode. Have a look at http://www.rubyist.net/~matz/a/yacc.el

VoidPointer
+2  A: 

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.sunet.se/pub/gnu/emacs-lisp/incoming/bison-mode.el

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.

chollida