Files
quickbook/doc/quickbook.xml
Eric Niebler fbfd16b7ee merge from QUICKBOOK_INCLUDE branch
[SVN r30369]
2005-08-02 03:39:30 +00:00

1775 lines
135 KiB
XML
Executable File

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
<part
id="quickbook"
name="quickbook"
dirname="quickbook"
last-revision="$Date$"
xmlns:xi="http://www.w3.org/2001/XInclude">
<partinfo>
<author>
<firstname>Joel</firstname>
<surname>de Guzman</surname>
</author>
<author>
<firstname>Eric</firstname>
<surname>Niebler</surname>
</author>
<copyright>
<year>2002</year>
<year>2004</year>
<holder>Joel de Guzman, Eric Niebler</holder>
</copyright>
<legalnotice>
<para>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
<ulink url="http://www.boost.org/LICENSE_1_0.txt">
http://www.boost.org/LICENSE_1_0.txt
</ulink>)
</para>
</legalnotice>
<partpurpose>
WikiWiki style documentation tool </partpurpose>
<partcategory name="category:"></partcategory>
</partinfo>
<title>quickbook 1.1</title>
<section id="quickbook.intro">
<title> Introduction</title>
<blockquote><para><emphasis role="bold"><emphasis>&quot;Why program by hand in five days what you can spend five years of your
life automating?&quot;</emphasis></emphasis><sbr/>
<sbr/>
-- Terrence Parr, author ANTLR/PCCTS</para></blockquote><para>
Well, QuickBook started as a weekend hack. It was originally intended to be a
sample application using <ulink url="http://spirit.sourceforge.net">Spirit</ulink>. What is it? What you are viewing now, this
documentation, is autogenerated by QuickBook. These files were generated from
one master:</para>
<blockquote><para><ulink url="../quickbook.qbk">quickbook.qbk</ulink></para></blockquote><para>
Originally named QuickDoc, this funky tool that never dies evolved into a
funkier tool thanks to Eric Niebler who resurrected the project making it
generate <ulink url="http://www.boost.org/doc/html/boostbook.html">BoostBook</ulink> instead of HTML. The <ulink url="http://www.boost.org/doc/html/boostbook.html">BoostBook</ulink> documentation format
is an extension of <ulink url="http://www.docbook.org/">DocBook</ulink>, an SGML- or XML- based format for describing
documentation.</para>
<para>
QuickBook is a WikiWiki style documentation tool geared towards C++
documentation using simple rules and markup for simple formatting tasks.
QuickBook extends the WikiWiki concept. Like the WikiWiki, QuickBook documents are
simple text files. A single QuickBook document can generate a fully linked set
of nice HTML and PostScript/PDF documents complete with images and syntax-
colorized source code.</para>
<para>
Features include:</para>
<itemizedlist>
<listitem>
generate <ulink url="http://www.boost.org/doc/html/boostbook.html">BoostBook</ulink> xml, to generate HTML, PostScript and PDF
</listitem><listitem>
simple markup to link to Doxygen-generated entities
</listitem><listitem>
macro system for simple text substitution
</listitem><listitem>
simple markup for italics, bold, preformatted, blurbs, code samples,
tables, URLs, anchors, images, etc.
</listitem><listitem>
automatic syntax coloring of code samples
</listitem><listitem>
CSS support
</listitem>
</itemizedlist></section>
<section id="quickbook.syntax">
<title> Syntax Summary</title>
<para>
A QuickBook document is composed of one or more blocks. An example of
a block is the paragraph or a C++ code snippet. Some blocks have
special mark-ups. Blocks, except code snippets which have their own
grammar (C++ or Python), are composed of one or more phrases. A phrase
can be a simple contiguous run of characters. Phrases can have special
mark-ups. Marked up phrases can recursively contain other phrases, but
cannot contain blocks. A terminal is a self contained block-level or
phrase- level element that does not nest anything.</para>
<para>
Blocks, in general, are delimited by two end-of-lines (the block terminator).
Phrases in each block cannot contain a block terminator. This way, syntax errors
such as un-matched closing brackets do not go haywire and corrupt anything past
a single block.</para>
<anchor id="syntax.comments" /><bridgehead renderas="sect2">Comments</bridgehead><para>
Can be placed anywhere.</para>
<programlisting><literal>[/ comment (no output generated) ]
</literal></programlisting><anchor id="syntax.phrase_level_elements" /><bridgehead renderas="sect2">Phrase Level Elements</bridgehead><anchor id="syntax.font_styles" /><bridgehead renderas="sect3">Font Styles</bridgehead><programlisting><literal>['italic], [*bold], [_underline], [^teletype], [-strikethrough]
</literal></programlisting><para>
will generate:</para>
<para>
<emphasis>italic</emphasis>, <emphasis role="bold">bold</emphasis>, <emphasis role="underline">underline</emphasis>, <literal>teletype</literal>, <emphasis role="strikethrough">strikethrough</emphasis></para>
<para>
Like all non-terminal phrase level elements, this can of course be nested:</para>
<programlisting><literal>[*['bold-italic]]
</literal></programlisting><para>
will generate:</para>
<para>
<emphasis role="bold"><emphasis>bold-italic</emphasis></emphasis></para>
<anchor id="syntax.simple_formatting" /><bridgehead renderas="sect3">Simple formatting</bridgehead><para>
Simple markup for formatting text, common in many applications, is now supported:</para>
<programlisting><literal>/italic/, *bold*, _underline_, =teletype=, -strikethrough-
</literal></programlisting><para>
will generate:</para>
<para>
<emphasis>italic</emphasis>, <emphasis role="bold">bold</emphasis>, <emphasis role="underline">underline</emphasis>, <literal>teletype</literal>, <emphasis role="strikethrough">strikethrough</emphasis></para>
<para>
Unlike QuickBook's standard formatting scheme, the rules for simpler alternatives
are much stricter.</para>
<itemizedlist>
<listitem>
Simple markups cannot nest. You can combine a simple markup with a nestable markup.
</listitem><listitem>
A non-space character must follow the leading markup
</listitem><listitem>
A non-space character must precede the trailing markup
</listitem><listitem>
A space or a punctuation must follow the trailing markup
</listitem><listitem>
If the matching markup cannot be found within a line, the formatting
will not be applied. This is to ensure that un-matched formatting markups,
which can be a common mistake, does not corrupt anything past a single line.
We do not want the rest of the document to be rendered bold just because we
forgot a trailing '*'.
</listitem><listitem>
A line starting with the star will be interpreted as an unordered list.
See <link linkend="syntax.unordered_lists">Unordered lists</link>.
</listitem>
</itemizedlist><informaltable frame="all">
<bridgehead renderas="sect4"><phrase role="table-title">More Formatting Samples</phrase></bridgehead>
<tgroup cols="2">
<thead><row><entry>Markup</entry><entry>Result</entry></row>
</thead>
<tbody>
<row><entry><literal>*Bold*</literal></entry><entry><emphasis role="bold">Bold</emphasis></entry></row>
<row><entry><literal>*Is bold*</literal></entry><entry><emphasis role="bold">Is bold</emphasis></entry></row>
<row><entry><literal>* Not bold* *Not bold * * Not bold *</literal></entry><entry>* Not bold* *Not bold * * Not bold *</entry></row>
<row><entry><literal>This*Isn't*Bold (no bold)</literal></entry><entry>This*Isn't*Bold (no bold)</entry></row>
<row><entry><literal>(*Bold Inside*) (parenthesis not bold)</literal></entry><entry>(<emphasis role="bold">Bold Inside</emphasis>) (parenthesis not bold)</entry></row>
<row><entry><literal>*(Bold Outside)* (parenthesis bold)</literal></entry><entry><emphasis role="bold">(Bold Outside)</emphasis> (parenthesis bold)</entry></row>
<row><entry><literal>3*4*5 = 60 (no bold)</literal></entry><entry>3*4*5 = 60 (no bold)</entry></row>
<row><entry><literal>3 * 4 * 5 = 60 (no bold)</literal></entry><entry>3 * 4 * 5 = 60 (no bold)</entry></row>
<row><entry><literal>3 *4* 5 = 60 (4 is bold)</literal></entry><entry>3 <emphasis role="bold">4</emphasis> 5 = 60 (4 is bold)</entry></row>
<row><entry><literal>*This is bold* this is not *but this is*</literal></entry><entry><emphasis role="bold">This is bold</emphasis> this is not <emphasis role="bold">but this is</emphasis></entry></row>
<row><entry><literal>*This is bold*.</literal></entry><entry><emphasis role="bold">This is bold</emphasis>.</entry></row>
<row><entry><literal>*B*. (bold B)</literal></entry><entry><emphasis role="bold">B</emphasis>. (bold B)</entry></row>
<row><entry><literal>['*Bold-Italic*]</literal></entry><entry><emphasis><emphasis role="bold">Bold-Italic</emphasis></emphasis></entry></row>
</tbody>
</tgroup>
</informaltable>
<informaltable frame="all">
<?dbhtml table-width="74%" ?>
<tgroup cols="1">
<tbody>
<row>
<entry role="blurb">
<inlinemediaobject><imageobject><imagedata fileref="images/note.png"></imagedata></imageobject></inlinemediaobject> Thanks to David Barrett, author of
<ulink url="http://quinthar.com/qwikiwiki/index.php?page=Home">Qwiki</ulink>, for sharing these samples
and teaching me these obscure formatting rules. I wasn't sure at all if <ulink url="http://spirit.sourceforge.net">Spirit</ulink>,
being more or less a formal EBNF parser, can handle the context sensitivity and ambiguity.</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<anchor id="syntax.inline_code" /><bridgehead renderas="sect3">Inline code</bridgehead><para>
Inlining code in paragraphs is quite common when writing C++ documentation. We
provide a very simple markup for this. For example, this:</para>
<programlisting><literal>This text has inlined code `int main() { return 0; }` in it.
</literal></programlisting><para>
will generate:</para>
<para>
This text has inlined code <code><phrase role="keyword">int</phrase><phrase role="identifier"> main</phrase><phrase role="special">()</phrase><phrase role="special"> {</phrase><phrase role="keyword"> return</phrase><phrase role="number"> 0</phrase><phrase role="special">;</phrase><phrase role="special"> }</phrase></code> in it. The code will be
syntax highlighted.</para>
<informaltable frame="all">
<?dbhtml table-width="74%" ?>
<tgroup cols="1">
<tbody>
<row>
<entry role="blurb">
<inlinemediaobject><imageobject><imagedata fileref="images/note.png"></imagedata></imageobject></inlinemediaobject>
Note that we simply enclose the code with the tick: <literal>"`"</literal>, not the
single quote: <code><phrase role="string">&quot;'&quot;</phrase></code>. Note too that <literal>`some code`</literal> is prefered over
<literal>[^some code]</literal>.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<anchor id="syntax.source_mode" /><bridgehead renderas="sect3">Source Mode</bridgehead><para>
If a document contains more than one type of source code then the source mode
may be changed dynamically as the document is processed. All QuickBook
documents are initially in C++ mode by default, though an alternative initial value
may be set in the <link linkend="syntax.document">Document Info</link> section.</para>
<para>
To change the source mode, use the <literal>[source-mode]</literal> markup, where
<literal>source-mode</literal> is one of the supported modes. For example, this:</para>
<programlisting><literal>Python's [python] `import` is rather like C++'s [c++] `#include`. A
C++ comment `// looks like this` whereas a Python comment [python]
`# looks like this`.
</literal></programlisting><para>
will generate:</para>
<para>
Python's <code><phrase role="keyword">import</phrase></code> is rather like C++'s <code><phrase role="preprocessor">#include</phrase></code>. A
C++ comment <code><phrase role="comment">// looks like this</phrase></code> whereas a Python comment
<code><phrase role="comment">#looks like this</phrase></code>.</para>
<informaltable frame="all">
<bridgehead renderas="sect4"><phrase role="table-title">Supported Source Modes</phrase></bridgehead>
<tgroup cols="2">
<thead><row><entry>Mode</entry><entry>Source Mode Markup</entry></row>
</thead>
<tbody>
<row><entry>C++</entry><entry><literal>[c++]</literal></entry></row>
<row><entry>Python</entry><entry><literal>[python]</literal></entry></row>
</tbody>
</tgroup>
</informaltable>
<informaltable frame="all">
<?dbhtml table-width="74%" ?>
<tgroup cols="1">
<tbody>
<row>
<entry role="blurb">
<inlinemediaobject><imageobject><imagedata fileref="images/note.png"></imagedata></imageobject></inlinemediaobject> The source mode strings are lowercase.</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<anchor id="syntax.line_break" /><bridgehead renderas="sect3">line-break</bridgehead><programlisting><literal>[br]
</literal></programlisting><informaltable frame="all">
<?dbhtml table-width="74%" ?>
<tgroup cols="1">
<tbody>
<row>
<entry role="blurb">
<inlinemediaobject><imageobject><imagedata fileref="images/note.png"></imagedata></imageobject></inlinemediaobject> Note that <code><phrase role="special">\</phrase><phrase role="identifier">n</phrase></code> is now preferred over <code><phrase role="special">[</phrase><phrase role="identifier">br</phrase><phrase role="special">]</phrase></code>.</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<anchor id="syntax.anchors" /><bridgehead renderas="sect3">Anchors</bridgehead><programlisting><literal>[#named_anchor]
</literal></programlisting><para>
A named anchor is a hook that can be referenced by a link elsewhere in the
document. You can then reference an anchor with <literal>[link named_anchor Some link text]</literal>.
More on anchors <link linkend="syntax.anchor_links">here</link>, <link linkend="syntax.section">here</link> and
<link linkend="syntax.headings">here</link>.</para>
<anchor id="syntax.links" /><bridgehead renderas="sect3">Links</bridgehead><programlisting><literal>[@http://www.boost.org this is [*boost's] website....]
</literal></programlisting><para>
will generate:</para>
<para>
<ulink url="http://www.boost.org">this is <emphasis role="bold">boost's</emphasis> website....</ulink></para>
<para>
URL links where the link text is the link itself is common. Example:</para>
<programlisting><literal>see http://spirit.sourceforge.net/
</literal></programlisting><para>
so, when the text is absent in a link markup, the URL is assumed. Example:</para>
<programlisting><literal>see [@http://spirit.sourceforge.net/]
</literal></programlisting><para>
will generate:</para>
<para>
see <ulink url="http://spirit.sourceforge.net/">http://spirit.sourceforge.net/</ulink></para>
<anchor id="syntax.anchor_links" /><bridgehead renderas="sect3">Anchor links</bridgehead><para>
You can link within a document using:</para>
<programlisting><literal>[link section_id.normalized_header_text The link text]
</literal></programlisting><para>
See sections <link linkend="syntax.section">Section</link> and <link linkend="syntax.headings">Headings</link>
for more info.</para>
<anchor id="syntax.refentry_links" /><bridgehead renderas="sect3">refentry links</bridgehead><para>
In addition, you can link internally to an XML refentry like:</para>
<programlisting><literal>[link xml.refentry The link text]
</literal></programlisting><para>
This gets converted into <literal>&lt;link linkend=&quot;xml.refentry&quot;&gt;The link text&lt;/link&gt;</literal>.</para>
<para>
Like URLs, the link text is optional. If this is not present, the link text will
automatically be the refentry. Example:</para>
<programlisting><literal>[link xml.refentry]
</literal></programlisting><para>
This gets converted into <literal>&lt;link linkend=&quot;xml.refentry&quot;&gt;xml.refentry&lt;/link&gt;</literal>.</para>
<anchor id="syntax.function__class__member__enum_or_header_links" /><bridgehead renderas="sect3">function, class, member, enum or header links</bridgehead><para>
If you want to link to a function, class, member, enum or header in the reference
section, you can use:</para>
<programlisting><literal>[funcref fully::qualified::function_name The link text]
[classref fully::qualified::class_name The link text]
[memberref fully::qualified::member_name The link text]
[enumref fully::qualified::enum_name The link text]
[headerref path/to/header.hpp The link text]
</literal></programlisting><para>
Again, the link text is optional. If this is not present, the link text will
automatically be the function, class, member or enum. Example:</para>
<programlisting><literal>[classref boost::bar::baz]
</literal></programlisting><para>
would have &quot;boost::bar::baz&quot; as the link text.</para>
<anchor id="syntax.escape" /><bridgehead renderas="sect3">Escape</bridgehead><para>
The escape mark-up is used when we don't want to do any processing.</para>
<programlisting><literal>'''
escape (no processing/formatting)
'''
</literal></programlisting><para>
Escaping allows us to pass XML markup to <ulink url="http://www.boost.org/doc/html/boostbook.html">BoostBook</ulink> or <ulink url="http://www.docbook.org/">DocBook</ulink>. For example:</para>
<programlisting><literal>'''
&lt;emphasis role=&quot;bold&quot;&gt;This is direct XML markup&lt;/emphasis&gt;
'''
</literal></programlisting><para>
<emphasis role="bold">This is direct XML markup</emphasis>
</para>
<informaltable frame="all">
<?dbhtml table-width="74%" ?>
<tgroup cols="1">
<tbody>
<row>
<entry role="blurb">
<inlinemediaobject><imageobject><imagedata fileref="images/alert.png"></imagedata></imageobject></inlinemediaobject> Be careful when using the escape. The text must conform to
<ulink url="http://www.boost.org/doc/html/boostbook.html">BoostBook</ulink>/<ulink url="http://www.docbook.org/">DocBook</ulink> syntax.</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<anchor id="syntax.single_char_escape" /><bridgehead renderas="sect3">Single char escape</bridgehead><para>
The backslash may be used to escape a single punctuation character. The
punctuation immediately after the backslash is passed without any processing.
This is useful when we need to escape QuickBook punctuations such as <code><phrase role="special">[</phrase></code> and <code><phrase role="special">]</phrase></code>.
For example, how do you escape the triple quote? Simple: <literal>\'\'\'</literal></para>
<para>
<code><phrase role="special">\</phrase><phrase role="identifier">n</phrase></code> has a special meaning. It is used to generate line breaks. Note that <code><phrase role="special">\</phrase><phrase role="identifier">n</phrase></code>
is now preferred over <code><phrase role="special">[</phrase><phrase role="identifier">br</phrase><phrase role="special">]</phrase></code>.</para>
<anchor id="syntax.images__terminal_" /><bridgehead renderas="sect3">Images (terminal)</bridgehead><programlisting><literal>[$image.jpg]
</literal></programlisting><anchor id="syntax.block_level_elements" /><bridgehead renderas="sect2">Block Level Elements</bridgehead><anchor id="syntax.document" /><bridgehead renderas="sect3">Document</bridgehead><para>
Every document must begin with a Document Info section, which should look
like this:</para>
<programlisting><literal>[document-type The Document Title
[version 1.0]
[id the_document_name]
[dirname the_document_dir]
[copyright 2000 2002 2003 Joe Blow, Jane Doe]
[purpose The document's reason for being]
[category The document's category]
[authors [Blow, Joe], [Doe, Jane]]
[license The document's license]
[last-revision $Date$]
[source-mode source-type]
]
</literal></programlisting><para>
Where document-type is one of:</para>
<itemizedlist>
<listitem>
book
</listitem><listitem>
library
</listitem><listitem>
part
</listitem><listitem>
article
</listitem><listitem>
chapter
</listitem>
</itemizedlist><para>
and <literal>version</literal>, <literal>id</literal>, <literal>dirname</literal>, <literal>copyright</literal>, <literal>purpose</literal>, <literal>category</literal>, <literal>authors</literal>,
<literal>license</literal>, <literal>last-revision</literal> and <literal>source-mode</literal> are optional information.</para>
<para>
Here <literal>source-type</literal> is a lowercase string setting the initial
<link linkend="syntax.source_mode">source mode</link>. If the <literal>source-mode</literal> field is omitted, a
default value of <literal>c++</literal> will be used.</para>
<anchor id="syntax.section" /><bridgehead renderas="sect3">Section</bridgehead><para>
Starting a new section is accomplished with:</para>
<programlisting><literal>[section:id The Section Title]
</literal></programlisting><para>
where <emphasis>id</emphasis> is optional. id will be the filename of the generated section.
If it is not present, &quot;The Section Title&quot; will be normalized and become the id.
Valid characters are <literal>a-Z</literal>, <literal>A-Z</literal>, <literal>0-9</literal> and <literal>_</literal>. All non-valid characters are
converted to underscore and all upper-case are converted to lower case.
Thus: &quot;The Section Title&quot; will be normalized to &quot;the_section_title&quot;.</para>
<para>
End a section with:</para>
<programlisting><literal>[endsect]
</literal></programlisting><para>
Sections can nest, and that results in a hierarchy in the table of contents.</para>
<anchor id="syntax.xinclude" /><bridgehead renderas="sect3">xinclude</bridgehead><para>
You can include another XML file with:</para>
<programlisting><literal>[xinclude file.xml]
</literal></programlisting><para>
This is useful when file.xml has been generated by Doxygen and contains your
reference section.</para>
<anchor id="syntax.paragraphs" /><bridgehead renderas="sect3">Paragraphs</bridgehead><para>
Paragraphs start left-flushed and are terminated by two or more newlines. No
markup is needed for paragraphs. QuickBook automatically detects paragraphs from
the context.</para>
<anchor id="syntax.ordered_lists" /><bridgehead renderas="sect3">Ordered lists</bridgehead><programlisting><literal># One
# Two
# Three
</literal></programlisting><para>
will generate:</para>
<orderedlist>
<listitem>
One
</listitem><listitem>
Two
</listitem><listitem>
Three
</listitem>
</orderedlist><anchor id="syntax.list_hierarchies" /><bridgehead renderas="sect3">List Hierarchies</bridgehead><para>
List hierarchies are supported. Example:</para>
<programlisting><literal># One
# Two
# Three
# Three.a
# Three.b
# Three.c
# Four
# Four.a
# Four.a.i
# Four.a.ii
# Five
</literal></programlisting><para>
will generate:</para>
<orderedlist>
<listitem>
One
</listitem><listitem>
Two
</listitem><listitem>
Three<orderedlist>
<listitem>
Three.a
</listitem><listitem>
Three.b
</listitem><listitem>
Three.c
</listitem>
</orderedlist>
</listitem><listitem>
Fourth<orderedlist>
<listitem>
Four.a<orderedlist>
<listitem>
Four.a.i
</listitem><listitem>
Four.a.ii
</listitem>
</orderedlist>
</listitem>
</orderedlist>
</listitem><listitem>
Five
</listitem>
</orderedlist><anchor id="syntax.long_list_lines" /><bridgehead renderas="sect3">Long List Lines</bridgehead><para>
Long lines will be wrapped appropriately. Example:</para>
<programlisting><literal># A short item.
# A very long item. A very long item. A very long item.
A very long item. A very long item. A very long item.
A very long item. A very long item. A very long item.
A very long item. A very long item. A very long item.
A very long item. A very long item. A very long item.
# A short item.
</literal></programlisting><orderedlist>
<listitem>
A short item.
</listitem><listitem>
A very long item. A very long item. A very long item.
A very long item. A very long item. A very long item.
A very long item. A very long item. A very long item.
A very long item. A very long item. A very long item.
A very long item. A very long item. A very long item.
</listitem><listitem>
A short item.
</listitem>
</orderedlist><anchor id="syntax.unordered_lists" /><bridgehead renderas="sect3">Unordered lists</bridgehead><programlisting><literal>* First
* Second
* Third
</literal></programlisting><para>
will generate:</para>
<itemizedlist>
<listitem>
First
</listitem><listitem>
Second
</listitem><listitem>
Third
</listitem>
</itemizedlist><anchor id="syntax.mixed_lists" /><bridgehead renderas="sect3">Mixed lists</bridgehead><para>
Mixed lists (ordered and unordered) are supported. Example:</para>
<programlisting><literal># One
# Two
# Three
* Three.a
* Three.b
* Three.c
# Four
</literal></programlisting><para>
will generate:</para>
<orderedlist>
<listitem>
One
</listitem><listitem>
Two
</listitem><listitem>
Three<itemizedlist>
<listitem>
Three.a
</listitem><listitem>
Three.b
</listitem><listitem>
Three.c
</listitem>
</itemizedlist>
</listitem><listitem>
Four
</listitem>
</orderedlist><para>
And...</para>
<programlisting><literal># 1
* 1.a
# 1.a.1
# 1.a.2
* 1.b
# 2
* 2.a
* 2.b
# 2.b.1
# 2.b.2
* 2.b.2.a
* 2.b.2.b
</literal></programlisting><para>
will generate:</para>
<orderedlist>
<listitem>
1<itemizedlist>
<listitem>
1.a<orderedlist>
<listitem>
1.a.1
</listitem><listitem>
1.a.2
</listitem>
</orderedlist>
</listitem><listitem>
1.b
</listitem>
</itemizedlist>
</listitem><listitem>
2<itemizedlist>
<listitem>
2.a
</listitem><listitem>
2.b<orderedlist>
<listitem>
2.b.1
</listitem><listitem>
2.b.2<itemizedlist>
<listitem>
2.b.2.a
</listitem><listitem>
2.b.2.b
</listitem>
</itemizedlist>
</listitem>
</orderedlist>
</listitem>
</itemizedlist>
</listitem>
</orderedlist><anchor id="syntax.code" /><bridgehead renderas="sect3">Code</bridgehead><para>
Preformatted code starts with a space or a tab. The code will be
syntax highlighted according to the current <link linkend="syntax.source_mode">source mode</link>:</para>
<para>
</para>
<programlisting>
<literal>
<phrase role="preprocessor">#include</phrase><phrase role="special"> &lt;</phrase><phrase role="identifier">iostream</phrase><phrase role="special">&gt;</phrase><phrase role="keyword">
int</phrase><phrase role="identifier"> main</phrase><phrase role="special">()</phrase><phrase role="special">
{</phrase><phrase role="comment">
// Sample code
</phrase><phrase role="identifier"> std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase><phrase role="special"> &lt;&lt;</phrase><phrase role="string"> &quot;Hello, World\n&quot;</phrase><phrase role="special">;</phrase><phrase role="keyword">
return</phrase><phrase role="number"> 0</phrase><phrase role="special">;</phrase><phrase role="special">
}</phrase>
</literal>
</programlisting>
<para>
</para>
<programlisting>
<literal>
<phrase role="keyword">import</phrase><phrase role="identifier"> cgi</phrase><phrase role="keyword">
def</phrase><phrase role="identifier"> cookForHtml</phrase><phrase role="special">(</phrase><phrase role="identifier">text</phrase><phrase role="special">):</phrase><phrase role="string">
'''&quot;Cooks&quot; the input text for HTML.'''</phrase><phrase role="keyword">
return</phrase><phrase role="identifier"> cgi</phrase><phrase role="special">.</phrase><phrase role="identifier">escape</phrase><phrase role="special">(</phrase><phrase role="identifier">text</phrase><phrase role="special">)</phrase></literal>
</programlisting>
<para>
Macros that are already defined are expanded in source code. Example:</para>
<programlisting><literal>[def __syntax_highlight__ [@quickbook/highlight.html syntax_highlight]]
[def __quickbook__ [@index.html quickbook]]
using __quickbook__::__syntax_highlight__;
</literal></programlisting><para>
Generates:</para>
<programlisting>
<literal>
<phrase role="identifier">using</phrase>&nbsp;<ulink url="index.html">quickbook</ulink><phrase role="special">::</phrase><ulink url="quickbook/highlight.html">syntax_highlight</ulink><phrase role="special">;</phrase></literal>
</programlisting>
<anchor id="syntax.preformatted" /><bridgehead renderas="sect3">Preformatted</bridgehead><para>
Sometimes, you don't want some preformatted text to be parsed as C++. In such
cases, use the <literal>[pre ... ]</literal> markup block.</para>
<programlisting><literal>[pre
Some *preformatted* text Some *preformatted* text
Some *preformatted* text Some *preformatted* text
Some *preformatted* text Some *preformatted* text
]
</literal></programlisting><para>
Spaces, tabs and newlines are rendered as-is. Unlike all quickbook block level
markup, pre (and Code) are the only ones that allow multiple newlines. The
markup above will generate:</para>
<programlisting><literal>Some <emphasis role="bold">preformatted</emphasis> text Some <emphasis role="bold">preformatted</emphasis> text
Some <emphasis role="bold">preformatted</emphasis> text Some <emphasis role="bold">preformatted</emphasis> text
Some <emphasis role="bold">preformatted</emphasis> text Some <emphasis role="bold">preformatted</emphasis> text
</literal></programlisting><para>
Notice that unlike Code, phrase markup such as font style is still permitted
inside <literal>pre</literal> blocks.</para>
<anchor id="syntax.blockquote" /><bridgehead renderas="sect3">Blockquote</bridgehead><programlisting><literal>[:sometext...]
</literal></programlisting><blockquote><para>Indents the paragraph. This applies to one paragraph only.</para></blockquote><anchor id="syntax.headings" /><bridgehead renderas="sect3">Headings</bridgehead><programlisting><literal>[h1 Heading 1]
[h2 Heading 2]
[h3 Heading 3]
[h4 Heading 4]
[h5 Heading 5]
[h6 Heading 6]
</literal></programlisting><anchor id="syntax.heading_1" /><bridgehead renderas="sect1">Heading 1</bridgehead><anchor id="syntax.heading_2" /><bridgehead renderas="sect2">Heading 2</bridgehead><anchor id="syntax.heading_3" /><bridgehead renderas="sect3">Heading 3</bridgehead><anchor id="syntax.heading_4" /><bridgehead renderas="sect4">Heading 4</bridgehead><anchor id="syntax.heading_5" /><bridgehead renderas="sect5">Heading 5</bridgehead><anchor id="syntax.heading_6" /><bridgehead renderas="sect6">Heading 6</bridgehead><para>
Headings 1-3 [h1 h2 and h3] will automatically have anchors with normalized
names with <literal>name=&quot;section_id.normalized_header_text&quot;</literal> (i.e. valid characters are
<literal>a-z</literal>, <literal>A-Z</literal>, <literal>0-9</literal> and <literal>_</literal>. All non-valid characters are converted to underscore
and all upper-case are converted to lower-case. For example: Heading
1 in section Section 2 will be normalized to <literal>section_2.heading_1</literal>). You can use:</para>
<programlisting><literal>[link section_id.normalized_header_text The link text]
</literal></programlisting><para>
to link to them. See <link linkend="syntax.anchor_links">Anchor links</link> and
<link linkend="syntax.section">Section</link> for more info.</para>
<anchor id="syntax.macros" /><bridgehead renderas="sect3">Macros</bridgehead><programlisting><literal>[def macro_identifier some text]
</literal></programlisting><para>
When a macro is defined, the identifier replaces the text anywhere in the file,
in paragraphs, in markups, etc. macro_identifier is a string of non- white space
characters except ']' while the replacement text can be any phrase (even
marked up). Example:</para>
<programlisting><literal>[def sf_logo [$http://sourceforge.net/sflogo.php?group_id=28447&amp;type=1]]
sf_logo
</literal></programlisting><para>
Now everywhere the sf_logo is placed, the picture will be inlined.</para>
<para>
<inlinemediaobject><imageobject><imagedata fileref="http://sourceforge.net/sflogo.php?group_id=28447&amp;type=1"></imagedata></imageobject></inlinemediaobject></para>
<informaltable frame="all">
<?dbhtml table-width="74%" ?>
<tgroup cols="1">
<tbody>
<row>
<entry role="blurb">
<inlinemediaobject><imageobject><imagedata fileref="images/tip.png"></imagedata></imageobject></inlinemediaobject> It's a good idea to use macro identifiers that are distinguishable.
For instance, in this document, macro identifiers have two leading and trailing
underscores (e.g. <literal>__spirit__</literal>). The reason is to avoid unwanted macro replacement.</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<para>
Links (URLS) and images are good candidates for macros. <emphasis role="bold">1</emphasis>) They tend to
change a lot. It is a good idea to place all links and images in one place near the top
to make it easy to make changes. <emphasis role="bold">2</emphasis>) The syntax is not pretty. It's easier to read and
write, e.g. <literal>__spirit__</literal> than <literal>[@http://spirit.sourceforge.net Spirit]</literal>.</para>
<para>
Some more examples:</para>
<programlisting><literal>[def :-) [$theme/smiley.png]]
[def __spirit__ [@http://spirit.sourceforge.net Spirit]]
</literal></programlisting><para>
(See <link linkend="syntax.images__terminal_">Images</link>
and <link linkend="syntax.links">Links</link>)</para>
<para>
Invoking these macros:</para>
<programlisting><literal>Hi __spirit__ :-)
</literal></programlisting><para>
will generate this:</para>
<para>
Hi <ulink url="http://spirit.sourceforge.net">Spirit</ulink> <inlinemediaobject><imageobject><imagedata fileref="images/smiley.png"></imagedata></imageobject></inlinemediaobject></para>
<anchor id="syntax.predefined_macros" /><bridgehead renderas="sect3">Predefined Macros</bridgehead><para>
Quickbook has some predefined macros that you can already use.</para>
<informaltable frame="all">
<bridgehead renderas="sect4"><phrase role="table-title">Predefined Macros</phrase></bridgehead>
<tgroup cols="3">
<thead><row><entry>Macro</entry><entry>Meaning</entry><entry>Example</entry></row>
</thead>
<tbody>
<row><entry>__DATE__</entry><entry>Today's date</entry><entry>2005-Aug-01</entry></row>
<row><entry>__TIME__</entry><entry>The current time</entry><entry>08:30:50 PM</entry></row>
<row><entry>__FILENAME__</entry><entry>Quickbook source filename</entry><entry>/home/ericne/boost/cvs/boost/tools/quickbook/doc/quickbook.qbk</entry></row>
</tbody>
</tgroup>
</informaltable>
<anchor id="syntax.blurbs" /><bridgehead renderas="sect3">Blurbs</bridgehead><programlisting><literal>[blurb :-) [*An eye catching advertisement or note...]\n\n
__spirit__ is an object-oriented recursive-descent parser generator framework
implemented using template meta-programming techniques. Expression templates
allow us to approximate the syntax of Extended Backus-Normal Form (EBNF)
completely in C++.
]
</literal></programlisting><para>
will generate this:</para>
<informaltable frame="all">
<?dbhtml table-width="74%" ?>
<tgroup cols="1">
<tbody>
<row>
<entry role="blurb">
<inlinemediaobject><imageobject><imagedata fileref="images/smiley.png"></imagedata></imageobject></inlinemediaobject> <emphasis role="bold">An eye catching advertisement or note...</emphasis><sbr/>
<sbr/>
<ulink url="http://spirit.sourceforge.net">Spirit</ulink> is an object- oriented recursive-descent parser generator
framework implemented using template meta-programming techniques. Expression
templates allow us to approximate the syntax of Extended Backus- Normal Form
(EBNF) completely in C++.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<anchor id="syntax.tables" /><bridgehead renderas="sect3">Tables</bridgehead><programlisting><literal>[table A Simple Table
[[Heading 1] [Heading 2] [Heading 3]]
[[R0-C0] [R0-C1] [R0-C2]]
[[R1-C0] [R1-C1] [R1-C2]]
[[R2-C0] [R2-C1] [R2-C2]]
]
</literal></programlisting><para>
will generate:</para>
<informaltable frame="all">
<bridgehead renderas="sect4"><phrase role="table-title">A Simple Table</phrase></bridgehead>
<tgroup cols="3">
<thead><row><entry>Heading 1</entry><entry>Heading 2</entry><entry>Heading 3</entry></row>
</thead>
<tbody>
<row><entry>R0-C0</entry><entry>R0-C1</entry><entry>R0-C2</entry></row>
<row><entry>R2-C0</entry><entry>R2-C1</entry><entry>R2-C2</entry></row>
<row><entry>R3-C0</entry><entry>R3-C1</entry><entry>R3-C2</entry></row>
</tbody>
</tgroup>
</informaltable>
<para>
The first row of the table is automatically treated as the table header; that is,
it is wrapped in <literal>&lt;thead&gt;...&lt;/thead&gt;</literal> XML tags. Note that unlike the original QuickDoc,
the columns are nested in [ cells... ]. The syntax is free-format and allows big
cells to be formatted nicely. Example:</para>
<programlisting><literal>[table Table with fat cells
[[Heading 1] [Heading 2]]
[
[Row 0, Col 0: a small cell]
[
Row 0, Col 1:
A very big cell...A very big cell...A very big cell...
A very big cell...A very big cell...A very big cell...
A very big cell...A very big cell...A very big cell...
]
]
[
[Row 1, Col 0: a small cell]
[Row 1, Col 1: a small cell]
]
]
</literal></programlisting><para>
and thus:</para>
<informaltable frame="all">
<bridgehead renderas="sect4"><phrase role="table-title">Table with fat cells</phrase></bridgehead>
<tgroup cols="2">
<thead><row><entry>Heading 1</entry><entry>Heading 2</entry></row>
</thead>
<tbody>
<row><entry>Row 0, Col 0: a small cell</entry><entry>
Row 0, Col 1:
A very big cell...A very big cell...A very big cell...
A very big cell...A very big cell...A very big cell...
A very big cell...A very big cell...A very big cell...
</entry></row>
<row><entry>Row 1, Col 0: a small cell</entry><entry>Row 1, Col 1: a small cell</entry></row>
</tbody>
</tgroup>
</informaltable>
<anchor id="syntax.variable_lists" /><bridgehead renderas="sect3">Variable Lists</bridgehead><programlisting><literal>[variablelist A Variable List
[[term 1] [The definition of term 1]]
[[term 2] [The definition of term 2]]
[[term 3] [The definition of term 3]]
]
</literal></programlisting><para>
will generate:</para>
<variablelist>
<title>A Variable List</title>
<varlistentry><term>term 1</term><listitem>The definition of term 1</listitem></varlistentry>
<varlistentry><term>term 2</term><listitem>The definition of term 2</listitem></varlistentry>
<varlistentry><term>term 3</term><listitem>The definition of term 3</listitem></varlistentry>
</variablelist>
<para>
The rules for variable lists are the same as for tables, except that
only 2 &quot;columns&quot; are allowed. The first column contains the terms, and
the second column contains the definitions. Those familiar with HTML
will recognize this as a &quot;definition list&quot;.</para>
<anchor id="syntax.include" /><bridgehead renderas="sect3">Include</bridgehead><para>
You can include one QuickBook file from another. The syntax is simply:</para>
<programlisting><literal>[include someother.qbk]
</literal></programlisting><para>
The included file will be processed as if it had be cut and pasted
into the current document, with the following exceptions:</para>
<itemizedlist>
<listitem>
The __FILENAME__ predefined macro will reflect the name of the
file currently being processed.
</listitem><listitem>
Any macros defined in the included file are scoped to that file.
</listitem>
</itemizedlist><para>
As the number of included QuickBook files grows, so too does the
likelihood of two sections having the same name. Since QuickBook generates
an anchor for each section based on the section name, it is possible to
end up with two identically named anchors, leading to link ambiguities.
To resolve these ambiguities, the <literal>[include]</literal> directive lets you
specify a document id to use for the included file. You can use it like
this:</para>
<programlisting><literal>[include:someid someother.qbk]
</literal></programlisting><para>
When using this form, all auto-generated anchors will use &quot;someid&quot; as
a unique prefix. So for instance, if there is a section in someother.qbk
named &quot;Intro&quot;, the named anchor for that section will be &quot;someid.intro&quot;,
and you can link to it with <literal>[link someid.intro The Intro]</literal>.</para>
</section>
<section id="quickbook.ref">
<title> Quick Reference</title>
<informaltable frame="all">
<bridgehead renderas="sect4"><phrase role="table-title">Syntax Compendium</phrase></bridgehead>
<tgroup cols="2">
<thead><row><entry>To do this...</entry><entry>Use this...</entry></row>
</thead>
<tbody>
<row><entry>comment</entry><entry><literal>[/ some comment]</literal></entry></row>
<row><entry><emphasis>italics</emphasis></entry><entry><literal>['italics] or /italics/</literal></entry></row>
<row><entry><emphasis role="bold">bold</emphasis></entry><entry><literal>[*bold] or *bold*</literal></entry></row>
<row><entry><emphasis role="underline">underline</emphasis></entry><entry><literal>[_underline] or _underline_</literal></entry></row>
<row><entry><literal>teletype</literal></entry><entry><literal>[^teletype] or =teletype=</literal></entry></row>
<row><entry><emphasis role="strikethrough">strikethrough</emphasis></entry><entry><literal>[-strikethrough] or -strikethrough-</literal></entry></row>
<row><entry>source mode</entry><entry><literal>[c++]</literal> or <literal>[python]</literal></entry></row>
<row><entry>inline code</entry><entry><literal>`int main();`</literal></entry></row>
<row><entry>line break</entry><entry><literal>[br] or \n</literal></entry></row>
<row><entry>anchor</entry><entry><literal>[#anchor]</literal></entry></row>
<row><entry>link</entry><entry><literal>[@http://www.boost.org Boost]</literal></entry></row>
<row><entry>anchor link</entry><entry><literal>[link section.anchor Link text]</literal></entry></row>
<row><entry>refentry link</entry><entry><literal>[link xml.refentry Link text]</literal></entry></row>
<row><entry>function link</entry><entry><literal>[funcref fully::qualified::function_name Link text]</literal></entry></row>
<row><entry>class link</entry><entry><literal>[classref fully::qualified::class_name Link text]</literal></entry></row>
<row><entry>member link</entry><entry><literal>[memberref fully::qualified::member_name Link text]</literal></entry></row>
<row><entry>enum link</entry><entry><literal>[enumref fully::qualified::enum_name Link text]</literal></entry></row>
<row><entry>header link</entry><entry><literal>[headerref path/to/header.hpp Link text]</literal></entry></row>
<row><entry>escape</entry><entry><literal>'''escaped text (no processing/formatting)'''</literal></entry></row>
<row><entry>single char escape</entry><entry><literal>\c</literal></entry></row>
<row><entry>images</entry><entry><literal>[$image.jpg]</literal></entry></row>
<row><entry>begin section</entry><entry><literal>[section The Section Title]</literal></entry></row>
<row><entry>end section</entry><entry><literal>[endsect]</literal></entry></row>
<row><entry>paragraph</entry><entry>No markup. Paragraphs start left-flushed and are terminated by two or more newlines.</entry></row>
<row><entry>ordered list</entry><entry><literal># one<sbr/>
# two<sbr/>
# three<sbr/>
</literal></entry></row>
<row><entry>unordered list</entry><entry><literal>* one<sbr/>
* two<sbr/>
* three<sbr/>
</literal></entry></row>
<row><entry>code</entry><entry>No markup. Preformatted code starts with a space or a tab.</entry></row>
<row><entry>preformatted</entry><entry><literal>[pre preformatted]</literal></entry></row>
<row><entry>block quote</entry><entry><literal>[:sometext...]</literal></entry></row>
<row><entry>heading 1</entry><entry><literal>[h1 Heading 1]</literal></entry></row>
<row><entry>heading 2</entry><entry><literal>[h2 Heading 2]</literal></entry></row>
<row><entry>heading 3</entry><entry><literal>[h3 Heading 3]</literal></entry></row>
<row><entry>heading 4</entry><entry><literal>[h4 Heading 4]</literal></entry></row>
<row><entry>heading 5</entry><entry><literal>[h5 Heading 5]</literal></entry></row>
<row><entry>heading 6</entry><entry><literal>[h6 Heading 6]</literal></entry></row>
<row><entry>macro</entry><entry><literal>[def macro_identifier some text]</literal></entry></row>
<row><entry>blurb</entry><entry><literal>[blurb advertisement or note...]</literal></entry></row>
<row><entry>table</entry><entry><literal>[table Title<sbr/>
[[a][b][c]]<sbr/>
[[a][b][c]]<sbr/>
]</literal></entry></row>
<row><entry>variablelist</entry><entry><literal>[variablelist Title<sbr/>
[[a][b]]<sbr/>
[[a][b]]<sbr/>
]</literal></entry></row>
<row><entry>include</entry><entry><literal>[include someother.qbk]</literal></entry></row>
</tbody>
</tgroup>
</informaltable>
</section>
<section id="quickbook.docinfo">
<title> Library Document Grammar</title>
<para>
</para>
<programlisting>
<literal>
<phrase role="identifier">doc_info</phrase><phrase role="special"> =</phrase><phrase role="identifier">
space</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="char"> '['</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> (</phrase><phrase role="identifier"> str_p</phrase><phrase role="special">(</phrase><phrase role="string">&quot;book&quot;</phrase><phrase role="special">)</phrase><phrase role="special">
|</phrase><phrase role="string"> &quot;article&quot;</phrase><phrase role="special">
|</phrase><phrase role="string"> &quot;library&quot;</phrase><phrase role="special">
|</phrase><phrase role="string"> &quot;chapter&quot;</phrase><phrase role="special">
|</phrase><phrase role="string"> &quot;part&quot;</phrase><phrase role="special">
)</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="identifier"> hard_space</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> (</phrase><phrase role="special"> *(</phrase><phrase role="identifier">anychar_p</phrase><phrase role="special"> -</phrase><phrase role="special">
(</phrase><phrase role="identifier">ch_p</phrase><phrase role="special">(</phrase><phrase role="char">'['</phrase><phrase role="special">)</phrase><phrase role="special"> |</phrase><phrase role="char"> ']'</phrase><phrase role="special"> |</phrase><phrase role="identifier"> eol_p</phrase><phrase role="special">)</phrase><phrase role="special">
)</phrase><phrase role="special">
)</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> *(</phrase><phrase role="identifier"> doc_version</phrase><phrase role="special">
|</phrase><phrase role="identifier"> doc_id</phrase><phrase role="special">
|</phrase><phrase role="identifier"> doc_dirname</phrase><phrase role="special">
|</phrase><phrase role="identifier"> doc_copyright</phrase><phrase role="special">
|</phrase><phrase role="identifier"> doc_purpose</phrase><phrase role="special">
|</phrase><phrase role="identifier"> doc_category</phrase><phrase role="special">
|</phrase><phrase role="identifier"> doc_authors</phrase><phrase role="special">
|</phrase><phrase role="identifier"> doc_license</phrase><phrase role="special">
|</phrase><phrase role="identifier"> doc_last_revision</phrase><phrase role="special">
)</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="char"> ']'</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="special"> +</phrase><phrase role="identifier">eol_p</phrase><phrase role="special">
;</phrase><phrase role="identifier">
doc_version</phrase><phrase role="special"> =</phrase><phrase role="identifier">
space</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="string"> &quot;[version&quot;</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> hard_space</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> (*(</phrase><phrase role="identifier">anychar_p</phrase><phrase role="special"> -</phrase><phrase role="char"> ']'</phrase><phrase role="special">))</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="char"> ']'</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="special"> +</phrase><phrase role="identifier">eol_p</phrase><phrase role="special">
;</phrase><phrase role="identifier">
doc_id</phrase><phrase role="special"> =</phrase><phrase role="identifier">
space</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="string"> &quot;[id&quot;</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> hard_space</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> (*(</phrase><phrase role="identifier">anychar_p</phrase><phrase role="special"> -</phrase><phrase role="char"> ']'</phrase><phrase role="special">))</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="char"> ']'</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="special"> +</phrase><phrase role="identifier">eol_p</phrase><phrase role="special">
;</phrase><phrase role="identifier">
doc_dirname</phrase><phrase role="special"> =</phrase><phrase role="identifier">
space</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="string"> &quot;[dirname&quot;</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> hard_space</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> (*(</phrase><phrase role="identifier">anychar_p</phrase><phrase role="special"> -</phrase><phrase role="char"> ']'</phrase><phrase role="special">))</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="char"> ']'</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="special"> +</phrase><phrase role="identifier">eol_p</phrase><phrase role="special">
;</phrase><phrase role="identifier">
doc_copyright</phrase><phrase role="special"> =</phrase><phrase role="identifier">
space</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="string"> &quot;[copyright&quot;</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> hard_space</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> +(</phrase><phrase role="identifier"> repeat_p</phrase><phrase role="special">(</phrase><phrase role="number">4</phrase><phrase role="special">)[</phrase><phrase role="identifier">digit_p</phrase><phrase role="special">]</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="identifier"> space</phrase><phrase role="special">
)</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="identifier"> space</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> (*(</phrase><phrase role="identifier">anychar_p</phrase><phrase role="special"> -</phrase><phrase role="char"> ']'</phrase><phrase role="special">))</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="char"> ']'</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="special"> +</phrase><phrase role="identifier">eol_p</phrase><phrase role="special">
;</phrase><phrase role="identifier">
doc_purpose</phrase><phrase role="special"> =</phrase><phrase role="identifier">
space</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="string"> &quot;[purpose&quot;</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> hard_space</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> (*(</phrase><phrase role="identifier">anychar_p</phrase><phrase role="special"> -</phrase><phrase role="char"> ']'</phrase><phrase role="special">))</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="char"> ']'</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="special"> +</phrase><phrase role="identifier">eol_p</phrase><phrase role="special">
;</phrase><phrase role="identifier">
doc_category</phrase><phrase role="special"> =</phrase><phrase role="identifier">
space</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="string"> &quot;[category&quot;</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> hard_space</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> (*(</phrase><phrase role="identifier">anychar_p</phrase><phrase role="special"> -</phrase><phrase role="char"> ']'</phrase><phrase role="special">))</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="char"> ']'</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="special"> +</phrase><phrase role="identifier">eol_p</phrase><phrase role="special">
;</phrase><phrase role="identifier">
doc_author</phrase><phrase role="special"> =</phrase><phrase role="identifier">
space</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="char"> '['</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> space</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> (*(</phrase><phrase role="identifier">anychar_p</phrase><phrase role="special"> -</phrase><phrase role="char"> ','</phrase><phrase role="special">))</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="char"> ','</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> space</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> (*(</phrase><phrase role="identifier">anychar_p</phrase><phrase role="special"> -</phrase><phrase role="char"> ']'</phrase><phrase role="special">))</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="char"> ']'</phrase><phrase role="special">
;</phrase><phrase role="identifier">
doc_authors</phrase><phrase role="special"> =</phrase><phrase role="identifier">
space</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="string"> &quot;[authors&quot;</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> hard_space</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="identifier"> doc_author</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> *(</phrase><phrase role="char"> ','</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="identifier"> doc_author</phrase><phrase role="special">
)</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="char"> ']'</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="special"> +</phrase><phrase role="identifier">eol_p</phrase><phrase role="special">
;</phrase><phrase role="identifier">
doc_license</phrase><phrase role="special"> =</phrase><phrase role="identifier">
space</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="string"> &quot;[license&quot;</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> hard_space</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> (*(</phrase><phrase role="identifier">anychar_p</phrase><phrase role="special"> -</phrase><phrase role="char"> ']'</phrase><phrase role="special">))</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="char"> ']'</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="special"> +</phrase><phrase role="identifier">eol_p</phrase><phrase role="special">
;</phrase><phrase role="identifier">
doc_last_revision</phrase><phrase role="special"> =</phrase><phrase role="identifier">
space</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="string"> &quot;[last-revision&quot;</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> hard_space</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> (*(</phrase><phrase role="identifier">anychar_p</phrase><phrase role="special"> -</phrase><phrase role="char"> ']'</phrase><phrase role="special">))</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="char"> ']'</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="special"> +</phrase><phrase role="identifier">eol_p</phrase><phrase role="special">
;</phrase><phrase role="identifier">
doc_source_mode</phrase><phrase role="special"> =</phrase><phrase role="identifier">
space</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="string"> &quot;[source-mode&quot;</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> hard_space</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> (</phrase><phrase role="identifier">
str_p</phrase><phrase role="special">(</phrase><phrase role="string">&quot;c++&quot;</phrase><phrase role="special">)</phrase><phrase role="special">
|</phrase><phrase role="string"> &quot;python&quot;</phrase><phrase role="special">
)</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="identifier"> space</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="char"> ']'</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="special"> +</phrase><phrase role="identifier">eol_p</phrase><phrase role="special">
;</phrase><phrase role="identifier">
comment</phrase><phrase role="special"> =</phrase><phrase role="string">
&quot;[/&quot;</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="special"> *(</phrase><phrase role="identifier">anychar_p</phrase><phrase role="special"> -</phrase><phrase role="char"> ']'</phrase><phrase role="special">)</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="char"> ']'</phrase><phrase role="special">
;</phrase><phrase role="identifier">
space</phrase><phrase role="special"> =</phrase><phrase role="special">
*(</phrase><phrase role="identifier">space_p</phrase><phrase role="special"> |</phrase><phrase role="identifier"> comment</phrase><phrase role="special">)</phrase><phrase role="special">
;</phrase><phrase role="identifier">
hard_space</phrase><phrase role="special"> =</phrase><phrase role="special">
(</phrase><phrase role="identifier">eps_p</phrase><phrase role="special"> -</phrase><phrase role="special"> (</phrase><phrase role="identifier">alnum_p</phrase><phrase role="special"> |</phrase><phrase role="char"> '_'</phrase><phrase role="special">))</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> space</phrase><phrase role="comment"> // must not be followed by
</phrase><phrase role="special"> ;</phrase><phrase role="comment"> // alpha-numeric or underscore
</phrase></literal>
</programlisting>
</section>
<section id="quickbook.quickbook">
<title> QuickBook Grammar</title>
<programlisting>
<literal>
<phrase role="identifier">library</phrase><phrase role="special"> =</phrase><phrase role="special">
*(</phrase><phrase role="identifier">space_p</phrase><phrase role="special"> |</phrase><phrase role="identifier"> comment</phrase><phrase role="special">)</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> blocks</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> blank</phrase><phrase role="special">
;</phrase><phrase role="identifier">
blocks</phrase><phrase role="special"> =</phrase><phrase role="special">
+(</phrase><phrase role="identifier"> block_markup</phrase><phrase role="special">
|</phrase><phrase role="identifier"> code</phrase><phrase role="special">
|</phrase><phrase role="identifier"> list</phrase><phrase role="special">
|</phrase><phrase role="identifier"> hr</phrase><phrase role="special">
|</phrase><phrase role="identifier"> comment</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="special"> *</phrase><phrase role="identifier">eol</phrase><phrase role="special">
|</phrase><phrase role="identifier"> paragraph</phrase><phrase role="special">
|</phrase><phrase role="identifier"> eol</phrase><phrase role="special">
)</phrase><phrase role="special">
;</phrase><phrase role="identifier">
space</phrase><phrase role="special"> =</phrase><phrase role="special">
*(</phrase><phrase role="identifier">space_p</phrase><phrase role="special"> |</phrase><phrase role="identifier"> comment</phrase><phrase role="special">)</phrase><phrase role="special">
;</phrase><phrase role="identifier">
blank</phrase><phrase role="special"> =</phrase><phrase role="special">
*(</phrase><phrase role="identifier">blank_p</phrase><phrase role="special"> |</phrase><phrase role="identifier"> comment</phrase><phrase role="special">)</phrase><phrase role="special">
;</phrase><phrase role="identifier">
eol</phrase><phrase role="special"> =</phrase><phrase role="identifier"> blank</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> eol_p</phrase><phrase role="special">
;</phrase><phrase role="identifier">
close_bracket</phrase><phrase role="special"> =</phrase><phrase role="char">
']'</phrase><phrase role="special"> |</phrase><phrase role="identifier">
if_p</phrase><phrase role="special">(</phrase><phrase role="identifier">var</phrase><phrase role="special">(</phrase><phrase role="identifier">is_not_preformatted</phrase><phrase role="special">))</phrase><phrase role="special">
[</phrase><phrase role="identifier">
eol_p</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> eol_p</phrase><phrase role="comment"> // Make sure that we don't go
</phrase><phrase role="special"> ]</phrase><phrase role="comment"> // past a single block, except
</phrase><phrase role="special"> ;</phrase><phrase role="comment"> // when preformatted.
</phrase><phrase role="identifier">
hard_space</phrase><phrase role="special"> =</phrase><phrase role="special">
(</phrase><phrase role="identifier">eps_p</phrase><phrase role="special"> -</phrase><phrase role="special"> (</phrase><phrase role="identifier">alnum_p</phrase><phrase role="special"> |</phrase><phrase role="char"> '_'</phrase><phrase role="special">))</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> space</phrase><phrase role="comment"> // must not be followed by
</phrase><phrase role="special"> ;</phrase><phrase role="comment"> // alpha-numeric or underscore
</phrase><phrase role="identifier">
comment</phrase><phrase role="special"> =</phrase><phrase role="string">
&quot;[/&quot;</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="special"> *(</phrase><phrase role="identifier">anychar_p</phrase><phrase role="special"> -</phrase><phrase role="char"> ']'</phrase><phrase role="special">)</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="char"> ']'</phrase><phrase role="special">
;</phrase><phrase role="identifier">
hr</phrase><phrase role="special"> =</phrase><phrase role="identifier">
str_p</phrase><phrase role="special">(</phrase><phrase role="string">&quot;----&quot;</phrase><phrase role="special">)</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> *(</phrase><phrase role="identifier">anychar_p</phrase><phrase role="special"> -</phrase><phrase role="identifier"> eol</phrase><phrase role="special">)</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> +</phrase><phrase role="identifier">eol</phrase><phrase role="special">
;</phrase><phrase role="identifier">
block_markup</phrase><phrase role="special"> =</phrase><phrase role="char">
'['</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> (</phrase><phrase role="identifier"> begin_section</phrase><phrase role="special">
|</phrase><phrase role="identifier"> end_section</phrase><phrase role="special">
|</phrase><phrase role="identifier"> headings</phrase><phrase role="special">
|</phrase><phrase role="identifier"> blurb</phrase><phrase role="special">
|</phrase><phrase role="identifier"> blockquote</phrase><phrase role="special">
|</phrase><phrase role="identifier"> preformatted</phrase><phrase role="special">
|</phrase><phrase role="identifier"> def_macro</phrase><phrase role="special">
|</phrase><phrase role="identifier"> table</phrase><phrase role="special">
|</phrase><phrase role="identifier"> variablelist</phrase><phrase role="special">
|</phrase><phrase role="identifier"> xinclude</phrase><phrase role="special">
|</phrase><phrase role="identifier"> include</phrase><phrase role="special">
)</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> (</phrase><phrase role="special"> (</phrase><phrase role="char">']'</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="special"> +</phrase><phrase role="identifier">eol</phrase><phrase role="special">)</phrase><phrase role="special">
|</phrase><phrase role="identifier"> eps_p</phrase><phrase role="special">
)</phrase><phrase role="special">
;</phrase><phrase role="identifier">
begin_section</phrase><phrase role="special"> =</phrase><phrase role="string">
&quot;section&quot;</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="identifier"> hard_space</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> (</phrase><phrase role="char">':'</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="special"> (*(</phrase><phrase role="identifier">alnum_p</phrase><phrase role="special"> |</phrase><phrase role="char"> '_'</phrase><phrase role="special">))</phrase><phrase role="special">
|</phrase><phrase role="identifier"> eps_p</phrase><phrase role="special">
)</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> (*(</phrase><phrase role="identifier">anychar_p</phrase><phrase role="special"> -</phrase><phrase role="identifier">
close_bracket</phrase><phrase role="special">))</phrase><phrase role="special">
;</phrase><phrase role="identifier">
end_section</phrase><phrase role="special"> =</phrase><phrase role="identifier">
str_p</phrase><phrase role="special">(</phrase><phrase role="string">&quot;endsect&quot;</phrase><phrase role="special">)</phrase><phrase role="special">
;</phrase><phrase role="identifier">
headings</phrase><phrase role="special"> =</phrase><phrase role="identifier">
h1</phrase><phrase role="special"> |</phrase><phrase role="identifier"> h2</phrase><phrase role="special"> |</phrase><phrase role="identifier"> h3</phrase><phrase role="special"> |</phrase><phrase role="identifier"> h4</phrase><phrase role="special"> |</phrase><phrase role="identifier"> h5</phrase><phrase role="special"> |</phrase><phrase role="identifier"> h6</phrase><phrase role="special">
;</phrase><phrase role="identifier">
h1</phrase><phrase role="special"> =</phrase><phrase role="string"> &quot;h1&quot;</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> hard_space</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> phrase</phrase><phrase role="identifier">
h2</phrase><phrase role="special"> =</phrase><phrase role="string"> &quot;h2&quot;</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> hard_space</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> phrase</phrase><phrase role="identifier">
h3</phrase><phrase role="special"> =</phrase><phrase role="string"> &quot;h3&quot;</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> hard_space</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> phrase</phrase><phrase role="identifier">
h4</phrase><phrase role="special"> =</phrase><phrase role="string"> &quot;h4&quot;</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> hard_space</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> phrase</phrase><phrase role="identifier">
h5</phrase><phrase role="special"> =</phrase><phrase role="string"> &quot;h5&quot;</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> hard_space</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> phrase</phrase><phrase role="identifier">
h6</phrase><phrase role="special"> =</phrase><phrase role="string"> &quot;h6&quot;</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> hard_space</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> phrase</phrase><phrase role="identifier">
blurb</phrase><phrase role="special"> =</phrase><phrase role="string">
&quot;blurb&quot;</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> hard_space</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="identifier"> phrase</phrase><phrase role="special">
;</phrase><phrase role="identifier">
blockquote</phrase><phrase role="special"> =</phrase><phrase role="char">
':'</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> blank</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier">
phrase</phrase><phrase role="special">
;</phrase><phrase role="identifier">
preformatted</phrase><phrase role="special"> =</phrase><phrase role="string">
&quot;pre&quot;</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> hard_space</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> !</phrase><phrase role="identifier">eol</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> phrase</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="identifier"> eps_p</phrase><phrase role="special">
;</phrase><phrase role="identifier">
def_macro</phrase><phrase role="special"> =</phrase><phrase role="string">
&quot;def&quot;</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> hard_space</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="identifier"> identifier</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="identifier"> blank</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> phrase</phrase><phrase role="special">
;</phrase><phrase role="identifier">
table</phrase><phrase role="special"> =</phrase><phrase role="string">
&quot;table&quot;</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> hard_space</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> (*(</phrase><phrase role="identifier">anychar_p</phrase><phrase role="special"> -</phrase><phrase role="identifier"> eol</phrase><phrase role="special">))</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> +</phrase><phrase role="identifier">eol</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> *</phrase><phrase role="identifier">table_row</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="identifier"> eps_p</phrase><phrase role="special">
;</phrase><phrase role="identifier">
table_row</phrase><phrase role="special"> =</phrase><phrase role="identifier">
space</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="identifier"> ch_p</phrase><phrase role="special">(</phrase><phrase role="char">'['</phrase><phrase role="special">)</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special">
(</phrase><phrase role="special">
(</phrase><phrase role="special">
*</phrase><phrase role="identifier">table_cell</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="identifier"> ch_p</phrase><phrase role="special">(</phrase><phrase role="char">']'</phrase><phrase role="special">)</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="identifier"> space</phrase><phrase role="special">
)</phrase><phrase role="special">
|</phrase><phrase role="identifier"> eps_p</phrase><phrase role="special">
)</phrase><phrase role="special">
;</phrase><phrase role="identifier">
table_cell</phrase><phrase role="special"> =</phrase><phrase role="identifier">
space</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="identifier"> ch_p</phrase><phrase role="special">(</phrase><phrase role="char">'['</phrase><phrase role="special">)</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special">
(</phrase><phrase role="special">
(</phrase><phrase role="identifier">
phrase</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="identifier"> ch_p</phrase><phrase role="special">(</phrase><phrase role="char">']'</phrase><phrase role="special">)</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="identifier"> space</phrase><phrase role="special">
)</phrase><phrase role="special">
|</phrase><phrase role="identifier"> eps_p</phrase><phrase role="special">
)</phrase><phrase role="special">
;</phrase><phrase role="identifier">
variablelist</phrase><phrase role="special"> =</phrase><phrase role="string">
&quot;variablelist&quot;</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> hard_space</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> (*(</phrase><phrase role="identifier">anychar_p</phrase><phrase role="special"> -</phrase><phrase role="identifier"> eol</phrase><phrase role="special">))</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> +</phrase><phrase role="identifier">eol</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> *</phrase><phrase role="identifier">varlistentry</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="identifier"> eps_p</phrase><phrase role="special">
;</phrase><phrase role="identifier">
varlistentry</phrase><phrase role="special"> =</phrase><phrase role="identifier">
space</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="identifier"> ch_p</phrase><phrase role="special">(</phrase><phrase role="char">'['</phrase><phrase role="special">)</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special">
(</phrase><phrase role="special">
(</phrase><phrase role="identifier">
varlistterm</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> +</phrase><phrase role="identifier">varlistitem</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="identifier"> ch_p</phrase><phrase role="special">(</phrase><phrase role="char">']'</phrase><phrase role="special">)</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="identifier"> space</phrase><phrase role="special">
)</phrase><phrase role="special">
|</phrase><phrase role="identifier"> eps_p</phrase><phrase role="special">
)</phrase><phrase role="special">
;</phrase><phrase role="identifier">
varlistterm</phrase><phrase role="special"> =</phrase><phrase role="identifier">
space</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="identifier"> ch_p</phrase><phrase role="special">(</phrase><phrase role="char">'['</phrase><phrase role="special">)</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special">
(</phrase><phrase role="special">
(</phrase><phrase role="identifier">
phrase</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="identifier"> ch_p</phrase><phrase role="special">(</phrase><phrase role="char">']'</phrase><phrase role="special">)</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="identifier"> space</phrase><phrase role="special">
)</phrase><phrase role="special">
|</phrase><phrase role="identifier"> eps_p</phrase><phrase role="special">
)</phrase><phrase role="special">
;</phrase><phrase role="identifier">
varlistitem</phrase><phrase role="special"> =</phrase><phrase role="identifier">
space</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="identifier"> ch_p</phrase><phrase role="special">(</phrase><phrase role="char">'['</phrase><phrase role="special">)</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special">
(</phrase><phrase role="special">
(</phrase><phrase role="identifier">
phrase</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="identifier"> ch_p</phrase><phrase role="special">(</phrase><phrase role="char">']'</phrase><phrase role="special">)</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="identifier"> space</phrase><phrase role="special">
)</phrase><phrase role="special">
|</phrase><phrase role="identifier"> eps_p</phrase><phrase role="special">
)</phrase><phrase role="special">
;</phrase><phrase role="identifier">
xinclude</phrase><phrase role="special"> =</phrase><phrase role="string">
&quot;xinclude&quot;</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="identifier"> hard_space</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> (*(</phrase><phrase role="identifier">anychar_p</phrase><phrase role="special"> -</phrase><phrase role="identifier">
close_bracket</phrase><phrase role="special">))</phrase><phrase role="special">
;</phrase><phrase role="identifier">
include</phrase><phrase role="special"> =</phrase><phrase role="string">
&quot;include&quot;</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="identifier"> hard_space</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special">
!(</phrase><phrase role="char">
':'</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> (*((</phrase><phrase role="identifier">alnum_p</phrase><phrase role="special"> |</phrase><phrase role="char"> '_'</phrase><phrase role="special">)</phrase><phrase role="special"> -</phrase><phrase role="identifier"> space_p</phrase><phrase role="special">))</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="identifier"> space</phrase><phrase role="special">
)</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> (*(</phrase><phrase role="identifier">anychar_p</phrase><phrase role="special"> -</phrase><phrase role="identifier">
close_bracket</phrase><phrase role="special">))</phrase><phrase role="special">
;</phrase><phrase role="identifier">
identifier</phrase><phrase role="special"> =</phrase><phrase role="special">
*(</phrase><phrase role="identifier">anychar_p</phrase><phrase role="special"> -</phrase><phrase role="special"> (</phrase><phrase role="identifier">space_p</phrase><phrase role="special"> |</phrase><phrase role="char"> ']'</phrase><phrase role="special">))</phrase><phrase role="special">
;</phrase><phrase role="identifier">
source_mode</phrase><phrase role="special"> =</phrase><phrase role="special">
(</phrase><phrase role="identifier">
str_p</phrase><phrase role="special">(</phrase><phrase role="string">&quot;c++&quot;</phrase><phrase role="special">)</phrase><phrase role="special">
|</phrase><phrase role="string"> &quot;python&quot;</phrase><phrase role="special">
)</phrase><phrase role="special">
;</phrase><phrase role="identifier">
code</phrase><phrase role="special"> =</phrase><phrase role="special">
(</phrase><phrase role="identifier">
code_line</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> *(*</phrase><phrase role="identifier">eol</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> code_line</phrase><phrase role="special">)</phrase><phrase role="special">
)</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> +</phrase><phrase role="identifier">eol</phrase><phrase role="special">
;</phrase><phrase role="identifier">
code_line</phrase><phrase role="special"> =</phrase><phrase role="special">
((</phrase><phrase role="identifier">ch_p</phrase><phrase role="special">(</phrase><phrase role="char">' '</phrase><phrase role="special">)</phrase><phrase role="special"> |</phrase><phrase role="char"> '\t'</phrase><phrase role="special">))</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> *(</phrase><phrase role="identifier">anychar_p</phrase><phrase role="special"> -</phrase><phrase role="identifier"> eol</phrase><phrase role="special">)</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> eol</phrase><phrase role="special">
;</phrase><phrase role="identifier">
list</phrase><phrase role="special"> =</phrase><phrase role="identifier">
eps_p</phrase><phrase role="special">(</phrase><phrase role="identifier">ch_p</phrase><phrase role="special">(</phrase><phrase role="char">'*'</phrase><phrase role="special">)</phrase><phrase role="special"> |</phrase><phrase role="char"> '#'</phrase><phrase role="special">)</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="special">
+(</phrase><phrase role="special">
(*</phrase><phrase role="identifier">blank_p</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> (</phrase><phrase role="identifier">ch_p</phrase><phrase role="special">(</phrase><phrase role="char">'*'</phrase><phrase role="special">)</phrase><phrase role="special"> |</phrase><phrase role="char"> '#'</phrase><phrase role="special">))</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> *</phrase><phrase role="identifier">blank_p</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="identifier"> list_item</phrase><phrase role="special">
)</phrase><phrase role="special">
;</phrase><phrase role="identifier">
list_item</phrase><phrase role="special"> =</phrase><phrase role="special">
*(</phrase><phrase role="identifier"> common</phrase><phrase role="special">
|</phrase><phrase role="special"> (</phrase><phrase role="identifier">anychar_p</phrase><phrase role="special"> -</phrase><phrase role="special">
(</phrase><phrase role="identifier"> eol_p</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="special"> *</phrase><phrase role="identifier">blank_p</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> eps_p</phrase><phrase role="special">(</phrase><phrase role="identifier">ch_p</phrase><phrase role="special">(</phrase><phrase role="char">'*'</phrase><phrase role="special">)</phrase><phrase role="special"> |</phrase><phrase role="char"> '#'</phrase><phrase role="special">)</phrase><phrase role="special">
|</phrase><phrase role="special"> (</phrase><phrase role="identifier">eol</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> eol</phrase><phrase role="special">)</phrase><phrase role="special">
)</phrase><phrase role="special">
)</phrase><phrase role="special">
)</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> +</phrase><phrase role="identifier">eol</phrase><phrase role="special">
;</phrase><phrase role="identifier">
common</phrase><phrase role="special"> =</phrase><phrase role="identifier">
self</phrase><phrase role="special">.</phrase><phrase role="identifier">actions</phrase><phrase role="special">.</phrase><phrase role="identifier">macro</phrase><phrase role="special">
|</phrase><phrase role="identifier"> phrase_markup</phrase><phrase role="special">
|</phrase><phrase role="identifier"> inline_code</phrase><phrase role="special">
|</phrase><phrase role="identifier"> simple_format</phrase><phrase role="special">
|</phrase><phrase role="identifier"> escape</phrase><phrase role="special">
|</phrase><phrase role="identifier"> comment</phrase><phrase role="special">
;</phrase><phrase role="identifier">
inline_code</phrase><phrase role="special"> =</phrase><phrase role="char">
'`'</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="special">
(</phrase><phrase role="special">
*(</phrase><phrase role="identifier">anychar_p</phrase><phrase role="special"> -</phrase><phrase role="special">
(</phrase><phrase role="char"> '`'</phrase><phrase role="special">
|</phrase><phrase role="special"> (</phrase><phrase role="identifier">eol</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> eol</phrase><phrase role="special">)</phrase><phrase role="comment"> // Make sure that we don't go
</phrase><phrase role="special"> )</phrase><phrase role="comment"> // past a single block
</phrase><phrase role="special"> )</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> eps_p</phrase><phrase role="special">(</phrase><phrase role="char">'`'</phrase><phrase role="special">)</phrase><phrase role="special">
)</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="char"> '`'</phrase><phrase role="special">
;</phrase><phrase role="identifier">
simple_format</phrase><phrase role="special"> =</phrase><phrase role="identifier">
simple_bold</phrase><phrase role="special">
|</phrase><phrase role="identifier"> simple_italic</phrase><phrase role="special">
|</phrase><phrase role="identifier"> simple_underline</phrase><phrase role="special">
|</phrase><phrase role="identifier"> simple_teletype</phrase><phrase role="special">
|</phrase><phrase role="identifier"> simple_strikethrough</phrase><phrase role="special">
;</phrase><phrase role="identifier">
simple_bold</phrase><phrase role="special"> =</phrase><phrase role="char">
'*'</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="special">
(</phrase><phrase role="special">
(</phrase><phrase role="identifier"> graph_p</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="comment"> // graph_p must follow '*'
</phrase><phrase role="special"> *(</phrase><phrase role="identifier">anychar_p</phrase><phrase role="special"> -</phrase><phrase role="special">
(</phrase><phrase role="identifier"> eol</phrase><phrase role="comment"> // Make sure that we don't go
</phrase><phrase role="special"> |</phrase><phrase role="special"> (</phrase><phrase role="identifier">graph_p</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="char"> '*'</phrase><phrase role="special">)</phrase><phrase role="comment"> // past a single line
</phrase><phrase role="special"> )</phrase><phrase role="special">
)</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> graph_p</phrase><phrase role="comment"> // graph_p must precede '*'
</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> eps_p</phrase><phrase role="special">(</phrase><phrase role="char">'*'</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> (</phrase><phrase role="identifier">space_p</phrase><phrase role="special"> |</phrase><phrase role="identifier"> punct_p</phrase><phrase role="special">))</phrase><phrase role="comment"> // space_p or punct_p must
</phrase><phrase role="special"> )</phrase><phrase role="comment"> // follow '*'
</phrase><phrase role="special"> |</phrase><phrase role="special"> (</phrase><phrase role="identifier">
graph_p</phrase><phrase role="comment"> // A single char. e.g. *c*
</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> eps_p</phrase><phrase role="special">(</phrase><phrase role="char">'*'</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> (</phrase><phrase role="identifier">space_p</phrase><phrase role="special"> |</phrase><phrase role="identifier"> punct_p</phrase><phrase role="special">))</phrase><phrase role="special">
)</phrase><phrase role="special">
)</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="char"> '*'</phrase><phrase role="special">
;</phrase><phrase role="identifier">
simple_italic</phrase><phrase role="special"> =</phrase><phrase role="char">
'/'</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="special">
(</phrase><phrase role="special">
(</phrase><phrase role="identifier"> graph_p</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="comment"> // graph_p must follow '/'
</phrase><phrase role="special"> *(</phrase><phrase role="identifier">anychar_p</phrase><phrase role="special"> -</phrase><phrase role="special">
(</phrase><phrase role="identifier"> eol</phrase><phrase role="comment"> // Make sure that we don't go
</phrase><phrase role="special"> |</phrase><phrase role="special"> (</phrase><phrase role="identifier">graph_p</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="char"> '/'</phrase><phrase role="special">)</phrase><phrase role="comment"> // past a single line
</phrase><phrase role="special"> )</phrase><phrase role="special">
)</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> graph_p</phrase><phrase role="comment"> // graph_p must precede '/'
</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> eps_p</phrase><phrase role="special">(</phrase><phrase role="char">'/'</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> (</phrase><phrase role="identifier">space_p</phrase><phrase role="special"> |</phrase><phrase role="identifier"> punct_p</phrase><phrase role="special">))</phrase><phrase role="comment"> // space_p or punct_p must
</phrase><phrase role="special"> )</phrase><phrase role="comment"> // follow '/'
</phrase><phrase role="special"> |</phrase><phrase role="special"> (</phrase><phrase role="identifier">
graph_p</phrase><phrase role="comment"> // A single char. e.g. /c/
</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> eps_p</phrase><phrase role="special">(</phrase><phrase role="char">'/'</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> (</phrase><phrase role="identifier">space_p</phrase><phrase role="special"> |</phrase><phrase role="identifier"> punct_p</phrase><phrase role="special">))</phrase><phrase role="special">
)</phrase><phrase role="special">
)</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="char"> '/'</phrase><phrase role="special">
;</phrase><phrase role="identifier">
simple_underline</phrase><phrase role="special"> =</phrase><phrase role="char">
'_'</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="special">
(</phrase><phrase role="special">
(</phrase><phrase role="identifier"> graph_p</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="comment"> // graph_p must follow '_'
</phrase><phrase role="special"> *(</phrase><phrase role="identifier">anychar_p</phrase><phrase role="special"> -</phrase><phrase role="special">
(</phrase><phrase role="identifier"> eol</phrase><phrase role="comment"> // Make sure that we don't go
</phrase><phrase role="special"> |</phrase><phrase role="special"> (</phrase><phrase role="identifier">graph_p</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="char"> '_'</phrase><phrase role="special">)</phrase><phrase role="comment"> // past a single line
</phrase><phrase role="special"> )</phrase><phrase role="special">
)</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> graph_p</phrase><phrase role="comment"> // graph_p must precede '_'
</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> eps_p</phrase><phrase role="special">(</phrase><phrase role="char">'_'</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> (</phrase><phrase role="identifier">space_p</phrase><phrase role="special"> |</phrase><phrase role="identifier"> punct_p</phrase><phrase role="special">))</phrase><phrase role="comment"> // space_p or punct_p must
</phrase><phrase role="special"> )</phrase><phrase role="comment"> // follow '_'
</phrase><phrase role="special"> |</phrase><phrase role="special"> (</phrase><phrase role="identifier">
graph_p</phrase><phrase role="comment"> // A single char. e.g. _c_
</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> eps_p</phrase><phrase role="special">(</phrase><phrase role="char">'_'</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> (</phrase><phrase role="identifier">space_p</phrase><phrase role="special"> |</phrase><phrase role="identifier"> punct_p</phrase><phrase role="special">))</phrase><phrase role="special">
)</phrase><phrase role="special">
)</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="char"> '_'</phrase><phrase role="special">
;</phrase><phrase role="identifier">
simple_teletype</phrase><phrase role="special"> =</phrase><phrase role="char">
'='</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="special">
(</phrase><phrase role="special">
(</phrase><phrase role="identifier"> graph_p</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="comment"> // graph_p must follow '='
</phrase><phrase role="special"> *(</phrase><phrase role="identifier">anychar_p</phrase><phrase role="special"> -</phrase><phrase role="special">
(</phrase><phrase role="identifier"> eol</phrase><phrase role="comment"> // Make sure that we don't go
</phrase><phrase role="special"> |</phrase><phrase role="special"> (</phrase><phrase role="identifier">graph_p</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="char"> '='</phrase><phrase role="special">)</phrase><phrase role="comment"> // past a single line
</phrase><phrase role="special"> )</phrase><phrase role="special">
)</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> graph_p</phrase><phrase role="comment"> // graph_p must precede '='
</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> eps_p</phrase><phrase role="special">(</phrase><phrase role="char">'='</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> (</phrase><phrase role="identifier">space_p</phrase><phrase role="special"> |</phrase><phrase role="identifier"> punct_p</phrase><phrase role="special">))</phrase><phrase role="comment"> // space_p or punct_p must
</phrase><phrase role="special"> )</phrase><phrase role="comment"> // follow '='
</phrase><phrase role="special"> |</phrase><phrase role="special"> (</phrase><phrase role="identifier">
graph_p</phrase><phrase role="comment"> // A single char. e.g. =c=
</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> eps_p</phrase><phrase role="special">(</phrase><phrase role="char">'='</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> (</phrase><phrase role="identifier">space_p</phrase><phrase role="special"> |</phrase><phrase role="identifier"> punct_p</phrase><phrase role="special">))</phrase><phrase role="special">
)</phrase><phrase role="special">
)</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="char"> '='</phrase><phrase role="special">
;</phrase><phrase role="identifier">
simple_strikethrough</phrase><phrase role="special"> =</phrase><phrase role="char">
'-'</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="special">
(</phrase><phrase role="special">
(</phrase><phrase role="identifier"> graph_p</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="comment"> // graph_p must follow '-'
</phrase><phrase role="special"> *(</phrase><phrase role="identifier">anychar_p</phrase><phrase role="special"> -</phrase><phrase role="special">
(</phrase><phrase role="identifier"> eol</phrase><phrase role="comment"> // Make sure that we don't go
</phrase><phrase role="special"> |</phrase><phrase role="special"> (</phrase><phrase role="identifier">graph_p</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="char"> '-'</phrase><phrase role="special">)</phrase><phrase role="comment"> // past a single line
</phrase><phrase role="special"> )</phrase><phrase role="special">
)</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> graph_p</phrase><phrase role="comment"> // graph_p must precede '-'
</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> eps_p</phrase><phrase role="special">(</phrase><phrase role="char">'-'</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> (</phrase><phrase role="identifier">space_p</phrase><phrase role="special"> |</phrase><phrase role="identifier"> punct_p</phrase><phrase role="special">))</phrase><phrase role="comment"> // space_p or punct_p must
</phrase><phrase role="special"> )</phrase><phrase role="comment"> // follow '-'
</phrase><phrase role="special"> |</phrase><phrase role="special"> (</phrase><phrase role="identifier">
graph_p</phrase><phrase role="comment"> // A single char. e.g. =c=
</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> eps_p</phrase><phrase role="special">(</phrase><phrase role="char">'-'</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> (</phrase><phrase role="identifier">space_p</phrase><phrase role="special"> |</phrase><phrase role="identifier"> punct_p</phrase><phrase role="special">))</phrase><phrase role="special">
)</phrase><phrase role="special">
)</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="char"> '-'</phrase><phrase role="special">
;</phrase><phrase role="identifier">
paragraph</phrase><phrase role="special"> =</phrase><phrase role="special">
*(</phrase><phrase role="identifier"> common</phrase><phrase role="special">
|</phrase><phrase role="special"> (</phrase><phrase role="identifier">anychar_p</phrase><phrase role="special"> -</phrase><phrase role="comment"> // Make sure we don't go past
</phrase><phrase role="special"> (</phrase><phrase role="identifier">eol</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> eol</phrase><phrase role="special">)</phrase><phrase role="comment"> // a single block.
</phrase><phrase role="special"> )</phrase><phrase role="special">
)</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> +</phrase><phrase role="identifier">eol</phrase><phrase role="special">
;</phrase><phrase role="identifier">
phrase</phrase><phrase role="special"> =</phrase><phrase role="special">
*(</phrase><phrase role="identifier"> common</phrase><phrase role="special">
|</phrase><phrase role="identifier"> comment</phrase><phrase role="special">
|</phrase><phrase role="special"> (</phrase><phrase role="identifier">anychar_p</phrase><phrase role="special"> -</phrase><phrase role="identifier">
close_bracket</phrase><phrase role="special">)</phrase><phrase role="special">
)</phrase><phrase role="special">
;</phrase><phrase role="identifier">
phrase_markup</phrase><phrase role="special"> =</phrase><phrase role="char">
'['</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> (</phrase><phrase role="identifier"> image</phrase><phrase role="special">
|</phrase><phrase role="identifier"> url</phrase><phrase role="special">
|</phrase><phrase role="identifier"> link</phrase><phrase role="special">
|</phrase><phrase role="identifier"> anchor</phrase><phrase role="special">
|</phrase><phrase role="identifier"> source_mode</phrase><phrase role="special">
|</phrase><phrase role="identifier"> funcref</phrase><phrase role="special">
|</phrase><phrase role="identifier"> classref</phrase><phrase role="special">
|</phrase><phrase role="identifier"> memberref</phrase><phrase role="special">
|</phrase><phrase role="identifier"> enumref</phrase><phrase role="special">
|</phrase><phrase role="identifier"> headerref</phrase><phrase role="special">
|</phrase><phrase role="identifier"> bold</phrase><phrase role="special">
|</phrase><phrase role="identifier"> italic</phrase><phrase role="special">
|</phrase><phrase role="identifier"> underline</phrase><phrase role="special">
|</phrase><phrase role="identifier"> teletype</phrase><phrase role="special">
|</phrase><phrase role="identifier"> strikethrough</phrase><phrase role="special">
|</phrase><phrase role="identifier"> str_p</phrase><phrase role="special">(</phrase><phrase role="string">&quot;br&quot;</phrase><phrase role="special">)</phrase><phrase role="special">
)</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="char"> ']'</phrase><phrase role="special">
;</phrase><phrase role="identifier">
escape</phrase><phrase role="special"> =</phrase><phrase role="identifier">
str_p</phrase><phrase role="special">(</phrase><phrase role="string">&quot;\\n&quot;</phrase><phrase role="special">)</phrase><phrase role="special">
|</phrase><phrase role="char"> '\\'</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> punct_p</phrase><phrase role="special">
|</phrase><phrase role="special"> (</phrase><phrase role="string">
&quot;'''&quot;</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="special"> !</phrase><phrase role="identifier">eol</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> *(</phrase><phrase role="identifier">anychar_p</phrase><phrase role="special"> -</phrase><phrase role="string"> &quot;'''&quot;</phrase><phrase role="special">)</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="string"> &quot;'''&quot;</phrase><phrase role="special">
)</phrase><phrase role="special">
;</phrase><phrase role="identifier">
image</phrase><phrase role="special"> =</phrase><phrase role="char">
'$'</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> blank</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> (*(</phrase><phrase role="identifier">anychar_p</phrase><phrase role="special"> -</phrase><phrase role="identifier">
close_bracket</phrase><phrase role="special">))</phrase><phrase role="special">
;</phrase><phrase role="identifier">
url</phrase><phrase role="special"> =</phrase><phrase role="char">
'@'</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> (*(</phrase><phrase role="identifier">anychar_p</phrase><phrase role="special"> -</phrase><phrase role="special">
(</phrase><phrase role="char">']'</phrase><phrase role="special"> |</phrase><phrase role="identifier"> hard_space</phrase><phrase role="special">)))</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> (</phrase><phrase role="identifier"> eps_p</phrase><phrase role="special">(</phrase><phrase role="char">']'</phrase><phrase role="special">)</phrase><phrase role="special">
|</phrase><phrase role="special"> (</phrase><phrase role="identifier">hard_space</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> phrase</phrase><phrase role="special">)</phrase><phrase role="special">
)</phrase><phrase role="special">
;</phrase><phrase role="identifier">
link</phrase><phrase role="special"> =</phrase><phrase role="string">
&quot;link&quot;</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> hard_space</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> (*(</phrase><phrase role="identifier">anychar_p</phrase><phrase role="special"> -</phrase><phrase role="special">
(</phrase><phrase role="char">']'</phrase><phrase role="special"> |</phrase><phrase role="identifier"> hard_space</phrase><phrase role="special">)))</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> (</phrase><phrase role="identifier"> eps_p</phrase><phrase role="special">(</phrase><phrase role="char">']'</phrase><phrase role="special">)</phrase><phrase role="special">
|</phrase><phrase role="special"> (</phrase><phrase role="identifier">hard_space</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> phrase</phrase><phrase role="special">)</phrase><phrase role="special">
)</phrase><phrase role="special">
;</phrase><phrase role="identifier">
anchor</phrase><phrase role="special"> =</phrase><phrase role="char">
'#'</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="identifier"> blank</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> (</phrase><phrase role="special"> *(</phrase><phrase role="identifier">anychar_p</phrase><phrase role="special"> -</phrase><phrase role="identifier">
close_bracket</phrase><phrase role="special">)</phrase><phrase role="special">
)</phrase><phrase role="special">
;</phrase><phrase role="identifier">
funcref</phrase><phrase role="special"> =</phrase><phrase role="string">
&quot;funcref&quot;</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> hard_space</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> (*(</phrase><phrase role="identifier">anychar_p</phrase><phrase role="special"> -</phrase><phrase role="special">
(</phrase><phrase role="char">']'</phrase><phrase role="special"> |</phrase><phrase role="identifier"> hard_space</phrase><phrase role="special">)))</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> (</phrase><phrase role="identifier"> eps_p</phrase><phrase role="special">(</phrase><phrase role="char">']'</phrase><phrase role="special">)</phrase><phrase role="special">
|</phrase><phrase role="special"> (</phrase><phrase role="identifier">hard_space</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> phrase</phrase><phrase role="special">)</phrase><phrase role="special">
)</phrase><phrase role="special">
;</phrase><phrase role="identifier">
classref</phrase><phrase role="special"> =</phrase><phrase role="string">
&quot;classref&quot;</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> hard_space</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> (*(</phrase><phrase role="identifier">anychar_p</phrase><phrase role="special"> -</phrase><phrase role="special">
(</phrase><phrase role="char">']'</phrase><phrase role="special"> |</phrase><phrase role="identifier"> hard_space</phrase><phrase role="special">)))</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> (</phrase><phrase role="identifier"> eps_p</phrase><phrase role="special">(</phrase><phrase role="char">']'</phrase><phrase role="special">)</phrase><phrase role="special">
|</phrase><phrase role="special"> (</phrase><phrase role="identifier">hard_space</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> phrase</phrase><phrase role="special">)</phrase><phrase role="special">
)</phrase><phrase role="special">
;</phrase><phrase role="identifier">
memberref</phrase><phrase role="special"> =</phrase><phrase role="string">
&quot;memberref&quot;</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> hard_space</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> (*(</phrase><phrase role="identifier">anychar_p</phrase><phrase role="special"> -</phrase><phrase role="special">
(</phrase><phrase role="char">']'</phrase><phrase role="special"> |</phrase><phrase role="identifier"> hard_space</phrase><phrase role="special">)))</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> (</phrase><phrase role="identifier"> eps_p</phrase><phrase role="special">(</phrase><phrase role="char">']'</phrase><phrase role="special">)</phrase><phrase role="special">
|</phrase><phrase role="special"> (</phrase><phrase role="identifier">hard_space</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> phrase</phrase><phrase role="special">)</phrase><phrase role="special">
)</phrase><phrase role="special">
;</phrase><phrase role="identifier">
enumref</phrase><phrase role="special"> =</phrase><phrase role="string">
&quot;enumref&quot;</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> hard_space</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> (*(</phrase><phrase role="identifier">anychar_p</phrase><phrase role="special"> -</phrase><phrase role="special">
(</phrase><phrase role="char">']'</phrase><phrase role="special"> |</phrase><phrase role="identifier"> hard_space</phrase><phrase role="special">)))</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> (</phrase><phrase role="identifier"> eps_p</phrase><phrase role="special">(</phrase><phrase role="char">']'</phrase><phrase role="special">)</phrase><phrase role="special">
|</phrase><phrase role="special"> (</phrase><phrase role="identifier">hard_space</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> phrase</phrase><phrase role="special">)</phrase><phrase role="special">
)</phrase><phrase role="special">
;</phrase><phrase role="identifier">
headerref</phrase><phrase role="special"> =</phrase><phrase role="string">
&quot;headerref&quot;</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> hard_space</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> (*(</phrase><phrase role="identifier">anychar_p</phrase><phrase role="special"> -</phrase><phrase role="special">
(</phrase><phrase role="char">']'</phrase><phrase role="special"> |</phrase><phrase role="identifier"> hard_space</phrase><phrase role="special">)))</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> (</phrase><phrase role="identifier"> eps_p</phrase><phrase role="special">(</phrase><phrase role="char">']'</phrase><phrase role="special">)</phrase><phrase role="special">
|</phrase><phrase role="special"> (</phrase><phrase role="identifier">hard_space</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> phrase</phrase><phrase role="special">)</phrase><phrase role="special">
)</phrase><phrase role="special">
;</phrase><phrase role="identifier">
bold</phrase><phrase role="special"> =</phrase><phrase role="identifier">
ch_p</phrase><phrase role="special">(</phrase><phrase role="char">'*'</phrase><phrase role="special">)</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="identifier"> blank</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> phrase</phrase><phrase role="special">
;</phrase><phrase role="identifier">
italic</phrase><phrase role="special"> =</phrase><phrase role="identifier">
ch_p</phrase><phrase role="special">(</phrase><phrase role="char">'\''</phrase><phrase role="special">)</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="identifier"> blank</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> phrase</phrase><phrase role="special">
;</phrase><phrase role="identifier">
underline</phrase><phrase role="special"> =</phrase><phrase role="identifier">
ch_p</phrase><phrase role="special">(</phrase><phrase role="char">'_'</phrase><phrase role="special">)</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="identifier"> blank</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> phrase</phrase><phrase role="special">
;</phrase><phrase role="identifier">
teletype</phrase><phrase role="special"> =</phrase><phrase role="identifier">
ch_p</phrase><phrase role="special">(</phrase><phrase role="char">'^'</phrase><phrase role="special">)</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="identifier"> blank</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> phrase</phrase><phrase role="special">
;</phrase><phrase role="identifier">
strikethrough</phrase><phrase role="special"> =</phrase><phrase role="identifier">
ch_p</phrase><phrase role="special">(</phrase><phrase role="char">'-'</phrase><phrase role="special">)</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="identifier"> blank</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> phrase</phrase><phrase role="special">
;</phrase>
</literal>
</programlisting>
</section>
<section id="quickbook.highlight">
<title> C++ Syntax Highlighting Grammar</title>
<programlisting>
<literal>
<phrase role="identifier">program</phrase><phrase role="special">
=</phrase><phrase role="special">
*(</phrase><phrase role="identifier"> macro</phrase><phrase role="special">
|</phrase><phrase role="identifier"> preprocessor</phrase><phrase role="special">
|</phrase><phrase role="identifier"> comment</phrase><phrase role="special">
|</phrase><phrase role="identifier"> keyword</phrase><phrase role="special">
|</phrase><phrase role="identifier"> identifier</phrase><phrase role="special">
|</phrase><phrase role="identifier"> special</phrase><phrase role="special">
|</phrase><phrase role="identifier"> string_</phrase><phrase role="special">
|</phrase><phrase role="identifier"> char_</phrase><phrase role="special">
|</phrase><phrase role="identifier"> number</phrase><phrase role="special">
|</phrase><phrase role="identifier"> space_p</phrase><phrase role="special">
|</phrase><phrase role="identifier"> anychar_p</phrase><phrase role="special">
)</phrase><phrase role="special">
;</phrase><phrase role="identifier">
macro</phrase><phrase role="special">
=</phrase><phrase role="special"> *</phrase><phrase role="identifier">space_p</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> self</phrase><phrase role="special">.</phrase><phrase role="identifier">macro</phrase><phrase role="special">
;</phrase><phrase role="identifier">
preprocessor</phrase><phrase role="special">
=</phrase><phrase role="special"> *</phrase><phrase role="identifier">space_p</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="char"> '#'</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="special"> ((</phrase><phrase role="identifier">alpha_p</phrase><phrase role="special"> |</phrase><phrase role="char"> '_'</phrase><phrase role="special">)</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="special"> *(</phrase><phrase role="identifier">alnum_p</phrase><phrase role="special"> |</phrase><phrase role="char"> '_'</phrase><phrase role="special">))</phrase><phrase role="special">
;</phrase><phrase role="identifier">
comment</phrase><phrase role="special">
=</phrase><phrase role="special"> +(*</phrase><phrase role="identifier">space_p</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="special"> (</phrase><phrase role="identifier">comment_p</phrase><phrase role="special">(</phrase><phrase role="string">&quot;//&quot;</phrase><phrase role="special">)</phrase><phrase role="special"> |</phrase><phrase role="identifier"> comment_p</phrase><phrase role="special">(</phrase><phrase role="string">&quot;/*&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;*/&quot;</phrase><phrase role="special">)))</phrase><phrase role="special">
;</phrase><phrase role="identifier">
keyword</phrase><phrase role="special">
=</phrase><phrase role="special"> *</phrase><phrase role="identifier">space_p</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> keyword_</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="special"> (</phrase><phrase role="identifier">eps_p</phrase><phrase role="special"> -</phrase><phrase role="special"> (</phrase><phrase role="identifier">alnum_p</phrase><phrase role="special"> |</phrase><phrase role="char"> '_'</phrase><phrase role="special">))</phrase><phrase role="special">
;</phrase><phrase role="comment"> // make sure we recognize whole words only
</phrase><phrase role="identifier">
keyword_</phrase><phrase role="special">
=</phrase><phrase role="string"> &quot;and_eq&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;and&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;asm&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;auto&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;bitand&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;bitor&quot;</phrase><phrase role="special">,</phrase><phrase role="string">
&quot;bool&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;break&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;case&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;catch&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;char&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;class&quot;</phrase><phrase role="special">,</phrase><phrase role="string">
&quot;compl&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;const_cast&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;const&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;continue&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;default&quot;</phrase><phrase role="special">,</phrase><phrase role="string">
&quot;delete&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;do&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;double&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;dynamic_cast&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;else&quot;</phrase><phrase role="special">,</phrase><phrase role="string">
&quot;enum&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;explicit&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;export&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;extern&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;false&quot;</phrase><phrase role="special">,</phrase><phrase role="string">
&quot;float&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;for&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;friend&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;goto&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;if&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;inline&quot;</phrase><phrase role="special">,</phrase><phrase role="string">
&quot;int&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;long&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;mutable&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;namespace&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;new&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;not_eq&quot;</phrase><phrase role="special">,</phrase><phrase role="string">
&quot;not&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;operator&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;or_eq&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;or&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;private&quot;</phrase><phrase role="special">,</phrase><phrase role="string">
&quot;protected&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;public&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;register&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;reinterpret_cast&quot;</phrase><phrase role="special">,</phrase><phrase role="string">
&quot;return&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;short&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;signed&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;sizeof&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;static&quot;</phrase><phrase role="special">,</phrase><phrase role="string">
&quot;static_cast&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;struct&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;switch&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;template&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;this&quot;</phrase><phrase role="special">,</phrase><phrase role="string">
&quot;throw&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;true&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;try&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;typedef&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;typeid&quot;</phrase><phrase role="special">,</phrase><phrase role="string">
&quot;typename&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;union&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;unsigned&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;using&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;virtual&quot;</phrase><phrase role="special">,</phrase><phrase role="string">
&quot;void&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;volatile&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;wchar_t&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;while&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;xor_eq&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;xor&quot;</phrase><phrase role="special">
;</phrase><phrase role="identifier">
special</phrase><phrase role="special">
=</phrase><phrase role="special"> *</phrase><phrase role="identifier">space_p</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="special"> +</phrase><phrase role="identifier">chset_p</phrase><phrase role="special">(</phrase><phrase role="string">&quot;~!%^&amp;*()+={[}]:;,&lt;.&gt;?/|\\-&quot;</phrase><phrase role="special">)</phrase><phrase role="special">
;</phrase><phrase role="identifier">
string_</phrase><phrase role="special">
=</phrase><phrase role="special"> *</phrase><phrase role="identifier">space_p</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="special"> !</phrase><phrase role="identifier">as_lower_d</phrase><phrase role="special">[</phrase><phrase role="char">'l'</phrase><phrase role="special">]</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> confix_p</phrase><phrase role="special">(</phrase><phrase role="char">'&quot;'</phrase><phrase role="special">,</phrase><phrase role="special"> *</phrase><phrase role="identifier">c_escape_ch_p</phrase><phrase role="special">,</phrase><phrase role="char"> '&quot;'</phrase><phrase role="special">)</phrase><phrase role="special">
;</phrase><phrase role="identifier">
char_</phrase><phrase role="special">
=</phrase><phrase role="special"> *</phrase><phrase role="identifier">space_p</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="special"> !</phrase><phrase role="identifier">as_lower_d</phrase><phrase role="special">[</phrase><phrase role="char">'l'</phrase><phrase role="special">]</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> confix_p</phrase><phrase role="special">(</phrase><phrase role="char">'\''</phrase><phrase role="special">,</phrase><phrase role="special"> *</phrase><phrase role="identifier">c_escape_ch_p</phrase><phrase role="special">,</phrase><phrase role="char"> '\''</phrase><phrase role="special">)</phrase><phrase role="special">
;</phrase><phrase role="identifier">
number</phrase><phrase role="special">
=</phrase><phrase role="special"> *</phrase><phrase role="identifier">space_p</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="special">
(</phrase><phrase role="identifier"> as_lower_d</phrase><phrase role="special">[</phrase><phrase role="string">&quot;0x&quot;</phrase><phrase role="special">]</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> hex_p</phrase><phrase role="special">
|</phrase><phrase role="char"> '0'</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> oct_p</phrase><phrase role="special">
|</phrase><phrase role="identifier"> real_p</phrase><phrase role="special">
)</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> *</phrase><phrase role="identifier">as_lower_d</phrase><phrase role="special">[</phrase><phrase role="identifier">chset_p</phrase><phrase role="special">(</phrase><phrase role="string">&quot;ldfu&quot;</phrase><phrase role="special">)]</phrase><phrase role="special">
;</phrase><phrase role="identifier">
identifier</phrase><phrase role="special">
=</phrase><phrase role="special"> *</phrase><phrase role="identifier">space_p</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="special"> ((</phrase><phrase role="identifier">alpha_p</phrase><phrase role="special"> |</phrase><phrase role="char"> '_'</phrase><phrase role="special">)</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="special"> *(</phrase><phrase role="identifier">alnum_p</phrase><phrase role="special"> |</phrase><phrase role="char"> '_'</phrase><phrase role="special">))</phrase><phrase role="special">
;</phrase>
</literal>
</programlisting>
</section>
<section id="quickbook.pyhighlight">
<title> Python Syntax Highlighting Grammar</title>
<para>
</para>
<programlisting>
<literal>
<phrase role="identifier">program</phrase><phrase role="special">
=</phrase><phrase role="special">
*(</phrase><phrase role="identifier"> macro</phrase><phrase role="special">
|</phrase><phrase role="identifier"> comment</phrase><phrase role="special">
|</phrase><phrase role="identifier"> keyword</phrase><phrase role="special">
|</phrase><phrase role="identifier"> identifier</phrase><phrase role="special">
|</phrase><phrase role="identifier"> special</phrase><phrase role="special">
|</phrase><phrase role="identifier"> string_</phrase><phrase role="special">
|</phrase><phrase role="identifier"> number</phrase><phrase role="special">
|</phrase><phrase role="identifier"> space_p</phrase><phrase role="special">
|</phrase><phrase role="identifier"> anychar_p</phrase><phrase role="special">
)</phrase><phrase role="special">
;</phrase><phrase role="identifier">
acro</phrase><phrase role="special">
=</phrase><phrase role="special"> *</phrase><phrase role="identifier">space_p</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> self</phrase><phrase role="special">.</phrase><phrase role="identifier">macro</phrase><phrase role="special">
;</phrase><phrase role="identifier">
comment</phrase><phrase role="special">
=</phrase><phrase role="special"> +(*</phrase><phrase role="identifier">space_p</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> comment_p</phrase><phrase role="special">(</phrase><phrase role="string">&quot;#&quot;</phrase><phrase role="special">))</phrase><phrase role="special">
;</phrase><phrase role="identifier">
keyword</phrase><phrase role="special">
=</phrase><phrase role="special"> *</phrase><phrase role="identifier">space_p</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> keyword_</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="special"> (</phrase><phrase role="identifier">eps_p</phrase><phrase role="special"> -</phrase><phrase role="special"> (</phrase><phrase role="identifier">alnum_p</phrase><phrase role="special"> |</phrase><phrase role="char"> '_'</phrase><phrase role="special">))</phrase><phrase role="special">
;</phrase><phrase role="comment"> // make sure we recognize whole words only
</phrase><phrase role="identifier">
keyword_</phrase><phrase role="special">
=</phrase><phrase role="string">
&quot;and&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;del&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;for&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;is&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;raise&quot;</phrase><phrase role="special">,</phrase><phrase role="string">
&quot;assert&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;elif&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;from&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;lambda&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;return&quot;</phrase><phrase role="special">,</phrase><phrase role="string">
&quot;break&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;else&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;global&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;not&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;try&quot;</phrase><phrase role="special">,</phrase><phrase role="string">
&quot;class&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;except&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;if&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;or&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;while&quot;</phrase><phrase role="special">,</phrase><phrase role="string">
&quot;continue&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;exec&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;import&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;pass&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;yield&quot;</phrase><phrase role="special">,</phrase><phrase role="string">
&quot;def&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;finally&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;in&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;print&quot;</phrase><phrase role="special">,</phrase><phrase role="comment">
// Technically &quot;as&quot; and &quot;None&quot; are not yet keywords (at Python
// 2.4). They are destined to become keywords, and we treat them
// as such for syntax highlighting purposes.
</phrase><phrase role="string">
&quot;as&quot;</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;None&quot;</phrase><phrase role="special">
;</phrase><phrase role="identifier">
special</phrase><phrase role="special">
=</phrase><phrase role="special"> *</phrase><phrase role="identifier">space_p</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="special"> +</phrase><phrase role="identifier">chset_p</phrase><phrase role="special">(</phrase><phrase role="string">&quot;~!%^&amp;*()+={[}]:;,&lt;.&gt;/|\\-&quot;</phrase><phrase role="special">)</phrase><phrase role="special">
;</phrase><phrase role="identifier">
string_prefix</phrase><phrase role="special">
=</phrase><phrase role="identifier"> as_lower_d</phrase><phrase role="special">[</phrase><phrase role="identifier">str_p</phrase><phrase role="special">(</phrase><phrase role="string">&quot;u&quot;</phrase><phrase role="special">)</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="special"> !</phrase><phrase role="identifier"> str_p</phrase><phrase role="special">(</phrase><phrase role="string">&quot;r&quot;</phrase><phrase role="special">)]</phrase><phrase role="special">
;</phrase><phrase role="identifier">
string_</phrase><phrase role="special">
=</phrase><phrase role="special"> *</phrase><phrase role="identifier">space_p</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="special"> !</phrase><phrase role="identifier"> string_prefix</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="special"> (</phrase><phrase role="identifier">long_string</phrase><phrase role="special"> |</phrase><phrase role="identifier"> short_string</phrase><phrase role="special">)</phrase><phrase role="special">
;</phrase><phrase role="identifier">
short_string</phrase><phrase role="special">
=</phrase><phrase role="identifier"> confix_p</phrase><phrase role="special">(</phrase><phrase role="char">'&quot;'</phrase><phrase role="special">,</phrase><phrase role="special"> *</phrase><phrase role="identifier"> c_escape_ch_p</phrase><phrase role="special">,</phrase><phrase role="char"> '&quot;'</phrase><phrase role="special">)</phrase><phrase role="special"> |</phrase><phrase role="identifier">
confix_p</phrase><phrase role="special">(</phrase><phrase role="char">'\''</phrase><phrase role="special">,</phrase><phrase role="special"> *</phrase><phrase role="identifier"> c_escape_ch_p</phrase><phrase role="special">,</phrase><phrase role="char"> '\''</phrase><phrase role="special">)</phrase><phrase role="special">
;</phrase><phrase role="identifier">
long_string</phrase><phrase role="special">
=</phrase><phrase role="identifier"> confix_p</phrase><phrase role="special">(</phrase><phrase role="string">&quot;'''&quot;</phrase><phrase role="special">,</phrase><phrase role="special"> *</phrase><phrase role="identifier"> lex_escape_ch_p</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;'''&quot;</phrase><phrase role="special">)</phrase><phrase role="special"> |</phrase><phrase role="identifier">
confix_p</phrase><phrase role="special">(</phrase><phrase role="string">&quot;\&quot;\&quot;\&quot;&quot;</phrase><phrase role="special">,</phrase><phrase role="special"> *</phrase><phrase role="identifier"> lex_escape_ch_p</phrase><phrase role="special">,</phrase><phrase role="string"> &quot;\&quot;\&quot;\&quot;&quot;</phrase><phrase role="special">)</phrase><phrase role="special">
;</phrase><phrase role="identifier">
number</phrase><phrase role="special">
=</phrase><phrase role="special"> *</phrase><phrase role="identifier">space_p</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="special">
(</phrase><phrase role="identifier">
as_lower_d</phrase><phrase role="special">[</phrase><phrase role="string">&quot;0x&quot;</phrase><phrase role="special">]</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> hex_p</phrase><phrase role="special">
|</phrase><phrase role="char"> '0'</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="identifier"> oct_p</phrase><phrase role="special">
|</phrase><phrase role="identifier"> real_p</phrase><phrase role="special">
)</phrase><phrase role="special">
&gt;&gt;</phrase><phrase role="special"> *</phrase><phrase role="identifier">as_lower_d</phrase><phrase role="special">[</phrase><phrase role="identifier">chset_p</phrase><phrase role="special">(</phrase><phrase role="string">&quot;lj&quot;</phrase><phrase role="special">)]</phrase><phrase role="special">
;</phrase><phrase role="identifier">
identifier</phrase><phrase role="special">
=</phrase><phrase role="special"> *</phrase><phrase role="identifier">space_p</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="special"> ((</phrase><phrase role="identifier">alpha_p</phrase><phrase role="special"> |</phrase><phrase role="char"> '_'</phrase><phrase role="special">)</phrase><phrase role="special"> &gt;&gt;</phrase><phrase role="special"> *(</phrase><phrase role="identifier">alnum_p</phrase><phrase role="special"> |</phrase><phrase role="char"> '_'</phrase><phrase role="special">))</phrase><phrase role="special">
;</phrase>
</literal>
</programlisting>
</section>
</part>