Sophie

Sophie

distrib > Mandriva > 9.1 > i586 > by-pkgid > b9ba69a436161613d8fb030c8c726a8e > files > 535

spirit-1.5.1-2mdk.noarch.rpm

<html>
<head>
<!-- Generated by the Spirit (http://spirit.sf.net) QuickDoc -->
<title>Syntax Summary</title>
<link rel="stylesheet" href="theme/style.css" type="text/css">
<link rel="prev" href="introduction.html">
<link rel="next" href="grammar.html">
</head>
<body>
<table width="100%" height="48" border="0" background="theme/bkd2.gif" cellspacing="2">
  <tr>
    <td width="10">
    </td>
    <td width="85%">
      <font size="6" face="Verdana, Arial, Helvetica, sans-serif"><b>Syntax Summary</b></font>
    </td>
    <td width="112"><a href="http://spirit.sf.net"><img src="theme/spirit.gif" align="right" border="0"></a></td>
  </tr>
</table>
<br>
<table border="0">
  <tr>
    <td width="30"><a href="../index.html"><img src="theme/u_arr.gif" border="0"></a></td>
    <td width="30"><a href="introduction.html"><img src="theme/l_arr.gif" border="0"></a></td>
    <td width="20"><a href="grammar.html"><img src="theme/r_arr.gif" border="0"></a></td>
   </tr>
</table>
<p>
A QuickDoc 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 its own grammar, 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.</p>
<a name="comments"></a><h2>Comments</h2><p>
Can be placed anywhere.</p>
<code><pre>
    [/ comment (no html generated) ]
</pre></code><a name="phrase_level_elements"></a><h2>Phrase Level Elements</h2><a name="font_styles"></a><h4>Font Styles</h4><code><pre>

    ['italic][br]
    [*bold][br]
    [_underline][br]
    [^teletype][br]

</pre></code><p>
Will generate:</p>
<p>
<i>italic</i><br>
<b>bold</b><br>
<u>underline</u><br>
<tt>teletype</tt><br></p>
<p>
Like all non-terminal phrase level elements, this can of course be nested:</p>
<code><pre>
    [*['bold-italic]]
</pre></code><p>
Will generate:</p>
<p>
<b><i>bold-italic</i></b></p>
<a name="line_break"></a><h4>line-break</h4><code><pre>
    [br]
</pre></code><a name="anchors"></a><h4>Anchors</h4><code><pre>
    [#named_anchor]
</pre></code><a name="links"></a><h4>Links</h4><code><pre>
    [@http&quot;//www.boost.org this is [*boost's] website....]
</pre></code><p>
Will generate:</p>
<p>
<a href="http&quot;//www.boost.org">
this is <b>boost's</b> website....</a></p>
<a name="escape"></a><h4>Escape</h4><p>
The escape mark-up is used when we don't want to do any processing.</p>
<code><pre>
    '''
    escape (no processing/formatting)
    '''
</pre></code><p>
In rare occasions (such as when writing this document <img src="theme/smiley.gif"></img>) when the triple-
quote <tt>'''</tt> is needed, a double-quote followed by a single-quote
<tt>&quot;'</tt> may be used as the escape delimiter.</p>
<a name="images__terminal_"></a><h4>Images (terminal)</h4><code><pre>
    [$image.jpg]
</pre></code><a name="block_level_elements"></a><h2>Block Level Elements</h2><a name="document"></a><h4>Document</h4><code><pre>
    [doc Document Title]
</pre></code><p>
Should be at the very top</p>
<a name="page"></a><h4>Page</h4><code><pre>
    [page:level Page Title]
</pre></code><p>
&quot;Page Title&quot; will be the html's title, a corresponding filename will be
created with the same name appended with &quot;.html&quot;, valid characters are
a..Z, A..Z, 0..9 and _. All non-valid characters are converted to
underscore and all upper-case are converted to lower case. Thus:
&quot;page_title.html&quot;</p>
<p>
A quickdoc document is basically a flat list of pages. However, the
generated table of contents may be formatted to reflect a certain
hierarchy. Example:</p>
<code><pre>
    intro
    basics
        pizza flavors
        pizza toppings
    crust
        size
        ingredients
</pre></code><p>
Here, intro, basics and crust are at level 0 while pizza flavors, pizza
toppings, size and ingredients are level 1. level is optional (defaults to
zero) and will be page's hierarchical level from the top. Up to 5 levels
(0..5) are currently supported.</p>
<a name="paragraphs"></a><h4>Paragraphs</h4><p>
Paragraphs start left-flushed and are terminated by two or more newlines.
No markup is needed for paragraphs. QuickDoc automatically detects
paragraphs from the context.</p>
<a name="bulleted_lists"></a><h4>Bulleted lists</h4><code><pre>
    * First
    * Second
    * Third
</pre></code><p>
Will generate:</p>
<ul><li>First</li><li>Second</li><li>Third</li></ul><a name="ordered_lists"></a><h4>Ordered lists</h4><code><pre>
    # First
    # Second
    # Third
</pre></code><p>
Will generate:</p>
<ol><li>First</li><li>Second</li><li>Third</li></ol><a name="code"></a><h4>Code</h4><code><pre>
    <span class=preprocessor>#include </span><span class=special>&lt;</span><span class=identifier>iostream</span><span class=special>&gt;

    </span><span class=keyword>int </span><span class=identifier>main</span><span class=special>()
    </span><span class=special>{
        </span><span class=identifier>std</span><span class=special>::</span><span class=identifier>cout </span><span class=special>&lt;&lt; </span><span class=string>&quot;Hello World\n&quot;</span><span class=special>;
    </span><span class=special>}
</span></pre></code>
<p>

Preformatted code starts with a space or a tab. The code will be syntax
highlighted.</p>
<a name="preformatted"></a><h4>Preformatted</h4><p>
Sometimes, you don't want some preformatted code to be parsed as C++. In
such cases, use the [pre ... ] markup block.</p>
<code><pre>
    This should not be taken in as C++
</pre></code><a name="horizontal_rule__terminal_"></a><h4>Horizontal rule (terminal)</h4><code><pre>
    ----------------- 4 or more dashes (text after the dashes are ignored)
</pre></code><p>
The above will generate this:</p>
<hr><a name="blockquote"></a><h4>blockquote</h4><code><pre>
    [:sometext...]
</pre></code><p>
Applies to one paragraph only.</p>
<a name="headings"></a><h4>Headings</h4><code><pre>

    [h1 Heading 1]
    [h2 Heading 2]
    [h4 Heading 3]
    [h4 Heading 4]
    [h5 Heading 5]
    [h6 Heading 6]

</pre></code><a name="heading_1"></a><h1>Heading 1</h1><a name="heading_2"></a><h2>Heading 2</h2><a name="heading_3"></a><h4>Heading 3</h4><a name="heading_4"></a><h4>Heading 4</h4><a name="heading_5"></a><h5>Heading 5</h5><a name="heading_6"></a><h6>Heading 6</h6><p>
All headings will have anchors with the same name, valid characters are
a..z, A..Z, 0..9 and _. All non-valid characters are converted to
underscore and all upper-case are converted to lower case. Example:
heading_1</p>
<a name="macros"></a><h4>Macros</h4><code><pre>
    [def macro_identifier some text]
</pre></code><p>
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:</p>
<code><pre>
    [def sf_logo [$http://sourceforge.net/sflogo.php?group_id=28447&amp;type=1]]
    sf_logo
</pre></code><p>
Now everytime sf_logo is seen, the picture will be inlined.</p>
<p>
<img src="http://sourceforge.net/sflogo.php?group_id=28447&amp;type=1"></img></p>
<p>
Some more examples:</p>
<code><pre>
    [def :-)            [$theme/smiley.gif]]
    [def Spirit         [@http://spirit.sourceforge.net Spirit]]
</pre></code><p>
(See <a href="syntax_summary.html#images__terminal_">
Images</a> and <a href="syntax_summary.html#links">
Links</a>)</p>
<p>
Invoking these macros:</p>
<code><pre>
    Hi Spirit :-)
</pre></code><p>
Will generate this:</p>
<p>
Hi <a href="http://spirit.sourceforge.net">
Spirit</a> <img src="theme/smiley.gif"></img></p>
<a name="blurbs"></a><h4>Blurbs</h4><code><pre>
    
    [blurb :-) [*An eye catching advertisement ornote...]
    [br][br]

    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++.]  </pre></code><p>
Will generate this:</p>
<table width="80%" border="0" align="center">
  <tr>
    <td class="note_box">
<img src="theme/smiley.gif"></img> <b>An eye catching advertisement or note...</b>

<br><br>
<a href="http://spirit.sourceforge.net">
Spirit</a> 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++.    </td>
  </tr>
</table>
<a name="tables"></a><h4>Tables</h4><code><pre>
    [table Title

        [R0-C0]     [R0-C1]     [R0-C2]
        [R1-C0]     [R1-C1]     [R1-C2]
        [R2-C0]     [R2-C1]     [R2-C2]
    ]
</pre></code><p>
Will generate:</p>
<table width="90%" border="0" align="center">  <tr>
  <td class="table_title" colspan="9">
Title  </td>
  </tr>
<tr><td class="table_cells">R0-C0</td><td class="table_cells">R0-C1</td><td class="table_cells">R0-C2</td></tr><td class="table_cells">R2-C0</td><td class="table_cells">R2-C1</td><td class="table_cells">R2-C2</td></tr><td class="table_cells">R3-C0</td><td class="table_cells">R3-C1</td><td class="table_cells">R3-C2</td></tr></table>
<table border="0">
  <tr>
    <td width="30"><a href="../index.html"><img src="theme/u_arr.gif" border="0"></a></td>
    <td width="30"><a href="introduction.html"><img src="theme/l_arr.gif" border="0"></a></td>
    <td width="20"><a href="grammar.html"><img src="theme/r_arr.gif" border="0"></a></td>
   </tr>
</table>
<br>
<hr size="1"><p class="copyright">Copyright &copy; 2001-2002 Joel de Guzman<br><br>
<font size="2">Permission to copy, use, modify, sell and distribute this document
 is granted provided this copyright notice appears in all copies. This document
 is provided &quot;as is&quot; without express or implied warranty, and with
 no claim as to its suitability for any purpose. </font> </p>
</body>
</html>