Programming Languages and Compilers

 

SPO EXAM, spring 2004

 

The exam is oral and without preparation. Each student will have a 20-minute session. The student will draw a question and give a short presentation about the subject in the first part of the session, max 10 minutes. In the second part of the session there will be a discussion between the student, lecturer and examiner.

Many subjects are rather broad, so it is your responsibility to select parts of the subject that you consider to be most relevant.

For each question there will be a set of slides available that you can choose to use for your presentation and subsequent discussion – note you do not need to use all the available slides.

You will not be allowed to use your own slides.

 

Note: You may choose to have your examination in Danish or English – just let us know which language at the beginning of the session.

Syllabus

 

Watt & Brown, chapter 1, 2, 3, 4, 5, 6, 7, 8, 9

 

Sebesta, chapter 1, 3.1-3.4, 4, 5, 6, 7, 8, 9, 10, 14.1

(Note that chapter 2, 3.5, 11, 12, 13, 15, 16 are not part of the syllabus)

 

Articles and web references used during the course are not considered part of the syllabus, but may serve you as background material for further elaboration.

 

Questions

 

  1. Language design issues
    1. Describe issues that influence the language design including

1.      Language paradigms

2.      Machine architecture

3.      Data representation

4.      Verbose vs. concise syntax

5.      Syntax vs. types

6.      Semantics

    1. Slides

 

  1. Sequence control and Subprogram Control

1.      Evaluation of expressions

2.      Explicit sequence control vs. structured sequence control

3.      Subprograms

4.      Parameter mechanisms

    1. Slides

 

  1. Structure of the compiler
    1. Describe the phases of the compiler and give an overall description of what the purpose of each phase is and how the phases interface

 

    1. Slides

 

 

  1. Lexical analysis
    1. Describe the role of the lexical analysis phase
    2. Describe regular expressions and finite automata

 

    1. Slides

 

 

  1. Parsing
    1. Describe the purpose of the parser
    2. Discuss top down vs. bottom up parsing
    3. Explain necessary conditions for construction of recursive decent parsers
    4. Discuss the construction of an RD parser from a grammar

 

    1. Slides

 

 

  1. Semantic Analysis
    1. Describe the purpose of the Semantic analysis phase
    2. Discuss Identification and type checking

 

    1. Slides

 

 

  1. Run-time organization
    1. Storage allocation strategies: static vs. dynamic
    2. Activation records (sometimes called frames)
    3. Parameter parsing

 

    1. Slides

 

 

  1. Heap allocation and Garbage Collection
    1. Why may we need heap allocation?
    2. Garbage collection strategies

 

    1. Slides

 

 

  1. Code Generation
    1. Describe the purpose of the code generator
    2. Code templates
    3. Back patching

 

    1. Slides

 

 

  1. Interpretation
    1. Iterative and Recursive interpreters
    2. Interpretive compilers
    3. Abstract machines

 

    1. Slides