[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 15:32:46 +0200 |
> On 6 May 2019, at 15:21, uxio prego <address@hidden> wrote:
>
>> On 6 May 2019, at 14:50, Hans Åberg <address@hidden> wrote:
>>
>>> On 6 May 2019, at 11:28, r0ller <address@hidden> wrote:
>>>
>>> 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:"<<???
>>> };
>>
>> In the C++ parser, one can write:
>> std::cout << “LHS: " << yytname_[yylhs.type_get()] << std::endl;
>>
>> Used for debugging, perhaps there is a more reliable macro.
>
> Thanks for the hint.
> Do you mean you know that it won’t work in a C parser or yacc compatibility?
It probably has a similar thing there. Check in the generated parser.
- how to get left hand side symbol in action, r0ller, 2019/05/06
- Re: how to get left hand side symbol in action, Giacinto Cifelli, 2019/05/06
- 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, 2019/05/06
- 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