|Using Flex and Bison firstname.lastname@example.org (2005-10-23)|
|Re: Using Flex and Bison email@example.com (2005-10-26)|
|Re: Using Flex and Bison firstname.lastname@example.org (toby) (2005-10-26)|
|Re: Using Flex and Bison email@example.com (Girvo) (2005-10-27)|
|Re: Using Flex and Bison firstname.lastname@example.org (toby) (2005-10-29)|
|From:||email@example.com (Hans Aberg)|
|Date:||26 Oct 2005 14:26:01 -0400|
> I was just wondering, which way is the best to work on a compiler. Work
> on the Lex file first, then the YACC file, and compile? Or the other
> way round. I have read many tutorials, and some of the do it the other
> way to others.
Just compile the file you have edited, be it the .l or the .y
file. Often these two hangs together, so that they often need to be
edited together, so that both needs to be compiled. So might want
writing a "make" script to automate it.
> Also, does anyone know of a good tutorial that I could read, that will
> actually COMPILE! All of the ones I have read have needed MAJOR changes
> to even attempt to compile!
The book by Aho, Sethi & Ullman, "Compilers..." (the "Dragon book")
has a simple Lex/Yacc calculator example, which can easily be made
working with Flex/Bison. Play around with it. Look into the Bison
manual, which shows how to use operator precedents. Then just move
along, either by building or to more advanced examples.
[The examples from lex&yacc in the comp.compilers archive work. You
may have to remove -ll and -ly from the Makefiles if you have a modern
version of lex and yacc without the separate libraries. -John]
Return to the
Search the comp.compilers archives again.