In order to translate a switch-statement into a sequence of case-statements as in Fig. 6.51, the translator needs to create the list of value-label pairs, as it processes the source code for the switch. We can do so, using an additional translation that accumulates just the pairs. Sketch a syntax -direction definition that produces the list of pairs, while also emitting code for the statements Si that are the actions for each case.
Fig. 6.51
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here