Introduction
CScout is a source code analyzer and refactoring browser for
collections of C programs.
It can process workspaces of multiple projects (we define a project
as a collection of C source files that are linked together)
mapping the complexity introduced
by the C preprocessor back into the original C source code files.
CScout takes advantage of modern hardware advances (fast processors
and large memory capacities) to analyze C source code beyond the level
of detail and accuracy provided by current compilers and linkers.
The analysis CScout performs takes into account the identifier scopes
introduced by the C preprocessor and the C language proper scopes and
namespaces.
CScout has already been applied on
- Projects of tens of thousands of lines,
like the apache web server (using 36MB of memory,
taking 6 minutes on a 500MHz Celeron processor).
- Projects above a million lines of code,
like the FreeBSD kernel (using 813MB of memory,
taking 3 hours 42 minutes on a 900MHz Itanium 2 processor).
- The complete
one true awk
source code (6600 lines - including a yacc grammar),
without modifying a single byte of the source code.
CScout as a source code analyzer can:
- annotate source code with hyperlinks to each identifier
- list files that would be affected by changing a specific identifier
- determine whether a given identifier belongs to the application
or to an external library based on the accessibility and location of the
header files that declare or define it
- locate unused identifiers taking into account inter-project
dependencies
- perform queries for identifiers based on their namespace,
scope, reachability, and regular expressions of their name and the
filename(s) they are found in,
- perform queries for files, based on their metrics, or properties
of the identifiers they contain
- monitor and report superfluously included header files
- provide accurate metrics on identifiers and files
More importantly,
CScout helps you in refactoring code by identifying dead objects
to remove, and
can automatically perform accurate global rename identifier
refactorings.
CScout will automatically rename identifiers
- taking into account the namespace of each identifier: a renaming of
a structure tag, member, or a statement label will not affect variables
with the same name
- respecting the scope of the renamed identifier: a rename can affect
multiple files, or variables within a single block, exactly matching
the semantics the C compiler would enforce
- across multiple projects when the same identifier is defined in
common shared include files
- occuring in macro bodies and parts of other identifiers,
when these are created through the C preprocessor's token concatenation
feature
Contents Next (Walkthrough)
Last change: Tuesday, August 12, 2003 10:00 pm
(C) Copyright 2000-2003 Diomidis Spinellis. May be freely viewed using web browsers and similar programs. All other rights reserved.