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 (Wednesday 09 September)
- Class 2.2: Syntax analysis (scanner DFA and parse tree) (Monday 14 September)
- Class 2.3: Top-down and bottom-up parsing (Wednesday 16 September)
- Class 2.4: Bottom-up parsing (Monday 21 September)
- Class 2.5: Using ANTLR and Maven (MEET IN LAB ROOM) (Wednesday 23 September)
- Class 2.6: Introducing the Scheme language (Monday 28 September)
- Class 2.7: Functional programming (Wednesday 30 September)
Homeworks
- HW 2.1 (due before class on Monday 14 September)
- HW 2.2 (due before class on Monday 21 September)
- HW 2.3 (due before class on Wednesday 30 September)
Labs
- Lab 2.1: Spec for StringBoolVar Language (due 23:59 on Wednesday 23 September)
- Lab 2.2: Interpreter for a StringBoolVar language (due 23:59 on Wednesday 30 September)
- Lab 2.3: Compiler for a StringBoolVar language (due 23:59 on Wednesday 07 October)