Creates a switch statement that dispatches on the expression.