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.
- See the homework page for your sixth (and last) homework assignment.
- Read the following sections from our textbook, Sections 4.3, 4.4, 5.3, Pattern 14.
- The following zip file contain several Antlr grammars and tree grammars that demonstrate some of the standard techniques for writing Antlr actions using token and rule attributes.
- The following zip file contains an Antlr parser grammar and tree grammar for Language-2.
- The following zip file contains an Antlr parser grammar and tree grammar for an infix version of Language-2. The zip file also contains four "hand written" recursive descent parsers for this language. The goal of Antlr is to automate the writing of these kinds of parsers.
- Download Antlr and AntlrWorks.
- Download our textbook's source code.
- Download the Antlr Reference Manual's source code.
- Here are some Antlr tutorials.
- 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.
- Read the following explanation of static and dynamic scope for nested functions with non-local references.
-
- 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.
- See the homework page for your third homework assignment.
- The following zip file contains files that define a language that adds one new term to the previous language and fixes a limitation in that language.
- Read the following web page to see a "real world" discussion of the limitation that the last language deals with.
- 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.
- Here are a few examples of important, "real world" grammars.
- Tuesday, January 15.
- See the homework page for your first homework assignment.
- For today and Thursday, read Chapters 1 and 2 from our textbook.
- You have several options for buying the textbook. You can either purchase and download a digital version of the book from the publisher's web site
or you can buy a (new, used, or digital) copy of the book from Amazon.com (or any other source that you know of).
- The following zip file contains files that define a "language of binary trees". The first homework assignment is based on this example.
- The following zip file contains files that define a language of "binary expression trees". This language is a subset of the language of binary trees, but it is a subset to which we can attach meaning (semantics). In the zip file is an interpreter which assigns a meaning (in this case, a value) to each binary expression tree.
|
|