The code you write to traverse the syntax tree should not
be composed of a single procedure containing one big case
statement.
Instead, have distinct processing routines (with little
case statements) for each major class of nodes (i.e. statements,
expressions, ...).