Evaluate the Use of Attribution Methods in your Cadaver



next up previous
Next: About this document Up: Assignment 4: Attribute Grammars Previous: Write an Attribute

Evaluate the Use of Attribution Methods in your Cadaver

Sketch an attribute grammar, over an idealized abstract grammar, for doing the static semantic analysis done in your cadaver. What is needed here is the high-level design, not a specific grammar and rules. If you need to refer back to things you said in your solution to assignment 3, restate them briefly so that this document is self-contained.

More precisely:

  1. Describe the analysis (in English). If there isn't very much, i.e. if it's deferred to runtime, describe some analyses that could be added (what things are done, or could be done: name-resolution? type-checking? overloading-resolution? type-inference? use-analysis? What sort of error messages can be generated?)
  2. Sketch how the same task could be done in an attribute grammar. What attributes would be necessary? What form would the dependencies take?
  3. If you were to use remote attribution, what sort of remote dependencies would exist? In what order could operations be done?
  4. Would the result be L-AG? multi-sweep? or more complicated? Why?

Note: this question is based on a suggestion from John Boyland

Note from Allen: in previous assignments, many of you have gone to great lengths to avoid insulting my intelligence by providing unnecessary background on the source language of your compilers. Although I appreciate the implied faith in my abilities, actually it would be very helpful if you would include with your description enough information about the source language that someone - and I'm not naming names - completely unfamiliar with the language would be able to read your homework.



Reader Cs
Mon Oct 30 17:51:33 PST 1995