2 ms·
Dangling "else" isn't actually a problem for parser generators. All you have to do is either: * use proper rules rather than cramming everything into "statemen
by o11c 1y ago
Dangling "else" isn't actually a problem for parser generators. All you have to do is either:
* use proper rules rather than cramming everything into "statement", or
* specify explicit precedence rules, which is just a shortcut for the above (also skipping useless reductions)
Doing this is ubiquitous with parser generators when dealing with vaguely Algol-like languages, and is no different than the fact that you have to do the same thing for expressions.