What to do with a dangling else
Chris Clark · ACM SIGPLAN Notices · 1999
In this second column on getting lexer and parser generators to do what you want, we are going to look at the problem of how to write grammars for if-then-else statements.This is another deceptively simple problem whose solutions reveal the nature and limitations of parsing technology.It is one of the cases where tension between writing a conflict free grammar and using a hack that works is the strongest.