Clone wiki

inf225public / glossary / Dangling else problem

[Alphabetical Index | Tag Index]

Dangling else problem

A common ambiguity in programming languages (particularly those with C-like syntax) in which an optional else clause may be interpreted as belonging to more than one if sentence. Usually resolved in favour of the closest if, often by an Implicit disambiguation rule (at least in non-generalised parsing).

[Wikipedia]

Updated