Re: YACC, Bison, lex, flex Modes for emacs

kelley@phys.ocean.dal.ca (Dan Kelley)
17 May 1997 22:53:04 -0400

          From comp.compilers

Related articles
YACC, Bison, lex, flex Modes for emacs hampton@ksu.edu (Tom Hampton) (1997-05-08)
Re: YACC, Bison, lex, flex Modes for emacs sandro@lattice.latte.it (1997-05-13)
Re: YACC, Bison, lex, flex Modes for emacs dan@unitech.com (Dan Harkless) (1997-05-15)
Re: YACC, Bison, lex, flex Modes for emacs kelley@phys.ocean.dal.ca (1997-05-17)
| List of all articles for this month |
From: kelley@phys.ocean.dal.ca (Dan Kelley)
Newsgroups: comp.compilers
Date: 17 May 1997 22:53:04 -0400
Organization: ISINet, Nova Scotia
References: 97-05-122
Keywords: tools

Tom Hampton (hampton@ksu.edu) wrote:
: After searching for a mode for the above, I found bison-mode.el which
: many of you have probably found as inadequate as I did. I am


May I introduce a slight twist in the thread? I've found c++mode to
be fine for editing my bison scripts -- I manually tweak the yacc bits
but they are outnumbered by the c++ bits, so c++mode is sufficient for
me.


What I *really* would like, though, is a mode to let me navigate the
"output" file from bison. I am designing a grammar for a new
language, and am a learner at this, and so I have lots of shift/reduce
and other errors. It would be lovely to be able to easily navigate
back and forth, to figure out what the problems are. I realize that
yacc and various yacc-like tools make differing output, but a mode
specific to bison output might help lots of folks like me.


As an example, my output file looks like:
    State SS contains XX shift/reduce conflicts.
    ...
    state SS
    ...
    '<' [reduce using rule RR (RR_NAME)]


It would be great if, perhaps, pressing carriage-return (or TAB or
whatever) at the "[reduce" line would split the window and scroll the
text in the other window to rule number 'RR'. Similarly, it would be
great if the same action on the 'State SS' line would split the window
and scroll the other to the indicated state.


I normally work by splitting a window into 3 parts:
- error list near start of the file
- a given state
- a rule related to the given state


I then manually scroll (or search) to search through the errors. In
another window I'm editing the .y input file, and running bison
repeatedly.


Perhaps other readers have spent time doing this, and wished for a
less manual method of navigation, perhaps somewhat like the terrific
"compilation" sub-mode of the c++mode.


Unfortunately I am a very poor emacs programmer and have no idea how
to do such work.


Dan E. Kelley internet: mailto:Dan.Kelley@Dal.CA
Oceanography Department phone: (902)494-1694
Dalhousie University fax: (902)494-2885
Halifax, NS, CANADA, B3H 4J1 http://www.phys.ocean.dal.ca/~kelley
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.