help-flex
[Top][All Lists]
Advanced

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

Re: Locations suggest -- we're stupid


From: Hans Aberg
Subject: Re: Locations suggest -- we're stupid
Date: Fri, 4 Jan 2002 11:18:13 +0100

At 18:57 +0200 2002/01/03, Nikos Balkanas wrote:
>I am not sure I follow all the fuss.
>IMHO there is a reason why flex treats differently '\n' from everything
>else. Basically I think it is that we should do our own tracking. We can
>have the knowledge of tracking built into our patterns. This is much faster
>than having flex scan yytext for new lines.

I have used both variations, and keeping track of newlines while designing
the lexer is a bother, especially when the grammar is not known beforehand.
So if Flex can do that, it is a help.

If further Flex is slow in doing that, then I think one should try to
figure out why, and then successively remove that.

Even if that optimization is not done, with a Flex newline tracking devise
in hand, one can use that when developing the lexer, and the go in optimize
when the scanning grammar is completed.

  Hans Aberg





reply via email to

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