TC-1/2-Lexer Goals
Things to learn during this sub-stage that you should remember:
- Basic C++ classes
The classes
Location(i.e.,parse::position,parse::location, etc.) and theiroperators provide a good start to study foreign C++ classes.- Writing and debugging a scanner
Learn to use RE/flex, see RE/flex & Bison.
- Location Tracking
Understand how to track the location and update it, within the scanner.
- Implementation of a few simple C++ classes
The code for
misc::symbolandmisc::uniqueis incomplete.- A first standard container:
std::set The implementation of the
misc::uniqueclass relies onstd::set.- The Flyweight design pattern
The
misc::uniqueclass is an implementation of the Flyweight design pattern.