Class 1: Introduction to Programming Languages
Slides - display version



Reading: Chapter 1 of PLP. (Most significant is Section 1.6.)

The First-Day Survey must be completed by the beginning of your lab this week. You can fill it out completely and turn it in then. Alternatively, if you visit the instructor's office before your lab, you only need to complete #2 and sign the back.

Due at the beginning of class on Friday, August 26:
  1. What role does the symbol table play in compilation? What information is stored in it?
  2. In the process of compilation, a program moves from source code to a token stream (scanning), to a parse tree (parsing), to an abstract syntax tree (semantic analysis), and finally to assembly language (code generation). For each of these four steps, explain whether that step is, in general, reversible.
  3. Give an example of Java code that generates each of the following:
    1. A syntax error detected by the scanner
    2. A syntax error detected by the parser
    3. A static semantic error, detected at compile-time
    4. A dynamic semantic error, detected at run-time