Definition
switch_stm : switch ( exp ) { case_list default : stm }
Purpose
A switch statement allows a more efficient way of selecting an action based on discrete values. The case for a given value of exp is executed, or the default case is executed if none exists. If a case does contains a break_stm, that ends its execution. Otherwise, execution will continue to the next case. This permits the same handler to apply to multiple cases.
Semantics
The exp must be of an integer type.