Next: , Previous: , Up: TC-1   [Contents][Index]

4.3.4 TC-1 Code to Write

Be sure to read Flex and Bison documentations and tutorials, see Flex & Bison.

Include your own test suite in the tests directory, and hook it to make check.


The scanner must be completed to read strings, identifiers etc. and track locations.


The class TigerParser drives the lexing and parsing of input file. Its implementation in src/parse/ is incomplete.


The class misc::symbol keeps a single copy of identifiers, see lib/misc. Its implementation in lib/misc/symbol.hxx and lib/misc/ is incomplete. Note that running ‘make check’ in lib/misc exercises lib/misc/ having this unit test pass should be a goal by itself. As a matter of fact, unit tests were left to help you: once they pass successfully you may proceed to the rest of the compiler. misc::symbol’s implementation is based on misc::unique, a generic class implementing the Flyweight design pattern. The definition of this class, lib/misc/unique.hxx, is also to be completed.


The implementation of the class template misc::variant<T0, Ts...> lacks a couple of conversion operators that you have to supply.

Next: , Previous: , Up: TC-1   [Contents][Index]