Exam 2 Topics - Fall 2010
Updates: Last modified on
- 11/24/10: Removed (by striking out) two items under Scanners
- 12/1/10: Fixed numbering of topics (previously Chapter 5
and Python were under Chapter 4)
- Material:
- Chapter 4: Lexical Analysis
- Chapter 4: Names, Binding, Scope
- Python
- Chapter 4 (and possibly a little grammars from Chapter 3): Part 1 - Lexical Analysis
- Lexical vs syntactic: define each and describe relationship between
- Lexical analysis
- Tokens and lexemes - define, recognize in program
- Scanners:
- Describe what one does
- Describe (using English and pseudocode)
different approaches to building (ie hand written vs table driven)
-
Create or interpret a Regular
Grammars that describes lexical structure
- Create or interpret a State Diagram (aka finite automata or
finite state machine) that describes lexical structure
-
Create a table that implements a
state diagram and interpret a table
- Chapter 5: NAMES, BINDINGS, TYPE CHECKING, SCOPE
- Memory allocation and organization:
- flat vs 3 areas
- 3 areas
- lifetime
- alloc and dealloc
- aliases
- Identifiers: Issues
- Variables
- 6 characteristics: name, address, value, type, lifetime, scope
- how characteristics designed in common languages
- Bindings:
- concept, possible times, static vs dynamic,
- for all six characteristics
- early vs late binding
- Anonymous variables
- Values: l-value, r-value
- Lifetime: static, heap dynamic, ...
- History sensitive
- Pros and Cons
- Types
- strong typing: definition, value, common languages
- static vs dynamic typing
- type compatibility: name vs structure
- Scope
- definition
- nested and blocks
- static vs dynamic
- vs lifetime
- Constants: dynamic binding, degree of protection
- Initialization: def, when, number of times, default
- Python:
- basic syntax
- type model
- Sequences:
- Strings
- Tuples
- Lists (mutable)
- scalars
- list operations
- Dictionary
- Def functions
- scope