Noeud « Next »: , Noeud « Previous »: src/task, Noeud « Up »: Project Layout



3.2.5 The src/symbol Directory

Namespace symbol, delivered for T1.

— File: symbol.hh (src/symbol/)

The handling of the symbols. In the program, the rule for identifiers is to be used many times: at least once for its definition, and once for each use. Just think about the number of occurrences of size_t in a C program for instance.

To save space one keeps a single copy of each identifier. This provides additional benefits: the address of this single copy can be used as a key: comparisons (equality or order) as much faster.

The class symbol::Symbol is an implementation of this idea. See the lecture notes.

— File: table.hh (src/symbol/)

The handling of generic symbol tables, i.e., it is independent of functions, types and variables.