help-flex
[Top][All Lists]
Advanced

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

Re: Featuritism


From: Hans Aberg
Subject: Re: Featuritism
Date: Wed, 9 Jan 2002 20:28:11 +0100

At 15:02 +0100 2002/01/09, Akim Demaille wrote:
>In the wide range of possible definition of locations I forgot one
>important: some scanners include yytext (well, a copy, of course) in
>the position, so that when they output an error message, they also
>include the text of the error:
>
>~/src/gawk % gawk 'BEGIN {error+}'                               nostromo
>Err 1
>gawk: cmd. line:1: BEGIN {error+}
>gawk: cmd. line:1:              ^ parse error
>
>One such example is GNU AWK.  The scanner is written by hand and it
>keeps the whole current line, but the idea applies equally.

The suggestion I gave is that one gives the location as a semi-open [begin,
end) pair of yytext. Then just use then end or end-1 value to get that
effect.

  Hans Aberg





reply via email to

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