Laurence Finston wrote: > On Thu, 10 Mar 2005, Volker Wegert wrote: > > > I'm currently trying to gain some experience with flex and bison. > > I've found that I prefer using Flex and Bison separately rather than > together. If you're just starting out learning Bison, I think you > might find it easier to write your own `yylex()' function rather than > using Flex.
Actually why? For lexing identifiers, numbers, the usual stuff, it's one line in flex, and loops, sometimes switches and manual loop-ahead in C. And for similar-beginning tokens (e.g. `&', `&&', `&=' in C), IMHO it gets more readable in flex (one entry per item, can be group topically -- arithmetics, comparisons, ...) than in manual code (where they have to be handled together after reading the first `&'). I recently converted a complex lexer from manual to flex, and though I added some more special cases etc., the resulting flex code was shorter and more readable. So I'm interested why you find the manual way easier. Frank -- Frank Heckenbach, [EMAIL PROTECTED] http://fjf.gnu.de/ GnuPG and PGP keys: http://fjf.gnu.de/plan (7977168E) _______________________________________________ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison