help-flex
[Top][All Lists]
Advanced

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

Re: Mystery: Why does yylineno cause backing up tables?


From: Hans Aberg
Subject: Re: Mystery: Why does yylineno cause backing up tables?
Date: Mon, 7 Jan 2002 18:38:23 +0100

At 09:16 -0800 2002/01/07, Vern Paxson wrote:
>> So what is your hunch, would it be acceptable to simply zip out the
>> reject_really_used = true requiremenet and see what happens?
>
>Yes, I think that's worth trying.

OK.

Personally, I do not see that from the theoretical point of view would be
much of an issue to implement efficient location tracking into Flex,
because what it essentially barks down to is to keep track of (line number,
stream position number) pairs. The stream position number can always be
kept track of by recording it before characters is read into the lexer
buffer. The line number can only be found by scanning.

Now, in as much as Flex generates deterministic code, it is easy to keep
track of the line number. In non-deterministic code, one needs to keep
track of the potential branching points, and record the line number at
those points. The same thing applies to pointers to the line beginnings, if
that is needed.

That should be it.

  Hans Aberg





reply via email to

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