help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: problem linking program containing bison-generated parser


From: Frank Heckenbach
Subject: Re: problem linking program containing bison-generated parser
Date: Fri, 11 Mar 2005 13:45:33 +0100
User-agent: semail 20050101

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, address@hidden
http://fjf.gnu.de/
GnuPG and PGP keys: http://fjf.gnu.de/plan (7977168E)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]