[Top][All Lists]

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

Re: why are locations dictated by bison?

From: Hans Aberg
Subject: Re: why are locations dictated by bison?
Date: Thu, 17 Jan 2002 15:48:57 +0100

At 22:28 -0500 2002/01/16, Bruce Lilly wrote:
>> thus freeing up the values 0 as well, but I am not sure one can do so: I
>> think the Bison manual does not tell that the parser actually accepts all
>> <= 0 values,  and does not mention the YYEOF macro, but instead says that
>> the lexer should return 0 at the end. So a change will probably break some
>> code.
>The lexical analyzer returns 0 at end of input for
>compatibility with lex (which explicitly did not
>handle ASCII NUL input).

One idea presented on the Bison lists is that Bison have two modes, one
YACC compatible, and another Bison mode that better addresses the need of
modern parser generators (which is what it already has, but one might push
it more systematically).

If now Bison and Flex might be tuned together, could not the Flex lexer have
#ifndef YYEOF
#define YYEOF
and return YYEOF instead? Then Bison x.tab.h file should define this macro,
and the manuals should in future say to return YYEOF instead of 0.

Then in the future, the Bison mode might define YYEOF to -1, whereas in the
Yacc/Lex mode it would always be defined to 0.

  Hans Aberg

reply via email to

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