Feedback Look at the lecture notes for syntax 

Forum: U Chicago, Com Sci 221, autumn 2000
Re: News Take-home midterm exam, due 6 November (Mike O'Donnell)
Re: Question question about problem 3 (Michael C. Brizic)
Date: 2000, Nov 02
From: Mike O'Donnell <odonnell@cs.uchicago.edu>

we cannot determine how to represent if/then and while using abstract syntax trees
Figure 7 in my lecture notes on syntax shows an abstract syntax tree with both a while loop and an if. The textbook shows an if on page 33. Regarding the relationship between abstract syntax and flowchart, try drawing a flowchart for a small piece of a program (that is, a subtree of the abstract syntax tree), and then for the whole program. The flowchart for the small piece should appear as a part of the flowchart for the larger piece. The interesting phenomenon is the way that the parts of the flowchart correspond to the subtrees of the abstract syntax tree. One aspect of that correspondence is that separate subtrees of the abstract syntax tree correspond to disjoint parts of the flowchart. Nested subtrees correspond to two parts of the flowchart, one of them completely containing the other. Different subtrees of the abstract syntax tree never correspond to parts of the flowchart that overlap, except when one completely contains the other.

I don't know where to go from here without a more definite question. We can take up the question in class on Friday if you like.



Mike O'D.


to: "Look at the lecture notes for syntax"