Feedback Give the activation tree 

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

Do we display the procedure activation tree or the parse tree corresponding to our grammar from 2.1? They have the same shape, but they are conceptually different things.
Good point. For definiteness, let's do the activation tree. You may want to sketch both for your own purposes, in order to understand question 3.

I don't know where the input string is, or what the variable "lookahead" is. It seems to me that the function main() will supply declarations and meanings for these variables
The basic idea is to assume that M and main manipulate the input and the lookahead variable so that the program checks whether these parentheses are balanced. For that purpose, main must initialize lookahead to the first thing in the input. M(c) must advance the input across an instance of the character c, and refresh lookahead to the next character in the input, after the instance of c that we just passed. When main or M encounters a character that doesn't make sense, or a premature end of the input, they presumably issue some sort of error message.

I noticed an inaccuracy in the statement of the problem, which I will address in a separate message.




Mike O'D.


Messages

to: "Give the activation tree"