Phase
|
Function
performed
|
Limiting
goal
|
1 "parse"
|
Parse C into a stream of tokens
that associate identifiers and constants with both their text position
(line,col) in the compilation unit and their semantic units (= UIDs)
in gcc's parse tree.
|
Still recognizable as a stream
of C code.
|
2 "token"
|
Fixup the token stream: sort by
(line,col), merge duplicate tokens in macro definitions, deal with
generated identifiers from macro calls. Split the token stream
by file of origin and convert compilation-unit line numbers back to
input-file line numbers.
|
Still processing each compilation
unit separately.
|
3 "merge'
|
Combine compilation units. Merge
the token-streams for header files mentioned in several units.
|
Still generic C processing.
|
4 "sum"
|
Produce summary counts of various
things, that will be used by phase 5.
|
Still no meat.
|
5 "calc"
|
Calculate marginal costs to coupling/cohesion
for each identifier and constant.
|
Still no HTML.
|
6 "html"
|
Reread input files, annotate with
marginal-cost info.
|
(Done.)
|