allbery@axcess.UUCP (Brandon S. Allbery) (01/15/88)
I am still looking for a yacc or bison major mode for GNU Emacs; C mode does things I don't like to yacc files. I have something hacked together currently, but I'm not an elisp hacker; it's rather ugly code and has some glitches in it. The code I have (attempts to) handle a yacc file as a file in one mode contain- ing sections in a second mode (c-mode); upon entry to yacc mode it narrows to a region bounded by the top of the file and the second %% token (or the whole file if there is no second %%). C code blocks, which I always indent relative to rule bodies, are hidden courtesy "selective-display" and "selective-display- ellipses"; inserting a { or typing C-C { when the cursor is positioned in front of such a block causes the buffer to be narrowed to the code block and C mode to be entered, wherein C-C C-C will resume yacc mode. Also, C-C C-N switches to c-mode after narrowing to the bottom third of a yacc file; again, C-C C-C returns. (Inserting a second %% token also does this.) Various things are configurable for the user's tastes. The unfortunate part is that the code glitches on occasion: in particular, doing the wrong thing around an ellipsis produces garbage in the file, and inserting the second %% ends up with THREE % characters in the file (after triggering on the FIRST % instead of the second -- program bug I haven't flushed out yet). It's very much unready for posting to the net, but it's better that what I've got now (my choice of c-mode or Jove). Anyway -- I would like either some suggestions as to a better way to do this or a complete ready-to-use yacc mode. Thanks in advance. -- ___ ________________, Brandon S. Allbery cbosgd \ ' \/ __ __, __, aXcess Company mandrill| __ | /__> <__ <__ 6615 Center St. #A1-105 !ncoast! / ` | \__. .__> .__> Mentor, OH 44060-4101 necntc | axcess!allbery \___/\________________. Moderator, comp.sources.misc hoptoad/