Warning Use Extended BNF/CFG in problem 2 

Forum: Com Sci 221, U Chicago, Autumn 2001, Old Classwork
Re: News Assignment #6 due Monday, 12 November (Mike O'Donnell)
Date: 2001, Nov 10
From: Mike O'Donnell <odonnell@cs.uchicago.edu>

In problem 2, in order to match the shape of the activation tree exactly, you need the "zero or more repetition" operator from Extended BNF, described on page 46 of the text. With a pure CFG or BNF, you can't exactly match the unbounded branching produced by the recursive calls in the for loop.

If you prefer, you may rewrite the parens procedure to eliminate the iteration, using additional recursion instead. Then you can match the activation trees exactly with a pure CFG or BNF. If you do this, show me your modified procedure so I'll know precisely what trees the derivations in your grammar must produce.




Mike O'D.


Messages

to: "Use Extended BNF/CFG in problem 2"