Replaces a switch statement with an equivalent series of if-else statements.