[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Locations suggest
From: |
Hans Aberg |
Subject: |
Re: Locations suggest |
Date: |
Fri, 4 Jan 2002 11:13:45 +0100 |
At 17:25 -0800 2002/01/03, John W. Millaway wrote:
>> The idea was otherwise just that if the file C/C++ file structure already
>> keeps track of the position, one can use that, and compute the column
>> number from that. This might be faster than trying to keep track of the
>> column number.
>
>Probably the same speed. This:
>
> col = ftell(yyin) - last_newline;
>
>compared to this:
>
> col = last_column + last_yyleng;
>
>The benefit of the second one is that it works for string buffers without
>conditional code.
My point was only: How do you compute the column numbers? Do you have a
variable that is set to zero whenever a newline is seen, and then
incremented for every character. If so, one may avoid doing that by
recording the position numbers of the newlines only, and compute the
difference at need.
Hans Aberg
- Re: Locations suggest, (continued)
- Re: Locations suggest, Hans Aberg, 2002/01/07
- Re: Locations suggest, Hans Aberg, 2002/01/07
- Re: Locations suggest, Akim Demaille, 2002/01/07
- Re: Locations suggest, Hans Aberg, 2002/01/07
- Re: Locations suggest, Akim Demaille, 2002/01/09
- Re: Locations suggest, Hans Aberg, 2002/01/09
Re: Locations suggest, Hans Aberg, 2002/01/03
Re: Locations suggest -- we're stupid, John W. Millaway, 2002/01/03
Re: Locations suggest -- we're stupid, Nikos Balkanas, 2002/01/03
Re: Locations suggest -- we're stupid, Hans Aberg, 2002/01/04
Re: Locations suggest -- we're stupid, Hans-Bernhard Broeker, 2002/01/04
Mystery: Why does yylineno cause backing up tables?, John W. Millaway, 2002/01/04
Re: Mystery: Why does yylineno cause backing up tables?, Hans Aberg, 2002/01/04
Re: Mystery: Why does yylineno cause backing up tables?, John W. Millaway, 2002/01/04
Re: Locations suggest -- we're stupid, Nikos Balkanas, 2002/01/07
Re: Locations suggest -- we're stupid, Hans Aberg, 2002/01/07
Re: Locations suggest -- we're stupid, Nikos Balkanas, 2002/01/07