Our work in this unit is to extend our languages to allow named variables and a second type of data, boolean true and false. This gives us an opportunity to dive into declared versus inferred types, compile-time or run-time type safety, and the importance of error messages.
From a language design standpoint, we will look at formal syntax specification via regular expressions and grammars, as a precise way to define the syntax of a language. Besides the clarity this gives us, we will also see that it allows us to use tools (sometimes) to automatically generate scanners and parsers for a language.
Implementation-wise, we will learn about the use of a basic global symbol table, and touch the surface of memory allocation.
Classes
- Class 2.1: Scanning (Monday 08 September)
- Class 2.2: Syntax analysis (scanner DFA and parse tree) (Wednesday 10 September)
- Class 2.3: Top-down and bottom-up parsing (Monday 15 September)
- Class 2.4: Using ANTLR and Maven (Wednesday 17 September)
- Class 2.5: Introducing the Scheme language (Monday 22 September)
- Class 2.6: Scheme practice (Wednesday 24 September)
- Class 2.7: Functional programming (Monday 29 September)
Homeworks
- HW 2.1 (due before class on Monday 15 September)
- HW 2.2 (due before class on Monday 22 September)
- HW 2.3 (due before class on Monday 29 September)
Labs
- Lab 2.1: Spec for StringBoolVar Language (due 23:59 on Tuesday 16 September)
- Lab 2.2: Interpreter for a StringBoolVar language (due 23:59 on Tuesday 23 September)
- Lab 2.3: Compiler for a StringBoolVar language (due 23:59 on Tuesday 30 September)