Replaces a switch statement with a series of if...else statements.