3 ms·
> It also has the “dangling else” problem: God I hate this term because it's not even a problem. For a human reader, it's pretty obvious that an "else" should
by Joker_vD 4y ago
> It also has the “dangling else” problem:
God I hate this term because it's not even a problem. For a human reader, it's pretty obvious that an "else" should belong to the closest "if"; and it's quite difficult to write a mechanical parser that would match "else" with the furthest "if" instead. So what is, exactly, the problem? That the grammar is technically ambiguous? Who cares? The authors of LR-generators? They don't, they have been resolving shift-reduce conflicts by default in favour of shifting for half a century already.