Related articles |
---|
YACC?? LEX?? akoolen@ihug.co.nz (Aaron Koolen) (1997-10-10) |
Re: YACC?? LEX?? smecucci@mbox.thunder.it (Silvio Mecucci) (1997-10-14) |
From: | Silvio Mecucci <smecucci@mbox.thunder.it> |
Newsgroups: | comp.compilers |
Date: | 14 Oct 1997 00:35:24 -0400 |
Organization: | Compilers Central |
References: | 97-10-059 |
Keywords: | yacc, lex |
Aaron Koolen wrote:
> I've had a brief look at some yacc docs and sample programs and they
> look rather complex and I dont know if the time to learn them would be
Well. As you said it just looks complex. Lex is really easy to use, if
you are familiar with extended regular expressions there is really few
new things to know about. Depending on the language you are triyng to
recognize and the way you wrote your grammar you may sometimes like to
integrate symbol tables with the code generated by this tools. But
even in this case is really simple.
> longer and the work involved more, as opposed to doing it by hand. So
At least you can rely on the fact that your code has no bug, exept
conceptual ones you can introduce writing your grammar.
> what I really want to know I suppose is - Does yacc and lex really
> help? What are there real advantages. If I learnt them, would
> producing other parsers/compilers etc in the future be a breeze?
The real advantages comes from yacc. You can write nearly all kind of
LR(1) grammars and have a parser able to recognize those. Doing it by
hand is not so easy. And as I told you before... you can rely on a bug
free code.
If you are concerned about performance.... as far as I know very few
people complain about this. I mean the code generated is
efficient. But if you want you can also try to modify it by
hand. More... there are many other programs which are yacc-equivalent,
you can try to find out if some of these has some particular
performance characteristic.
> Thanks a lot.
Hope this helps!
--
Silvio Mecucci, Dpt. of Chemistry, Columbia University
3000 Broadway, Mail Code 3153, New York, N.Y. 10027
Tel. +1 212 854 8402, 854 5143
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.