[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: how to solve this reduce/reduce conflict?
From: |
Hans Åberg |
Subject: |
Re: how to solve this reduce/reduce conflict? |
Date: |
Thu, 22 Sep 2022 09:53:39 +0200 |
> On 22 Sep 2022, at 08:30, Lukas Arsalan <cptarse-luke@yahoo.com> wrote:
>
> Hi,
>
> At 2022-09-22T07:08:55CEST Akim Demaille <akim@lrde.epita.fr> wrote:
>> This snippet is clearly ambiguous, since it allows two different parses of
>> -1, which -Wcex nicely showed.
>>
> yes. right.
>
>> If I were you, I would handle this in the scanner. IOW, the scanner should
>> be extended to support signed literals, and > process that initial `-`.
>>
> uhm... is that possible?
> e. g.:
> [1] -1 --> "num"
> [2] 1-2 --> "num" "-" "num"
> [3] (-1^-2) --> "(" "num" "^" "num" ")"
> [4] 1--2 --> "num" "-" "num"
> [5] 1---3 --> "num" "-" "-" "num"
> [6] 1-2^3 --> "num" "-" "num" "^" "num"
> I do not think that it is possible, to do that with regular expressions...
I think it is not possible, so therefore one expects -2⁴ to be parsed as -(2⁴).
- how to solve this reduce/reduce conflict?, Lukas Arsalan, 2022/09/21
- Re: how to solve this reduce/reduce conflict?, Akim Demaille, 2022/09/22
- Re: how to solve this reduce/reduce conflict?, Lukas Arsalan, 2022/09/22
- Re: how to solve this reduce/reduce conflict?,
Hans Åberg <=
- Re: how to solve this reduce/reduce conflict?, Lukas Arsalan, 2022/09/22
- Re: how to solve this reduce/reduce conflict?, Hans Åberg, 2022/09/22
- Re: how to solve this reduce/reduce conflict?, Lukas Arsalan, 2022/09/22
- Re: how to solve this reduce/reduce conflict?, Hans Åberg, 2022/09/22
- Re: how to solve this reduce/reduce conflict?, Derek Clegg, 2022/09/22
- Re: how to solve this reduce/reduce conflict?, Evan Lavelle, 2022/09/23
- Re: how to solve this reduce/reduce conflict?, AW, 2022/09/23
- Re: how to solve this reduce/reduce conflict?, lostbits, 2022/09/23