# COMS W4115

Programming Languages and Translators

Lecture 14: Midterm Review

March 11, 2013

## 1. What you should know for the midterm

- The different kinds of programming languages
- The fundamental elements of programming languages
- Language processing tools
- The structure of a compiler
- Lecture 3, ALSU Chs. 1 and 2

- Regular languages, regular expressions, finite automata
- Lectures 4 and 5, ALSU Ch. 3 except for Sect. 3.9

- Lexical analysis
- Lectures 4 and 5, ALSU Chs. 2 and 3 except for Sect. 3.9

- Context-free languages and grammars
- Lectures 6 and 7, ALSU Ch. 4 except for Sect. 4.7

- Top-down parsing
- Lecture 9, ALSU Chs. 2 and 4 except for Sect. 4.7

- Bottom-up parsing
- Lectures 10 and 11, ALSU Ch. 4 except for Sect. 4.7

- Syntax-directed translation
- Lectures 12 and 13, ALSU Chs. 2 and Ch. 5 except for Sect. 5.5

## 2. Automata and Language Theory Review

- Regular languages
- Finite automata
- Regular expressions
- Closure properties of regular languages
- Decision properties of regular languages
- Pumping lemma for regular languages and its uses

- Context-free languages
- Context-free grammars
- Parse trees, derivations, and ambiguity
- Pushdown automata and deterministic pushdown automata
- Closure properties of CFLs
- Decision properties of CFLs
- Pumping lemma for CFLs and its uses

- Syntax-directed translation
- Syntax-directed definitions and translation schemes
- Attribute grammars, inherited and synthesized attributes
- S-attributed and L-attributed SDDs

## 3. Not all LL(1) grammars are SLR(1) and vice versa

- An LL(1) grammar that is not SLR(1)

```
S → AaAb | BbBa
A → ε
B → ε
```

An SLR(1) grammar that is not LL(1)
```
S → SA | A
A → a
```

aho@cs.columbia.edu