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:12:29 +0100

At 17:50 -0800 2002/01/03, John W. Millaway wrote:
>Damn we're stupid. Flex reads ahead on the input stream!! In most cases, ftell
>will report the same position for repeated calls, that position being far
>ahead
>of the curent token.

Flex will have to use ftell before it is doing the buffering: That is, when
the part the Flex generated scanner that is doing the buffering is seeing a
newline, it should record its position.

This will not help if one wants to get the position number for some other
position.

So one way around this might be that the buffer records the position number
of the first character in it (or rather, just before the first character is
read into the buffer, the position number of the buffer is recorded). Then
the Flex scanner can have its own position number function which computes
the position number of every character in the buffer.

  Hans Aberg





reply via email to

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