|
|
|||||||||||||||
|
|
A PostScript InterpreterLast time I asked you to sketch the implementation of a PostScript interpreter in pseudo-code and diagrams, and taking into account the handling of
I asked that you pay attention to what you might not understand well enough to describe well and to see if you noticed anything about interpretation of PS that could not be handled by the mechanisms described so far. The primary misunderstandings had to do with distinguishing between dictionaries and dictionary entries, with distinguishing between the behavior of code and non-code values as the values of names in dictionaries, and the rules for looking up names.
Finally, although we have talked about calling code as a subroutine and it seems natural enough, we discover that the PS abstract machine as we had previously described does not have a mechanism for keeping track of where we are executing in multiple code blocks. Thus we need to include in the AM an execution stack that maintains the execution point in each active code block so we can return to it when we finish executing a routine that has been called. Calling a code block can also be modelled as copying that code block to the point of the call. (Illustrate the above using the fact function.) Go over the last problem on HW1 using all of the above to follow the
behavior of a PS interpreter and answer the questions.
|
||||||||||||||
| (c) 2003 Curtis Dyreson, (c) 2004, 2005 Carl H. Hauser E-mail questions or comments to Prof. Carl Hauser | ||||||||||||||||