RHODES UNIVERSITY


June Examinations - 2014


Computer Science 301 - Programming Language Translation

Examiners:                               Time: 4 hours
   Prof P.D. Terry                       Marks: 180
   Prof P. Blignault                     Venue: Hamilton Laboratory

A copy of this document is available on the course web page. That copy will contain any last minute alterations, so make sure you study it closer to the time.


Rules and information (Last updated 2014/05/26)


Section B - Practically oriented questions [85 / 180]

You will receive material relating to Section B at 08h00 on Sunday 22 June, the day before the examination. No details will be given until then, but it is safe to assume that Section B will comprise a set of tasks that you could answer in a laboratory situation, similar in complexity and content to exercises you have done this year.

This year you will receive a challenging problem at 08h00 and be encouraged to develop a solution. Later in the day you will receive further hints as to how this problem should be solved (by then you might have worked this out for yourselves, of course). You will be encouraged to study the problem and the hints in detail, because during the examination on Monday you will be set further questions relating to the system - for example, asked to extend the system in certain ways. It is my hope that if you have really understood the material on Sunday, these questions will have solutions that come readily to mind, but of course you will have to answer these on your own!

You might like to have a look at some old examinations on the Web Pages to see the sort of standard expected - but remember that old exam papers are "context sensitive", as they apply to a particular course at a particular time that covered material in slightly different ways to the course done this year.

The "24 hour" problems have all been designed so that everyone should have been able to produce at least the basic solution, with scope given for top students to demonstrate their understanding of the subtler points of parsing, scanning and compiling. Each year I have been astounded at the quality of some of the solutions received, and I trust that this year will be no exception.

Please note that there will be no obligation to produce machine-readable solutions in the examination (in fact doing so is quite a risky thing, if things go wrong for you, or if you cannot type quickly). The tools will be provided before the examination so that you can experiment in detail. If you feel confident, then you are free to produce a complete working solution to Section B during the examination. If you feel more confident writing out a neat detailed solution or extensive summary of the important parts of the solution, then that is quite acceptable. Many of the best solutions over the last few years have taken that form.


Examinable material

Please take note of the following summary of those sections of the textbook that are examinable. The complete (published) book has some sections that are not examinable.

   Chapter 1   -  All
   Chapter 2   -  All
   Chapter 3   -  All
   Chapter 4   -  All except 4.11 and 4.12
   Chapter 5   -  5.1 ... 5.9
   Chapter 6   -  6.1 ... 6.4
   Chapter 7   -  All
   Chapter 8   -  8.1 ... 8.8.  Sections 8.7 and 8.8 need not be known in detail, only the material that was
                   covered in practicals.
   Chapter 9   -  All
   Chapter 10  -  All, but only in the sense that there might be "practical" type questions that would require you
                   to develop or annotate a Cocol grammar, which by now you should be able to do, I hope.
   Chapter 11  -  11.5 describes the implementation of the Label class used in chapters 13 and 14.
   Chapter 12  -  All
   Chapter 13  -  13.1 ... 13.5
   Chapter 14  -  14.1 ... 14.5
   Chapter 15, 16  None


Cessation of Hostilities Party

It has become a long-standing tradition (now going back far longer than most of you have been alive) for the Terrys to host a party for those who manage to survive Professor Pat's Perilous Programming courses. By consensus it has been decided to delay this until after the final exams in November.


Definitions and Terminology

There are many terms that you should make sure you understand and can define succinctly.

To help you search for terms you don't know, I have temporarily put a PDF file of "the Book" at

http://www.scifac.ru.ac.za/csc301compilers.pdf

Please do not redistribute this copy further, as it actually infringing copyright to do so.


  Abstract syntax tree (AST)                Optimizing compilers
  Alphabet                                  Orthogonality
  Ambiguity                                 Overflow
  Analytic phase                            Phrase structure
  Attribute                                 Portability
  Back end                                  Postfix notation
  Backpatching                              Pragma
  Backtracking                              Precedence
  BNF                                       Produces directly
  Character handler                         Productions
  Closure                                   Program counter
  Cocol                                     Pseudo-code
  Code generation                           Range checks
  Compile-time                              Regular expression
  Constraint analysis                       Regular grammar
  Context condition                         Reverse Polish Notation
  Cycle-free grammar                        Run-time
  Dangling else                             Scanner
  Decompiler                                Scope
  Decorated tree                            Self-embedding
  Defining occurrence                       Semantic action
  Dereferencing                             Semantic attributes
  Dynamic semantics                         Semantically driven parser
  EBNF                                      Semantic error detection
  Emulator                                  Semantic overtones
  Environment                               Semantics
  Fetch-execute cycle                       Sentence
  FIRST function and sets                   Sentential form
  FOLLOW function and sets                  Source handling
  Frame file                                Source language
  Front end                                 Stack frame
  Goal symbol                               Stack pointer
  Grammar                                   Start symbol
  High-level translator                     State diagram
  Host language                             State variable
  Instruction set                           Static semantics
  Intermediate code                         Symbol
  Interpreter                               Symbol table
  JIT compilation                           Syntactic class
  Keywords                                  Syntax
  Kleene closure                            Syntax directed translation
  Language                                  Systems program
  Lexeme                                    T-diagram
  Lexical analyser                          Table-driven algorithm
  Lexicon                                   Target language
  LL(1) conflict resolution                 Terminal start sets
  LL(1) restrictions                        Terminal successors
  LL(k) parsing                             Token
  Macro assembler                           Top-down parsing
  Native code                               Type checking
  Non-terminal                              Vocabulary
  Null production                           Weak separator
  Nullable                                  Weak terminal
  Object language                           Zero address instruction


Home  © P.D. Terry