Evaluate Cadaver Syntax Analyzer
Next: Learn about the
Up: Assignment 2: Syntax
Previous: Assignment 2: Syntax
Study the way syntax analysis is done in your Cadaver compiler and
relate it to the material discussed in class. Following are some
examples of issues that would be interesting to discuss. You should
add any others that you discover or that you think are relevant. The
purpose of these questions is to motivate you to understand details
about how the source language is handled, not just find out
(superficially) what category of parser is used.
-
What parsing method is used? If it is table-driven, what is the
table-building tool? Is the parser itself provided by the tool?
If it is hand-coded, is there any formal specification of the syntax
that is parsed?
-
Is there a clean interface between parser and semantics?
If so, how can you tell? If not, why not?
-
Does the parser use semantic information to make parsing decisions?
If so, explain how and why.
-
If the parser is LALR or full LR, are there some grammar situations
in which non-SLR lookahead is needed? Explain how you determined
that (no matter which way the answer goes). If yes, give at least
one example. If you can, show what the corresponding SLR grammar
would look like.
-
If the parser is hand-written, describe its organization. Does it
parse in a deterministic context free manner (i.e. does it mimic a
table-driven parser)? If so, explain what would be entailed in
replacing the parser with a Bison or Yacc parser. If not, explain
in what ways the programmed solution deviates from the equivalent
formal solution (e.g. give an example in which the programming
flexibility is exploited).
-
What is the design of the error handling? Is there evidence that it
is tuned to this source language? Give some examples, or explain
why not.
-
How robust is the compiler in the face of errors? How good are the
diagnostics? How did you determine that?
Next: Learn about the
Up: Assignment 2: Syntax
Previous: Assignment 2: Syntax
Reader Cs
Wed Sep 20 14:25:53 PDT 1995