[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: how to get left hand side symbol in action
From: |
Hans Åberg |
Subject: |
Re: how to get left hand side symbol in action |
Date: |
Mon, 6 May 2019 22:45:27 +0200 |
> On 6 May 2019, at 18:09, Akim Demaille <address@hidden> wrote:
>
>> Le 6 mai 2019 à 14:50, Hans Åberg <address@hidden> a écrit :
>>
>>
>>> On 6 May 2019, at 11:28, r0ller <address@hidden> wrote:
>>>
>>> Hi All,
>>>
>>> Is it possible in *any* way to get the left hand side symbol in an action
>>> of a rule? Say, I have:
>>>
>>> A : B C
>>> {<!-- -->
>>> std:cout<<"left hand side symbol is:"<<???
>>> };
>>>
>>> I tried to find it out myself and googled a lot but didn't find anything:(
>>
>> In the C++ parser, one can write:
>> std::cout << “LHS: " << yytname_[yylhs.type_get()] << std::endl;
>
> But it's an internal detail, there is no guarantee it won't change.
Right, so it might be a feature request for the longer term. Perhaps a
variation of $ and @ that gives access to the name, or the raw stack value in
case there are more stuff to access.
- Re: how to get left hand side symbol in action, (continued)
- Re: how to get left hand side symbol in action, Hans Åberg, 2019/05/06
- Re: how to get left hand side symbol in action,
Hans Åberg <=
- Re: how to get left hand side symbol in action, Akim Demaille, 2019/05/09
- Re: how to get left hand side symbol in action, Hans Åberg, 2019/05/09
- Re: how to get left hand side symbol in action, Christian Schoenebeck, 2019/05/09
- Re: how to get left hand side symbol in action, r0ller, 2019/05/09
- Re: how to get left hand side symbol in action, Akim Demaille, 2019/05/10
- Re: how to get left hand side symbol in action, Hans Åberg, 2019/05/10
- Re: how to get left hand side symbol in action, Derek Clegg, 2019/05/10
- Re: how to get left hand side symbol in action, Christian Schoenebeck, 2019/05/10
- Re: how to get left hand side symbol in action, Akim Demaille, 2019/05/10
- Re: how to get left hand side symbol in action, Derek Clegg, 2019/05/10