Re: YACC/Lex

Michael Snyder
2006-10-09T18:14:28Z

On Mon, 2006-10-09 at 12:44 +0100, Rob Quill wrote:
> Hi,
>
> Is it ok to use code generated by YACC and/or Lex in GDB? If not, what
> alternatives are there?

First of all, the open source / gnu / fsf equivalents are byacc (bison),
and flex. Bison and byacc are two independent implementations of a
yacc equivalent. If I remember correctly, gdb will work with bison but
prefers byacc. I'm not sure if it will work with yacc itself any more.

If you cd to the gdb source directory and do "ls *.y", you will see
that there are existing (b)yacc parsers for ada, c, java, fortran,
pascal and modula-2, plus a few more. There's also a separate lexer
for ada, ada-lex.l.

Look at the makefile to see how these get built, and then if you want to
pursue it further, look at language.c and language.h.

Michael