help-bison
[Top][All Lists]
Advanced

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

Re: %destructor and unused values


From: John P. Hartmann
Subject: Re: %destructor and unused values
Date: Mon, 28 Jan 2013 18:14:35 +0100

Thank you for the clarification.  I see.

I guess I am handicapped by having converted the parser code to /360
assembler language.

Others might have studied the skeleton code.  Maybe a comment to the
effect that one should forget having seen this assignment?

On 28 January 2013 18:02, Akim Demaille <address@hidden> wrote:
>
> Le 28 janv. 2013 à 17:11, John P. Hartmann <address@hidden> a écrit :
>
>> On 28 January 2013 16:43, John P. Hartmann <address@hidden> wrote:
>>> But here is another one:
>>>
>>>               |  dotobyfors dotobyfor { listend($1, $2); }
>>>
>>> Gets "warning: unset value: $$".
>>>
>>> I'm relying on the default $$ = $1 here.
>>>
>>> Or is there something more subtle going on?  Or (shudder) is the
>>> default applied only when there is no explicit semantic code?  (In
>>> which case I have a lot of grammars to fix.)
>>
>> Adding $$ = $1 kept Bison quiet.
>>
>> Here is a variation that gets Unused value $1.
>>
>> assign         :  variable ASSIGN expression
>>                  {
>>                     $$->term.oper = op_assign;
>>
>> This is also fixed by stating the default action.
>>
>> Surely this is a bug (?).
>
> Actually, I prefer to leave this as is, instead of promoting
> the fact that $$ = $1 is run beforehand.  This is not true
> for all the configurations (where the warning is right),
> so I still prefer pushing the users towards explicitly
> perform their $$ = $1 themselves.
>
> Besides, you are not supposed to know that $$ = $1 is always
> run before.  The documentation should only state that if
> no action at all is provided, then this action defaults to
> { $$ = $1; }.
>



reply via email to

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