QuickBook v1.0 wikiwiki-style doc tool for BoostBook
[SVN r26857]
@@ -0,0 +1,96 @@
|
||||
* text=auto !eol svneol=native#text/plain
|
||||
*.gitattributes text svneol=native#text/plain
|
||||
|
||||
# Scriptish formats
|
||||
*.bat text svneol=native#text/plain
|
||||
*.bsh text svneol=native#text/x-beanshell
|
||||
*.cgi text svneol=native#text/plain
|
||||
*.cmd text svneol=native#text/plain
|
||||
*.js text svneol=native#text/javascript
|
||||
*.php text svneol=native#text/x-php
|
||||
*.pl text svneol=native#text/x-perl
|
||||
*.pm text svneol=native#text/x-perl
|
||||
*.py text svneol=native#text/x-python
|
||||
*.sh eol=lf svneol=LF#text/x-sh
|
||||
configure eol=lf svneol=LF#text/x-sh
|
||||
|
||||
# Image formats
|
||||
*.bmp binary svneol=unset#image/bmp
|
||||
*.gif binary svneol=unset#image/gif
|
||||
*.ico binary svneol=unset#image/ico
|
||||
*.jpeg binary svneol=unset#image/jpeg
|
||||
*.jpg binary svneol=unset#image/jpeg
|
||||
*.png binary svneol=unset#image/png
|
||||
*.tif binary svneol=unset#image/tiff
|
||||
*.tiff binary svneol=unset#image/tiff
|
||||
*.svg text svneol=native#image/svg%2Bxml
|
||||
|
||||
# Data formats
|
||||
*.pdf binary svneol=unset#application/pdf
|
||||
*.avi binary svneol=unset#video/avi
|
||||
*.doc binary svneol=unset#application/msword
|
||||
*.dsp text svneol=crlf#text/plain
|
||||
*.dsw text svneol=crlf#text/plain
|
||||
*.eps binary svneol=unset#application/postscript
|
||||
*.gz binary svneol=unset#application/gzip
|
||||
*.mov binary svneol=unset#video/quicktime
|
||||
*.mp3 binary svneol=unset#audio/mpeg
|
||||
*.ppt binary svneol=unset#application/vnd.ms-powerpoint
|
||||
*.ps binary svneol=unset#application/postscript
|
||||
*.psd binary svneol=unset#application/photoshop
|
||||
*.rdf binary svneol=unset#text/rdf
|
||||
*.rss text svneol=unset#text/xml
|
||||
*.rtf binary svneol=unset#text/rtf
|
||||
*.sln text svneol=native#text/plain
|
||||
*.swf binary svneol=unset#application/x-shockwave-flash
|
||||
*.tgz binary svneol=unset#application/gzip
|
||||
*.vcproj text svneol=native#text/xml
|
||||
*.vcxproj text svneol=native#text/xml
|
||||
*.vsprops text svneol=native#text/xml
|
||||
*.wav binary svneol=unset#audio/wav
|
||||
*.xls binary svneol=unset#application/vnd.ms-excel
|
||||
*.zip binary svneol=unset#application/zip
|
||||
|
||||
# Text formats
|
||||
.htaccess text svneol=native#text/plain
|
||||
*.bbk text svneol=native#text/xml
|
||||
*.cmake text svneol=native#text/plain
|
||||
*.css text svneol=native#text/css
|
||||
*.dtd text svneol=native#text/xml
|
||||
*.htm text svneol=native#text/html
|
||||
*.html text svneol=native#text/html
|
||||
*.ini text svneol=native#text/plain
|
||||
*.log text svneol=native#text/plain
|
||||
*.mak text svneol=native#text/plain
|
||||
*.qbk text svneol=native#text/plain
|
||||
*.rst text svneol=native#text/plain
|
||||
*.sql text svneol=native#text/x-sql
|
||||
*.txt text svneol=native#text/plain
|
||||
*.xhtml text svneol=native#text/xhtml%2Bxml
|
||||
*.xml text svneol=native#text/xml
|
||||
*.xsd text svneol=native#text/xml
|
||||
*.xsl text svneol=native#text/xml
|
||||
*.xslt text svneol=native#text/xml
|
||||
*.xul text svneol=native#text/xul
|
||||
*.yml text svneol=native#text/plain
|
||||
boost-no-inspect text svneol=native#text/plain
|
||||
CHANGES text svneol=native#text/plain
|
||||
COPYING text svneol=native#text/plain
|
||||
INSTALL text svneol=native#text/plain
|
||||
Jamfile text svneol=native#text/plain
|
||||
Jamroot text svneol=native#text/plain
|
||||
Jamfile.v2 text svneol=native#text/plain
|
||||
Jamrules text svneol=native#text/plain
|
||||
Makefile* text svneol=native#text/plain
|
||||
README text svneol=native#text/plain
|
||||
TODO text svneol=native#text/plain
|
||||
|
||||
# Code formats
|
||||
*.c text svneol=native#text/plain
|
||||
*.cpp text svneol=native#text/plain
|
||||
*.h text svneol=native#text/plain
|
||||
*.hpp text svneol=native#text/plain
|
||||
*.ipp text svneol=native#text/plain
|
||||
*.tpp text svneol=native#text/plain
|
||||
*.jam text svneol=native#text/plain
|
||||
*.java text svneol=native#text/plain
|
||||
@@ -0,0 +1,6 @@
|
||||
|
||||
exe quickbook
|
||||
: detail/quickbook.cpp
|
||||
: <include>$(BOOST_ROOT)
|
||||
;
|
||||
|
||||
@@ -0,0 +1,345 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2002 2004 Joel de Guzman
|
||||
Copyright (c) 2004 Eric Niebler
|
||||
http://spirit.sourceforge.net/
|
||||
|
||||
Use, modification and distribution is subject to the Boost Software
|
||||
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
#include "../quickbook.hpp"
|
||||
#include "../doc_info.hpp"
|
||||
#include "utils.hpp"
|
||||
#include "actions.hpp"
|
||||
#include <boost/spirit/iterator/position_iterator.hpp>
|
||||
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
|
||||
#if (defined(BOOST_MSVC) && (BOOST_MSVC <= 1310))
|
||||
#pragma warning(disable:4355)
|
||||
#endif
|
||||
|
||||
namespace quickbook
|
||||
{
|
||||
using namespace boost::spirit;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Our actions
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
struct actions
|
||||
{
|
||||
actions(char const* filein_, char const* fileout_)
|
||||
: filename(filein_)
|
||||
, out(fileout_)
|
||||
, table_span(0)
|
||||
, table_header()
|
||||
, source_mode("c++")
|
||||
, code(out, source_mode, macro)
|
||||
, inline_code(phrase, source_mode, macro)
|
||||
, paragraph(out, phrase, section_id, paragraph_pre, paragraph_post)
|
||||
, h1(out, phrase, section_id, h1_pre, h1_post, true)
|
||||
, h2(out, phrase, section_id, h2_pre, h2_post, true)
|
||||
, h3(out, phrase, section_id, h3_pre, h3_post, true)
|
||||
, h4(out, phrase, section_id, h4_pre, h4_post, true)
|
||||
, h5(out, phrase, section_id, h5_pre, h5_post, true)
|
||||
, h6(out, phrase, section_id, h6_pre, h6_post, true)
|
||||
, hr(out, hr_)
|
||||
, blurb(out, phrase, section_id, blurb_pre, blurb_post)
|
||||
, blockquote(out, phrase, section_id, blockquote_pre, blockquote_post)
|
||||
, preformatted(out, phrase, section_id, preformatted_pre, preformatted_post)
|
||||
, plain_char(phrase)
|
||||
, raw_char(phrase)
|
||||
, image(phrase)
|
||||
, list_buffer()
|
||||
, list_marks()
|
||||
, indent(-1)
|
||||
, list(out, list_buffer, indent, list_marks)
|
||||
, list_format(list_buffer, indent, list_marks)
|
||||
, list_item(list_buffer, phrase, section_id, list_item_pre, list_item_post)
|
||||
, funcref_pre(phrase, funcref_pre_)
|
||||
, funcref_post(phrase, funcref_post_)
|
||||
, classref_pre(phrase, classref_pre_)
|
||||
, classref_post(phrase, classref_post_)
|
||||
, memberref_pre(phrase, memberref_pre_)
|
||||
, memberref_post(phrase, memberref_post_)
|
||||
, enumref_pre(phrase, enumref_pre_)
|
||||
, enumref_post(phrase, enumref_post_)
|
||||
, bold_pre(phrase, bold_pre_)
|
||||
, bold_post(phrase, bold_post_)
|
||||
, italic_pre(phrase, italic_pre_)
|
||||
, italic_post(phrase, italic_post_)
|
||||
, underline_pre(phrase, underline_pre_)
|
||||
, underline_post(phrase, underline_post_)
|
||||
, teletype_pre(phrase, teletype_pre_)
|
||||
, teletype_post(phrase, teletype_post_)
|
||||
, simple_bold(phrase, bold_pre_, bold_post_)
|
||||
, simple_italic(phrase, italic_pre_, italic_post_)
|
||||
, simple_underline(phrase, underline_pre_, underline_post_)
|
||||
, simple_teletype(phrase, teletype_pre_, teletype_post_)
|
||||
, variablelist(*this)
|
||||
, start_varlistentry(phrase, start_varlistentry_)
|
||||
, end_varlistentry(phrase, end_varlistentry_)
|
||||
, start_varlistterm(phrase, start_varlistterm_)
|
||||
, end_varlistterm(phrase, end_varlistterm_)
|
||||
, start_varlistitem(phrase, start_varlistitem_)
|
||||
, end_varlistitem(phrase, end_varlistitem_)
|
||||
, break_(phrase, break_mark)
|
||||
, identifier(*this)
|
||||
, macro_def(*this)
|
||||
, do_macro(phrase)
|
||||
, url_pre(phrase, url_pre_)
|
||||
, url_post(phrase, url_post_)
|
||||
, link_pre(phrase, link_pre_)
|
||||
, link_post(phrase, link_post_)
|
||||
, table(*this)
|
||||
, start_row(phrase, table_span, table_header)
|
||||
, end_row(phrase, end_row_)
|
||||
, start_cell(phrase, table_span)
|
||||
, end_cell(phrase, end_cell_)
|
||||
, anchor(out)
|
||||
, begin_section(out, doc_id, section_id)
|
||||
, end_section(out, "</section>")
|
||||
, xinclude(out)
|
||||
{
|
||||
std::cout << "Generating Output File: "
|
||||
<< fileout_
|
||||
<< std::endl;
|
||||
|
||||
// add the predefined macros
|
||||
macro.add
|
||||
("__DATE__", std::string(quickbook_get_date))
|
||||
("__TIME__", std::string(quickbook_get_time))
|
||||
("__FILENAME__", std::string(filein_))
|
||||
;
|
||||
}
|
||||
|
||||
typedef indentifier_action<actions> indentifier_action;
|
||||
typedef macro_def_action<actions> macro_def_action;
|
||||
typedef table_action<actions> table_action;
|
||||
typedef variablelist_action<actions> variablelist_action;
|
||||
|
||||
char const* filename;
|
||||
std::string directory;
|
||||
std::string macro_id;
|
||||
std::string phrase_save;
|
||||
std::string table_title;
|
||||
std::ofstream out;
|
||||
error_action error;
|
||||
|
||||
typedef std::vector<std::string> copyright_list;
|
||||
typedef std::vector<std::pair<std::string, std::string> > author_list;
|
||||
|
||||
std::string doc_type;
|
||||
std::string doc_title;
|
||||
std::string doc_version;
|
||||
std::string doc_id;
|
||||
std::string doc_dirname;
|
||||
copyright_list doc_copyright_years;
|
||||
std::string doc_copyright_holder;
|
||||
std::string doc_purpose;
|
||||
std::string doc_category;
|
||||
author_list doc_authors;
|
||||
std::string doc_license;
|
||||
std::string doc_last_revision;
|
||||
|
||||
std::string page_title;
|
||||
std::string section_id;
|
||||
std::string previous;
|
||||
std::stringstream phrase;
|
||||
unsigned table_span;
|
||||
std::string table_header;
|
||||
|
||||
symbols<std::string> macro;
|
||||
std::string source_mode;
|
||||
code_action code;
|
||||
inline_code_action inline_code;
|
||||
phrase_action paragraph, h1, h2, h3, h4, h5, h6;
|
||||
markup_action hr;
|
||||
phrase_action blurb, blockquote, preformatted;
|
||||
plain_char_action plain_char;
|
||||
raw_char_action raw_char;
|
||||
image_action image;
|
||||
|
||||
std::stringstream list_buffer;
|
||||
std::stack<char> list_marks;
|
||||
int indent;
|
||||
list_action list;
|
||||
list_format_action list_format;
|
||||
phrase_action list_item;
|
||||
|
||||
link_action funcref_pre;
|
||||
markup_action funcref_post;
|
||||
link_action classref_pre;
|
||||
markup_action classref_post;
|
||||
link_action memberref_pre;
|
||||
markup_action memberref_post;
|
||||
link_action enumref_pre;
|
||||
markup_action enumref_post;
|
||||
|
||||
markup_action bold_pre;
|
||||
markup_action bold_post;
|
||||
markup_action italic_pre;
|
||||
markup_action italic_post;
|
||||
markup_action underline_pre;
|
||||
markup_action underline_post;
|
||||
markup_action teletype_pre;
|
||||
markup_action teletype_post;
|
||||
|
||||
simple_phrase_action simple_bold;
|
||||
simple_phrase_action simple_italic;
|
||||
simple_phrase_action simple_underline;
|
||||
simple_phrase_action simple_teletype;
|
||||
|
||||
variablelist_action variablelist;
|
||||
markup_action start_varlistentry;
|
||||
markup_action end_varlistentry;
|
||||
markup_action start_varlistterm;
|
||||
markup_action end_varlistterm;
|
||||
markup_action start_varlistitem;
|
||||
markup_action end_varlistitem;
|
||||
|
||||
markup_action break_;
|
||||
indentifier_action identifier;
|
||||
macro_def_action macro_def;
|
||||
do_macro_action do_macro;
|
||||
link_action url_pre;
|
||||
markup_action url_post;
|
||||
link_action link_pre;
|
||||
markup_action link_post;
|
||||
table_action table;
|
||||
start_row_action start_row;
|
||||
markup_action end_row;
|
||||
start_col_action start_cell;
|
||||
markup_action end_cell;
|
||||
anchor_action anchor;
|
||||
|
||||
begin_section_action begin_section;
|
||||
markup_action end_section;
|
||||
xinclude_action xinclude;
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Load a file
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
typedef std::vector<char> file_storage;
|
||||
|
||||
static int
|
||||
load(char const* filename, file_storage& storage)
|
||||
{
|
||||
using std::cerr;
|
||||
using std::endl;
|
||||
using std::ios;
|
||||
using std::ifstream;
|
||||
using std::istream_iterator;
|
||||
|
||||
ifstream in(filename);
|
||||
|
||||
if (!in)
|
||||
{
|
||||
cerr << "Could not open input file: " << filename << endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Turn of white space skipping on the stream
|
||||
in.unsetf(ios::skipws);
|
||||
|
||||
std::copy(
|
||||
istream_iterator<char>(in),
|
||||
istream_iterator<char>(),
|
||||
std::back_inserter(storage));
|
||||
|
||||
// ensure that we have enough trailing newlines to eliminate
|
||||
// the need to check for end of file in the grammar.
|
||||
storage.push_back('\n');
|
||||
storage.push_back('\n');
|
||||
return 0;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Parse a file
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
static int
|
||||
parse(char const* filein_, char const* fileout_)
|
||||
{
|
||||
using std::cerr;
|
||||
using std::vector;
|
||||
using std::string;
|
||||
|
||||
file_storage storage;
|
||||
int err = quickbook::load(filein_, storage);
|
||||
if (err != 0)
|
||||
return err;
|
||||
|
||||
typedef position_iterator<file_storage::const_iterator> iterator_type;
|
||||
iterator_type first(storage.begin(), storage.end(), filein_);
|
||||
iterator_type last(storage.end(), storage.end());
|
||||
|
||||
actions actor(filein_, fileout_);
|
||||
|
||||
doc_info_grammar<actions> l(actor);
|
||||
parse_info<iterator_type> info = parse(first, last, l);
|
||||
|
||||
if (info.hit)
|
||||
{
|
||||
pre(actor.out, actor);
|
||||
|
||||
first = info.stop;
|
||||
quickbook_grammar<actions> g(actor);
|
||||
info = parse(first, last, g);
|
||||
if (info.full)
|
||||
{
|
||||
post(actor.out, actor);
|
||||
}
|
||||
}
|
||||
|
||||
if (!info.full)
|
||||
{
|
||||
file_position const pos = info.stop.get_position();
|
||||
cerr
|
||||
<< "Syntax error at \"" << pos.file
|
||||
<< "\" line " << pos.line
|
||||
<< ", column " << pos.column << ".\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Main program
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
int
|
||||
main(int argc, char* argv[])
|
||||
{
|
||||
if (argc > 1)
|
||||
{
|
||||
std::string fileout;
|
||||
if (argc == 2)
|
||||
{
|
||||
fileout = quickbook::detail::remove_extension(argv[1]);
|
||||
fileout += ".xml";
|
||||
}
|
||||
else
|
||||
{
|
||||
fileout = argv[2];
|
||||
}
|
||||
|
||||
return quickbook::parse(argv[1], fileout.c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cerr << "---NO FILENAME GIVEN---" << std::endl;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2002 2004 Joel de Guzman
|
||||
Copyright (c) 2004 Eric Niebler
|
||||
http://spirit.sourceforge.net/
|
||||
|
||||
Use, modification and distribution is subject to the Boost Software
|
||||
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
#if !defined(BOOST_SPIRIT_QUICKBOOK_UTILS_HPP)
|
||||
#define BOOST_SPIRIT_QUICKBOOK_UTILS_HPP
|
||||
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <boost/ref.hpp>
|
||||
#include <boost/assert.hpp>
|
||||
|
||||
namespace quickbook { namespace detail
|
||||
{
|
||||
template <typename Char>
|
||||
inline void
|
||||
print_char(Char ch, std::ostream& out)
|
||||
{
|
||||
switch (ch)
|
||||
{
|
||||
case '<': out << "<"; break;
|
||||
case '>': out << ">"; break;
|
||||
case '&': out << "&"; break;
|
||||
case '"': out << """; break;
|
||||
default: out << ch; break;
|
||||
}
|
||||
}
|
||||
|
||||
template <typename Char>
|
||||
inline void
|
||||
print_space(Char ch, std::ostream& out)
|
||||
{
|
||||
switch (ch)
|
||||
{
|
||||
case ' ': out << " "; break;
|
||||
default: out << ch; break;
|
||||
}
|
||||
}
|
||||
|
||||
template <typename Char>
|
||||
inline Char
|
||||
filter_identifier_char(Char ch)
|
||||
{
|
||||
if (!std::isalnum(ch))
|
||||
ch = '_';
|
||||
return tolower(ch);
|
||||
}
|
||||
|
||||
template <typename Iterator>
|
||||
inline std::string
|
||||
make_identifier(Iterator const& first, Iterator const& last)
|
||||
{
|
||||
std::string out_name;
|
||||
for (Iterator i = first; i != last; ++i)
|
||||
out_name += filter_identifier_char(*i);
|
||||
return out_name;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
struct var_wrapper
|
||||
: public ::boost::reference_wrapper<T>
|
||||
{
|
||||
typedef ::boost::reference_wrapper<T> parent;
|
||||
|
||||
explicit inline var_wrapper(T& t) : parent(t) {}
|
||||
|
||||
inline T& operator()() const { return parent::get(); }
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
inline var_wrapper<T>
|
||||
var(T& t)
|
||||
{
|
||||
return var_wrapper<T>(t);
|
||||
}
|
||||
|
||||
// un-indent a code segment
|
||||
void unindent( std::string& program )
|
||||
{
|
||||
std::string::size_type const n = program.find_first_not_of(" \t");
|
||||
BOOST_ASSERT( std::string::npos != n );
|
||||
program.erase( 0, n );
|
||||
|
||||
std::string::size_type pos = 0;
|
||||
while( std::string::npos != ( pos = program.find( '\n', pos ) ) )
|
||||
{
|
||||
if( std::string::npos == ( pos = program.find_first_not_of('\n', pos) ) )
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
program.erase( pos, n );
|
||||
}
|
||||
}
|
||||
|
||||
// remove the extension from a filename
|
||||
std::string
|
||||
remove_extension(std::string const& filename)
|
||||
{
|
||||
std::string::size_type const n = filename.find_last_of('.');
|
||||
return std::string(filename.begin(), filename.begin()+n);
|
||||
}
|
||||
}}
|
||||
|
||||
#endif // BOOST_SPIRIT_QUICKBOOK_UTILS_HPP
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
project boost/quickbook/doc ;
|
||||
import boostbook : boostbook ;
|
||||
|
||||
boostbook quickbook
|
||||
:
|
||||
quickbook.xml
|
||||
:
|
||||
<xsl:param>boost.root=../../../..
|
||||
;
|
||||
@@ -0,0 +1,343 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2002 2004 Joel de Guzman, Eric Niebler, Rene Rivera
|
||||
http://spirit.sourceforge.net/
|
||||
|
||||
Use, modification and distribution is subject to the Boost Software
|
||||
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
/* CSS based on w3c documentation which I like a lot, and the classic Spirit
|
||||
documentation. */
|
||||
|
||||
/* Body defaults */
|
||||
body
|
||||
{
|
||||
padding: 2em 1em 2em 1em;
|
||||
margin: 1em 1em 1em 1em;
|
||||
font-family: sans-serif;
|
||||
}
|
||||
|
||||
/* Paragraphs */
|
||||
p
|
||||
{
|
||||
text-align: justify;
|
||||
}
|
||||
|
||||
pre.synopsis
|
||||
{
|
||||
margin: 1pc 4% 0pc 4%;
|
||||
padding: 0.5pc 0.5pc 0.5pc 0.5pc;
|
||||
}
|
||||
|
||||
/* Headings */
|
||||
h1, h2, h3, h4, h5, h6 { text-align: left; margin-top: 2pc; }
|
||||
h1 { font: 170% sans-serif }
|
||||
h2 { font: bold 140% sans-serif }
|
||||
h3 { font: 120% sans-serif }
|
||||
h4 { font: bold 100% sans-serif }
|
||||
h5 { font: italic 100% sans-serif }
|
||||
h6 { font: italic 100% sans-serif }
|
||||
|
||||
/* Unordered lists */
|
||||
ul
|
||||
{
|
||||
text-align: justify;
|
||||
}
|
||||
|
||||
/* Links */
|
||||
a
|
||||
{
|
||||
text-decoration: none; /* no underline */
|
||||
}
|
||||
|
||||
a:hover
|
||||
{
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* Top page title */
|
||||
title, h1.title, h2.title, h3.title,
|
||||
h4.title, h5.title, h6.title,
|
||||
.refentrytitle
|
||||
{
|
||||
font-weight: bold;
|
||||
font-size: 2pc;
|
||||
margin-bottom: 1pc;
|
||||
}
|
||||
|
||||
/* Spirit style navigation */
|
||||
.spirit-nav
|
||||
{
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.spirit-nav a
|
||||
{
|
||||
color: white;
|
||||
padding-left: 0.5em;
|
||||
}
|
||||
|
||||
.spirit-nav img
|
||||
{
|
||||
border-width: 0px;
|
||||
}
|
||||
|
||||
/* Program listing box */
|
||||
.programlisting, .screen
|
||||
{
|
||||
display: block;
|
||||
margin-left: 4%;
|
||||
margin-right: 4%;
|
||||
padding: 0.5pc 0.5pc 0.5pc 0.5pc;
|
||||
}
|
||||
|
||||
/* Table of contents */
|
||||
.toc
|
||||
{
|
||||
margin: 1pc 4% 0pc 4%;
|
||||
padding: 0.5pc 0.5pc 0.5pc 0.5pc;
|
||||
}
|
||||
|
||||
.boost-toc
|
||||
{
|
||||
float: right;
|
||||
padding: 0.5pc;
|
||||
}
|
||||
|
||||
/* Tables */
|
||||
.table-title, div.table p.title
|
||||
{
|
||||
margin-left: 4%;
|
||||
padding-right: 0.5em;
|
||||
padding-left: 0.5em;
|
||||
font-size: 120%;
|
||||
}
|
||||
|
||||
.informaltable table, .table table
|
||||
{
|
||||
width: 92%;
|
||||
margin-left: 4%;
|
||||
margin-right: 4%;
|
||||
}
|
||||
|
||||
div.informaltable table, div.table table
|
||||
{
|
||||
padding: 4px 4px 4px 4px;
|
||||
}
|
||||
|
||||
div.informaltable table tr td, div.table table tr td
|
||||
{
|
||||
padding: 0.5em 0.5em 0.5em 0.5em;
|
||||
text-align: justify;
|
||||
}
|
||||
|
||||
div.informaltable table tr th, div.table table tr th
|
||||
{
|
||||
padding: 0.5em 0.5em 0.5em 0.5em;
|
||||
border: 1pt solid white;
|
||||
}
|
||||
|
||||
/* inlined images */
|
||||
.inlinemediaobject
|
||||
{
|
||||
padding: 0.5em 0.5em 0.5em 0.5em;
|
||||
}
|
||||
|
||||
/* tone down the title of Parameter lists */
|
||||
div.variablelist p.title
|
||||
{
|
||||
font-weight: bold;
|
||||
font-size: 100%;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
/* tabularize parameter lists */
|
||||
div.variablelist dl dt
|
||||
{
|
||||
float: left;
|
||||
clear: left;
|
||||
display: block;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
div.variablelist dl dd
|
||||
{
|
||||
display: block;
|
||||
clear: right;
|
||||
padding-left: 8pc;
|
||||
}
|
||||
|
||||
/* title of books and articles in bibliographies */
|
||||
span.title
|
||||
{
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
/* tips, notes and warnings done in Spirit style */
|
||||
div.tip, div.note, div.warning
|
||||
{
|
||||
position: relative;
|
||||
padding: 0.5em;
|
||||
border: 0.5pt solid white;
|
||||
}
|
||||
|
||||
div.tip .title, div.note .title, div.warning .title
|
||||
{
|
||||
display: block;
|
||||
font: bold xx-small sans-serif;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
position: absolute;
|
||||
left: -4em;
|
||||
top: 0em;
|
||||
height: 25px;
|
||||
width: 24px;
|
||||
text-indent: 32px;
|
||||
overflow: hidden;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
div.tip .title
|
||||
{
|
||||
background: url(images/tip.png);
|
||||
}
|
||||
|
||||
div.note .title
|
||||
{
|
||||
background: url(images/note.png);
|
||||
}
|
||||
|
||||
div.warning .title
|
||||
{
|
||||
background: url(images/caution.png);
|
||||
}
|
||||
|
||||
@media screen
|
||||
{
|
||||
a
|
||||
{
|
||||
color: #005a9c;
|
||||
}
|
||||
|
||||
a:visited
|
||||
{
|
||||
color: #9c5a9c;
|
||||
}
|
||||
|
||||
/* Syntax Highlighting */
|
||||
.keyword { color: #0000AA; font-weight: bold; }
|
||||
.identifier {}
|
||||
.special { color: #707070; }
|
||||
.preprocessor { color: #402080; font-weight: bold; }
|
||||
.char { color: teal; }
|
||||
.comment { color: #800000; }
|
||||
.string { color: teal; }
|
||||
.number { color: teal; }
|
||||
.copyright { color: #666666; font-size: small; }
|
||||
.white_bkd { background-color: #FFFFFF; }
|
||||
.dk_grey_bkd { background-color: #999999; }
|
||||
|
||||
pre.synopsis
|
||||
{
|
||||
background-color: #f3f3f3;
|
||||
}
|
||||
|
||||
.programlisting, .screen
|
||||
{
|
||||
background-color: #f3f3f3;
|
||||
}
|
||||
|
||||
/* Table of contents */
|
||||
.toc
|
||||
{
|
||||
background-color: #f3f3f3;
|
||||
}
|
||||
|
||||
div.informaltable table tr td, div.table table tr td
|
||||
{
|
||||
background-color: #F3F3F3;
|
||||
border: 1pt solid white;
|
||||
}
|
||||
|
||||
div.informaltable table tr th, div.table table tr th
|
||||
{
|
||||
background-color: #e4e4e4;
|
||||
}
|
||||
|
||||
div.tip, div.note, div.warning
|
||||
{
|
||||
background-color: #F3F3F3;
|
||||
}
|
||||
|
||||
span.highlight
|
||||
{
|
||||
color: #00A000;
|
||||
}
|
||||
}
|
||||
|
||||
@media print
|
||||
{
|
||||
a
|
||||
{
|
||||
color: black;
|
||||
}
|
||||
|
||||
a:visited
|
||||
{
|
||||
color: black;
|
||||
}
|
||||
|
||||
.spirit-nav
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Syntax Highlighting */
|
||||
.keyword
|
||||
{
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
pre.synopsis
|
||||
{
|
||||
border: 1px solid gray;
|
||||
}
|
||||
|
||||
.programlisting, .screen
|
||||
{
|
||||
border: 1px solid gray;
|
||||
}
|
||||
|
||||
/* Table of contents */
|
||||
.toc
|
||||
{
|
||||
border: 1px solid gray;
|
||||
}
|
||||
|
||||
.informaltable table, .table table
|
||||
{
|
||||
border: 1px solid gray;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
div.informaltable table tr td, div.table table tr td
|
||||
{
|
||||
border: 1px solid gray;
|
||||
}
|
||||
|
||||
div.informaltable table tr th, div.table table tr th
|
||||
{
|
||||
border: 1px solid gray;
|
||||
}
|
||||
|
||||
div.tip, div.note, div.warning
|
||||
{
|
||||
border: 1px solid gray;
|
||||
}
|
||||
|
||||
span.highlight
|
||||
{
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 603 B |
|
After Width: | Height: | Size: 358 B |
|
After Width: | Height: | Size: 336 B |
|
After Width: | Height: | Size: 658 B |
|
After Width: | Height: | Size: 334 B |
|
After Width: | Height: | Size: 867 B |
|
After Width: | Height: | Size: 640 B |
|
After Width: | Height: | Size: 370 B |
@@ -0,0 +1,100 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title>Part I. quickbook 1.0</title>
|
||||
<link rel="stylesheet" href="boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.66.1">
|
||||
<link rel="start" href="index.html" title="Part I. quickbook 1.0">
|
||||
<link rel="next" href="quickbook/syntax.html" title=" Syntax Summary">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%">
|
||||
<td valign="top"><img alt="boost.png (6897 bytes)" width="277" height="86" src="../../../../boost.png"></td>
|
||||
<td align="center"><a href="../../../../index.htm">Home</a></td>
|
||||
<td align="center"><a href="libraries.html">Libraries</a></td>
|
||||
<td align="center"><a href="../../../../people/people.htm">People</a></td>
|
||||
<td align="center"><a href="../../../../more/faq.htm">FAQ</a></td>
|
||||
<td align="center"><a href="../../../../more/index.htm">More</a></td>
|
||||
</table>
|
||||
<hr>
|
||||
<div class="spirit-nav"><a accesskey="n" href="quickbook/syntax.html"><img src="images/next.png" alt="Next"></a></div>
|
||||
<div class="part" lang="en">
|
||||
<div class="titlepage"><div>
|
||||
<div><h1 class="title">
|
||||
<a name="quickbook"></a>quickbook 1.0</h1></div>
|
||||
<div><div class="author"><h3 class="author">
|
||||
<span class="firstname">Joel</span> <span class="surname">de Guzman</span>
|
||||
</h3></div></div>
|
||||
<div><div class="author"><h3 class="author">
|
||||
<span class="firstname">Eric</span> <span class="surname">Niebler</span>
|
||||
</h3></div></div>
|
||||
<div><p class="copyright">Copyright © 2002, 2004 Joel de Guzman, Eric Niebler</p></div>
|
||||
<div><div class="legalnotice">
|
||||
<a name="id374150"></a><p>
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
<a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">
|
||||
http://www.boost.org/LICENSE_1_0.txt
|
||||
</a>)
|
||||
|
||||
</p>
|
||||
</div></div>
|
||||
</div></div>
|
||||
<div class="section" lang="en">
|
||||
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
|
||||
<a name="quickbook.intro"></a> Introduction</h2></div></div></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p><span class="bold"><b><span class="emphasis"><em>"Why program by hand in five days what you can spend five years of your
|
||||
life automating?"</em></span></b></span><br><br>
|
||||
-- Terrence Parr, author ANTLR/PCCTS</p></blockquote></div>
|
||||
<p>
|
||||
Well, QuickBook started as a weekend hack. It was originally intended to be a
|
||||
sample application using <a href="http://spirit.sourceforge.net" target="_top">Spirit</a>. What is it? What you are viewing now, this
|
||||
documentation, is autogenerated by QuickBook. These files were generated from
|
||||
one master:</p>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p><a href="../quickbook.qbk" target="_top">quickbook.qbk</a></p></blockquote></div>
|
||||
<p>
|
||||
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 <a href="http://www.boost.org/doc/html/boostbook.html" target="_top">BoostBook</a> instead of HTML. The <a href="http://www.boost.org/doc/html/boostbook.html" target="_top">BoostBook</a> documentation format
|
||||
is an extension of <a href="http://www.docbook.org/" target="_top">DocBook</a>, an SGML- or XML- based format for describing
|
||||
documentation.</p>
|
||||
<p>
|
||||
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.</p>
|
||||
<p>
|
||||
Features include:</p>
|
||||
<div class="itemizedlist"><ul type="disc">
|
||||
<li>
|
||||
generate <a href="http://www.boost.org/doc/html/boostbook.html" target="_top">BoostBook</a> xml, to generate HTML, PostScript and PDF
|
||||
</li>
|
||||
<li>
|
||||
simple markup to link to Doxygen-generated entities
|
||||
</li>
|
||||
<li>
|
||||
macro system for simple text substitution
|
||||
</li>
|
||||
<li>
|
||||
simple markup for italics, bold, preformatted, blurbs, code samples,
|
||||
tables, URLs, anchors, images, etc.
|
||||
</li>
|
||||
<li>
|
||||
automatic syntax coloring of code samples
|
||||
</li>
|
||||
<li>
|
||||
CSS support
|
||||
</li>
|
||||
</ul></div>
|
||||
</div>
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"><small><p>Last revised: January 21, 2005 at 06:19:27 GMT</p></small></td>
|
||||
<td align="right"><small></small></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav"><a accesskey="n" href="quickbook/syntax.html"><img src="images/next.png" alt="Next"></a></div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,167 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title> Library Document Grammar</title>
|
||||
<link rel="stylesheet" href="../boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.66.1">
|
||||
<link rel="start" href="../index.html" title="Part I. quickbook 1.0">
|
||||
<link rel="up" href="../index.html" title="Part I. quickbook 1.0">
|
||||
<link rel="prev" href="ref.html" title=" Quick Reference">
|
||||
<link rel="next" href="quickbook.html" title=" QuickBook Grammar">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%">
|
||||
<td valign="top"><img alt="boost.png (6897 bytes)" width="277" height="86" src="../../../../../boost.png"></td>
|
||||
<td align="center"><a href="../../../../../index.htm">Home</a></td>
|
||||
<td align="center"><a href="../libraries.html">Libraries</a></td>
|
||||
<td align="center"><a href="../../../../../people/people.htm">People</a></td>
|
||||
<td align="center"><a href="../../../../../more/faq.htm">FAQ</a></td>
|
||||
<td align="center"><a href="../../../../../more/index.htm">More</a></td>
|
||||
</table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="ref.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="quickbook.html"><img src="../images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section" lang="en">
|
||||
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
|
||||
<a name="quickbook.docinfo"></a> Library Document Grammar</h2></div></div></div>
|
||||
<p></p>
|
||||
<pre class="programlisting"><tt class="literal"><span class="identifier">doc_info</span><span class="special"> =</span><span class="identifier">
|
||||
space</span><span class="special">
|
||||
>></span><span class="char"> '['</span><span class="special">
|
||||
>></span><span class="special"> (</span><span class="identifier"> str_p</span><span class="special">(</span><span class="string">"book"</span><span class="special">)</span><span class="special">
|
||||
|</span><span class="string"> "article"</span><span class="special">
|
||||
|</span><span class="string"> "library"</span><span class="special">
|
||||
|</span><span class="string"> "chapter"</span><span class="special">
|
||||
|</span><span class="string"> "part"</span><span class="special">
|
||||
)</span><span class="special">
|
||||
>></span><span class="identifier"> hard_space</span><span class="special">
|
||||
>></span><span class="special"> (</span><span class="special"> *(</span><span class="identifier">anychar_p</span><span class="special"> -</span><span class="special">
|
||||
(</span><span class="identifier">ch_p</span><span class="special">(</span><span class="char">'['</span><span class="special">)</span><span class="special"> |</span><span class="char"> ']'</span><span class="special"> |</span><span class="identifier"> eol_p</span><span class="special">)</span><span class="special">
|
||||
)</span><span class="special">
|
||||
)</span><span class="special">
|
||||
>></span><span class="special"> *(</span><span class="identifier"> doc_version</span><span class="special">
|
||||
|</span><span class="identifier"> doc_id</span><span class="special">
|
||||
|</span><span class="identifier"> doc_dirname</span><span class="special">
|
||||
|</span><span class="identifier"> doc_copyright</span><span class="special">
|
||||
|</span><span class="identifier"> doc_purpose</span><span class="special">
|
||||
|</span><span class="identifier"> doc_category</span><span class="special">
|
||||
|</span><span class="identifier"> doc_authors</span><span class="special">
|
||||
|</span><span class="identifier"> doc_license</span><span class="special">
|
||||
|</span><span class="identifier"> doc_last_revision</span><span class="special">
|
||||
)</span><span class="special">
|
||||
>></span><span class="char"> ']'</span><span class="special"> >></span><span class="special"> +</span><span class="identifier">eol_p</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
doc_version</span><span class="special"> =</span><span class="identifier">
|
||||
space</span><span class="special">
|
||||
>></span><span class="string"> "[version"</span><span class="special"> >></span><span class="identifier"> hard_space</span><span class="special">
|
||||
>></span><span class="special"> (*(</span><span class="identifier">anychar_p</span><span class="special"> -</span><span class="char"> ']'</span><span class="special">))</span><span class="special">
|
||||
>></span><span class="char"> ']'</span><span class="special"> >></span><span class="special"> +</span><span class="identifier">eol_p</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
doc_id</span><span class="special"> =</span><span class="identifier">
|
||||
space</span><span class="special">
|
||||
>></span><span class="string"> "[id"</span><span class="special"> >></span><span class="identifier"> hard_space</span><span class="special">
|
||||
>></span><span class="special"> (*(</span><span class="identifier">anychar_p</span><span class="special"> -</span><span class="char"> ']'</span><span class="special">))</span><span class="special">
|
||||
>></span><span class="char"> ']'</span><span class="special"> >></span><span class="special"> +</span><span class="identifier">eol_p</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
doc_dirname</span><span class="special"> =</span><span class="identifier">
|
||||
space</span><span class="special">
|
||||
>></span><span class="string"> "[dirname"</span><span class="special"> >></span><span class="identifier"> hard_space</span><span class="special">
|
||||
>></span><span class="special"> (*(</span><span class="identifier">anychar_p</span><span class="special"> -</span><span class="char"> ']'</span><span class="special">))</span><span class="special">
|
||||
>></span><span class="char"> ']'</span><span class="special"> >></span><span class="special"> +</span><span class="identifier">eol_p</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
doc_copyright</span><span class="special"> =</span><span class="identifier">
|
||||
space</span><span class="special">
|
||||
>></span><span class="string"> "[copyright"</span><span class="special"> >></span><span class="identifier"> hard_space</span><span class="special">
|
||||
>></span><span class="special"> +(</span><span class="identifier"> repeat_p</span><span class="special">(</span><span class="number">4</span><span class="special">)[</span><span class="identifier">digit_p</span><span class="special">]</span><span class="special">
|
||||
>></span><span class="identifier"> space</span><span class="special">
|
||||
)</span><span class="special">
|
||||
>></span><span class="identifier"> space</span><span class="special">
|
||||
>></span><span class="special"> (*(</span><span class="identifier">anychar_p</span><span class="special"> -</span><span class="char"> ']'</span><span class="special">))</span><span class="special">
|
||||
>></span><span class="char"> ']'</span><span class="special"> >></span><span class="special"> +</span><span class="identifier">eol_p</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
doc_purpose</span><span class="special"> =</span><span class="identifier">
|
||||
space</span><span class="special">
|
||||
>></span><span class="string"> "[purpose"</span><span class="special"> >></span><span class="identifier"> hard_space</span><span class="special">
|
||||
>></span><span class="special"> (*(</span><span class="identifier">anychar_p</span><span class="special"> -</span><span class="char"> ']'</span><span class="special">))</span><span class="special">
|
||||
>></span><span class="char"> ']'</span><span class="special"> >></span><span class="special"> +</span><span class="identifier">eol_p</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
doc_category</span><span class="special"> =</span><span class="identifier">
|
||||
space</span><span class="special">
|
||||
>></span><span class="string"> "[category"</span><span class="special"> >></span><span class="identifier"> hard_space</span><span class="special">
|
||||
>></span><span class="special"> (*(</span><span class="identifier">anychar_p</span><span class="special"> -</span><span class="char"> ']'</span><span class="special">))</span><span class="special">
|
||||
>></span><span class="char"> ']'</span><span class="special"> >></span><span class="special"> +</span><span class="identifier">eol_p</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
doc_author</span><span class="special"> =</span><span class="identifier">
|
||||
space</span><span class="special">
|
||||
>></span><span class="char"> '['</span><span class="special"> >></span><span class="identifier"> space</span><span class="special">
|
||||
>></span><span class="special"> (*(</span><span class="identifier">anychar_p</span><span class="special"> -</span><span class="char"> ','</span><span class="special">))</span><span class="special">
|
||||
>></span><span class="char"> ','</span><span class="special"> >></span><span class="identifier"> space</span><span class="special">
|
||||
>></span><span class="special"> (*(</span><span class="identifier">anychar_p</span><span class="special"> -</span><span class="char"> ']'</span><span class="special">))</span><span class="special">
|
||||
>></span><span class="char"> ']'</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
doc_authors</span><span class="special"> =</span><span class="identifier">
|
||||
space</span><span class="special">
|
||||
>></span><span class="string"> "[authors"</span><span class="special"> >></span><span class="identifier"> hard_space</span><span class="special">
|
||||
>></span><span class="identifier"> doc_author</span><span class="special">
|
||||
>></span><span class="special"> *(</span><span class="char"> ','</span><span class="special">
|
||||
>></span><span class="identifier"> doc_author</span><span class="special">
|
||||
)</span><span class="special">
|
||||
>></span><span class="char"> ']'</span><span class="special"> >></span><span class="special"> +</span><span class="identifier">eol_p</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
doc_license</span><span class="special"> =</span><span class="identifier">
|
||||
space</span><span class="special">
|
||||
>></span><span class="string"> "[license"</span><span class="special"> >></span><span class="identifier"> hard_space</span><span class="special">
|
||||
>></span><span class="special"> (*(</span><span class="identifier">anychar_p</span><span class="special"> -</span><span class="char"> ']'</span><span class="special">))</span><span class="special">
|
||||
>></span><span class="char"> ']'</span><span class="special"> >></span><span class="special"> +</span><span class="identifier">eol_p</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
doc_last_revision</span><span class="special"> =</span><span class="identifier">
|
||||
space</span><span class="special">
|
||||
>></span><span class="string"> "[last-revision"</span><span class="special"> >></span><span class="identifier"> hard_space</span><span class="special">
|
||||
>></span><span class="special"> (*(</span><span class="identifier">anychar_p</span><span class="special"> -</span><span class="char"> ']'</span><span class="special">))</span><span class="special">
|
||||
>></span><span class="char"> ']'</span><span class="special"> >></span><span class="special"> +</span><span class="identifier">eol_p</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
doc_source_mode</span><span class="special"> =</span><span class="identifier">
|
||||
space</span><span class="special">
|
||||
>></span><span class="string"> "[source-mode"</span><span class="special"> >></span><span class="identifier"> hard_space</span><span class="special">
|
||||
>></span><span class="special"> (</span><span class="identifier">
|
||||
str_p</span><span class="special">(</span><span class="string">"c++"</span><span class="special">)</span><span class="special">
|
||||
|</span><span class="string"> "python"</span><span class="special">
|
||||
)</span><span class="special">
|
||||
>></span><span class="identifier"> space</span><span class="special"> >></span><span class="char"> ']'</span><span class="special"> >></span><span class="special"> +</span><span class="identifier">eol_p</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
comment</span><span class="special"> =</span><span class="string">
|
||||
"[/"</span><span class="special"> >></span><span class="special"> *(</span><span class="identifier">anychar_p</span><span class="special"> -</span><span class="char"> ']'</span><span class="special">)</span><span class="special"> >></span><span class="char"> ']'</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
space</span><span class="special"> =</span><span class="special">
|
||||
*(</span><span class="identifier">space_p</span><span class="special"> |</span><span class="identifier"> comment</span><span class="special">)</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
hard_space</span><span class="special"> =</span><span class="special">
|
||||
(</span><span class="identifier">eps_p</span><span class="special"> -</span><span class="special"> (</span><span class="identifier">alnum_p</span><span class="special"> |</span><span class="char"> '_'</span><span class="special">))</span><span class="special"> >></span><span class="identifier"> space</span><span class="comment"> // must not be followed by
|
||||
</span><span class="special"> ;</span><span class="comment"> // alpha-numeric or underscore
|
||||
</span></tt></pre>
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><small>Copyright © 2002, 2004 Joel de Guzman, Eric Niebler</small></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="ref.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="quickbook.html"><img src="../images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,111 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title> C++ Syntax Highlighting Grammar</title>
|
||||
<link rel="stylesheet" href="../boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.66.1">
|
||||
<link rel="start" href="../index.html" title="Part I. quickbook 1.0">
|
||||
<link rel="up" href="../index.html" title="Part I. quickbook 1.0">
|
||||
<link rel="prev" href="quickbook.html" title=" QuickBook Grammar">
|
||||
<link rel="next" href="pyhighlight.html" title=" Python Syntax Highlighting Grammar">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%">
|
||||
<td valign="top"><img alt="boost.png (6897 bytes)" width="277" height="86" src="../../../../../boost.png"></td>
|
||||
<td align="center"><a href="../../../../../index.htm">Home</a></td>
|
||||
<td align="center"><a href="../libraries.html">Libraries</a></td>
|
||||
<td align="center"><a href="../../../../../people/people.htm">People</a></td>
|
||||
<td align="center"><a href="../../../../../more/faq.htm">FAQ</a></td>
|
||||
<td align="center"><a href="../../../../../more/index.htm">More</a></td>
|
||||
</table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="quickbook.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="pyhighlight.html"><img src="../images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section" lang="en">
|
||||
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
|
||||
<a name="quickbook.highlight"></a> C++ Syntax Highlighting Grammar</h2></div></div></div>
|
||||
<pre class="programlisting"><tt class="literal"><span class="identifier">program</span><span class="special">
|
||||
=</span><span class="special">
|
||||
*(</span><span class="identifier"> macro</span><span class="special">
|
||||
|</span><span class="identifier"> preprocessor</span><span class="special">
|
||||
|</span><span class="identifier"> comment</span><span class="special">
|
||||
|</span><span class="identifier"> keyword</span><span class="special">
|
||||
|</span><span class="identifier"> identifier</span><span class="special">
|
||||
|</span><span class="identifier"> special</span><span class="special">
|
||||
|</span><span class="identifier"> string_</span><span class="special">
|
||||
|</span><span class="identifier"> char_</span><span class="special">
|
||||
|</span><span class="identifier"> number</span><span class="special">
|
||||
|</span><span class="identifier"> space_p</span><span class="special">
|
||||
|</span><span class="identifier"> anychar_p</span><span class="special">
|
||||
)</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
macro</span><span class="special">
|
||||
=</span><span class="special"> *</span><span class="identifier">space_p</span><span class="special"> >></span><span class="identifier"> self</span><span class="special">.</span><span class="identifier">macro</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
preprocessor</span><span class="special">
|
||||
=</span><span class="special"> *</span><span class="identifier">space_p</span><span class="special"> >></span><span class="char"> '#'</span><span class="special"> >></span><span class="special"> ((</span><span class="identifier">alpha_p</span><span class="special"> |</span><span class="char"> '_'</span><span class="special">)</span><span class="special"> >></span><span class="special"> *(</span><span class="identifier">alnum_p</span><span class="special"> |</span><span class="char"> '_'</span><span class="special">))</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
comment</span><span class="special">
|
||||
=</span><span class="special"> +(*</span><span class="identifier">space_p</span><span class="special"> >></span><span class="special"> (</span><span class="identifier">comment_p</span><span class="special">(</span><span class="string">"//"</span><span class="special">)</span><span class="special"> |</span><span class="identifier"> comment_p</span><span class="special">(</span><span class="string">"/*"</span><span class="special">,</span><span class="string"> "*/"</span><span class="special">)))</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
keyword</span><span class="special">
|
||||
=</span><span class="special"> *</span><span class="identifier">space_p</span><span class="special"> >></span><span class="identifier"> keyword_</span><span class="special"> >></span><span class="special"> (</span><span class="identifier">eps_p</span><span class="special"> -</span><span class="special"> (</span><span class="identifier">alnum_p</span><span class="special"> |</span><span class="char"> '_'</span><span class="special">))</span><span class="special">
|
||||
;</span><span class="comment"> // make sure we recognize whole words only
|
||||
</span><span class="identifier">
|
||||
keyword_</span><span class="special">
|
||||
=</span><span class="string"> "and_eq"</span><span class="special">,</span><span class="string"> "and"</span><span class="special">,</span><span class="string"> "asm"</span><span class="special">,</span><span class="string"> "auto"</span><span class="special">,</span><span class="string"> "bitand"</span><span class="special">,</span><span class="string"> "bitor"</span><span class="special">,</span><span class="string">
|
||||
"bool"</span><span class="special">,</span><span class="string"> "break"</span><span class="special">,</span><span class="string"> "case"</span><span class="special">,</span><span class="string"> "catch"</span><span class="special">,</span><span class="string"> "char"</span><span class="special">,</span><span class="string"> "class"</span><span class="special">,</span><span class="string">
|
||||
"compl"</span><span class="special">,</span><span class="string"> "const_cast"</span><span class="special">,</span><span class="string"> "const"</span><span class="special">,</span><span class="string"> "continue"</span><span class="special">,</span><span class="string"> "default"</span><span class="special">,</span><span class="string">
|
||||
"delete"</span><span class="special">,</span><span class="string"> "do"</span><span class="special">,</span><span class="string"> "double"</span><span class="special">,</span><span class="string"> "dynamic_cast"</span><span class="special">,</span><span class="string"> "else"</span><span class="special">,</span><span class="string">
|
||||
"enum"</span><span class="special">,</span><span class="string"> "explicit"</span><span class="special">,</span><span class="string"> "export"</span><span class="special">,</span><span class="string"> "extern"</span><span class="special">,</span><span class="string"> "false"</span><span class="special">,</span><span class="string">
|
||||
"float"</span><span class="special">,</span><span class="string"> "for"</span><span class="special">,</span><span class="string"> "friend"</span><span class="special">,</span><span class="string"> "goto"</span><span class="special">,</span><span class="string"> "if"</span><span class="special">,</span><span class="string"> "inline"</span><span class="special">,</span><span class="string">
|
||||
"int"</span><span class="special">,</span><span class="string"> "long"</span><span class="special">,</span><span class="string"> "mutable"</span><span class="special">,</span><span class="string"> "namespace"</span><span class="special">,</span><span class="string"> "new"</span><span class="special">,</span><span class="string"> "not_eq"</span><span class="special">,</span><span class="string">
|
||||
"not"</span><span class="special">,</span><span class="string"> "operator"</span><span class="special">,</span><span class="string"> "or_eq"</span><span class="special">,</span><span class="string"> "or"</span><span class="special">,</span><span class="string"> "private"</span><span class="special">,</span><span class="string">
|
||||
"protected"</span><span class="special">,</span><span class="string"> "public"</span><span class="special">,</span><span class="string"> "register"</span><span class="special">,</span><span class="string"> "reinterpret_cast"</span><span class="special">,</span><span class="string">
|
||||
"return"</span><span class="special">,</span><span class="string"> "short"</span><span class="special">,</span><span class="string"> "signed"</span><span class="special">,</span><span class="string"> "sizeof"</span><span class="special">,</span><span class="string"> "static"</span><span class="special">,</span><span class="string">
|
||||
"static_cast"</span><span class="special">,</span><span class="string"> "struct"</span><span class="special">,</span><span class="string"> "switch"</span><span class="special">,</span><span class="string"> "template"</span><span class="special">,</span><span class="string"> "this"</span><span class="special">,</span><span class="string">
|
||||
"throw"</span><span class="special">,</span><span class="string"> "true"</span><span class="special">,</span><span class="string"> "try"</span><span class="special">,</span><span class="string"> "typedef"</span><span class="special">,</span><span class="string"> "typeid"</span><span class="special">,</span><span class="string">
|
||||
"typename"</span><span class="special">,</span><span class="string"> "union"</span><span class="special">,</span><span class="string"> "unsigned"</span><span class="special">,</span><span class="string"> "using"</span><span class="special">,</span><span class="string"> "virtual"</span><span class="special">,</span><span class="string">
|
||||
"void"</span><span class="special">,</span><span class="string"> "volatile"</span><span class="special">,</span><span class="string"> "wchar_t"</span><span class="special">,</span><span class="string"> "while"</span><span class="special">,</span><span class="string"> "xor_eq"</span><span class="special">,</span><span class="string"> "xor"</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
special</span><span class="special">
|
||||
=</span><span class="special"> *</span><span class="identifier">space_p</span><span class="special"> >></span><span class="special"> +</span><span class="identifier">chset_p</span><span class="special">(</span><span class="string">"~!%^&*()+={[}]:;,<.>?/|\\-"</span><span class="special">)</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
string_</span><span class="special">
|
||||
=</span><span class="special"> *</span><span class="identifier">space_p</span><span class="special"> >></span><span class="special"> !</span><span class="identifier">as_lower_d</span><span class="special">[</span><span class="char">'l'</span><span class="special">]</span><span class="special"> >></span><span class="identifier"> confix_p</span><span class="special">(</span><span class="char">'"'</span><span class="special">,</span><span class="special"> *</span><span class="identifier">c_escape_ch_p</span><span class="special">,</span><span class="char"> '"'</span><span class="special">)</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
char_</span><span class="special">
|
||||
=</span><span class="special"> *</span><span class="identifier">space_p</span><span class="special"> >></span><span class="special"> !</span><span class="identifier">as_lower_d</span><span class="special">[</span><span class="char">'l'</span><span class="special">]</span><span class="special"> >></span><span class="identifier"> confix_p</span><span class="special">(</span><span class="char">'\''</span><span class="special">,</span><span class="special"> *</span><span class="identifier">c_escape_ch_p</span><span class="special">,</span><span class="char"> '\''</span><span class="special">)</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
number</span><span class="special">
|
||||
=</span><span class="special"> *</span><span class="identifier">space_p</span><span class="special"> >></span><span class="special">
|
||||
(</span><span class="identifier"> as_lower_d</span><span class="special">[</span><span class="string">"0x"</span><span class="special">]</span><span class="special"> >></span><span class="identifier"> hex_p</span><span class="special">
|
||||
|</span><span class="char"> '0'</span><span class="special"> >></span><span class="identifier"> oct_p</span><span class="special">
|
||||
|</span><span class="identifier"> real_p</span><span class="special">
|
||||
)</span><span class="special">
|
||||
>></span><span class="special"> *</span><span class="identifier">as_lower_d</span><span class="special">[</span><span class="identifier">chset_p</span><span class="special">(</span><span class="string">"ldfu"</span><span class="special">)]</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
identifier</span><span class="special">
|
||||
=</span><span class="special"> *</span><span class="identifier">space_p</span><span class="special"> >></span><span class="special"> ((</span><span class="identifier">alpha_p</span><span class="special"> |</span><span class="char"> '_'</span><span class="special">)</span><span class="special"> >></span><span class="special"> *(</span><span class="identifier">alnum_p</span><span class="special"> |</span><span class="char"> '_'</span><span class="special">))</span><span class="special">
|
||||
;</span></tt></pre>
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><small>Copyright © 2002, 2004 Joel de Guzman, Eric Niebler</small></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="quickbook.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="pyhighlight.html"><img src="../images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,110 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title> Python Syntax Highlighting Grammar</title>
|
||||
<link rel="stylesheet" href="../boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.66.1">
|
||||
<link rel="start" href="../index.html" title="Part I. quickbook 1.0">
|
||||
<link rel="up" href="../index.html" title="Part I. quickbook 1.0">
|
||||
<link rel="prev" href="highlight.html" title=" C++ Syntax Highlighting Grammar">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%">
|
||||
<td valign="top"><img alt="boost.png (6897 bytes)" width="277" height="86" src="../../../../../boost.png"></td>
|
||||
<td align="center"><a href="../../../../../index.htm">Home</a></td>
|
||||
<td align="center"><a href="../libraries.html">Libraries</a></td>
|
||||
<td align="center"><a href="../../../../../people/people.htm">People</a></td>
|
||||
<td align="center"><a href="../../../../../more/faq.htm">FAQ</a></td>
|
||||
<td align="center"><a href="../../../../../more/index.htm">More</a></td>
|
||||
</table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="highlight.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a>
|
||||
</div>
|
||||
<div class="section" lang="en">
|
||||
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
|
||||
<a name="quickbook.pyhighlight"></a> Python Syntax Highlighting Grammar</h2></div></div></div>
|
||||
<p></p>
|
||||
<pre class="programlisting"><tt class="literal"><span class="identifier">program</span><span class="special">
|
||||
=</span><span class="special">
|
||||
*(</span><span class="identifier"> comment</span><span class="special">
|
||||
|</span><span class="identifier"> keyword</span><span class="special">
|
||||
|</span><span class="identifier"> identifier</span><span class="special">
|
||||
|</span><span class="identifier"> special</span><span class="special">
|
||||
|</span><span class="identifier"> string_</span><span class="special">
|
||||
|</span><span class="identifier"> number</span><span class="special">
|
||||
|</span><span class="identifier"> space_p</span><span class="special">
|
||||
|</span><span class="identifier"> anychar_p</span><span class="special">
|
||||
)</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
comment</span><span class="special">
|
||||
=</span><span class="special"> +(*</span><span class="identifier">space_p</span><span class="special"> >></span><span class="identifier"> comment_p</span><span class="special">(</span><span class="string">"#"</span><span class="special">))</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
keyword</span><span class="special">
|
||||
=</span><span class="special"> *</span><span class="identifier">space_p</span><span class="special"> >></span><span class="identifier"> keyword_</span><span class="special"> >></span><span class="special"> (</span><span class="identifier">eps_p</span><span class="special"> -</span><span class="special"> (</span><span class="identifier">alnum_p</span><span class="special"> |</span><span class="char"> '_'</span><span class="special">))</span><span class="special">
|
||||
;</span><span class="comment"> // make sure we recognize whole words only
|
||||
</span><span class="identifier">
|
||||
keyword_</span><span class="special">
|
||||
=</span><span class="string">
|
||||
"and"</span><span class="special">,</span><span class="string"> "del"</span><span class="special">,</span><span class="string"> "for"</span><span class="special">,</span><span class="string"> "is"</span><span class="special">,</span><span class="string"> "raise"</span><span class="special">,</span><span class="string">
|
||||
"assert"</span><span class="special">,</span><span class="string"> "elif"</span><span class="special">,</span><span class="string"> "from"</span><span class="special">,</span><span class="string"> "lambda"</span><span class="special">,</span><span class="string"> "return"</span><span class="special">,</span><span class="string">
|
||||
"break"</span><span class="special">,</span><span class="string"> "else"</span><span class="special">,</span><span class="string"> "global"</span><span class="special">,</span><span class="string"> "not"</span><span class="special">,</span><span class="string"> "try"</span><span class="special">,</span><span class="string">
|
||||
"class"</span><span class="special">,</span><span class="string"> "except"</span><span class="special">,</span><span class="string"> "if"</span><span class="special">,</span><span class="string"> "or"</span><span class="special">,</span><span class="string"> "while"</span><span class="special">,</span><span class="string">
|
||||
"continue"</span><span class="special">,</span><span class="string"> "exec"</span><span class="special">,</span><span class="string"> "import"</span><span class="special">,</span><span class="string"> "pass"</span><span class="special">,</span><span class="string"> "yield"</span><span class="special">,</span><span class="string">
|
||||
"def"</span><span class="special">,</span><span class="string"> "finally"</span><span class="special">,</span><span class="string"> "in"</span><span class="special">,</span><span class="string"> "print"</span><span class="special">,</span><span class="comment">
|
||||
|
||||
// Technically "as" and "None" are not yet keywords (at Python
|
||||
// 2.4). They are destined to become keywords, and we treat them
|
||||
// as such for syntax highlighting purposes.
|
||||
</span><span class="string">
|
||||
"as"</span><span class="special">,</span><span class="string"> "None"</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
special</span><span class="special">
|
||||
=</span><span class="special"> *</span><span class="identifier">space_p</span><span class="special"> >></span><span class="special"> +</span><span class="identifier">chset_p</span><span class="special">(</span><span class="string">"~!%^&*()+={[}]:;,<.>/|\\-"</span><span class="special">)</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
string_prefix</span><span class="special">
|
||||
=</span><span class="identifier"> as_lower_d</span><span class="special">[</span><span class="identifier">str_p</span><span class="special">(</span><span class="string">"u"</span><span class="special">)</span><span class="special"> >></span><span class="special"> !</span><span class="identifier"> str_p</span><span class="special">(</span><span class="string">"r"</span><span class="special">)]</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
string_</span><span class="special">
|
||||
=</span><span class="special"> *</span><span class="identifier">space_p</span><span class="special"> >></span><span class="special"> !</span><span class="identifier"> string_prefix</span><span class="special"> >></span><span class="special"> (</span><span class="identifier">long_string</span><span class="special"> |</span><span class="identifier"> short_string</span><span class="special">)</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
short_string</span><span class="special">
|
||||
=</span><span class="identifier"> confix_p</span><span class="special">(</span><span class="char">'"'</span><span class="special">,</span><span class="special"> *</span><span class="identifier"> c_escape_ch_p</span><span class="special">,</span><span class="char"> '"'</span><span class="special">)</span><span class="special"> |</span><span class="identifier">
|
||||
confix_p</span><span class="special">(</span><span class="string">"'"</span><span class="special">,</span><span class="special"> *</span><span class="identifier"> c_escape_ch_p</span><span class="special">,</span><span class="string"> "'"</span><span class="special">)</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
long_string</span><span class="special">
|
||||
=</span><span class="identifier"> confix_p</span><span class="special">(</span><span class="string">"'''"</span><span class="special">,</span><span class="special"> *</span><span class="identifier"> lex_escape_ch_p</span><span class="special">,</span><span class="string"> "'''"</span><span class="special">)</span><span class="special"> |</span><span class="identifier">
|
||||
confix_p</span><span class="special">(</span><span class="string">"\"\"\""</span><span class="special">,</span><span class="special"> *</span><span class="identifier"> lex_escape_ch_p</span><span class="special">,</span><span class="string"> "\"\"\""</span><span class="special">)</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
number</span><span class="special">
|
||||
=</span><span class="special"> *</span><span class="identifier">space_p</span><span class="special"> >></span><span class="special">
|
||||
(</span><span class="identifier">
|
||||
as_lower_d</span><span class="special">[</span><span class="string">"0x"</span><span class="special">]</span><span class="special"> >></span><span class="identifier"> hex_p</span><span class="special">
|
||||
|</span><span class="char"> '0'</span><span class="special"> >></span><span class="identifier"> oct_p</span><span class="special">
|
||||
|</span><span class="identifier"> real_p</span><span class="special">
|
||||
)</span><span class="special">
|
||||
>></span><span class="special"> *</span><span class="identifier">as_lower_d</span><span class="special">[</span><span class="identifier">chset_p</span><span class="special">(</span><span class="string">"lj"</span><span class="special">)]</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
identifier</span><span class="special">
|
||||
=</span><span class="special"> *</span><span class="identifier">space_p</span><span class="special"> >></span><span class="special"> ((</span><span class="identifier">alpha_p</span><span class="special"> |</span><span class="char"> '_'</span><span class="special">)</span><span class="special"> >></span><span class="special"> *(</span><span class="identifier">alnum_p</span><span class="special"> |</span><span class="char"> '_'</span><span class="special">))</span><span class="special">
|
||||
;</span></tt></pre>
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><small>Copyright © 2002, 2004 Joel de Guzman, Eric Niebler</small></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="highlight.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,536 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title> QuickBook Grammar</title>
|
||||
<link rel="stylesheet" href="../boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.66.1">
|
||||
<link rel="start" href="../index.html" title="Part I. quickbook 1.0">
|
||||
<link rel="up" href="../index.html" title="Part I. quickbook 1.0">
|
||||
<link rel="prev" href="docinfo.html" title=" Library Document Grammar">
|
||||
<link rel="next" href="highlight.html" title=" C++ Syntax Highlighting Grammar">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%">
|
||||
<td valign="top"><img alt="boost.png (6897 bytes)" width="277" height="86" src="../../../../../boost.png"></td>
|
||||
<td align="center"><a href="../../../../../index.htm">Home</a></td>
|
||||
<td align="center"><a href="../libraries.html">Libraries</a></td>
|
||||
<td align="center"><a href="../../../../../people/people.htm">People</a></td>
|
||||
<td align="center"><a href="../../../../../more/faq.htm">FAQ</a></td>
|
||||
<td align="center"><a href="../../../../../more/index.htm">More</a></td>
|
||||
</table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="docinfo.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="highlight.html"><img src="../images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section" lang="en">
|
||||
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
|
||||
<a name="quickbook.quickbook"></a> QuickBook Grammar</h2></div></div></div>
|
||||
<pre class="programlisting"><tt class="literal"><span class="identifier">library</span><span class="special"> =</span><span class="special">
|
||||
*(</span><span class="identifier">space_p</span><span class="special"> |</span><span class="identifier"> comment</span><span class="special">)</span><span class="special"> >></span><span class="identifier"> blocks</span><span class="special"> >></span><span class="identifier"> blank</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
blocks</span><span class="special"> =</span><span class="special">
|
||||
+(</span><span class="identifier"> block_markup</span><span class="special">
|
||||
|</span><span class="identifier"> code</span><span class="special">
|
||||
|</span><span class="identifier"> list</span><span class="special">
|
||||
|</span><span class="identifier"> hr</span><span class="special">
|
||||
|</span><span class="identifier"> comment</span><span class="special"> >></span><span class="special"> *</span><span class="identifier">eol</span><span class="special">
|
||||
|</span><span class="identifier"> paragraph</span><span class="special">
|
||||
|</span><span class="identifier"> eol</span><span class="special">
|
||||
)</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
space</span><span class="special"> =</span><span class="special">
|
||||
*(</span><span class="identifier">space_p</span><span class="special"> |</span><span class="identifier"> comment</span><span class="special">)</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
blank</span><span class="special"> =</span><span class="special">
|
||||
*(</span><span class="identifier">blank_p</span><span class="special"> |</span><span class="identifier"> comment</span><span class="special">)</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
eol</span><span class="special"> =</span><span class="identifier"> blank</span><span class="special"> >></span><span class="identifier"> eol_p</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
close_bracket</span><span class="special"> =</span><span class="char">
|
||||
']'</span><span class="special"> |</span><span class="identifier">
|
||||
if_p</span><span class="special">(</span><span class="identifier">var</span><span class="special">(</span><span class="identifier">is_not_preformatted</span><span class="special">))</span><span class="special">
|
||||
[</span><span class="identifier">
|
||||
eol_p</span><span class="special"> >></span><span class="identifier"> eol_p</span><span class="comment"> // Make sure that we don't go
|
||||
</span><span class="special"> ]</span><span class="comment"> // past a single block, except
|
||||
</span><span class="special"> ;</span><span class="comment"> // when preformatted.
|
||||
</span><span class="identifier">
|
||||
hard_space</span><span class="special"> =</span><span class="special">
|
||||
(</span><span class="identifier">eps_p</span><span class="special"> -</span><span class="special"> (</span><span class="identifier">alnum_p</span><span class="special"> |</span><span class="char"> '_'</span><span class="special">))</span><span class="special"> >></span><span class="identifier"> space</span><span class="comment"> // must not be followed by
|
||||
</span><span class="special"> ;</span><span class="comment"> // alpha-numeric or underscore
|
||||
</span><span class="identifier">
|
||||
comment</span><span class="special"> =</span><span class="string">
|
||||
"[/"</span><span class="special"> >></span><span class="special"> *(</span><span class="identifier">anychar_p</span><span class="special"> -</span><span class="char"> ']'</span><span class="special">)</span><span class="special"> >></span><span class="char"> ']'</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
hr</span><span class="special"> =</span><span class="identifier">
|
||||
str_p</span><span class="special">(</span><span class="string">"----"</span><span class="special">)</span><span class="special">
|
||||
>></span><span class="special"> *(</span><span class="identifier">anychar_p</span><span class="special"> -</span><span class="identifier"> eol</span><span class="special">)</span><span class="special">
|
||||
>></span><span class="special"> +</span><span class="identifier">eol</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
block_markup</span><span class="special"> =</span><span class="char">
|
||||
'['</span><span class="special">
|
||||
>></span><span class="special"> (</span><span class="identifier"> begin_section</span><span class="special">
|
||||
|</span><span class="identifier"> end_section</span><span class="special">
|
||||
|</span><span class="identifier"> headings</span><span class="special">
|
||||
|</span><span class="identifier"> blurb</span><span class="special">
|
||||
|</span><span class="identifier"> blockquote</span><span class="special">
|
||||
|</span><span class="identifier"> preformatted</span><span class="special">
|
||||
|</span><span class="identifier"> def_macro</span><span class="special">
|
||||
|</span><span class="identifier"> table</span><span class="special">
|
||||
|</span><span class="identifier"> variablelist</span><span class="special">
|
||||
|</span><span class="identifier"> xinclude</span><span class="special">
|
||||
)</span><span class="special">
|
||||
>></span><span class="special"> (</span><span class="special"> (</span><span class="char">']'</span><span class="special"> >></span><span class="special"> +</span><span class="identifier">eol</span><span class="special">)</span><span class="special">
|
||||
|</span><span class="identifier"> eps_p</span><span class="special">
|
||||
)</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
begin_section</span><span class="special"> =</span><span class="string">
|
||||
"section"</span><span class="special">
|
||||
>></span><span class="identifier"> hard_space</span><span class="special">
|
||||
>></span><span class="special"> (</span><span class="char">':'</span><span class="special"> >></span><span class="special"> (*(</span><span class="identifier">alnum_p</span><span class="special"> |</span><span class="char"> '_'</span><span class="special">))</span><span class="special">
|
||||
|</span><span class="identifier"> eps_p</span><span class="special">
|
||||
)</span><span class="special">
|
||||
>></span><span class="special"> (*(</span><span class="identifier">anychar_p</span><span class="special"> -</span><span class="identifier">
|
||||
close_bracket</span><span class="special">))</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
end_section</span><span class="special"> =</span><span class="identifier">
|
||||
str_p</span><span class="special">(</span><span class="string">"endsect"</span><span class="special">)</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
headings</span><span class="special"> =</span><span class="identifier">
|
||||
h1</span><span class="special"> |</span><span class="identifier"> h2</span><span class="special"> |</span><span class="identifier"> h3</span><span class="special"> |</span><span class="identifier"> h4</span><span class="special"> |</span><span class="identifier"> h5</span><span class="special"> |</span><span class="identifier"> h6</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
h1</span><span class="special"> =</span><span class="string"> "h1"</span><span class="special"> >></span><span class="identifier"> hard_space</span><span class="special"> >></span><span class="identifier"> phrase</span><span class="identifier">
|
||||
h2</span><span class="special"> =</span><span class="string"> "h2"</span><span class="special"> >></span><span class="identifier"> hard_space</span><span class="special"> >></span><span class="identifier"> phrase</span><span class="identifier">
|
||||
h3</span><span class="special"> =</span><span class="string"> "h3"</span><span class="special"> >></span><span class="identifier"> hard_space</span><span class="special"> >></span><span class="identifier"> phrase</span><span class="identifier">
|
||||
h4</span><span class="special"> =</span><span class="string"> "h4"</span><span class="special"> >></span><span class="identifier"> hard_space</span><span class="special"> >></span><span class="identifier"> phrase</span><span class="identifier">
|
||||
h5</span><span class="special"> =</span><span class="string"> "h5"</span><span class="special"> >></span><span class="identifier"> hard_space</span><span class="special"> >></span><span class="identifier"> phrase</span><span class="identifier">
|
||||
h6</span><span class="special"> =</span><span class="string"> "h6"</span><span class="special"> >></span><span class="identifier"> hard_space</span><span class="special"> >></span><span class="identifier"> phrase</span><span class="identifier">
|
||||
|
||||
blurb</span><span class="special"> =</span><span class="string">
|
||||
"blurb"</span><span class="special"> >></span><span class="identifier"> hard_space</span><span class="special">
|
||||
>></span><span class="identifier"> phrase</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
blockquote</span><span class="special"> =</span><span class="char">
|
||||
':'</span><span class="special"> >></span><span class="identifier"> blank</span><span class="special"> >></span><span class="identifier">
|
||||
phrase</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
preformatted</span><span class="special"> =</span><span class="string">
|
||||
"pre"</span><span class="special"> >></span><span class="identifier"> hard_space</span><span class="special">
|
||||
>></span><span class="special"> !</span><span class="identifier">eol</span><span class="special"> >></span><span class="identifier"> phrase</span><span class="special">
|
||||
>></span><span class="identifier"> eps_p</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
def_macro</span><span class="special"> =</span><span class="string">
|
||||
"def"</span><span class="special"> >></span><span class="identifier"> hard_space</span><span class="special">
|
||||
>></span><span class="identifier"> identifier</span><span class="special">
|
||||
>></span><span class="identifier"> blank</span><span class="special"> >></span><span class="identifier"> phrase</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
table</span><span class="special"> =</span><span class="string">
|
||||
"table"</span><span class="special"> >></span><span class="identifier"> hard_space</span><span class="special">
|
||||
>></span><span class="special"> (*(</span><span class="identifier">anychar_p</span><span class="special"> -</span><span class="identifier"> eol</span><span class="special">))</span><span class="special">
|
||||
>></span><span class="special"> +</span><span class="identifier">eol</span><span class="special">
|
||||
>></span><span class="special"> *</span><span class="identifier">table_row</span><span class="special">
|
||||
>></span><span class="identifier"> eps_p</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
table_row</span><span class="special"> =</span><span class="identifier">
|
||||
space</span><span class="special">
|
||||
>></span><span class="identifier"> ch_p</span><span class="special">(</span><span class="char">'['</span><span class="special">)</span><span class="special">
|
||||
>></span><span class="special">
|
||||
(</span><span class="special">
|
||||
(</span><span class="special">
|
||||
*</span><span class="identifier">table_cell</span><span class="special">
|
||||
>></span><span class="identifier"> ch_p</span><span class="special">(</span><span class="char">']'</span><span class="special">)</span><span class="special">
|
||||
>></span><span class="identifier"> space</span><span class="special">
|
||||
)</span><span class="special">
|
||||
|</span><span class="identifier"> eps_p</span><span class="special">
|
||||
)</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
table_cell</span><span class="special"> =</span><span class="identifier">
|
||||
space</span><span class="special">
|
||||
>></span><span class="identifier"> ch_p</span><span class="special">(</span><span class="char">'['</span><span class="special">)</span><span class="special">
|
||||
>></span><span class="special">
|
||||
(</span><span class="special">
|
||||
(</span><span class="identifier">
|
||||
phrase</span><span class="special">
|
||||
>></span><span class="identifier"> ch_p</span><span class="special">(</span><span class="char">']'</span><span class="special">)</span><span class="special">
|
||||
>></span><span class="identifier"> space</span><span class="special">
|
||||
)</span><span class="special">
|
||||
|</span><span class="identifier"> eps_p</span><span class="special">
|
||||
)</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
variablelist</span><span class="special"> =</span><span class="string">
|
||||
"variablelist"</span><span class="special"> >></span><span class="identifier"> hard_space</span><span class="special">
|
||||
>></span><span class="special"> (*(</span><span class="identifier">anychar_p</span><span class="special"> -</span><span class="identifier"> eol</span><span class="special">))</span><span class="special">
|
||||
>></span><span class="special"> +</span><span class="identifier">eol</span><span class="special">
|
||||
>></span><span class="special"> *</span><span class="identifier">varlistentry</span><span class="special">
|
||||
>></span><span class="identifier"> eps_p</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
varlistentry</span><span class="special"> =</span><span class="identifier">
|
||||
space</span><span class="special">
|
||||
>></span><span class="identifier"> ch_p</span><span class="special">(</span><span class="char">'['</span><span class="special">)</span><span class="special">
|
||||
>></span><span class="special">
|
||||
(</span><span class="special">
|
||||
(</span><span class="identifier">
|
||||
varlistterm</span><span class="special">
|
||||
>></span><span class="special"> +</span><span class="identifier">varlistitem</span><span class="special">
|
||||
>></span><span class="identifier"> ch_p</span><span class="special">(</span><span class="char">']'</span><span class="special">)</span><span class="special">
|
||||
>></span><span class="identifier"> space</span><span class="special">
|
||||
)</span><span class="special">
|
||||
|</span><span class="identifier"> eps_p</span><span class="special">
|
||||
)</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
varlistterm</span><span class="special"> =</span><span class="identifier">
|
||||
space</span><span class="special">
|
||||
>></span><span class="identifier"> ch_p</span><span class="special">(</span><span class="char">'['</span><span class="special">)</span><span class="special">
|
||||
>></span><span class="special">
|
||||
(</span><span class="special">
|
||||
(</span><span class="identifier">
|
||||
phrase</span><span class="special">
|
||||
>></span><span class="identifier"> ch_p</span><span class="special">(</span><span class="char">']'</span><span class="special">)</span><span class="special">
|
||||
>></span><span class="identifier"> space</span><span class="special">
|
||||
)</span><span class="special">
|
||||
|</span><span class="identifier"> eps_p</span><span class="special">
|
||||
)</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
varlistitem</span><span class="special"> =</span><span class="identifier">
|
||||
space</span><span class="special">
|
||||
>></span><span class="identifier"> ch_p</span><span class="special">(</span><span class="char">'['</span><span class="special">)</span><span class="special">
|
||||
>></span><span class="special">
|
||||
(</span><span class="special">
|
||||
(</span><span class="identifier">
|
||||
phrase</span><span class="special">
|
||||
>></span><span class="identifier"> ch_p</span><span class="special">(</span><span class="char">']'</span><span class="special">)</span><span class="special">
|
||||
>></span><span class="identifier"> space</span><span class="special">
|
||||
)</span><span class="special">
|
||||
|</span><span class="identifier"> eps_p</span><span class="special">
|
||||
)</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
xinclude</span><span class="special"> =</span><span class="string">
|
||||
"xinclude"</span><span class="special">
|
||||
>></span><span class="identifier"> hard_space</span><span class="special">
|
||||
>></span><span class="special"> (*(</span><span class="identifier">anychar_p</span><span class="special"> -</span><span class="identifier">
|
||||
close_bracket</span><span class="special">))</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
identifier</span><span class="special"> =</span><span class="special">
|
||||
*(</span><span class="identifier">anychar_p</span><span class="special"> -</span><span class="special"> (</span><span class="identifier">space_p</span><span class="special"> |</span><span class="char"> ']'</span><span class="special">))</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
source_mode</span><span class="special"> =</span><span class="special">
|
||||
(</span><span class="identifier">
|
||||
str_p</span><span class="special">(</span><span class="string">"c++"</span><span class="special">)</span><span class="special">
|
||||
|</span><span class="string"> "python"</span><span class="special">
|
||||
)</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
code</span><span class="special"> =</span><span class="special">
|
||||
(</span><span class="identifier">
|
||||
code_line</span><span class="special">
|
||||
>></span><span class="special"> *(*</span><span class="identifier">eol</span><span class="special"> >></span><span class="identifier"> code_line</span><span class="special">)</span><span class="special">
|
||||
)</span><span class="special">
|
||||
>></span><span class="special"> +</span><span class="identifier">eol</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
code_line</span><span class="special"> =</span><span class="special">
|
||||
((</span><span class="identifier">ch_p</span><span class="special">(</span><span class="char">' '</span><span class="special">)</span><span class="special"> |</span><span class="char"> '\t'</span><span class="special">))</span><span class="special">
|
||||
>></span><span class="special"> *(</span><span class="identifier">anychar_p</span><span class="special"> -</span><span class="identifier"> eol</span><span class="special">)</span><span class="special"> >></span><span class="identifier"> eol</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
list</span><span class="special"> =</span><span class="identifier">
|
||||
eps_p</span><span class="special">(</span><span class="identifier">ch_p</span><span class="special">(</span><span class="char">'*'</span><span class="special">)</span><span class="special"> |</span><span class="char"> '#'</span><span class="special">)</span><span class="special"> >></span><span class="special">
|
||||
+(</span><span class="special">
|
||||
(*</span><span class="identifier">blank_p</span><span class="special">
|
||||
>></span><span class="special"> (</span><span class="identifier">ch_p</span><span class="special">(</span><span class="char">'*'</span><span class="special">)</span><span class="special"> |</span><span class="char"> '#'</span><span class="special">))</span><span class="special">
|
||||
>></span><span class="special"> *</span><span class="identifier">blank_p</span><span class="special">
|
||||
>></span><span class="identifier"> list_item</span><span class="special">
|
||||
)</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
list_item</span><span class="special"> =</span><span class="special">
|
||||
*(</span><span class="identifier"> common</span><span class="special">
|
||||
|</span><span class="special"> (</span><span class="identifier">anychar_p</span><span class="special"> -</span><span class="special">
|
||||
(</span><span class="identifier"> eol_p</span><span class="special"> >></span><span class="special"> *</span><span class="identifier">blank_p</span><span class="special"> >></span><span class="identifier"> eps_p</span><span class="special">(</span><span class="identifier">ch_p</span><span class="special">(</span><span class="char">'*'</span><span class="special">)</span><span class="special"> |</span><span class="char"> '#'</span><span class="special">)</span><span class="special">
|
||||
|</span><span class="special"> (</span><span class="identifier">eol</span><span class="special"> >></span><span class="identifier"> eol</span><span class="special">)</span><span class="special">
|
||||
)</span><span class="special">
|
||||
)</span><span class="special">
|
||||
)</span><span class="special">
|
||||
>></span><span class="special"> +</span><span class="identifier">eol</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
common</span><span class="special"> =</span><span class="identifier">
|
||||
self</span><span class="special">.</span><span class="identifier">actions</span><span class="special">.</span><span class="identifier">macro</span><span class="special">
|
||||
|</span><span class="identifier"> phrase_markup</span><span class="special">
|
||||
|</span><span class="identifier"> inline_code</span><span class="special">
|
||||
|</span><span class="identifier"> simple_format</span><span class="special">
|
||||
|</span><span class="identifier"> escape</span><span class="special">
|
||||
|</span><span class="identifier"> comment</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
inline_code</span><span class="special"> =</span><span class="char">
|
||||
'`'</span><span class="special"> >></span><span class="special">
|
||||
(</span><span class="special">
|
||||
*(</span><span class="identifier">anychar_p</span><span class="special"> -</span><span class="special">
|
||||
(</span><span class="char"> '`'</span><span class="special">
|
||||
|</span><span class="special"> (</span><span class="identifier">eol</span><span class="special"> >></span><span class="identifier"> eol</span><span class="special">)</span><span class="comment"> // Make sure that we don't go
|
||||
</span><span class="special"> )</span><span class="comment"> // past a single block
|
||||
</span><span class="special"> )</span><span class="special"> >></span><span class="identifier"> eps_p</span><span class="special">(</span><span class="char">'`'</span><span class="special">)</span><span class="special">
|
||||
)</span><span class="special">
|
||||
>></span><span class="char"> '`'</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
simple_format</span><span class="special"> =</span><span class="identifier">
|
||||
simple_bold</span><span class="special">
|
||||
|</span><span class="identifier"> simple_italic</span><span class="special">
|
||||
|</span><span class="identifier"> simple_underline</span><span class="special">
|
||||
|</span><span class="identifier"> simple_teletype</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
simple_bold</span><span class="special"> =</span><span class="char">
|
||||
'*'</span><span class="special"> >></span><span class="special">
|
||||
(</span><span class="special">
|
||||
(</span><span class="identifier"> graph_p</span><span class="special"> >></span><span class="comment"> // graph_p must follow '*'
|
||||
</span><span class="special"> *(</span><span class="identifier">anychar_p</span><span class="special"> -</span><span class="special">
|
||||
(</span><span class="identifier"> eol</span><span class="comment"> // Make sure that we don't go
|
||||
</span><span class="special"> |</span><span class="special"> (</span><span class="identifier">graph_p</span><span class="special"> >></span><span class="char"> '*'</span><span class="special">)</span><span class="comment"> // past a single line
|
||||
</span><span class="special"> )</span><span class="special">
|
||||
)</span><span class="special"> >></span><span class="identifier"> graph_p</span><span class="comment"> // graph_p must precede '*'
|
||||
</span><span class="special"> >></span><span class="identifier"> eps_p</span><span class="special">(</span><span class="char">'*'</span><span class="special">
|
||||
>></span><span class="special"> (</span><span class="identifier">space_p</span><span class="special"> |</span><span class="identifier"> punct_p</span><span class="special">))</span><span class="comment"> // space_p or punct_p must
|
||||
</span><span class="special"> )</span><span class="comment"> // follow '*'
|
||||
</span><span class="special"> |</span><span class="special"> (</span><span class="identifier">
|
||||
graph_p</span><span class="comment"> // A single char. e.g. *c*
|
||||
</span><span class="special"> >></span><span class="identifier"> eps_p</span><span class="special">(</span><span class="char">'*'</span><span class="special">
|
||||
>></span><span class="special"> (</span><span class="identifier">space_p</span><span class="special"> |</span><span class="identifier"> punct_p</span><span class="special">))</span><span class="special">
|
||||
)</span><span class="special">
|
||||
)</span><span class="special">
|
||||
>></span><span class="char"> '*'</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
simple_italic</span><span class="special"> =</span><span class="char">
|
||||
'/'</span><span class="special"> >></span><span class="special">
|
||||
(</span><span class="special">
|
||||
(</span><span class="identifier"> graph_p</span><span class="special"> >></span><span class="comment"> // graph_p must follow '/'
|
||||
</span><span class="special"> *(</span><span class="identifier">anychar_p</span><span class="special"> -</span><span class="special">
|
||||
(</span><span class="identifier"> eol</span><span class="comment"> // Make sure that we don't go
|
||||
</span><span class="special"> |</span><span class="special"> (</span><span class="identifier">graph_p</span><span class="special"> >></span><span class="char"> '/'</span><span class="special">)</span><span class="comment"> // past a single line
|
||||
</span><span class="special"> )</span><span class="special">
|
||||
)</span><span class="special"> >></span><span class="identifier"> graph_p</span><span class="comment"> // graph_p must precede '/'
|
||||
</span><span class="special"> >></span><span class="identifier"> eps_p</span><span class="special">(</span><span class="char">'/'</span><span class="special">
|
||||
>></span><span class="special"> (</span><span class="identifier">space_p</span><span class="special"> |</span><span class="identifier"> punct_p</span><span class="special">))</span><span class="comment"> // space_p or punct_p must
|
||||
</span><span class="special"> )</span><span class="comment"> // follow '/'
|
||||
</span><span class="special"> |</span><span class="special"> (</span><span class="identifier">
|
||||
graph_p</span><span class="comment"> // A single char. e.g. /c/
|
||||
</span><span class="special"> >></span><span class="identifier"> eps_p</span><span class="special">(</span><span class="char">'/'</span><span class="special">
|
||||
>></span><span class="special"> (</span><span class="identifier">space_p</span><span class="special"> |</span><span class="identifier"> punct_p</span><span class="special">))</span><span class="special">
|
||||
)</span><span class="special">
|
||||
)</span><span class="special">
|
||||
>></span><span class="char"> '/'</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
simple_underline</span><span class="special"> =</span><span class="char">
|
||||
'_'</span><span class="special"> >></span><span class="special">
|
||||
(</span><span class="special">
|
||||
(</span><span class="identifier"> graph_p</span><span class="special"> >></span><span class="comment"> // graph_p must follow '_'
|
||||
</span><span class="special"> *(</span><span class="identifier">anychar_p</span><span class="special"> -</span><span class="special">
|
||||
(</span><span class="identifier"> eol</span><span class="comment"> // Make sure that we don't go
|
||||
</span><span class="special"> |</span><span class="special"> (</span><span class="identifier">graph_p</span><span class="special"> >></span><span class="char"> '_'</span><span class="special">)</span><span class="comment"> // past a single line
|
||||
</span><span class="special"> )</span><span class="special">
|
||||
)</span><span class="special"> >></span><span class="identifier"> graph_p</span><span class="comment"> // graph_p must precede '_'
|
||||
</span><span class="special"> >></span><span class="identifier"> eps_p</span><span class="special">(</span><span class="char">'_'</span><span class="special">
|
||||
>></span><span class="special"> (</span><span class="identifier">space_p</span><span class="special"> |</span><span class="identifier"> punct_p</span><span class="special">))</span><span class="comment"> // space_p or punct_p must
|
||||
</span><span class="special"> )</span><span class="comment"> // follow '_'
|
||||
</span><span class="special"> |</span><span class="special"> (</span><span class="identifier">
|
||||
graph_p</span><span class="comment"> // A single char. e.g. _c_
|
||||
</span><span class="special"> >></span><span class="identifier"> eps_p</span><span class="special">(</span><span class="char">'_'</span><span class="special">
|
||||
>></span><span class="special"> (</span><span class="identifier">space_p</span><span class="special"> |</span><span class="identifier"> punct_p</span><span class="special">))</span><span class="special">
|
||||
)</span><span class="special">
|
||||
)</span><span class="special">
|
||||
>></span><span class="char"> '_'</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
simple_teletype</span><span class="special"> =</span><span class="char">
|
||||
'='</span><span class="special"> >></span><span class="special">
|
||||
(</span><span class="special">
|
||||
(</span><span class="identifier"> graph_p</span><span class="special"> >></span><span class="comment"> // graph_p must follow '='
|
||||
</span><span class="special"> *(</span><span class="identifier">anychar_p</span><span class="special"> -</span><span class="special">
|
||||
(</span><span class="identifier"> eol</span><span class="comment"> // Make sure that we don't go
|
||||
</span><span class="special"> |</span><span class="special"> (</span><span class="identifier">graph_p</span><span class="special"> >></span><span class="char"> '='</span><span class="special">)</span><span class="comment"> // past a single line
|
||||
</span><span class="special"> )</span><span class="special">
|
||||
)</span><span class="special"> >></span><span class="identifier"> graph_p</span><span class="comment"> // graph_p must precede '='
|
||||
</span><span class="special"> >></span><span class="identifier"> eps_p</span><span class="special">(</span><span class="char">'='</span><span class="special">
|
||||
>></span><span class="special"> (</span><span class="identifier">space_p</span><span class="special"> |</span><span class="identifier"> punct_p</span><span class="special">))</span><span class="comment"> // space_p or punct_p must
|
||||
</span><span class="special"> )</span><span class="comment"> // follow '='
|
||||
</span><span class="special"> |</span><span class="special"> (</span><span class="identifier">
|
||||
graph_p</span><span class="comment"> // A single char. e.g. =c=
|
||||
</span><span class="special"> >></span><span class="identifier"> eps_p</span><span class="special">(</span><span class="char">'='</span><span class="special">
|
||||
>></span><span class="special"> (</span><span class="identifier">space_p</span><span class="special"> |</span><span class="identifier"> punct_p</span><span class="special">))</span><span class="special">
|
||||
)</span><span class="special">
|
||||
)</span><span class="special">
|
||||
>></span><span class="char"> '='</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
paragraph</span><span class="special"> =</span><span class="special">
|
||||
*(</span><span class="identifier"> common</span><span class="special">
|
||||
|</span><span class="special"> (</span><span class="identifier">anychar_p</span><span class="special"> -</span><span class="comment"> // Make sure we don't go past
|
||||
</span><span class="special"> (</span><span class="identifier">eol</span><span class="special"> >></span><span class="identifier"> eol</span><span class="special">)</span><span class="comment"> // a single block.
|
||||
</span><span class="special"> )</span><span class="special">
|
||||
)</span><span class="special">
|
||||
>></span><span class="special"> +</span><span class="identifier">eol</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
phrase</span><span class="special"> =</span><span class="special">
|
||||
*(</span><span class="identifier"> common</span><span class="special">
|
||||
|</span><span class="identifier"> comment</span><span class="special">
|
||||
|</span><span class="special"> (</span><span class="identifier">anychar_p</span><span class="special"> -</span><span class="identifier">
|
||||
close_bracket</span><span class="special">)</span><span class="special">
|
||||
)</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
phrase_markup</span><span class="special"> =</span><span class="char">
|
||||
'['</span><span class="special">
|
||||
>></span><span class="special"> (</span><span class="identifier"> image</span><span class="special">
|
||||
|</span><span class="identifier"> url</span><span class="special">
|
||||
|</span><span class="identifier"> link</span><span class="special">
|
||||
|</span><span class="identifier"> anchor</span><span class="special">
|
||||
|</span><span class="identifier"> source_mode</span><span class="special">
|
||||
|</span><span class="identifier"> funcref</span><span class="special">
|
||||
|</span><span class="identifier"> classref</span><span class="special">
|
||||
|</span><span class="identifier"> memberref</span><span class="special">
|
||||
|</span><span class="identifier"> enumref</span><span class="special">
|
||||
|</span><span class="identifier"> bold</span><span class="special">
|
||||
|</span><span class="identifier"> italic</span><span class="special">
|
||||
|</span><span class="identifier"> underline</span><span class="special">
|
||||
|</span><span class="identifier"> teletype</span><span class="special">
|
||||
|</span><span class="identifier"> str_p</span><span class="special">(</span><span class="string">"br"</span><span class="special">)</span><span class="special">
|
||||
)</span><span class="special">
|
||||
>></span><span class="char"> ']'</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
escape</span><span class="special"> =</span><span class="identifier">
|
||||
str_p</span><span class="special">(</span><span class="string">"\\n"</span><span class="special">)</span><span class="special">
|
||||
|</span><span class="char"> '\\'</span><span class="special"> >></span><span class="identifier"> punct_p</span><span class="special">
|
||||
|</span><span class="special"> (</span><span class="string">
|
||||
"'''"</span><span class="special"> >></span><span class="special"> !</span><span class="identifier">eol</span><span class="special">
|
||||
>></span><span class="special"> *(</span><span class="identifier">anychar_p</span><span class="special"> -</span><span class="string"> "'''"</span><span class="special">)</span><span class="special">
|
||||
>></span><span class="string"> "'''"</span><span class="special">
|
||||
)</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
image</span><span class="special"> =</span><span class="char">
|
||||
'$'</span><span class="special"> >></span><span class="identifier"> blank</span><span class="special">
|
||||
>></span><span class="special"> (*(</span><span class="identifier">anychar_p</span><span class="special"> -</span><span class="identifier">
|
||||
close_bracket</span><span class="special">))</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
url</span><span class="special"> =</span><span class="char">
|
||||
'@'</span><span class="special">
|
||||
>></span><span class="special"> (*(</span><span class="identifier">anychar_p</span><span class="special"> -</span><span class="special">
|
||||
(</span><span class="char">']'</span><span class="special"> |</span><span class="identifier"> hard_space</span><span class="special">)))</span><span class="special">
|
||||
>></span><span class="special"> (</span><span class="identifier"> eps_p</span><span class="special">(</span><span class="char">']'</span><span class="special">)</span><span class="special">
|
||||
|</span><span class="special"> (</span><span class="identifier">hard_space</span><span class="special"> >></span><span class="identifier"> phrase</span><span class="special">)</span><span class="special">
|
||||
)</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
link</span><span class="special"> =</span><span class="string">
|
||||
"link"</span><span class="special"> >></span><span class="identifier"> hard_space</span><span class="special">
|
||||
>></span><span class="special"> (*(</span><span class="identifier">anychar_p</span><span class="special"> -</span><span class="special">
|
||||
(</span><span class="char">']'</span><span class="special"> |</span><span class="identifier"> hard_space</span><span class="special">)))</span><span class="special">
|
||||
>></span><span class="special"> (</span><span class="identifier"> eps_p</span><span class="special">(</span><span class="char">']'</span><span class="special">)</span><span class="special">
|
||||
|</span><span class="special"> (</span><span class="identifier">hard_space</span><span class="special"> >></span><span class="identifier"> phrase</span><span class="special">)</span><span class="special">
|
||||
)</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
anchor</span><span class="special"> =</span><span class="char">
|
||||
'#'</span><span class="special">
|
||||
>></span><span class="identifier"> blank</span><span class="special">
|
||||
>></span><span class="special"> (</span><span class="special"> *(</span><span class="identifier">anychar_p</span><span class="special"> -</span><span class="identifier">
|
||||
close_bracket</span><span class="special">)</span><span class="special">
|
||||
)</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
funcref</span><span class="special"> =</span><span class="string">
|
||||
"funcref"</span><span class="special"> >></span><span class="identifier"> hard_space</span><span class="special">
|
||||
>></span><span class="special"> (*(</span><span class="identifier">anychar_p</span><span class="special"> -</span><span class="special">
|
||||
(</span><span class="char">']'</span><span class="special"> |</span><span class="identifier"> hard_space</span><span class="special">)))</span><span class="special">
|
||||
>></span><span class="special"> (</span><span class="identifier"> eps_p</span><span class="special">(</span><span class="char">']'</span><span class="special">)</span><span class="special">
|
||||
|</span><span class="special"> (</span><span class="identifier">hard_space</span><span class="special"> >></span><span class="identifier"> phrase</span><span class="special">)</span><span class="special">
|
||||
)</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
classref</span><span class="special"> =</span><span class="string">
|
||||
"classref"</span><span class="special"> >></span><span class="identifier"> hard_space</span><span class="special">
|
||||
>></span><span class="special"> (*(</span><span class="identifier">anychar_p</span><span class="special"> -</span><span class="special">
|
||||
(</span><span class="char">']'</span><span class="special"> |</span><span class="identifier"> hard_space</span><span class="special">)))</span><span class="special">
|
||||
>></span><span class="special"> (</span><span class="identifier"> eps_p</span><span class="special">(</span><span class="char">']'</span><span class="special">)</span><span class="special">
|
||||
|</span><span class="special"> (</span><span class="identifier">hard_space</span><span class="special"> >></span><span class="identifier"> phrase</span><span class="special">)</span><span class="special">
|
||||
)</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
memberref</span><span class="special"> =</span><span class="string">
|
||||
"memberref"</span><span class="special"> >></span><span class="identifier"> hard_space</span><span class="special">
|
||||
>></span><span class="special"> (*(</span><span class="identifier">anychar_p</span><span class="special"> -</span><span class="special">
|
||||
(</span><span class="char">']'</span><span class="special"> |</span><span class="identifier"> hard_space</span><span class="special">)))</span><span class="special">
|
||||
>></span><span class="special"> (</span><span class="identifier"> eps_p</span><span class="special">(</span><span class="char">']'</span><span class="special">)</span><span class="special">
|
||||
|</span><span class="special"> (</span><span class="identifier">hard_space</span><span class="special"> >></span><span class="identifier"> phrase</span><span class="special">)</span><span class="special">
|
||||
)</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
enumref</span><span class="special"> =</span><span class="string">
|
||||
"enumref"</span><span class="special"> >></span><span class="identifier"> hard_space</span><span class="special">
|
||||
>></span><span class="special"> (*(</span><span class="identifier">anychar_p</span><span class="special"> -</span><span class="special">
|
||||
(</span><span class="char">']'</span><span class="special"> |</span><span class="identifier"> hard_space</span><span class="special">)))</span><span class="special">
|
||||
>></span><span class="special"> (</span><span class="identifier"> eps_p</span><span class="special">(</span><span class="char">']'</span><span class="special">)</span><span class="special">
|
||||
|</span><span class="special"> (</span><span class="identifier">hard_space</span><span class="special"> >></span><span class="identifier"> phrase</span><span class="special">)</span><span class="special">
|
||||
)</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
bold</span><span class="special"> =</span><span class="identifier">
|
||||
ch_p</span><span class="special">(</span><span class="char">'*'</span><span class="special">)</span><span class="special">
|
||||
>></span><span class="identifier"> blank</span><span class="special"> >></span><span class="identifier"> phrase</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
italic</span><span class="special"> =</span><span class="identifier">
|
||||
ch_p</span><span class="special">(</span><span class="char">'\''</span><span class="special">)</span><span class="special">
|
||||
>></span><span class="identifier"> blank</span><span class="special"> >></span><span class="identifier"> phrase</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
underline</span><span class="special"> =</span><span class="identifier">
|
||||
ch_p</span><span class="special">(</span><span class="char">'_'</span><span class="special">)</span><span class="special">
|
||||
>></span><span class="identifier"> blank</span><span class="special"> >></span><span class="identifier"> phrase</span><span class="special">
|
||||
;</span><span class="identifier">
|
||||
|
||||
teletype</span><span class="special"> =</span><span class="identifier">
|
||||
ch_p</span><span class="special">(</span><span class="char">'^'</span><span class="special">)</span><span class="special">
|
||||
>></span><span class="identifier"> blank</span><span class="special"> >></span><span class="identifier"> phrase</span><span class="special">
|
||||
;</span></tt></pre>
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><small>Copyright © 2002, 2004 Joel de Guzman, Eric Niebler</small></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="docinfo.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="highlight.html"><img src="../images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,219 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title> Quick Reference</title>
|
||||
<link rel="stylesheet" href="../boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.66.1">
|
||||
<link rel="start" href="../index.html" title="Part I. quickbook 1.0">
|
||||
<link rel="up" href="../index.html" title="Part I. quickbook 1.0">
|
||||
<link rel="prev" href="syntax.html" title=" Syntax Summary">
|
||||
<link rel="next" href="docinfo.html" title=" Library Document Grammar">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%">
|
||||
<td valign="top"><img alt="boost.png (6897 bytes)" width="277" height="86" src="../../../../../boost.png"></td>
|
||||
<td align="center"><a href="../../../../../index.htm">Home</a></td>
|
||||
<td align="center"><a href="../libraries.html">Libraries</a></td>
|
||||
<td align="center"><a href="../../../../../people/people.htm">People</a></td>
|
||||
<td align="center"><a href="../../../../../more/faq.htm">FAQ</a></td>
|
||||
<td align="center"><a href="../../../../../more/index.htm">More</a></td>
|
||||
</table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="syntax.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="docinfo.html"><img src="../images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section" lang="en">
|
||||
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
|
||||
<a name="quickbook.ref"></a> Quick Reference</h2></div></div></div>
|
||||
<div class="informaltable">
|
||||
<h4>
|
||||
<a name="id444390"></a><span class="table-title">Syntax Compendium</span>
|
||||
</h4>
|
||||
<table class="table">
|
||||
<colgroup>
|
||||
<col>
|
||||
<col>
|
||||
</colgroup>
|
||||
<thead><tr>
|
||||
<th>To do this...</th>
|
||||
<th>Use this...</th>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>comment</td>
|
||||
<td><tt class="literal">[/ some comment]</tt></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="emphasis"><em>italics</em></span></td>
|
||||
<td><tt class="literal">['italics] or /italics/</tt></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="bold"><b>bold</b></span></td>
|
||||
<td><tt class="literal">[*bold] or *bold*</tt></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="underline">underline</span></td>
|
||||
<td><tt class="literal">[_underline] or _underline_</tt></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt class="literal">teletype</tt></td>
|
||||
<td><tt class="literal">[^teletype] or =teletype=</tt></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>source mode</td>
|
||||
<td>
|
||||
<tt class="literal">[c++]</tt> or <tt class="literal">[python]</tt>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>inline code</td>
|
||||
<td><tt class="literal">`int main();`</tt></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>line break</td>
|
||||
<td><tt class="literal">[br]</tt></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>line break</td>
|
||||
<td><tt class="literal">\n</tt></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>anchor</td>
|
||||
<td><tt class="literal">[#anchor]</tt></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>link</td>
|
||||
<td><tt class="literal">[@http://www.boost.org Boost]</tt></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>anchor link</td>
|
||||
<td><tt class="literal">[link section.anchor Link text]</tt></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>refentry link</td>
|
||||
<td><tt class="literal">[link xml.refentry Link text]</tt></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>function link</td>
|
||||
<td><tt class="literal">[funcref fully::qualified::function_name Link text]</tt></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>class link</td>
|
||||
<td><tt class="literal">[classref fully::qualified::class_name Link text]</tt></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>member link</td>
|
||||
<td><tt class="literal">[memberref fully::qualified::member_name Link text]</tt></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>enum link</td>
|
||||
<td><tt class="literal">[enumref fully::qualified::enum_name Link text]</tt></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>escape</td>
|
||||
<td><tt class="literal">'''escaped text (no processing/formatting)'''</tt></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>single char escape</td>
|
||||
<td><tt class="literal">\c</tt></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>images</td>
|
||||
<td><tt class="literal">[$image.jpg]</tt></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>begin section</td>
|
||||
<td><tt class="literal">[section The Section Title]</tt></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>end section</td>
|
||||
<td><tt class="literal">[endsect]</tt></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>paragraph</td>
|
||||
<td>No markup. Paragraphs start left-flushed and are terminated by two or more newlines.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ordered list</td>
|
||||
<td><tt class="literal"># one<br>
|
||||
# two<br>
|
||||
# three<br></tt></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>unordered list</td>
|
||||
<td><tt class="literal">* one<br>
|
||||
* two<br>
|
||||
* three<br></tt></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>code</td>
|
||||
<td>No markup. Preformatted code starts with a space or a tab.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>preformatted</td>
|
||||
<td><tt class="literal">[pre preformatted]</tt></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>block quote</td>
|
||||
<td><tt class="literal">[:sometext...]</tt></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>heading 1</td>
|
||||
<td><tt class="literal">[h1 Heading 1]</tt></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>heading 2</td>
|
||||
<td><tt class="literal">[h2 Heading 2]</tt></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>heading 3</td>
|
||||
<td><tt class="literal">[h3 Heading 3]</tt></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>heading 4</td>
|
||||
<td><tt class="literal">[h4 Heading 4]</tt></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>heading 5</td>
|
||||
<td><tt class="literal">[h5 Heading 5]</tt></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>heading 6</td>
|
||||
<td><tt class="literal">[h6 Heading 6]</tt></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>macro</td>
|
||||
<td><tt class="literal">[def macro_identifier some text]</tt></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>blurb</td>
|
||||
<td><tt class="literal">[blurb advertisement or note...]</tt></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>table</td>
|
||||
<td><tt class="literal">[table Title<br>
|
||||
[[a][b][c]]<br>
|
||||
[[a][b][c]]<br>
|
||||
]</tt></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>variablelist</td>
|
||||
<td><tt class="literal">[variablelist Title<br>
|
||||
[[a][b]]<br>
|
||||
[[a][b]]<br>
|
||||
]</tt></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><small>Copyright © 2002, 2004 Joel de Guzman, Eric Niebler</small></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="syntax.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="docinfo.html"><img src="../images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,927 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title> Syntax Summary</title>
|
||||
<link rel="stylesheet" href="../boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.66.1">
|
||||
<link rel="start" href="../index.html" title="Part I. quickbook 1.0">
|
||||
<link rel="up" href="../index.html" title="Part I. quickbook 1.0">
|
||||
<link rel="prev" href="../index.html" title="Part I. quickbook 1.0">
|
||||
<link rel="next" href="ref.html" title=" Quick Reference">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%">
|
||||
<td valign="top"><img alt="boost.png (6897 bytes)" width="277" height="86" src="../../../../../boost.png"></td>
|
||||
<td align="center"><a href="../../../../../index.htm">Home</a></td>
|
||||
<td align="center"><a href="../libraries.html">Libraries</a></td>
|
||||
<td align="center"><a href="../../../../../people/people.htm">People</a></td>
|
||||
<td align="center"><a href="../../../../../more/faq.htm">FAQ</a></td>
|
||||
<td align="center"><a href="../../../../../more/index.htm">More</a></td>
|
||||
</table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="../index.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="ref.html"><img src="../images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section" lang="en">
|
||||
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
|
||||
<a name="quickbook.syntax"></a> Syntax Summary</h2></div></div></div>
|
||||
<p>
|
||||
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.</p>
|
||||
<p>
|
||||
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.</p>
|
||||
<a name="syntax.comments"></a><h2>
|
||||
<a name="id373011"></a>Comments</h2>
|
||||
<p>
|
||||
Can be placed anywhere.</p>
|
||||
<pre class="programlisting"><tt class="literal">[/ comment (no output generated) ]
|
||||
</tt></pre>
|
||||
<a name="syntax.phrase_level_elements"></a><h2>
|
||||
<a name="id373031"></a>Phrase Level Elements</h2>
|
||||
<a name="syntax.font_styles"></a><h3>
|
||||
<a name="id373042"></a>Font Styles</h3>
|
||||
<pre class="programlisting"><tt class="literal">['italic], [*bold], [_underline], [^teletype]
|
||||
</tt></pre>
|
||||
<p>
|
||||
will generate:</p>
|
||||
<p><span class="emphasis"><em>italic</em></span>, <span class="bold"><b>bold</b></span>, <span class="underline">underline</span>, <tt class="literal">teletype</tt></p>
|
||||
<p>
|
||||
Like all non-terminal phrase level elements, this can of course be nested:</p>
|
||||
<pre class="programlisting"><tt class="literal">[*['bold-italic]]
|
||||
</tt></pre>
|
||||
<p>
|
||||
will generate:</p>
|
||||
<p><span class="bold"><b><span class="emphasis"><em>bold-italic</em></span></b></span></p>
|
||||
<a name="syntax.simple_formatting"></a><h3>
|
||||
<a name="id371768"></a>Simple formatting</h3>
|
||||
<p>
|
||||
Simple markup for formatting text, common in many applications, is now supported:</p>
|
||||
<pre class="programlisting"><tt class="literal">/italic/, *bold*, _underline_, =teletype=
|
||||
</tt></pre>
|
||||
<p>
|
||||
will generate:</p>
|
||||
<p><span class="emphasis"><em>italic</em></span>, <span class="bold"><b>bold</b></span>, <span class="underline">underline</span>, <tt class="literal">teletype</tt></p>
|
||||
<p>
|
||||
Unlike QuickBook's standard formatting scheme, the rules for simpler alternatives
|
||||
are much stricter.</p>
|
||||
<div class="itemizedlist"><ul type="disc">
|
||||
<li>
|
||||
Simple markups cannot nest. You can combine a simple markup with a nestable markup.
|
||||
</li>
|
||||
<li>
|
||||
A non-space character must follow the leading markup
|
||||
</li>
|
||||
<li>
|
||||
A non-space character must precede the trailing markup
|
||||
</li>
|
||||
<li>
|
||||
A space or a punctuation must follow the trailing markup
|
||||
</li>
|
||||
<li>
|
||||
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 '*'.
|
||||
</li>
|
||||
<li>
|
||||
A line starting with the star will be interpreted as an unordered list.
|
||||
See <a href="syntax.html#syntax.unordered_lists">Unordered lists</a>.
|
||||
</li>
|
||||
</ul></div>
|
||||
<div class="informaltable">
|
||||
<h4>
|
||||
<a name="id371958"></a><span class="table-title">More Formatting Samples</span>
|
||||
</h4>
|
||||
<table class="table">
|
||||
<colgroup>
|
||||
<col>
|
||||
<col>
|
||||
</colgroup>
|
||||
<thead><tr>
|
||||
<th>Markup</th>
|
||||
<th>Result</th>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><tt class="literal">*Bold*</tt></td>
|
||||
<td><span class="bold"><b>Bold</b></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt class="literal">*Is bold*</tt></td>
|
||||
<td><span class="bold"><b>Is bold</b></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt class="literal">* Not bold* *Not bold * * Not bold *</tt></td>
|
||||
<td>* Not bold* *Not bold * * Not bold *</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt class="literal">This*Isn't*Bold (no bold)</tt></td>
|
||||
<td>This*Isn't*Bold (no bold)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt class="literal">(*Bold Inside*) (parenthesis not bold)</tt></td>
|
||||
<td>(<span class="bold"><b>Bold Inside</b></span>) (parenthesis not bold)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt class="literal">*(Bold Outside)* (parenthesis bold)</tt></td>
|
||||
<td>
|
||||
<span class="bold"><b>(Bold Outside)</b></span> (parenthesis bold)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt class="literal">3*4*5 = 60 (no bold)</tt></td>
|
||||
<td>3*4*5 = 60 (no bold)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt class="literal">3 * 4 * 5 = 60 (no bold)</tt></td>
|
||||
<td>3 * 4 * 5 = 60 (no bold)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt class="literal">3 *4* 5 = 60 (4 is bold)</tt></td>
|
||||
<td>3 <span class="bold"><b>4</b></span> 5 = 60 (4 is bold)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt class="literal">*This is bold* this is not *but this is*</tt></td>
|
||||
<td>
|
||||
<span class="bold"><b>This is bold</b></span> this is not <span class="bold"><b>but this is</b></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt class="literal">*This is bold*.</tt></td>
|
||||
<td>
|
||||
<span class="bold"><b>This is bold</b></span>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt class="literal">*B*. (bold B)</tt></td>
|
||||
<td>
|
||||
<span class="bold"><b>B</b></span>. (bold B)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt class="literal">['*Bold-Italic*]</tt></td>
|
||||
<td><span class="emphasis"><em><span class="bold"><b>Bold-Italic</b></span></em></span></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="informaltable"><table class="table">
|
||||
<colgroup><col></colgroup>
|
||||
<tbody><tr><td class="blurb">
|
||||
<span class="inlinemediaobject"><img src="../images/note.png"></span> Thanks to David Barrett, author of
|
||||
<a href="http://quinthar.com/qwikiwiki/index.php?page=Home" target="_top">Qwiki</a>, for sharing these samples
|
||||
and teaching me these obscure formatting rules. I wasn't sure at all if <a href="http://spirit.sourceforge.net" target="_top">Spirit</a>,
|
||||
being more or less a formal EBNF parser, can handle the context sensitivity and ambiguity.</td></tr></tbody>
|
||||
</table></div>
|
||||
<a name="syntax.inline_code"></a><h3>
|
||||
<a name="id372692"></a>Inline code</h3>
|
||||
<p>
|
||||
Inlining code in paragraphs is quite common when writing C++ documentation. We
|
||||
provide a very simple markup for this. For example, this:</p>
|
||||
<pre class="programlisting"><tt class="literal">This text has inlined code `int main() { return 0; }` in it.
|
||||
</tt></pre>
|
||||
<p>
|
||||
will generate:</p>
|
||||
<p>
|
||||
This text has inlined code <tt class="computeroutput"><span class="keyword">int</span><span class="identifier"> main</span><span class="special">()</span><span class="special"> {</span><span class="keyword"> return</span><span class="number"> 0</span><span class="special">;</span><span class="special"> }</span></tt> in it. The code will be
|
||||
syntax highlighted.</p>
|
||||
<div class="informaltable"><table class="table">
|
||||
<colgroup><col></colgroup>
|
||||
<tbody><tr><td class="blurb">
|
||||
<span class="inlinemediaobject"><img src="../images/note.png"></span>
|
||||
Note that we simply enclose the code with the tick: <tt class="literal">"`"</tt>, not the
|
||||
single quote: <tt class="computeroutput"><span class="string">"'"</span></tt>. Note too that <tt class="literal">`some code`</tt> is prefered over
|
||||
<tt class="literal">[^some code]</tt>.
|
||||
</td></tr></tbody>
|
||||
</table></div>
|
||||
<a name="syntax.source_mode"></a><h3>
|
||||
<a name="id372818"></a>Source Mode</h3>
|
||||
<p>
|
||||
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 <a href="syntax.html#syntax.document">Document Info</a> section.</p>
|
||||
<p>
|
||||
To change the source mode, use the <tt class="literal">[source-mode]</tt> markup, where
|
||||
<tt class="literal">source-mode</tt> is one of the supported modes. For example, this:</p>
|
||||
<pre class="programlisting"><tt class="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`.
|
||||
</tt></pre>
|
||||
<p>
|
||||
will generate:</p>
|
||||
<p>
|
||||
Python's <tt class="computeroutput"><span class="keyword">import</span></tt> is rather like C++'s <tt class="computeroutput"><span class="preprocessor">#include</span></tt>. A
|
||||
C++ comment <tt class="computeroutput"><span class="comment">// looks like this</span></tt> whereas a Python comment
|
||||
<tt class="computeroutput"><span class="comment">#looks like this</span></tt>.</p>
|
||||
<div class="informaltable">
|
||||
<h4>
|
||||
<a name="id372918"></a><span class="table-title">Supported Source Modes</span>
|
||||
</h4>
|
||||
<table class="table">
|
||||
<colgroup>
|
||||
<col>
|
||||
<col>
|
||||
</colgroup>
|
||||
<thead><tr>
|
||||
<th>Mode</th>
|
||||
<th>Source Mode Markup</th>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>C++</td>
|
||||
<td><tt class="literal">[c++]</tt></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Python</td>
|
||||
<td><tt class="literal">[python]</tt></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="informaltable"><table class="table">
|
||||
<colgroup><col></colgroup>
|
||||
<tbody><tr><td class="blurb">
|
||||
<span class="inlinemediaobject"><img src="../images/note.png"></span> The source mode strings are lowercase.</td></tr></tbody>
|
||||
</table></div>
|
||||
<a name="syntax.line_break"></a><h3>
|
||||
<a name="id372987"></a>line-break</h3>
|
||||
<pre class="programlisting"><tt class="literal">[br]
|
||||
</tt></pre>
|
||||
<div class="informaltable"><table class="table">
|
||||
<colgroup><col></colgroup>
|
||||
<tbody><tr><td class="blurb">
|
||||
<span class="inlinemediaobject"><img src="../images/note.png"></span> Note that <tt class="computeroutput"><span class="special">\</span><span class="identifier">n</span></tt> is now preferred over <tt class="computeroutput"><span class="special">[</span><span class="identifier">br</span><span class="special">]</span></tt>.</td></tr></tbody>
|
||||
</table></div>
|
||||
<a name="syntax.anchors"></a><h3>
|
||||
<a name="id442370"></a>Anchors</h3>
|
||||
<pre class="programlisting"><tt class="literal">[#named_anchor]
|
||||
</tt></pre>
|
||||
<p>
|
||||
A named anchor is a hook that can be referenced by a link elsewhere in the
|
||||
document. You can then reference an anchor with <tt class="literal">[link named_anchor Some link text]</tt>.
|
||||
More on anchors <a href="syntax.html#syntax.anchor_links">here</a>, <a href="syntax.html#syntax.section">here</a> and
|
||||
<a href="syntax.html#syntax.headings">here</a>.</p>
|
||||
<a name="syntax.links"></a><h3>
|
||||
<a name="id442429"></a>Links</h3>
|
||||
<pre class="programlisting"><tt class="literal">[@http://www.boost.org this is [*boost's] website....]
|
||||
</tt></pre>
|
||||
<p>
|
||||
will generate:</p>
|
||||
<p><a href="http://www.boost.org" target="_top">this is <span class="bold"><b>boost's</b></span> website....</a></p>
|
||||
<p>
|
||||
URL links where the link text is the link itself is common. Example:</p>
|
||||
<pre class="programlisting"><tt class="literal">see http://spirit.sourceforge.net/
|
||||
</tt></pre>
|
||||
<p>
|
||||
so, when the text is absent in a link markup, the URL is assumed. Example:</p>
|
||||
<pre class="programlisting"><tt class="literal">see [@http://spirit.sourceforge.net/]
|
||||
</tt></pre>
|
||||
<p>
|
||||
will generate:</p>
|
||||
<p>
|
||||
see <a href="http://spirit.sourceforge.net/" target="_top">http://spirit.sourceforge.net/</a></p>
|
||||
<a name="syntax.anchor_links"></a><h3>
|
||||
<a name="id442500"></a>Anchor links</h3>
|
||||
<p>
|
||||
You can link within a document using:</p>
|
||||
<pre class="programlisting"><tt class="literal">[link section_id.normalized_header_text The link text]
|
||||
</tt></pre>
|
||||
<p>
|
||||
See sections <a href="syntax.html#syntax.section">Section</a> and <a href="syntax.html#syntax.headings">Headings</a>
|
||||
for more info.</p>
|
||||
<a name="syntax.refentry_links"></a><h3>
|
||||
<a name="id442543"></a>refentry links</h3>
|
||||
<p>
|
||||
In addition, you can link internally to an XML refentry like:</p>
|
||||
<pre class="programlisting"><tt class="literal">[link xml.refentry The link text]
|
||||
</tt></pre>
|
||||
<p>
|
||||
This gets converted into <tt class="literal"><link linkend="xml.refentry">The link text</link></tt>.</p>
|
||||
<p>
|
||||
Like URLs, the link text is optional. If this is not present, the link text will
|
||||
automatically be the refentry. Example:</p>
|
||||
<pre class="programlisting"><tt class="literal">[link xml.refentry]
|
||||
</tt></pre>
|
||||
<p>
|
||||
This gets converted into <tt class="literal"><link linkend="xml.refentry">xml.refentry</link></tt>.</p>
|
||||
<a name="syntax.function__class_or_member_links"></a><h3>
|
||||
<a name="id442601"></a>function, class or member links</h3>
|
||||
<p>
|
||||
If you want to link to a function, class, member or enum in the reference section, you
|
||||
can use:</p>
|
||||
<pre class="programlisting"><tt class="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]
|
||||
</tt></pre>
|
||||
<p>
|
||||
Again, the link text is optional. If this is not present, the link text will
|
||||
automatically be the function, class, member or enum. Example:</p>
|
||||
<pre class="programlisting"><tt class="literal">[classref boost::bar::baz]
|
||||
</tt></pre>
|
||||
<p>
|
||||
would have "boost::bar::baz" as the link text.</p>
|
||||
<a name="syntax.escape"></a><h3>
|
||||
<a name="id442644"></a>Escape</h3>
|
||||
<p>
|
||||
The escape mark-up is used when we don't want to do any processing.</p>
|
||||
<pre class="programlisting"><tt class="literal">'''
|
||||
escape (no processing/formatting)
|
||||
'''
|
||||
</tt></pre>
|
||||
<p>
|
||||
Escaping allows us to pass XML markup to <a href="http://www.boost.org/doc/html/boostbook.html" target="_top">BoostBook</a> or <a href="http://www.docbook.org/" target="_top">DocBook</a>. For example:</p>
|
||||
<pre class="programlisting"><tt class="literal">'''
|
||||
<emphasis role="bold">This is direct XML markup</emphasis>
|
||||
'''
|
||||
</tt></pre>
|
||||
<p><span class="bold"><b>This is direct XML markup</b></span></p>
|
||||
<div class="informaltable"><table class="table">
|
||||
<colgroup><col></colgroup>
|
||||
<tbody><tr><td class="blurb">
|
||||
<span class="inlinemediaobject"><img src="../images/alert.png"></span> Be careful when using the escape. The text must conform to
|
||||
<a href="http://www.boost.org/doc/html/boostbook.html" target="_top">BoostBook</a>/<a href="http://www.docbook.org/" target="_top">DocBook</a> syntax.</td></tr></tbody>
|
||||
</table></div>
|
||||
<a name="syntax.single_char_escape"></a><h3>
|
||||
<a name="id442736"></a>Single char escape</h3>
|
||||
<p>
|
||||
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 <tt class="computeroutput"><span class="special">[</span></tt> and <tt class="computeroutput"><span class="special">]</span></tt>.
|
||||
For example, how do you escape the triple quote? Simple: <tt class="literal">\'\'\'</tt></p>
|
||||
<p><tt class="computeroutput"><span class="special">\</span><span class="identifier">n</span></tt> has a special meaning. It is used to generate line breaks. Note that <tt class="computeroutput"><span class="special">\</span><span class="identifier">n</span></tt>
|
||||
is now preferred over <tt class="computeroutput"><span class="special">[</span><span class="identifier">br</span><span class="special">]</span></tt>.</p>
|
||||
<a name="syntax.images__terminal_"></a><h3>
|
||||
<a name="id442829"></a>Images (terminal)</h3>
|
||||
<pre class="programlisting"><tt class="literal">[$image.jpg]
|
||||
</tt></pre>
|
||||
<a name="syntax.block_level_elements"></a><h2>
|
||||
<a name="id442847"></a>Block Level Elements</h2>
|
||||
<a name="syntax.document"></a><h3>
|
||||
<a name="id442858"></a>Document</h3>
|
||||
<p>
|
||||
Every document must begin with a Document Info section, which should look
|
||||
like this:</p>
|
||||
<pre class="programlisting"><tt class="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]
|
||||
]
|
||||
</tt></pre>
|
||||
<p>
|
||||
Where document-type is one of:</p>
|
||||
<div class="itemizedlist"><ul type="disc">
|
||||
<li>
|
||||
book
|
||||
</li>
|
||||
<li>
|
||||
library
|
||||
</li>
|
||||
<li>
|
||||
part
|
||||
</li>
|
||||
<li>
|
||||
article
|
||||
</li>
|
||||
<li>
|
||||
chapter
|
||||
</li>
|
||||
</ul></div>
|
||||
<p>
|
||||
and <tt class="literal">version</tt>, <tt class="literal">id</tt>, <tt class="literal">dirname</tt>, <tt class="literal">copyright</tt>, <tt class="literal">purpose</tt>, <tt class="literal">category</tt>, <tt class="literal">authors</tt>,
|
||||
<tt class="literal">license</tt>, <tt class="literal">last-revision</tt> and <tt class="literal">source-mode</tt> are optional information.</p>
|
||||
<p>
|
||||
Here <tt class="literal">source-type</tt> is a lowercase string setting the initial
|
||||
<a href="syntax.html#syntax.source_mode">source mode</a>. If the <tt class="literal">source-mode</tt> field is omitted, a
|
||||
default value of <tt class="literal">c++</tt> will be used.</p>
|
||||
<a name="syntax.section"></a><h3>
|
||||
<a name="id443004"></a>Section</h3>
|
||||
<p>
|
||||
Starting a new section is accomplished with:</p>
|
||||
<pre class="programlisting"><tt class="literal">[section:id The Section Title]
|
||||
</tt></pre>
|
||||
<p>
|
||||
where <span class="emphasis"><em>id</em></span> is optional. id will be the filename of the generated section.
|
||||
If it is not present, "The Section Title" will be normalized and become the id.
|
||||
Valid characters are <tt class="literal">a-Z</tt>, <tt class="literal">A-Z</tt>, <tt class="literal">0-9</tt> and <tt class="literal">_</tt>. All non-valid characters are
|
||||
converted to underscore and all upper-case are converted to lower case.
|
||||
Thus: "The Section Title" will be normalized to "the_section_title".</p>
|
||||
<p>
|
||||
End a section with:</p>
|
||||
<pre class="programlisting"><tt class="literal">[endsect]
|
||||
</tt></pre>
|
||||
<p>
|
||||
Sections can nest, and that results in a hierarchy in the table of contents.</p>
|
||||
<a name="syntax.xinclude"></a><h3>
|
||||
<a name="id443079"></a>xinclude</h3>
|
||||
<p>
|
||||
You can include another XML file with:</p>
|
||||
<pre class="programlisting"><tt class="literal">[xinclude file.xml]
|
||||
</tt></pre>
|
||||
<p>
|
||||
This is useful when file.xml has been generated by Doxygen and contains your
|
||||
reference section.</p>
|
||||
<a name="syntax.paragraphs"></a><h3>
|
||||
<a name="id443106"></a>Paragraphs</h3>
|
||||
<p>
|
||||
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.</p>
|
||||
<a name="syntax.ordered_lists"></a><h3>
|
||||
<a name="id443122"></a>Ordered lists</h3>
|
||||
<pre class="programlisting"><tt class="literal"># One
|
||||
# Two
|
||||
# Three
|
||||
</tt></pre>
|
||||
<p>
|
||||
will generate:</p>
|
||||
<div class="orderedlist"><ol type="1">
|
||||
<li>
|
||||
One
|
||||
</li>
|
||||
<li>
|
||||
Two
|
||||
</li>
|
||||
<li>
|
||||
Three
|
||||
</li>
|
||||
</ol></div>
|
||||
<p>
|
||||
List hierarchies are supported. Example:</p>
|
||||
<pre class="programlisting"><tt class="literal"># One
|
||||
# Two
|
||||
# Three
|
||||
# Three.a
|
||||
# Three.b
|
||||
# Three.c
|
||||
# Four
|
||||
# Four.a
|
||||
# Four.a.i
|
||||
# Four.a.ii
|
||||
# Four.b
|
||||
</tt></pre>
|
||||
<p>
|
||||
will generate:</p>
|
||||
<div class="orderedlist"><ol type="1">
|
||||
<li>
|
||||
One
|
||||
</li>
|
||||
<li>
|
||||
Two
|
||||
</li>
|
||||
<li>
|
||||
Three<div class="orderedlist"><ol type="a">
|
||||
<li>
|
||||
Three.a
|
||||
</li>
|
||||
<li>
|
||||
Three.b
|
||||
</li>
|
||||
<li>
|
||||
Three.c
|
||||
</li>
|
||||
</ol></div>
|
||||
</li>
|
||||
<li>
|
||||
Fourth<div class="orderedlist"><ol type="a">
|
||||
<li>
|
||||
Four.a<div class="orderedlist"><ol type="i">
|
||||
<li>
|
||||
Four.a.i
|
||||
</li>
|
||||
<li>
|
||||
Four.a.ii
|
||||
</li>
|
||||
</ol></div>
|
||||
</li>
|
||||
<li>
|
||||
Four.b
|
||||
</li>
|
||||
</ol></div>
|
||||
</li>
|
||||
</ol></div>
|
||||
<p>
|
||||
Long lines will be wrapped appropriately. Example:</p>
|
||||
<pre class="programlisting"><tt class="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.
|
||||
</tt></pre>
|
||||
<div class="orderedlist"><ol type="1">
|
||||
<li>
|
||||
A short item.
|
||||
</li>
|
||||
<li>
|
||||
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.
|
||||
</li>
|
||||
<li>
|
||||
A short item.
|
||||
</li>
|
||||
</ol></div>
|
||||
<a name="syntax.unordered_lists"></a><h3>
|
||||
<a name="id443263"></a>Unordered lists</h3>
|
||||
<pre class="programlisting"><tt class="literal">* First
|
||||
* Second
|
||||
* Third
|
||||
</tt></pre>
|
||||
<p>
|
||||
will generate:</p>
|
||||
<div class="itemizedlist"><ul type="disc">
|
||||
<li>
|
||||
First
|
||||
</li>
|
||||
<li>
|
||||
Second
|
||||
</li>
|
||||
<li>
|
||||
Third
|
||||
</li>
|
||||
</ul></div>
|
||||
<p>
|
||||
Mixed lists (ordered and unordered) are supported. Example:</p>
|
||||
<pre class="programlisting"><tt class="literal"># One
|
||||
# Two
|
||||
# Three
|
||||
* Three.a
|
||||
* Three.b
|
||||
* Three.c
|
||||
</tt></pre>
|
||||
<p>
|
||||
will generate:</p>
|
||||
<div class="orderedlist"><ol type="1">
|
||||
<li>
|
||||
One
|
||||
</li>
|
||||
<li>
|
||||
Two
|
||||
</li>
|
||||
<li>
|
||||
Three<div class="itemizedlist"><ul type="disc">
|
||||
<li>
|
||||
Three.a
|
||||
</li>
|
||||
<li>
|
||||
Three.b
|
||||
</li>
|
||||
<li>
|
||||
Three.c
|
||||
</li>
|
||||
</ul></div>
|
||||
</li>
|
||||
</ol></div>
|
||||
<a name="syntax.code"></a><h3>
|
||||
<a name="id443333"></a>Code</h3>
|
||||
<p>
|
||||
Preformatted code starts with a space or a tab. The code will be
|
||||
syntax highlighted according to the current <a href="syntax.html#syntax.source_mode">source mode</a>:</p>
|
||||
<p></p>
|
||||
<pre class="programlisting"><tt class="literal"><span class="preprocessor">#include</span><span class="special"> <</span><span class="identifier">iostream</span><span class="special">></span><span class="keyword">
|
||||
|
||||
int</span><span class="identifier"> main</span><span class="special">()</span><span class="special">
|
||||
{</span><span class="comment">
|
||||
// Sample code
|
||||
</span><span class="identifier"> std</span><span class="special">::</span><span class="identifier">cout</span><span class="special"> <<</span><span class="string"> "Hello, World\n"</span><span class="special">;</span><span class="keyword">
|
||||
return</span><span class="number"> 0</span><span class="special">;</span><span class="special">
|
||||
}</span></tt></pre>
|
||||
<p></p>
|
||||
<pre class="programlisting"><tt class="literal"><span class="keyword">import</span><span class="identifier"> cgi</span><span class="keyword">
|
||||
|
||||
def</span><span class="identifier"> cookForHtml</span><span class="special">(</span><span class="identifier">text</span><span class="special">):</span><span class="string">
|
||||
'''"Cooks" the input text for HTML.'''</span><span class="keyword">
|
||||
|
||||
return</span><span class="identifier"> cgi</span><span class="special">.</span><span class="identifier">escape</span><span class="special">(</span><span class="identifier">text</span><span class="special">)</span></tt></pre>
|
||||
<p>
|
||||
Macros that are already defined are expanded in source code. Example:</p>
|
||||
<pre class="programlisting"><tt class="literal">[def __syntax_highlight__ [@highlight.html syntax_highlight]]
|
||||
[def __quickbook__ [@../index.html quickbook]]
|
||||
|
||||
using __quickbook__::__syntax_highlight__;
|
||||
</tt></pre>
|
||||
<p>
|
||||
Generates:</p>
|
||||
<pre class="programlisting"><tt class="literal"><span class="identifier">using</span><span class="identifier"> __quickbook__</span><span class="special">::</span><span class="identifier">__syntax_highlight__</span><span class="special">;</span></tt></pre>
|
||||
<a name="syntax.preformatted"></a><h3>
|
||||
<a name="id443597"></a>Preformatted</h3>
|
||||
<p>
|
||||
Sometimes, you don't want some preformatted text to be parsed as C++. In such
|
||||
cases, use the <tt class="literal">[pre ... ]</tt> markup block.</p>
|
||||
<pre class="programlisting"><tt class="literal">[pre
|
||||
|
||||
Some *preformatted* text Some *preformatted* text
|
||||
|
||||
Some *preformatted* text Some *preformatted* text
|
||||
|
||||
Some *preformatted* text Some *preformatted* text
|
||||
|
||||
]
|
||||
</tt></pre>
|
||||
<p>
|
||||
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:</p>
|
||||
<pre class="programlisting"><tt class="literal">Some <span class="bold"><b>preformatted</b></span> text Some <span class="bold"><b>preformatted</b></span> text
|
||||
|
||||
Some <span class="bold"><b>preformatted</b></span> text Some <span class="bold"><b>preformatted</b></span> text
|
||||
|
||||
Some <span class="bold"><b>preformatted</b></span> text Some <span class="bold"><b>preformatted</b></span> text
|
||||
|
||||
</tt></pre>
|
||||
<p>
|
||||
Notice that unlike Code, phrase markup such as font style is still permitted
|
||||
inside <tt class="literal">pre</tt> blocks.</p>
|
||||
<a name="syntax.blockquote"></a><h3>
|
||||
<a name="id443696"></a>Blockquote</h3>
|
||||
<pre class="programlisting"><tt class="literal">[:sometext...]
|
||||
</tt></pre>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>Indents the paragraph. This applies to one paragraph only.</p></blockquote></div>
|
||||
<a name="syntax.headings"></a><h3>
|
||||
<a name="id443720"></a>Headings</h3>
|
||||
<pre class="programlisting"><tt class="literal">[h1 Heading 1]
|
||||
[h2 Heading 2]
|
||||
[h3 Heading 3]
|
||||
[h4 Heading 4]
|
||||
[h5 Heading 5]
|
||||
[h6 Heading 6]
|
||||
</tt></pre>
|
||||
<a name="syntax.heading_1"></a><h1>
|
||||
<a name="id443741"></a>Heading 1</h1>
|
||||
<a name="syntax.heading_2"></a><h2>
|
||||
<a name="id443753"></a>Heading 2</h2>
|
||||
<a name="syntax.heading_3"></a><h3>
|
||||
<a name="id443763"></a>Heading 3</h3>
|
||||
<a name="syntax.heading_4"></a><h4>
|
||||
<a name="id443774"></a>Heading 4</h4>
|
||||
<a name="syntax.heading_5"></a><h5>
|
||||
<a name="id443785"></a>Heading 5</h5>
|
||||
<a name="syntax.heading_6"></a><h3>
|
||||
<a name="id443796"></a>Heading 6</h3>
|
||||
<p>
|
||||
Headings 1-3 [h1 h2 and h3] will automatically have anchors with normalized
|
||||
names with <tt class="literal">name="section_id.normalized_header_text"</tt> (i.e. valid characters are
|
||||
<tt class="literal">a-z</tt>, <tt class="literal">A-Z</tt>, <tt class="literal">0-9</tt> and <tt class="literal">_</tt>. 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 <tt class="literal">section_2.heading_1</tt>). You can use:</p>
|
||||
<pre class="programlisting"><tt class="literal">[link section_id.normalized_header_text The link text]
|
||||
</tt></pre>
|
||||
<p>
|
||||
to link to them. See <a href="syntax.html#syntax.anchor_links">Anchor links</a> and
|
||||
<a href="syntax.html#syntax.section">Section</a> for more info.</p>
|
||||
<a name="syntax.macros"></a><h3>
|
||||
<a name="id443880"></a>Macros</h3>
|
||||
<pre class="programlisting"><tt class="literal">[def macro_identifier some text]
|
||||
</tt></pre>
|
||||
<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>
|
||||
<pre class="programlisting"><tt class="literal">[def sf_logo [$http://sourceforge.net/sflogo.php?group_id=28447&type=1]]
|
||||
sf_logo
|
||||
</tt></pre>
|
||||
<p>
|
||||
Now everywhere the sf_logo is placed, the picture will be inlined.</p>
|
||||
<p><span class="inlinemediaobject"><img src="http://sourceforge.net/sflogo.php?group_id=28447&type=1"></span></p>
|
||||
<div class="informaltable"><table class="table">
|
||||
<colgroup><col></colgroup>
|
||||
<tbody><tr><td class="blurb">
|
||||
<span class="inlinemediaobject"><img src="../images/tip.png"></span> 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. <tt class="literal">__spirit__</tt>). The reason is to avoid unwanted macro replacement.</td></tr></tbody>
|
||||
</table></div>
|
||||
<p>
|
||||
Links (URLS) and images are good candidates for macros. <span class="bold"><b>1</b></span>) 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. <span class="bold"><b>2</b></span>) The syntax is not pretty. It's easier to read and
|
||||
write, e.g. <tt class="literal">__spirit__</tt> than <tt class="literal">[@http://spirit.sourceforge.net Spirit]</tt>.</p>
|
||||
<p>
|
||||
Some more examples:</p>
|
||||
<pre class="programlisting"><tt class="literal">[def :-) [$theme/smiley.png]]
|
||||
[def __spirit__ [@http://spirit.sourceforge.net Spirit]]
|
||||
</tt></pre>
|
||||
<p>
|
||||
(See <a href="syntax.html#syntax.images__terminal_">Images</a>
|
||||
and <a href="syntax.html#syntax.links">Links</a>)</p>
|
||||
<p>
|
||||
Invoking these macros:</p>
|
||||
<pre class="programlisting"><tt class="literal">Hi __spirit__ :-)
|
||||
</tt></pre>
|
||||
<p>
|
||||
will generate this:</p>
|
||||
<p>
|
||||
Hi <a href="http://spirit.sourceforge.net" target="_top">Spirit</a><span class="inlinemediaobject"><img src="../images/smiley.png"></span></p>
|
||||
<a name="syntax.predefined_macros"></a><h3>
|
||||
<a name="id444053"></a>Predefined Macros</h3>
|
||||
<p>
|
||||
Quickbook has some predefined macros that you can already use.</p>
|
||||
<div class="informaltable">
|
||||
<h4>
|
||||
<a name="id444066"></a><span class="table-title">Predefined Macros</span>
|
||||
</h4>
|
||||
<table class="table">
|
||||
<colgroup>
|
||||
<col>
|
||||
<col>
|
||||
<col>
|
||||
</colgroup>
|
||||
<thead><tr>
|
||||
<th>Macro</th>
|
||||
<th>Meaning</th>
|
||||
<th>Example</th>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>__DATE__</td>
|
||||
<td>Today's date</td>
|
||||
<td>2005-Jan-26</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>__TIME__</td>
|
||||
<td>The current time</td>
|
||||
<td>10:59:00 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>__FILENAME__</td>
|
||||
<td>Quickbook source filename</td>
|
||||
<td>quickbook.qbk</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<a name="syntax.blurbs"></a><h3>
|
||||
<a name="id444124"></a>Blurbs</h3>
|
||||
<pre class="programlisting"><tt class="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++.
|
||||
]
|
||||
</tt></pre>
|
||||
<p>
|
||||
will generate this:</p>
|
||||
<div class="informaltable"><table class="table">
|
||||
<colgroup><col></colgroup>
|
||||
<tbody><tr><td class="blurb">
|
||||
<span class="inlinemediaobject"><img src="../images/smiley.png"></span><span class="bold"><b>An eye catching advertisement or note...</b></span><br><br><a href="http://spirit.sourceforge.net" target="_top">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></tbody>
|
||||
</table></div>
|
||||
<a name="syntax.tables"></a><h3>
|
||||
<a name="id444183"></a>Tables</h3>
|
||||
<pre class="programlisting"><tt class="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]]
|
||||
]
|
||||
</tt></pre>
|
||||
<p>
|
||||
will generate:</p>
|
||||
<div class="informaltable">
|
||||
<h4>
|
||||
<a name="id444205"></a><span class="table-title">A Simple Table</span>
|
||||
</h4>
|
||||
<table class="table">
|
||||
<colgroup>
|
||||
<col>
|
||||
<col>
|
||||
<col>
|
||||
</colgroup>
|
||||
<thead><tr>
|
||||
<th>Heading 1</th>
|
||||
<th>Heading 2</th>
|
||||
<th>Heading 3</th>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>R0-C0</td>
|
||||
<td>R0-C1</td>
|
||||
<td>R0-C2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>R2-C0</td>
|
||||
<td>R2-C1</td>
|
||||
<td>R2-C2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>R3-C0</td>
|
||||
<td>R3-C1</td>
|
||||
<td>R3-C2</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<p>
|
||||
The first row of the table is automatically treated as the table header; that is,
|
||||
it is wrapped in <tt class="literal"><thead>...</thead></tt> 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:</p>
|
||||
<pre class="programlisting"><tt class="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]
|
||||
]
|
||||
]
|
||||
</tt></pre>
|
||||
<p>
|
||||
and thus:</p>
|
||||
<div class="informaltable">
|
||||
<h4>
|
||||
<a name="id444286"></a><span class="table-title">Table with fat cells</span>
|
||||
</h4>
|
||||
<table class="table">
|
||||
<colgroup>
|
||||
<col>
|
||||
<col>
|
||||
</colgroup>
|
||||
<thead><tr>
|
||||
<th>Heading 1</th>
|
||||
<th>Heading 2</th>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Row 0, Col 0: a small cell</td>
|
||||
<td>
|
||||
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...
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Row 1, Col 0: a small cell</td>
|
||||
<td>Row 1, Col 1: a small cell</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<a name="syntax.variable_lists"></a><h3>
|
||||
<a name="id444330"></a>Variable Lists</h3>
|
||||
<pre class="programlisting"><tt class="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]]
|
||||
]
|
||||
</tt></pre>
|
||||
<p>
|
||||
will generate:</p>
|
||||
<div class="variablelist">
|
||||
<p class="title"><b>A Variable List</b></p>
|
||||
<dl>
|
||||
<dt><span class="term">term 1</span></dt>
|
||||
<dd>The definition of term 1</dd>
|
||||
<dt><span class="term">term 2</span></dt>
|
||||
<dd>The definition of term 2</dd>
|
||||
<dt><span class="term">term 3</span></dt>
|
||||
<dd>The definition of term 3</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<p>
|
||||
The rules for variable lists are the same as for tables, except that
|
||||
only 2 "columns" are allowed. The first column contains the terms, and
|
||||
the second column contains the definitions. Those familiar with HTML
|
||||
will recognize this as a "definition list".</p>
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><small>Copyright © 2002, 2004 Joel de Guzman, Eric Niebler</small></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="../index.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="ref.html"><img src="../images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,178 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2002 2004 Joel de Guzman
|
||||
Copyright (c) 2004 Eric Niebler
|
||||
http://spirit.sourceforge.net/
|
||||
|
||||
Use, modification and distribution is subject to the Boost Software
|
||||
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
#if !defined(BOOST_SPIRIT_QUICKBOOK_DOC_INFO_HPP)
|
||||
#define BOOST_SPIRIT_QUICKBOOK_DOC_INFO_HPP
|
||||
|
||||
#include <boost/spirit/core.hpp>
|
||||
#include <boost/spirit/actor.hpp>
|
||||
#include <boost/spirit/utility/loops.hpp>
|
||||
|
||||
namespace quickbook
|
||||
{
|
||||
using namespace boost::spirit;
|
||||
|
||||
template <typename Actions>
|
||||
struct doc_info_grammar
|
||||
: public grammar<doc_info_grammar<Actions> >
|
||||
{
|
||||
doc_info_grammar(Actions& actions)
|
||||
: actions(actions) {}
|
||||
|
||||
template <typename Scanner>
|
||||
struct definition
|
||||
{
|
||||
definition(doc_info_grammar const& self)
|
||||
{
|
||||
doc_info =
|
||||
space
|
||||
>> '['
|
||||
>> ( str_p("book")
|
||||
| "article"
|
||||
| "library"
|
||||
| "chapter"
|
||||
| "part"
|
||||
) [assign_a(self.actions.doc_type)]
|
||||
>> hard_space
|
||||
>> ( *(anychar_p -
|
||||
(ch_p('[') | ']' | eol_p)
|
||||
)
|
||||
) [assign_a(self.actions.doc_title)]
|
||||
>> *( doc_version
|
||||
| doc_id
|
||||
| doc_dirname
|
||||
| doc_copyright
|
||||
| doc_purpose
|
||||
| doc_category
|
||||
| doc_authors
|
||||
| doc_license
|
||||
| doc_last_revision
|
||||
| doc_source_mode
|
||||
)
|
||||
>> ']' >> +eol_p
|
||||
;
|
||||
|
||||
doc_version =
|
||||
space
|
||||
>> "[version" >> hard_space
|
||||
>> (*(anychar_p - ']')) [assign_a(self.actions.doc_version)]
|
||||
>> ']' >> +eol_p
|
||||
;
|
||||
|
||||
doc_id =
|
||||
space
|
||||
>> "[id" >> hard_space
|
||||
>> (*(anychar_p - ']')) [assign_a(self.actions.doc_id)]
|
||||
>> ']' >> +eol_p
|
||||
;
|
||||
|
||||
doc_dirname =
|
||||
space
|
||||
>> "[dirname" >> hard_space
|
||||
>> (*(anychar_p - ']')) [assign_a(self.actions.doc_dirname)]
|
||||
>> ']' >> +eol_p
|
||||
;
|
||||
|
||||
doc_copyright =
|
||||
space
|
||||
>> "[copyright" >> hard_space
|
||||
>> +( repeat_p(4)[digit_p] [push_back_a(self.actions.doc_copyright_years)]
|
||||
>> space
|
||||
)
|
||||
>> space
|
||||
>> (*(anychar_p - ']')) [assign_a(self.actions.doc_copyright_holder)]
|
||||
>> ']' >> +eol_p
|
||||
;
|
||||
|
||||
doc_purpose =
|
||||
space
|
||||
>> "[purpose" >> hard_space
|
||||
>> (*(anychar_p - ']')) [assign_a(self.actions.doc_purpose)]
|
||||
>> ']' >> +eol_p
|
||||
;
|
||||
|
||||
doc_category =
|
||||
space
|
||||
>> "[category" >> hard_space
|
||||
>> (*(anychar_p - ']')) [assign_a(self.actions.doc_category)]
|
||||
>> ']' >> +eol_p
|
||||
;
|
||||
|
||||
doc_author =
|
||||
space
|
||||
>> '[' >> space
|
||||
>> (*(anychar_p - ',')) [assign_a(name.second)] // surname
|
||||
>> ',' >> space
|
||||
>> (*(anychar_p - ']')) [assign_a(name.first)] // firstname
|
||||
>> ']'
|
||||
;
|
||||
|
||||
doc_authors =
|
||||
space
|
||||
>> "[authors" >> hard_space
|
||||
>> doc_author [push_back_a(self.actions.doc_authors, name)]
|
||||
>> *( ','
|
||||
>> doc_author [push_back_a(self.actions.doc_authors, name)]
|
||||
)
|
||||
>> ']' >> +eol_p
|
||||
;
|
||||
|
||||
doc_license =
|
||||
space
|
||||
>> "[license" >> hard_space
|
||||
>> (*(anychar_p - ']')) [assign_a(self.actions.doc_license)]
|
||||
>> ']' >> +eol_p
|
||||
;
|
||||
|
||||
doc_last_revision =
|
||||
space
|
||||
>> "[last-revision" >> hard_space
|
||||
>> (*(anychar_p - ']')) [assign_a(self.actions.doc_last_revision)]
|
||||
>> ']' >> +eol_p
|
||||
;
|
||||
|
||||
doc_source_mode =
|
||||
space
|
||||
>> "[source-mode" >> hard_space
|
||||
>> (
|
||||
str_p("c++")
|
||||
| "python"
|
||||
) [assign_a(self.actions.source_mode)]
|
||||
>> space >> ']' >> +eol_p
|
||||
;
|
||||
|
||||
comment =
|
||||
"[/" >> *(anychar_p - ']') >> ']'
|
||||
;
|
||||
|
||||
space =
|
||||
*(space_p | comment)
|
||||
;
|
||||
|
||||
hard_space =
|
||||
(eps_p - (alnum_p | '_')) >> space // must not be followed by
|
||||
; // alpha-numeric or underscore
|
||||
}
|
||||
|
||||
std::pair<std::string, std::string> name;
|
||||
rule<Scanner> doc_info, doc_title, doc_version, doc_id, doc_dirname,
|
||||
doc_copyright, doc_purpose,doc_category, doc_authors,
|
||||
doc_author, comment, space, hard_space, doc_license,
|
||||
doc_last_revision, doc_source_mode;
|
||||
|
||||
rule<Scanner> const&
|
||||
start() const { return doc_info; }
|
||||
};
|
||||
|
||||
Actions& actions;
|
||||
};
|
||||
}
|
||||
|
||||
#endif // BOOST_SPIRIT_QUICKBOOK_DOC_INFO_HPP
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0; URL=doc/html/index.html">
|
||||
</head>
|
||||
<body>
|
||||
Automatic redirection failed, click this
|
||||
<a href="doc/html/index.html">link</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,563 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2002 2004 Joel de Guzman
|
||||
Copyright (c) 2004 Eric Niebler
|
||||
http://spirit.sourceforge.net/
|
||||
|
||||
Use, modification and distribution is subject to the Boost Software
|
||||
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
#if !defined(BOOST_SPIRIT_QUICKBOOK_HPP)
|
||||
#define BOOST_SPIRIT_QUICKBOOK_HPP
|
||||
|
||||
#include "detail/utils.hpp"
|
||||
#include <boost/spirit/core.hpp>
|
||||
#include <boost/spirit/utility/confix.hpp>
|
||||
#include <boost/spirit/utility/chset.hpp>
|
||||
#include <boost/spirit/actor/assign_actor.hpp>
|
||||
#include <boost/spirit/dynamic/if.hpp>
|
||||
|
||||
namespace quickbook
|
||||
{
|
||||
using namespace boost::spirit;
|
||||
|
||||
template <typename Actions>
|
||||
struct quickbook_grammar
|
||||
: public grammar<quickbook_grammar<Actions> >
|
||||
{
|
||||
quickbook_grammar(Actions& actions_)
|
||||
: actions(actions_) {}
|
||||
|
||||
template <typename Scanner>
|
||||
struct definition
|
||||
{
|
||||
definition(quickbook_grammar const& self)
|
||||
: is_not_preformatted(true)
|
||||
{
|
||||
using detail::var;
|
||||
|
||||
library =
|
||||
*(space_p | comment) >> blocks >> blank
|
||||
;
|
||||
|
||||
blocks =
|
||||
+( block_markup
|
||||
| code
|
||||
| list [self.actions.list]
|
||||
| hr [self.actions.hr]
|
||||
| comment >> *eol
|
||||
| paragraph [self.actions.paragraph]
|
||||
| eol
|
||||
)
|
||||
;
|
||||
|
||||
space =
|
||||
*(space_p | comment)
|
||||
;
|
||||
|
||||
blank =
|
||||
*(blank_p | comment)
|
||||
;
|
||||
|
||||
eol = blank >> eol_p
|
||||
;
|
||||
|
||||
close_bracket =
|
||||
']' |
|
||||
if_p(var(is_not_preformatted))
|
||||
[
|
||||
eol_p >> eol_p // Make sure that we don't go
|
||||
] // past a single block, except
|
||||
; // when preformatted.
|
||||
|
||||
hard_space =
|
||||
(eps_p - (alnum_p | '_')) >> space // must not be followed by
|
||||
; // alpha-numeric or underscore
|
||||
|
||||
comment =
|
||||
"[/" >> *(anychar_p - ']') >> ']'
|
||||
;
|
||||
|
||||
hr =
|
||||
str_p("----")
|
||||
>> *(anychar_p - eol)
|
||||
>> +eol
|
||||
;
|
||||
|
||||
block_markup =
|
||||
'['
|
||||
>> ( begin_section
|
||||
| end_section
|
||||
| headings
|
||||
| blurb
|
||||
| blockquote
|
||||
| preformatted
|
||||
| def_macro
|
||||
| table
|
||||
| variablelist
|
||||
| xinclude
|
||||
)
|
||||
>> ( (']' >> +eol)
|
||||
| eps_p [self.actions.error]
|
||||
)
|
||||
;
|
||||
|
||||
begin_section =
|
||||
"section"
|
||||
>> hard_space
|
||||
>> (':' >> (*(alnum_p | '_')) [assign_a(self.actions.section_id)]
|
||||
| eps_p [assign_a(self.actions.section_id)]
|
||||
)
|
||||
>> (*(anychar_p -
|
||||
close_bracket)) [self.actions.begin_section]
|
||||
;
|
||||
|
||||
end_section =
|
||||
str_p("endsect") [self.actions.end_section]
|
||||
;
|
||||
|
||||
headings =
|
||||
h1 | h2 | h3 | h4 | h5 | h6
|
||||
;
|
||||
|
||||
h1 = "h1" >> hard_space >> phrase [self.actions.h1];
|
||||
h2 = "h2" >> hard_space >> phrase [self.actions.h2];
|
||||
h3 = "h3" >> hard_space >> phrase [self.actions.h3];
|
||||
h4 = "h4" >> hard_space >> phrase [self.actions.h4];
|
||||
h5 = "h5" >> hard_space >> phrase [self.actions.h5];
|
||||
h6 = "h6" >> hard_space >> phrase [self.actions.h6];
|
||||
|
||||
blurb =
|
||||
"blurb" >> hard_space
|
||||
>> phrase [self.actions.blurb]
|
||||
;
|
||||
|
||||
blockquote =
|
||||
':' >> blank >>
|
||||
phrase [self.actions.blockquote]
|
||||
;
|
||||
|
||||
preformatted =
|
||||
"pre" >> hard_space [assign_a(is_not_preformatted, false)]
|
||||
>> !eol >> phrase [self.actions.preformatted]
|
||||
>> eps_p [assign_a(is_not_preformatted, true)]
|
||||
;
|
||||
|
||||
def_macro =
|
||||
"def" >> hard_space
|
||||
>> identifier [self.actions.identifier]
|
||||
>> blank >> phrase [self.actions.macro_def]
|
||||
;
|
||||
|
||||
variablelist =
|
||||
"variablelist" >> hard_space
|
||||
>> (*(anychar_p - eol)) [assign_a(self.actions.table_title)]
|
||||
>> +eol
|
||||
>> *varlistentry
|
||||
>> eps_p [self.actions.variablelist]
|
||||
;
|
||||
|
||||
varlistentry =
|
||||
space
|
||||
>> ch_p('[') [self.actions.start_varlistentry]
|
||||
>>
|
||||
(
|
||||
(
|
||||
varlistterm
|
||||
>> +varlistitem
|
||||
>> ch_p(']') [self.actions.end_varlistentry]
|
||||
>> space
|
||||
)
|
||||
| eps_p [self.actions.error]
|
||||
)
|
||||
;
|
||||
|
||||
varlistterm =
|
||||
space
|
||||
>> ch_p('[') [self.actions.start_varlistterm]
|
||||
>>
|
||||
(
|
||||
(
|
||||
phrase
|
||||
>> ch_p(']') [self.actions.end_varlistterm]
|
||||
>> space
|
||||
)
|
||||
| eps_p [self.actions.error]
|
||||
)
|
||||
;
|
||||
|
||||
varlistitem =
|
||||
space
|
||||
>> ch_p('[') [self.actions.start_varlistitem]
|
||||
>>
|
||||
(
|
||||
(
|
||||
phrase [self.actions.end_varlistitem]
|
||||
>> ch_p(']')
|
||||
>> space
|
||||
)
|
||||
| eps_p [self.actions.error]
|
||||
)
|
||||
;
|
||||
|
||||
table =
|
||||
"table" >> hard_space
|
||||
>> (*(anychar_p - eol)) [assign_a(self.actions.table_title)]
|
||||
>> +eol
|
||||
>> *table_row
|
||||
>> eps_p [self.actions.table]
|
||||
;
|
||||
|
||||
table_row =
|
||||
space
|
||||
>> ch_p('[') [self.actions.start_row]
|
||||
>>
|
||||
(
|
||||
(
|
||||
*table_cell
|
||||
>> ch_p(']') [self.actions.end_row]
|
||||
>> space
|
||||
)
|
||||
| eps_p [self.actions.error]
|
||||
)
|
||||
;
|
||||
|
||||
table_cell =
|
||||
space
|
||||
>> ch_p('[') [self.actions.start_cell]
|
||||
>>
|
||||
(
|
||||
(
|
||||
phrase
|
||||
>> ch_p(']') [self.actions.end_cell]
|
||||
>> space
|
||||
)
|
||||
| eps_p [self.actions.error]
|
||||
)
|
||||
;
|
||||
|
||||
xinclude =
|
||||
"xinclude"
|
||||
>> hard_space
|
||||
>> (*(anychar_p -
|
||||
close_bracket)) [self.actions.xinclude]
|
||||
;
|
||||
|
||||
identifier =
|
||||
*(anychar_p - (space_p | ']'))
|
||||
;
|
||||
|
||||
source_mode =
|
||||
(
|
||||
str_p("c++")
|
||||
| "python"
|
||||
) [assign_a(self.actions.source_mode)]
|
||||
;
|
||||
|
||||
code =
|
||||
(
|
||||
code_line
|
||||
>> *(*eol >> code_line)
|
||||
) [self.actions.code]
|
||||
>> +eol
|
||||
;
|
||||
|
||||
code_line =
|
||||
((ch_p(' ') | '\t'))
|
||||
>> *(anychar_p - eol) >> eol
|
||||
;
|
||||
|
||||
list =
|
||||
eps_p(ch_p('*') | '#') >>
|
||||
+(
|
||||
(*blank_p
|
||||
>> (ch_p('*') | '#')) [self.actions.list_format]
|
||||
>> *blank_p
|
||||
>> list_item
|
||||
) [self.actions.list_item]
|
||||
;
|
||||
|
||||
list_item =
|
||||
*( common
|
||||
| (anychar_p -
|
||||
( eol_p >> *blank_p >> eps_p(ch_p('*') | '#')
|
||||
| (eol >> eol)
|
||||
)
|
||||
) [self.actions.plain_char]
|
||||
)
|
||||
>> +eol
|
||||
;
|
||||
|
||||
common =
|
||||
self.actions.macro [self.actions.do_macro]
|
||||
| phrase_markup
|
||||
| inline_code
|
||||
| simple_format
|
||||
| escape
|
||||
| comment
|
||||
;
|
||||
|
||||
inline_code =
|
||||
'`' >>
|
||||
(
|
||||
*(anychar_p -
|
||||
( '`'
|
||||
| (eol >> eol) // Make sure that we don't go
|
||||
) // past a single block
|
||||
) >> eps_p('`')
|
||||
) [self.actions.inline_code]
|
||||
>> '`'
|
||||
;
|
||||
|
||||
simple_format =
|
||||
simple_bold
|
||||
| simple_italic
|
||||
| simple_underline
|
||||
| simple_teletype
|
||||
;
|
||||
|
||||
simple_bold =
|
||||
'*' >>
|
||||
(
|
||||
( graph_p >> // graph_p must follow '*'
|
||||
*(anychar_p -
|
||||
( eol // Make sure that we don't go
|
||||
| (graph_p >> '*') // past a single line
|
||||
)
|
||||
) >> graph_p // graph_p must precede '*'
|
||||
>> eps_p('*'
|
||||
>> (space_p | punct_p)) // space_p or punct_p must
|
||||
) // follow '*'
|
||||
| (
|
||||
graph_p // A single char. e.g. *c*
|
||||
>> eps_p('*'
|
||||
>> (space_p | punct_p))
|
||||
)
|
||||
) [self.actions.simple_bold]
|
||||
>> '*'
|
||||
;
|
||||
|
||||
simple_italic =
|
||||
'/' >>
|
||||
(
|
||||
( graph_p >> // graph_p must follow '/'
|
||||
*(anychar_p -
|
||||
( eol // Make sure that we don't go
|
||||
| (graph_p >> '/') // past a single line
|
||||
)
|
||||
) >> graph_p // graph_p must precede '/'
|
||||
>> eps_p('/'
|
||||
>> (space_p | punct_p)) // space_p or punct_p must
|
||||
) // follow '/'
|
||||
| (
|
||||
graph_p // A single char. e.g. /c/
|
||||
>> eps_p('/'
|
||||
>> (space_p | punct_p))
|
||||
)
|
||||
) [self.actions.simple_italic]
|
||||
>> '/'
|
||||
;
|
||||
|
||||
simple_underline =
|
||||
'_' >>
|
||||
(
|
||||
( graph_p >> // graph_p must follow '_'
|
||||
*(anychar_p -
|
||||
( eol // Make sure that we don't go
|
||||
| (graph_p >> '_') // past a single line
|
||||
)
|
||||
) >> graph_p // graph_p must precede '_'
|
||||
>> eps_p('_'
|
||||
>> (space_p | punct_p)) // space_p or punct_p must
|
||||
) // follow '_'
|
||||
| (
|
||||
graph_p // A single char. e.g. _c_
|
||||
>> eps_p('_'
|
||||
>> (space_p | punct_p))
|
||||
)
|
||||
) [self.actions.simple_underline]
|
||||
>> '_'
|
||||
;
|
||||
|
||||
simple_teletype =
|
||||
'=' >>
|
||||
(
|
||||
( graph_p >> // graph_p must follow '='
|
||||
*(anychar_p -
|
||||
( eol // Make sure that we don't go
|
||||
| (graph_p >> '=') // past a single line
|
||||
)
|
||||
) >> graph_p // graph_p must precede '='
|
||||
>> eps_p('='
|
||||
>> (space_p | punct_p)) // space_p or punct_p must
|
||||
) // follow '='
|
||||
| (
|
||||
graph_p // A single char. e.g. =c=
|
||||
>> eps_p('='
|
||||
>> (space_p | punct_p))
|
||||
)
|
||||
) [self.actions.simple_teletype]
|
||||
>> '='
|
||||
;
|
||||
|
||||
paragraph =
|
||||
*( common
|
||||
| (anychar_p - // Make sure we don't go past
|
||||
(eol >> eol) // a single block.
|
||||
) [self.actions.plain_char]
|
||||
)
|
||||
>> +eol
|
||||
;
|
||||
|
||||
phrase =
|
||||
*( common
|
||||
| comment
|
||||
| (anychar_p -
|
||||
close_bracket) [self.actions.plain_char]
|
||||
)
|
||||
;
|
||||
|
||||
phrase_markup =
|
||||
'['
|
||||
>> ( image
|
||||
| url
|
||||
| link
|
||||
| anchor
|
||||
| source_mode
|
||||
| funcref
|
||||
| classref
|
||||
| memberref
|
||||
| enumref
|
||||
| bold
|
||||
| italic
|
||||
| underline
|
||||
| teletype
|
||||
| str_p("br") [self.actions.break_]
|
||||
)
|
||||
>> ']'
|
||||
;
|
||||
|
||||
escape =
|
||||
str_p("\\n") [self.actions.break_]
|
||||
| '\\' >> punct_p [self.actions.raw_char]
|
||||
| (
|
||||
"'''" >> !eol
|
||||
>> *(anychar_p - "'''") [self.actions.raw_char]
|
||||
>> "'''"
|
||||
)
|
||||
;
|
||||
|
||||
image =
|
||||
'$' >> blank
|
||||
>> (*(anychar_p -
|
||||
close_bracket)) [self.actions.image]
|
||||
;
|
||||
|
||||
url =
|
||||
'@'
|
||||
>> (*(anychar_p -
|
||||
(']' | hard_space))) [self.actions.url_pre]
|
||||
>> ( eps_p(']')
|
||||
| (hard_space >> phrase)
|
||||
) [self.actions.url_post]
|
||||
;
|
||||
|
||||
link =
|
||||
"link" >> hard_space
|
||||
>> (*(anychar_p -
|
||||
(']' | hard_space))) [self.actions.link_pre]
|
||||
>> ( eps_p(']')
|
||||
| (hard_space >> phrase)
|
||||
) [self.actions.link_post]
|
||||
;
|
||||
|
||||
anchor =
|
||||
'#'
|
||||
>> blank
|
||||
>> ( *(anychar_p -
|
||||
close_bracket)
|
||||
) [self.actions.anchor]
|
||||
;
|
||||
|
||||
funcref =
|
||||
"funcref" >> hard_space
|
||||
>> (*(anychar_p -
|
||||
(']' | hard_space))) [self.actions.funcref_pre]
|
||||
>> ( eps_p(']')
|
||||
| (hard_space >> phrase)
|
||||
) [self.actions.funcref_post]
|
||||
;
|
||||
|
||||
classref =
|
||||
"classref" >> hard_space
|
||||
>> (*(anychar_p -
|
||||
(']' | hard_space))) [self.actions.classref_pre]
|
||||
>> ( eps_p(']')
|
||||
| (hard_space >> phrase)
|
||||
) [self.actions.classref_post]
|
||||
;
|
||||
|
||||
memberref =
|
||||
"memberref" >> hard_space
|
||||
>> (*(anychar_p -
|
||||
(']' | hard_space))) [self.actions.memberref_pre]
|
||||
>> ( eps_p(']')
|
||||
| (hard_space >> phrase)
|
||||
) [self.actions.memberref_post]
|
||||
;
|
||||
|
||||
enumref =
|
||||
"enumref" >> hard_space
|
||||
>> (*(anychar_p -
|
||||
(']' | hard_space))) [self.actions.enumref_pre]
|
||||
>> ( eps_p(']')
|
||||
| (hard_space >> phrase)
|
||||
) [self.actions.enumref_post]
|
||||
;
|
||||
|
||||
bold =
|
||||
ch_p('*') [self.actions.bold_pre]
|
||||
>> blank >> phrase [self.actions.bold_post]
|
||||
;
|
||||
|
||||
italic =
|
||||
ch_p('\'') [self.actions.italic_pre]
|
||||
>> blank >> phrase [self.actions.italic_post]
|
||||
;
|
||||
|
||||
underline =
|
||||
ch_p('_') [self.actions.underline_pre]
|
||||
>> blank >> phrase [self.actions.underline_post]
|
||||
;
|
||||
|
||||
teletype =
|
||||
ch_p('^') [self.actions.teletype_pre]
|
||||
>> blank >> phrase [self.actions.teletype_post]
|
||||
;
|
||||
}
|
||||
|
||||
bool is_not_preformatted;
|
||||
|
||||
rule<Scanner> library, blocks, lib_info, block_markup, source_mode, code,
|
||||
code_line, paragraph, space, blank, comment, headings,
|
||||
h1, h2, h3, h4, h5, h6, hr, blurb, blockquote,
|
||||
phrase, phrase_markup, image, list, close_bracket,
|
||||
ordered_list, bold, italic, underline, teletype,
|
||||
escape, def_macro, identifier, url, table, table_row,
|
||||
variablelist, varlistentry, varlistterm, varlistitem,
|
||||
table_cell, preformatted, list_item, common,
|
||||
funcref, classref, memberref, enumref, anchor, link,
|
||||
begin_section, end_section, xinclude, hard_space, eol,
|
||||
inline_code, simple_format, simple_bold, simple_italic,
|
||||
simple_underline, simple_teletype;
|
||||
|
||||
rule<Scanner> const&
|
||||
start() const { return library; }
|
||||
};
|
||||
|
||||
Actions& actions;
|
||||
};
|
||||
}
|
||||
|
||||
#endif // BOOST_SPIRIT_QUICKBOOK_HPP
|
||||
|
||||
@@ -0,0 +1,246 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2002 2004 Joel de Guzman
|
||||
Copyright (c) 2004 Eric Niebler
|
||||
http://spirit.sourceforge.net/
|
||||
|
||||
Use, modification and distribution is subject to the Boost Software
|
||||
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
#if !defined(BOOST_SPIRIT_QUICKBOOK_SYNTAX_HIGHLIGHT_HPP)
|
||||
#define BOOST_SPIRIT_QUICKBOOK_SYNTAX_HIGHLIGHT_HPP
|
||||
|
||||
#include <boost/spirit/core.hpp>
|
||||
#include <boost/spirit/utility/confix.hpp>
|
||||
#include <boost/spirit/utility/chset.hpp>
|
||||
#include <boost/spirit/symbols/symbols.hpp>
|
||||
#include <boost/spirit/utility/escape_char.hpp>
|
||||
|
||||
namespace quickbook
|
||||
{
|
||||
using namespace boost::spirit;
|
||||
|
||||
// Grammar for C++ highlighting
|
||||
template <
|
||||
typename Process
|
||||
, typename Space
|
||||
, typename Macro
|
||||
, typename DoMacro
|
||||
, typename Unexpected
|
||||
, typename Out>
|
||||
struct cpp_highlight
|
||||
: public grammar<cpp_highlight<Process, Space, Macro, DoMacro, Unexpected, Out> >
|
||||
{
|
||||
cpp_highlight(Out& out, Macro const& macro, DoMacro do_macro)
|
||||
: out(out), macro(macro), do_macro(do_macro) {}
|
||||
|
||||
template <typename Scanner>
|
||||
struct definition
|
||||
{
|
||||
definition(cpp_highlight const& self)
|
||||
{
|
||||
program
|
||||
=
|
||||
*( macro
|
||||
| preprocessor [Process("preprocessor", self.out)]
|
||||
| comment [Process("comment", self.out)]
|
||||
| keyword [Process("keyword", self.out)]
|
||||
| identifier [Process("identifier", self.out)]
|
||||
| special [Process("special", self.out)]
|
||||
| string_ [Process("string", self.out)]
|
||||
| char_ [Process("char", self.out)]
|
||||
| number [Process("number", self.out)]
|
||||
| space_p [Space(self.out)]
|
||||
| anychar_p [Unexpected(self.out)]
|
||||
)
|
||||
;
|
||||
|
||||
macro
|
||||
= eps_p(*space_p >> self.macro)
|
||||
>> (*space_p) [Space(self.out)]
|
||||
>> self.macro [self.do_macro]
|
||||
;
|
||||
|
||||
preprocessor
|
||||
= *space_p >> '#' >> ((alpha_p | '_') >> *(alnum_p | '_'))
|
||||
;
|
||||
|
||||
comment
|
||||
= +(*space_p >> (comment_p("//") | comment_p("/*", "*/")))
|
||||
;
|
||||
|
||||
keyword
|
||||
= *space_p >> keyword_ >> (eps_p - (alnum_p | '_'))
|
||||
; // make sure we recognize whole words only
|
||||
|
||||
keyword_
|
||||
= "and_eq", "and", "asm", "auto", "bitand", "bitor",
|
||||
"bool", "break", "case", "catch", "char", "class",
|
||||
"compl", "const_cast", "const", "continue", "default",
|
||||
"delete", "do", "double", "dynamic_cast", "else",
|
||||
"enum", "explicit", "export", "extern", "false",
|
||||
"float", "for", "friend", "goto", "if", "inline",
|
||||
"int", "long", "mutable", "namespace", "new", "not_eq",
|
||||
"not", "operator", "or_eq", "or", "private",
|
||||
"protected", "public", "register", "reinterpret_cast",
|
||||
"return", "short", "signed", "sizeof", "static",
|
||||
"static_cast", "struct", "switch", "template", "this",
|
||||
"throw", "true", "try", "typedef", "typeid",
|
||||
"typename", "union", "unsigned", "using", "virtual",
|
||||
"void", "volatile", "wchar_t", "while", "xor_eq", "xor"
|
||||
;
|
||||
|
||||
special
|
||||
= *space_p >> +chset_p("~!%^&*()+={[}]:;,<.>?/|\\-")
|
||||
;
|
||||
|
||||
string_
|
||||
= *space_p >> !as_lower_d['l'] >> confix_p('"', *c_escape_ch_p, '"')
|
||||
;
|
||||
|
||||
char_
|
||||
= *space_p >> !as_lower_d['l'] >> confix_p('\'', *c_escape_ch_p, '\'')
|
||||
;
|
||||
|
||||
number
|
||||
= *space_p >>
|
||||
(
|
||||
as_lower_d["0x"] >> hex_p
|
||||
| '0' >> oct_p
|
||||
| real_p
|
||||
)
|
||||
>> *as_lower_d[chset_p("ldfu")]
|
||||
;
|
||||
|
||||
identifier
|
||||
= *space_p >> ((alpha_p | '_') >> *(alnum_p | '_'))
|
||||
;
|
||||
}
|
||||
|
||||
rule<Scanner> program, macro, preprocessor, comment, special,
|
||||
string_, char_, number, identifier, keyword;
|
||||
symbols<> keyword_;
|
||||
|
||||
rule<Scanner> const&
|
||||
start() const { return program; }
|
||||
};
|
||||
|
||||
Out& out;
|
||||
Macro const& macro;
|
||||
DoMacro do_macro;
|
||||
};
|
||||
|
||||
// Grammar for Python highlighting
|
||||
// See also: The Python Reference Manual
|
||||
// http://docs.python.org/ref/ref.html
|
||||
template <
|
||||
typename Process
|
||||
, typename Space
|
||||
, typename Macro
|
||||
, typename DoMacro
|
||||
, typename Unexpected
|
||||
, typename Out>
|
||||
struct python_highlight
|
||||
: public grammar<python_highlight<Process, Space, Macro, DoMacro, Unexpected, Out> >
|
||||
{
|
||||
python_highlight(Out& out, Macro const& macro, DoMacro do_macro)
|
||||
: out(out), macro(macro), do_macro(do_macro) {}
|
||||
|
||||
template <typename Scanner>
|
||||
struct definition
|
||||
{
|
||||
definition(python_highlight const& self)
|
||||
{
|
||||
program
|
||||
=
|
||||
*( comment [Process("comment", self.out)]
|
||||
| keyword [Process("keyword", self.out)]
|
||||
| identifier [Process("identifier", self.out)]
|
||||
| special [Process("special", self.out)]
|
||||
| string_ [Process("string", self.out)]
|
||||
| number [Process("number", self.out)]
|
||||
| space_p
|
||||
| anychar_p [Unexpected(self.out)]
|
||||
)
|
||||
;
|
||||
|
||||
comment
|
||||
= +(*space_p >> comment_p("#"))
|
||||
;
|
||||
|
||||
keyword
|
||||
= *space_p >> keyword_ >> (eps_p - (alnum_p | '_'))
|
||||
; // make sure we recognize whole words only
|
||||
|
||||
keyword_
|
||||
=
|
||||
"and", "del", "for", "is", "raise",
|
||||
"assert", "elif", "from", "lambda", "return",
|
||||
"break", "else", "global", "not", "try",
|
||||
"class", "except", "if", "or", "while",
|
||||
"continue", "exec", "import", "pass", "yield",
|
||||
"def", "finally", "in", "print",
|
||||
|
||||
// Technically "as" and "None" are not yet keywords (at Python
|
||||
// 2.4). They are destined to become keywords, and we treat them
|
||||
// as such for syntax highlighting purposes.
|
||||
|
||||
"as", "None"
|
||||
;
|
||||
|
||||
special
|
||||
= *space_p >> +chset_p("~!%^&*()+={[}]:;,<.>/|\\-")
|
||||
;
|
||||
|
||||
string_prefix
|
||||
= as_lower_d[str_p("u") >> ! str_p("r")]
|
||||
;
|
||||
|
||||
string_
|
||||
= *space_p >> ! string_prefix >> (long_string | short_string)
|
||||
;
|
||||
|
||||
short_string
|
||||
= confix_p('\'', * c_escape_ch_p, '\'') |
|
||||
confix_p('"', * c_escape_ch_p, '"')
|
||||
;
|
||||
|
||||
long_string
|
||||
// Note: the "str_p" on the next two lines are required for
|
||||
// to avoid an INTERNAL COMPILER ERROR when using VC7.1
|
||||
= confix_p(str_p("'''"), * lex_escape_ch_p, "'''") |
|
||||
confix_p(str_p("\"\"\""), * lex_escape_ch_p, "\"\"\"")
|
||||
;
|
||||
|
||||
number
|
||||
= *space_p >>
|
||||
(
|
||||
as_lower_d["0x"] >> hex_p
|
||||
| '0' >> oct_p
|
||||
| real_p
|
||||
)
|
||||
>> *as_lower_d[chset_p("lj")]
|
||||
;
|
||||
|
||||
identifier
|
||||
= *space_p >> ((alpha_p | '_') >> *(alnum_p | '_'))
|
||||
;
|
||||
}
|
||||
|
||||
rule<Scanner> program, comment, special,
|
||||
string_, string_prefix, short_string, long_string,
|
||||
number, identifier, keyword;
|
||||
symbols<> keyword_;
|
||||
|
||||
rule<Scanner> const&
|
||||
start() const { return program; }
|
||||
};
|
||||
|
||||
Out& out;
|
||||
Macro const& macro;
|
||||
DoMacro do_macro;
|
||||
};
|
||||
}
|
||||
|
||||
#endif // BOOST_SPIRIT_QUICKBOOK_SYNTAX_HIGHLIGHT_HPP
|
||||
|
||||