[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bison Grammar Rules : Refering to non-terminals semantic value
From: |
Thomas Lavergne |
Subject: |
Re: Bison Grammar Rules : Refering to non-terminals semantic value |
Date: |
Wed, 17 Dec 2003 18:25:45 +0100 |
Hans Aberg wrote:
>[Reply to Help-Bison.]
>At 18:02 +0100 2003/12/16, Thomas Lavergne wrote:
>
>
>>The basic problem is that I want to refer to the semantic value of a
>>non-terminal symbol from elsewhere than its own rule.
>>
>>
>
>You can't do that: You have to record the value in a global variable, which
>then can get accessed by other rules. Lookup tables and such fall into this
>category.
>
Thanks, I will use global variables and free them in a END :
{/*action*/} rule.
>>I read also about $0 and $-1 references, but it
>>does not seem to apply here, isn't it?
>>
>>
>
>Where did you read about this, i.e., in which version of Bison? Later
>versions are 1.75-1.875.
>
>
My version of Bison is 1.35, but I read this info in the Bison manual
(ps format) downloaded (yesterday) from the GNU bison site. This manual
is for Bison 1.35
Cheers
Thomas