HTML Formatter

The HTML formatter generates html output. It is designed in a modular way, to let users customize in much detail how to format the AST. It formats the AST into a number of views, which highlight different aspects of the AST. Some views show the file / directory layout, others group declarations by scopes, or provide an annotated source view.

The views parameter is used to specify the list of View objects to be used by the formatter. Each is a Parametrized, so you can pass parameters to the views, too. Here are the most important View types:

FramesIndex

While arguably not really a view in itself, this is right now the master view, organizing other views in frames.

FileDetails

Shows details about a given file, such as what other files are included, what declarations it contains, etc.

DirBrowse

Presents a directory (of source files).

FileTreeJS

A tree view containing source files.

InheritanceGraph

A UML-like inheritance diagram for all classes.

ModuleIndexer

A tree containing all modules.

NameIndex

A global index of all declared names (macros, variables, types, ...)

Scope

The content of a given scope.

Source

A cross-referenced view of a source file.

XRef

A listing of symbols with links to their documentation, definition, and reference.

The Scope View

The most important view for documentation purposes is doubtless the Scopeview. It presents all declaration in a given scope, together with a number of references to other views if appropriate. The Scope view is subdivided into Parts, which are (for flexibility's sake) further subdivided into Fragments.

SourceCode Cross Referencing

A particularly interesting feature of the C++ parser and the HTML formatter is the ability to generate a cross-referenced view on the entire source code. Since the AST itself only stores declarations, the two processors need to share some other external data containing all the remaining details about the code, i.e. where the various types and variables are declared and where they are referenced from.

Here is a diagram for the data flow used to generate these views:

Use the syntax_prefix and xref_prefix parameters in both, the C++ parser as well as the XRef and Source views to specify the files to pass source file detail information.