Related smells: Autogenerated Stovepipe, Alternative Classes with Different Interfaces, Repeated Conditionals
Traditionally grammar notations advertised to have a sequence combinator and a choice combinator as the ways to compose complex expressions from atomic symbols (terminals and nonterminals) [BNF]. Modern frameworks are more advanced and versatile, they feature several kinds of negation, conjunction, ordered choices, precede and follow restrictions, etc. However, there is none that explicitly provides an exclusive disjunction combinator [SAC-2012-Zaytsev], even though it was the original intent behind the choice: thus, a statement may be a conditional statement or a print statement, but not both at the same time. There is an entire research domain dedicated to disambiguation of grammars – that is, detecting when something intended as an exclusive choice, leads to several successful parses, only one of which must remain in the final tree [POPL-1973-AhoJU]. This smell is about such situations: it occurs whenever languages of alternative siblings overlap and create an ambiguity. Ambiguity detection and removal techniques can be powerful but not perfect, and the general case is undecidable because it requires decidability of language equivalence.