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?
Asked
Active
Viewed 8,695 times
4 Answers
7
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.

Vadim Kotov
- 8,084
- 8
- 48
- 62

chollida
- 7,834
- 11
- 55
- 85
4
Looks like Matz (of Ruby fame) wrote a yacc(/bison) mode. Have a look at http://www.rubyist.net/~matz/a/yacc.el

VoidPointer
- 17,651
- 15
- 54
- 58
0
How about this one?
http://borkware.com/quickies/single?id=73
or this one
http://www.cs.utah.edu/dept/old/texinfo/emacs19/emacs_26.html#SEC184

ant
- 22,634
- 36
- 132
- 182
-4
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
- 28,461
- 37
- 122
- 246
-
1
-
When you don't have an answer, why do you tell him to write it by himself? Seriously if I could down vote, I would. – Reza Hajianpour Feb 02 '16 at 18:11
-
It's open source software. If you don't like the way it works, you can fix it. That's the whole point of open source software. – vy32 Feb 03 '16 at 02:42
-