Answers to Self-Study Questions

Test Yourself #1

The new production is: stmt WHILE LPAREN bexp RPAREN stmt


Test Yourself #2

Question 1: stmt => if ( bexp ) stmt => if ( ! bexp ) stmt => if ( ! true ) stmt => if ( ! true ) ID = bexp ; => if ( ! true ) ID = false ;

This derivation is a leftmost derivation.

Question 2: