Code Examples and Reading Assignments

This page documents what we do in class. It contains Java programs that we will discuss in class, reading assignments from our textbook, simple homework exercises that you can work on for practice and exam preparation (not for credit), and links to other sources of information.

The reading assignments and practice problems are listed by the date on which they were assigned. The sample program files are listed by the date on which they were used. You can click on a .java link and see the source code. When you are viewing the source code, you can use your browser's "File -> Save As..." menu item to save a copy of the file on your computer.

  • Thursday, April 25.
    • Please take the time to respond to the following course evaluation survey. This is your chance to provide (anonymous) feedback about this course.
    • Read Chapter 3 of "The Definitive ANTLR Reference" for a good overview of how Antlr works. The primary Antlr reference material is Chapters 4 - 8 (pages 86 - 205) from "The Definitive ANTLR Reference".
    • The following zip file contains an example that demonstrates the kinds of things that can go wrong when you use a parser generator like Antlr.
    • The following zip file contains an Antlr parser grammar and tree grammar for Language-4.
    • The following zip file contains an Antlr parser grammar and tree grammar for an infix version of Language-4.
  • Tuesday, April 23.
  • Thursday, April 4.
    • The following zip file contains a C++ implementation of Language-11.
    • The following zip file contains files that define a language with first class nested functions with static scope.
  • Tuesday, March 26.
    • The following zip file contains files that define a language with nested functions, static scope, and function parameters.
  • Thursday, March 21.
    • See the homework page for your fifth homework assignment.
  • Thursday, March 7.
  • Thursday, February 28.
    • The following zip file contains files that define a language with nested functions with static scope (but the functions in this language are not first class).
    • Here is a brief guide to the languages that we have defined so far.
      • Language 1) Tree language
      • Language 2) Integer expressions
      • Language 3) add boolean expressions
      • Language 4) add global variables
      • Language 5) add local variables
      • Language 6) add assignment
      • Language 7) add global functions (with dynamic or static scope)
      • Language 8) add first class global functions (with dynamic or static scope)
      • Language 9) add nested (non first class) functions with dynamic scope
      • Language 10) change nested functions to static scope
  • Thursday, February 21.
    • See the homework page for your fourth homework assignment.
    • The following zip file contains files that define a language with nested functions with dynamic scope (but the functions in this language are not first class).
  • Thursday, February 14.
    • The following zip file contains files that define a language with first class functions.
  • Tuesday, February 12.
    • The following zip file contains files that define a language with global functions.
  • Thursday, February 7.
  • Tuesday, February 5.
    • Here is an interesting description of how a web browser works, written in terms of parsers, parse trees, and interpreters.
    • The following zip file contains files that define a language of "binary expressions with local variables and nested scopes". This language has exactly the same syntax as cs50200-Language-4. What changes is the semantics of the language.
  • Tuesday, January 29.
    • The following zip file contains files that define a language of "binary expressions with global variables". This language adds variables to the language cs50200-Language-3.
  • Tuesday, January 22.
    • See the homework page for your second homework assignment.
    • For Thursday, read Chapter 4, Sections 4.1-4.2 (pages 73-83) from our textbook.
    • The following zip file contains files that extend the language of binary expression trees by adding another data type to the language, boolean values. The second homework assignment is based on this and the previous language.
  • Thursday, January 17.
  • Tuesday, January 15.


Return to the CS 50200 home page.


compliments and criticisms