bison-patches
[Top][All Lists]
Advanced

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

Re: Locations in bison itself are wrong


From: Paul Eggert
Subject: Re: Locations in bison itself are wrong
Date: 03 Mar 2003 13:25:27 -0800
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.3

Akim Demaille <address@hidden> writes:

> Instead of a macro to set the fields of the initial location, I was
> thinking of having a reference value, as in the piece of patch above.
> But contrary to yyloc_default in GLR, the user would be able to
> override the value, including using the name of a variable which
> contents are set at runtime.

Sorry, I don't quite follow.  lalr1.cc has the leftmost location be an
argument to the constructor for the parser class.  But yacc.c doesn't
have the notion of parsers that are constructed, so we have to do it
differently in C somehow.  (Perhaps we should define a more
object-oriented API for C parsers, but that's a separate and bigger
subject.)

So, how would you have the user override the default value in yacc.c?
Would this be another %-directive?  If so, how would such a directive
affect other languages, and parsers other than yacc.c?

Surely whatever method is used to override the default, would have to
be done consistently with how the user defines the YYLLOC_DEFAULT and
YYLTYPE macros.  Were you thinking of deprecating those macros too?




reply via email to

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