|
PS Interpreter Issues
CptS 355 - Programming Language Design Washington State University |
|
A PostScript InterpreterSketch the implementation of a PostScript interpreter in pseudo-code and diagrams, and taking into account the handling of
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 usually have 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.) |
|