1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>HTML Formatter</title><link rel="stylesheet" href="synopsis.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.65.1"><link rel="home" href="index.html" title="Synopsis Tutorial"><link rel="up" href="ch04.html" title="Chapter4.Processor design"><link rel="previous" href="dot-formatter.html" title="Dot Formatter"><link rel="next" href="sxr-formatter.html" title="SXR Formatter"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">HTML Formatter</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="dot-formatter.html">Prev</a></td><th width="60%" align="center">Chapter4.Processor design</th><td width="20%" align="right"><a accesskey="n" href="sxr-formatter.html">Next</a></td></tr></table></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="html-formatter"></a>HTML Formatter</h2></div></div><div></div></div><p>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.</p><div class="mediaobject"><img src="images/html-classes.png"></div><p>The <span class="type">views</span> parameter is used to specify the list of View objects to be
used by the formatter. Each is a <span class="type">Parametrized</span>, so you can pass parameters to
the views, too. Here are the most important <span class="type">View</span> types:</p><div class="variablelist"><dl><dt><span class="term">FramesIndex</span></dt><dd><p>While arguably not really a view in itself, this is right now the master view, organizing other views in frames.</p></dd><dt><span class="term">FileDetails</span></dt><dd><p>Shows details about a given file, such as what other files are included, what declarations it contains, etc.</p></dd><dt><span class="term">DirBrowse</span></dt><dd><p>Presents a directory (of source files).</p></dd><dt><span class="term">FileTreeJS</span></dt><dd><p>A tree view containing source files.</p></dd><dt><span class="term">InheritanceGraph</span></dt><dd><p>A UML-like inheritance diagram for all classes.</p></dd><dt><span class="term">ModuleIndexer</span></dt><dd><p>A tree containing all modules.</p></dd><dt><span class="term">NameIndex</span></dt><dd><p>A global index of all declared names (macros, variables, types, ...)</p></dd><dt><span class="term">Scope</span></dt><dd><p>The content of a given scope.</p></dd><dt><span class="term">Source</span></dt><dd><p>A cross-referenced view of a source file.</p></dd><dt><span class="term">XRef</span></dt><dd><p>A listing of symbols with links to their documentation, definition, and reference.</p></dd></dl></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="scope-formatter"></a>The Scope View</h3></div></div><div></div></div><p>
The most important view for documentation purposes is doubtless the <span class="type">Scope</span>view. It presents all declaration
in a given scope, together with a number of references to other views if appropriate. The <span class="type">Scope</span>
view is subdivided into <span class="type">Parts</span>, which are (for flexibility's sake) further subdivided into
<span class="type">Fragments</span>.
</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="cross-referencing"></a>SourceCode Cross Referencing</h3></div></div><div></div></div><p>
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.
</p><p>
Here is a diagram for the data flow used to generate these views:
</p><div class="mediaobject"><img src="images/xref.png"></div><p>
Use the <span class="type">syntax_prefix</span> and <span class="type">xref_prefix</span> parameters in both, the C++ parser
as well as the XRef and Source views to specify the files to pass source file detail information.
</p></div></div><div class="navfooter"><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="dot-formatter.html">Prev</a></td><td width="20%" align="center"><a accesskey="u" href="ch04.html">Up</a></td><td width="40%" align="right"><a accesskey="n" href="sxr-formatter.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Dot Formatter</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">SXR Formatter</td></tr></table></div></body></html>
|