context analysis: switch event.type and state

This makes event.type the outer switch statement and state the
inner switch statement in read_clause. The rationale for this
is to avoid repeating the cases in the different event.type
classes in the state transitions.