Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r65103 - trunk/tools/quickbook/src
From: dnljms_at_[hidden]
Date: 2010-08-29 07:20:26


Author: danieljames
Date: 2010-08-29 07:20:24 EDT (Sun, 29 Aug 2010)
New Revision: 65103
URL: http://svn.boost.org/trac/boost/changeset/65103

Log:
Fix some issues with inlined template code not being available to other compile units.
Text files modified:
   trunk/tools/quickbook/src/actions.cpp | 4
   trunk/tools/quickbook/src/block_grammar.cpp | 8
   trunk/tools/quickbook/src/doc_info_grammar.cpp | 8
   trunk/tools/quickbook/src/grammar.hpp | 18 +
   trunk/tools/quickbook/src/phrase_grammar.cpp | 470 ---------------------------------------
   trunk/tools/quickbook/src/phrase_grammar.hpp | 449 ++++++++++++++++++++++++++++++++++++++
   trunk/tools/quickbook/src/quickbook.cpp | 6
   7 files changed, 482 insertions(+), 481 deletions(-)

Modified: trunk/tools/quickbook/src/actions.cpp
==============================================================================
--- trunk/tools/quickbook/src/actions.cpp (original)
+++ trunk/tools/quickbook/src/actions.cpp 2010-08-29 07:20:24 EDT (Sun, 29 Aug 2010)
@@ -760,7 +760,7 @@
                 // do a phrase level parse
                 iterator first(body.content.begin(), body.content.end(), body.position);
                 iterator last(body.content.end(), body.content.end());
- bool r = quickbook::parse(first, last, phrase_p).full;
+ bool r = call_parse(first, last, phrase_p).full;
                 actions.phrase.swap(result);
                 return r;
             }
@@ -775,7 +775,7 @@
                 std::string content = body.content + "\n\n";
                 iterator first(content.begin(), content.end(), body.position);
                 iterator last(content.end(), content.end());
- bool r = quickbook::parse(first, last, block_p).full;
+ bool r = call_parse(first, last, block_p).full;
                 actions.inside_paragraph();
                 actions.out.swap(result);
                 return r;

Modified: trunk/tools/quickbook/src/block_grammar.cpp
==============================================================================
--- trunk/tools/quickbook/src/block_grammar.cpp (original)
+++ trunk/tools/quickbook/src/block_grammar.cpp 2010-08-29 07:20:24 EDT (Sun, 29 Aug 2010)
@@ -470,13 +470,9 @@
             ;
     }
 
- template <typename Iterator, typename Grammar>
- parse_info<Iterator> parse(Iterator& first, Iterator last, Grammar& g)
+ parse_info<iterator> call_parse(
+ iterator& first, iterator last, block_grammar& g)
     {
         return boost::spirit::classic::parse(first, last, g);
     }
-
- void instantiate_block_grammar(quickbook::iterator i, block_grammar& g) {
- parse(i, i, g);
- }
 }

Modified: trunk/tools/quickbook/src/doc_info_grammar.cpp
==============================================================================
--- trunk/tools/quickbook/src/doc_info_grammar.cpp (original)
+++ trunk/tools/quickbook/src/doc_info_grammar.cpp 2010-08-29 07:20:24 EDT (Sun, 29 Aug 2010)
@@ -205,13 +205,9 @@
             ;
     }
 
- template <typename Iterator, typename Grammar>
- parse_info<Iterator> parse(Iterator& first, Iterator last, Grammar& g)
+ parse_info<iterator> call_parse(
+ iterator& first, iterator last, doc_info_grammar& g)
     {
         return boost::spirit::classic::parse(first, last, g);
     }
-
- void instantiate_doc_info_grammar(quickbook::iterator i, doc_info_grammar& g) {
- parse(i, i, g);
- }
 }

Modified: trunk/tools/quickbook/src/grammar.hpp
==============================================================================
--- trunk/tools/quickbook/src/grammar.hpp (original)
+++ trunk/tools/quickbook/src/grammar.hpp 2010-08-29 07:20:24 EDT (Sun, 29 Aug 2010)
@@ -41,7 +41,8 @@
         bool const skip_initial_spaces;
     };
 
- struct phrase_grammar : cl::grammar<phrase_grammar>
+ struct phrase_grammar
+ : cl::grammar<phrase_grammar>
     {
         phrase_grammar(quickbook::actions& actions, bool& no_eols)
             : no_eols(no_eols), actions(actions) {}
@@ -53,7 +54,8 @@
         quickbook::actions& actions;
     };
 
- struct simple_phrase_grammar : public cl::grammar<simple_phrase_grammar >
+ struct simple_phrase_grammar
+ : public cl::grammar<simple_phrase_grammar >
     {
         simple_phrase_grammar(quickbook::actions& actions)
             : actions(actions) {}
@@ -76,8 +78,16 @@
         quickbook::actions& actions;
     };
 
- template <typename Iterator, typename Grammar>
- cl::parse_info<Iterator> parse(Iterator&, Iterator, Grammar&);
+ cl::parse_info<iterator> call_parse(
+ iterator&, iterator, doc_info_grammar&);
+ cl::parse_info<iterator> call_parse(
+ iterator&, iterator, block_grammar&);
+ cl::parse_info<iterator> call_parse(
+ iterator&, iterator, phrase_grammar&);
+ cl::parse_info<iterator> call_parse(
+ iterator&, iterator, simple_phrase_grammar&);
+ cl::parse_info<iterator> call_parse(
+ iterator&, iterator, command_line_grammar&);
 }
 
 #endif

Modified: trunk/tools/quickbook/src/phrase_grammar.cpp
==============================================================================
--- trunk/tools/quickbook/src/phrase_grammar.cpp (original)
+++ trunk/tools/quickbook/src/phrase_grammar.cpp 2010-08-29 07:20:24 EDT (Sun, 29 Aug 2010)
@@ -9,459 +9,9 @@
 =============================================================================*/
 
 #include "phrase_grammar.hpp"
-#include "quickbook.hpp"
-#include "actions_class.hpp"
-#include "utils.hpp"
-#include <boost/spirit/include/classic_core.hpp>
-#include <boost/spirit/include/classic_confix.hpp>
-#include <boost/spirit/include/classic_chset.hpp>
-#include <boost/spirit/include/classic_assign_actor.hpp>
-#include <boost/spirit/include/classic_clear_actor.hpp>
-#include <boost/spirit/include/classic_if.hpp>
-#include <boost/spirit/include/classic_loops.hpp>
 
 namespace quickbook
 {
- using namespace boost::spirit::classic;
-
- template <typename Rule, typename Action>
- inline void
- simple_markup(
- Rule& simple
- , char mark
- , Action const& action
- , Rule const& close
- )
- {
- simple =
- mark >>
- (
- (
- graph_p // A single char. e.g. *c*
- >> eps_p(mark
- >> (space_p | punct_p | end_p))
- // space_p, punct_p or end_p
- ) // must follow mark
- |
- ( graph_p >> // graph_p must follow mark
- *(anychar_p -
- ( (graph_p >> mark) // Make sure that we don't go
- | close // past a single block
- )
- ) >> graph_p // graph_p must precede mark
- >> eps_p(mark
- >> (space_p | punct_p | end_p))
- // space_p, punct_p or end_p
- ) // must follow mark
- ) [action]
- >> mark
- ;
- }
-
- template <typename Scanner>
- phrase_grammar::definition<Scanner>::definition(phrase_grammar const& self)
- {
- using detail::var;
- quickbook::actions& actions = self.actions;
-
- space =
- *(space_p | comment)
- ;
-
- blank =
- *(blank_p | comment)
- ;
-
- eol = blank >> eol_p
- ;
-
- phrase_end =
- ']' |
- if_p(var(self.no_eols))
- [
- eol >> eol // Make sure that we don't go
- ] // past a single block, except
- ; // when preformatted.
-
- hard_space =
- (eps_p - (alnum_p | '_')) >> space // must not be preceded by
- ; // alpha-numeric or underscore
-
- comment =
- "[/" >> *(dummy_block | (anychar_p - ']')) >> ']'
- ;
-
- dummy_block =
- '[' >> *(dummy_block | (anychar_p - ']')) >> ']'
- ;
-
- common =
- macro
- | phrase_markup
- | code_block
- | inline_code
- | simple_format
- | escape
- | comment
- ;
-
- macro =
- eps_p(actions.macro // must not be followed by
- >> (eps_p - (alpha_p | '_'))) // alpha or underscore
- >> actions.macro [actions.do_macro]
- ;
-
- static const bool true_ = true;
- static const bool false_ = false;
-
- template_ =
- (
- ch_p('`') [assign_a(actions.template_escape,true_)]
- |
- eps_p [assign_a(actions.template_escape,false_)]
- )
- >>
- ( (
- (eps_p(punct_p)
- >> actions.templates.scope
- ) [assign_a(actions.template_identifier)]
- [clear_a(actions.template_args)]
- >> !template_args
- ) | (
- (actions.templates.scope
- >> eps_p(hard_space)
- ) [assign_a(actions.template_identifier)]
- [clear_a(actions.template_args)]
- >> space
- >> !template_args
- ) )
- >> eps_p(']')
- ;
-
- template_args =
- if_p(qbk_since(105u)) [
- template_args_1_5
- ].else_p [
- template_args_1_4
- ]
- ;
-
- template_args_1_4 = template_arg_1_4 >> *(".." >> template_arg_1_4);
-
- template_arg_1_4 =
- ( eps_p(*blank_p >> eol_p) [assign_a(actions.template_block, true_)]
- | eps_p [assign_a(actions.template_block, false_)]
- )
- >> template_inner_arg_1_4 [actions.template_arg]
- ;
-
- template_inner_arg_1_4 =
- +(brackets_1_4 | (anychar_p - (str_p("..") | ']')))
- ;
-
- brackets_1_4 =
- '[' >> template_inner_arg_1_4 >> ']'
- ;
-
- template_args_1_5 = template_arg_1_5 >> *(".." >> template_arg_1_5);
-
- template_arg_1_5 =
- ( eps_p(*blank_p >> eol_p) [assign_a(actions.template_block, true_)]
- | eps_p [assign_a(actions.template_block, false_)]
- )
- >> (+(brackets_1_5 | ('\\' >> anychar_p) | (anychar_p - (str_p("..") | '[' | ']'))))
- [actions.template_arg]
- ;
-
- template_inner_arg_1_5 =
- +(brackets_1_5 | ('\\' >> anychar_p) | (anychar_p - (str_p('[') | ']')))
- ;
-
- brackets_1_5 =
- '[' >> template_inner_arg_1_5 >> ']'
- ;
-
- inline_code =
- '`' >>
- (
- *(anychar_p -
- ( '`'
- | (eol >> eol) // Make sure that we don't go
- ) // past a single block
- ) >> eps_p('`')
- ) [actions.inline_code]
- >> '`'
- ;
-
- code_block =
- (
- "```" >>
- (
- *(anychar_p - "```")
- >> eps_p("```")
- ) [actions.code_block]
- >> "```"
- )
- | (
- "``" >>
- (
- *(anychar_p - "``")
- >> eps_p("``")
- ) [actions.code_block]
- >> "``"
- )
- ;
-
- simple_format =
- simple_bold
- | simple_italic
- | simple_underline
- | simple_teletype
- ;
-
- simple_phrase_end = '[' | phrase_end;
-
- simple_markup(simple_bold,
- '*', actions.simple_bold, simple_phrase_end);
- simple_markup(simple_italic,
- '/', actions.simple_italic, simple_phrase_end);
- simple_markup(simple_underline,
- '_', actions.simple_underline, simple_phrase_end);
- simple_markup(simple_teletype,
- '=', actions.simple_teletype, simple_phrase_end);
-
- phrase =
- *( common
- | comment
- | (anychar_p - phrase_end) [actions.plain_char]
- )
- ;
-
- phrase_markup =
- '['
- >> ( cond_phrase
- | image
- | url
- | link
- | anchor
- | source_mode
- | funcref
- | classref
- | memberref
- | enumref
- | macroref
- | headerref
- | conceptref
- | globalref
- | bold
- | italic
- | underline
- | teletype
- | strikethrough
- | quote
- | replaceable
- | footnote
- | template_ [actions.do_template]
- | str_p("br") [actions.break_]
- )
- >> ']'
- ;
-
- escape =
- str_p("\\ ") // ignore an escaped space
- | '\\' >> punct_p [actions.raw_char]
- | "\\u" >> repeat_p(4) [chset<>("0-9a-fA-F")]
- [actions.escape_unicode]
- | "\\U" >> repeat_p(8) [chset<>("0-9a-fA-F")]
- [actions.escape_unicode]
- | (
- ("'''" >> !eol) [actions.escape_pre]
- >> *(anychar_p - "'''") [actions.raw_char]
- >> str_p("'''") [actions.escape_post]
- )
- ;
-
- macro_identifier =
- +(anychar_p - (space_p | ']'))
- ;
-
- cond_phrase =
- '?' >> blank
- >> macro_identifier [actions.cond_phrase_pre]
- >> (!phrase) [actions.cond_phrase_post]
- ;
-
- image =
- '$' >> blank [clear_a(actions.attributes)]
- >> if_p(qbk_since(105u)) [
- (+(
- *space_p
- >> +(anychar_p - (space_p | phrase_end | '['))
- )) [assign_a(actions.image_fileref)]
- >> hard_space
- >> *(
- '['
- >> (*(alnum_p | '_')) [assign_a(actions.attribute_name)]
- >> space
- >> (*(anychar_p - (phrase_end | '[')))
- [actions.attribute]
- >> ']'
- >> space
- )
- ].else_p [
- (*(anychar_p -
- phrase_end)) [assign_a(actions.image_fileref)]
- ]
- >> eps_p(']') [actions.image]
- ;
-
- url =
- '@'
- >> (*(anychar_p -
- (']' | hard_space))) [actions.url_pre]
- >> ( eps_p(']')
- | (hard_space >> phrase)
- ) [actions.url_post]
- ;
-
- link =
- "link" >> hard_space
- >> (*(anychar_p -
- (']' | hard_space))) [actions.link_pre]
- >> ( eps_p(']')
- | (hard_space >> phrase)
- ) [actions.link_post]
- ;
-
- anchor =
- '#'
- >> blank
- >> ( *(anychar_p -
- phrase_end)
- ) [actions.anchor]
- ;
-
- funcref =
- "funcref" >> hard_space
- >> (*(anychar_p -
- (']' | hard_space))) [actions.funcref_pre]
- >> ( eps_p(']')
- | (hard_space >> phrase)
- ) [actions.funcref_post]
- ;
-
- classref =
- "classref" >> hard_space
- >> (*(anychar_p -
- (']' | hard_space))) [actions.classref_pre]
- >> ( eps_p(']')
- | (hard_space >> phrase)
- ) [actions.classref_post]
- ;
-
- memberref =
- "memberref" >> hard_space
- >> (*(anychar_p -
- (']' | hard_space))) [actions.memberref_pre]
- >> ( eps_p(']')
- | (hard_space >> phrase)
- ) [actions.memberref_post]
- ;
-
- enumref =
- "enumref" >> hard_space
- >> (*(anychar_p -
- (']' | hard_space))) [actions.enumref_pre]
- >> ( eps_p(']')
- | (hard_space >> phrase)
- ) [actions.enumref_post]
- ;
-
- macroref =
- "macroref" >> hard_space
- >> (*(anychar_p -
- (']' | hard_space))) [actions.macroref_pre]
- >> ( eps_p(']')
- | (hard_space >> phrase)
- ) [actions.macroref_post]
- ;
-
- headerref =
- "headerref" >> hard_space
- >> (*(anychar_p -
- (']' | hard_space))) [actions.headerref_pre]
- >> ( eps_p(']')
- | (hard_space >> phrase)
- ) [actions.headerref_post]
- ;
-
- conceptref =
- "conceptref" >> hard_space
- >> (*(anychar_p -
- (']' | hard_space))) [actions.conceptref_pre]
- >> ( eps_p(']')
- | (hard_space >> phrase)
- ) [actions.conceptref_post]
- ;
-
- globalref =
- "globalref" >> hard_space
- >> (*(anychar_p -
- (']' | hard_space))) [actions.globalref_pre]
- >> ( eps_p(']')
- | (hard_space >> phrase)
- ) [actions.globalref_post]
- ;
-
- bold =
- ch_p('*') [actions.bold_pre]
- >> blank >> phrase [actions.bold_post]
- ;
-
- italic =
- ch_p('\'') [actions.italic_pre]
- >> blank >> phrase [actions.italic_post]
- ;
-
- underline =
- ch_p('_') [actions.underline_pre]
- >> blank >> phrase [actions.underline_post]
- ;
-
- teletype =
- ch_p('^') [actions.teletype_pre]
- >> blank >> phrase [actions.teletype_post]
- ;
-
- strikethrough =
- ch_p('-') [actions.strikethrough_pre]
- >> blank >> phrase [actions.strikethrough_post]
- ;
-
- quote =
- ch_p('"') [actions.quote_pre]
- >> blank >> phrase [actions.quote_post]
- ;
-
- replaceable =
- ch_p('~') [actions.replaceable_pre]
- >> blank >> phrase [actions.replaceable_post]
- ;
-
- source_mode =
- (
- str_p("c++")
- | "python"
- | "teletype"
- ) [assign_a(actions.source_mode)]
- ;
-
- footnote =
- str_p("footnote") [actions.footnote_pre]
- >> blank >> phrase [actions.footnote_post]
- ;
- }
-
     template <typename Scanner>
     struct simple_phrase_grammar::definition
     {
@@ -533,21 +83,21 @@
         start() const { return macro; }
     };
 
- template <typename Iterator, typename Grammar>
- parse_info<Iterator> parse(Iterator& first, Iterator last, Grammar& g)
+ parse_info<iterator> call_parse(
+ iterator& first, iterator last, phrase_grammar& g)
     {
         return boost::spirit::classic::parse(first, last, g);
     }
 
- void instantiate_phrase_grammar(quickbook::iterator i, phrase_grammar& g) {
- parse(i, i, g);
- }
-
- void instantiate_simple_phrase_grammar(quickbook::iterator i, simple_phrase_grammar& g) {
- parse(i, i, g);
+ parse_info<iterator> call_parse(
+ iterator& first, iterator last, simple_phrase_grammar& g)
+ {
+ return boost::spirit::classic::parse(first, last, g);
     }
 
- void instantiate_command_line_grammar(quickbook::iterator i, command_line_grammar& g) {
- parse(i, i, g);
+ parse_info<iterator> call_parse(
+ iterator& first, iterator last, command_line_grammar& g)
+ {
+ return boost::spirit::classic::parse(first, last, g);
     }
 }

Modified: trunk/tools/quickbook/src/phrase_grammar.hpp
==============================================================================
--- trunk/tools/quickbook/src/phrase_grammar.hpp (original)
+++ trunk/tools/quickbook/src/phrase_grammar.hpp 2010-08-29 07:20:24 EDT (Sun, 29 Aug 2010)
@@ -11,10 +11,55 @@
 #define BOOST_SPIRIT_QUICKBOOK_PHRASE_HPP
 
 #include "grammar.hpp"
+#include "actions_class.hpp"
+#include "quickbook.hpp"
+#include "utils.hpp"
+#include <boost/spirit/include/classic_core.hpp>
+#include <boost/spirit/include/classic_confix.hpp>
+#include <boost/spirit/include/classic_chset.hpp>
+#include <boost/spirit/include/classic_assign_actor.hpp>
+#include <boost/spirit/include/classic_clear_actor.hpp>
+#include <boost/spirit/include/classic_if.hpp>
+#include <boost/spirit/include/classic_loops.hpp>
 
 namespace quickbook
 {
     namespace cl = boost::spirit::classic;
+ using namespace boost::spirit::classic;
+
+ template <typename Rule, typename Action>
+ inline void
+ simple_markup(
+ Rule& simple
+ , char mark
+ , Action const& action
+ , Rule const& close
+ )
+ {
+ simple =
+ mark >>
+ (
+ (
+ graph_p // A single char. e.g. *c*
+ >> eps_p(mark
+ >> (space_p | punct_p | end_p))
+ // space_p, punct_p or end_p
+ ) // must follow mark
+ |
+ ( graph_p >> // graph_p must follow mark
+ *(anychar_p -
+ ( (graph_p >> mark) // Make sure that we don't go
+ | close // past a single block
+ )
+ ) >> graph_p // graph_p must precede mark
+ >> eps_p(mark
+ >> (space_p | punct_p | end_p))
+ // space_p, punct_p or end_p
+ ) // must follow mark
+ ) [action]
+ >> mark
+ ;
+ }
 
     template <typename Scanner>
     struct phrase_grammar::definition
@@ -40,6 +85,410 @@
         cl::rule<Scanner> const&
         start() const { return common; }
     };
+
+ template <typename Scanner>
+ phrase_grammar::definition<Scanner>::definition(phrase_grammar const& self)
+ {
+ using detail::var;
+ quickbook::actions& actions = self.actions;
+
+ space =
+ *(space_p | comment)
+ ;
+
+ blank =
+ *(blank_p | comment)
+ ;
+
+ eol = blank >> eol_p
+ ;
+
+ phrase_end =
+ ']' |
+ if_p(var(self.no_eols))
+ [
+ eol >> eol // Make sure that we don't go
+ ] // past a single block, except
+ ; // when preformatted.
+
+ hard_space =
+ (eps_p - (alnum_p | '_')) >> space // must not be preceded by
+ ; // alpha-numeric or underscore
+
+ comment =
+ "[/" >> *(dummy_block | (anychar_p - ']')) >> ']'
+ ;
+
+ dummy_block =
+ '[' >> *(dummy_block | (anychar_p - ']')) >> ']'
+ ;
+
+ common =
+ macro
+ | phrase_markup
+ | code_block
+ | inline_code
+ | simple_format
+ | escape
+ | comment
+ ;
+
+ macro =
+ eps_p(actions.macro // must not be followed by
+ >> (eps_p - (alpha_p | '_'))) // alpha or underscore
+ >> actions.macro [actions.do_macro]
+ ;
+
+ static const bool true_ = true;
+ static const bool false_ = false;
+
+ template_ =
+ (
+ ch_p('`') [assign_a(actions.template_escape,true_)]
+ |
+ eps_p [assign_a(actions.template_escape,false_)]
+ )
+ >>
+ ( (
+ (eps_p(punct_p)
+ >> actions.templates.scope
+ ) [assign_a(actions.template_identifier)]
+ [clear_a(actions.template_args)]
+ >> !template_args
+ ) | (
+ (actions.templates.scope
+ >> eps_p(hard_space)
+ ) [assign_a(actions.template_identifier)]
+ [clear_a(actions.template_args)]
+ >> space
+ >> !template_args
+ ) )
+ >> eps_p(']')
+ ;
+
+ template_args =
+ if_p(qbk_since(105u)) [
+ template_args_1_5
+ ].else_p [
+ template_args_1_4
+ ]
+ ;
+
+ template_args_1_4 = template_arg_1_4 >> *(".." >> template_arg_1_4);
+
+ template_arg_1_4 =
+ ( eps_p(*blank_p >> eol_p) [assign_a(actions.template_block, true_)]
+ | eps_p [assign_a(actions.template_block, false_)]
+ )
+ >> template_inner_arg_1_4 [actions.template_arg]
+ ;
+
+ template_inner_arg_1_4 =
+ +(brackets_1_4 | (anychar_p - (str_p("..") | ']')))
+ ;
+
+ brackets_1_4 =
+ '[' >> template_inner_arg_1_4 >> ']'
+ ;
+
+ template_args_1_5 = template_arg_1_5 >> *(".." >> template_arg_1_5);
+
+ template_arg_1_5 =
+ ( eps_p(*blank_p >> eol_p) [assign_a(actions.template_block, true_)]
+ | eps_p [assign_a(actions.template_block, false_)]
+ )
+ >> (+(brackets_1_5 | ('\\' >> anychar_p) | (anychar_p - (str_p("..") | '[' | ']'))))
+ [actions.template_arg]
+ ;
+
+ template_inner_arg_1_5 =
+ +(brackets_1_5 | ('\\' >> anychar_p) | (anychar_p - (str_p('[') | ']')))
+ ;
+
+ brackets_1_5 =
+ '[' >> template_inner_arg_1_5 >> ']'
+ ;
+
+ inline_code =
+ '`' >>
+ (
+ *(anychar_p -
+ ( '`'
+ | (eol >> eol) // Make sure that we don't go
+ ) // past a single block
+ ) >> eps_p('`')
+ ) [actions.inline_code]
+ >> '`'
+ ;
+
+ code_block =
+ (
+ "```" >>
+ (
+ *(anychar_p - "```")
+ >> eps_p("```")
+ ) [actions.code_block]
+ >> "```"
+ )
+ | (
+ "``" >>
+ (
+ *(anychar_p - "``")
+ >> eps_p("``")
+ ) [actions.code_block]
+ >> "``"
+ )
+ ;
+
+ simple_format =
+ simple_bold
+ | simple_italic
+ | simple_underline
+ | simple_teletype
+ ;
+
+ simple_phrase_end = '[' | phrase_end;
+
+ simple_markup(simple_bold,
+ '*', actions.simple_bold, simple_phrase_end);
+ simple_markup(simple_italic,
+ '/', actions.simple_italic, simple_phrase_end);
+ simple_markup(simple_underline,
+ '_', actions.simple_underline, simple_phrase_end);
+ simple_markup(simple_teletype,
+ '=', actions.simple_teletype, simple_phrase_end);
+
+ phrase =
+ *( common
+ | comment
+ | (anychar_p - phrase_end) [actions.plain_char]
+ )
+ ;
+
+ phrase_markup =
+ '['
+ >> ( cond_phrase
+ | image
+ | url
+ | link
+ | anchor
+ | source_mode
+ | funcref
+ | classref
+ | memberref
+ | enumref
+ | macroref
+ | headerref
+ | conceptref
+ | globalref
+ | bold
+ | italic
+ | underline
+ | teletype
+ | strikethrough
+ | quote
+ | replaceable
+ | footnote
+ | template_ [actions.do_template]
+ | str_p("br") [actions.break_]
+ )
+ >> ']'
+ ;
+
+ escape =
+ str_p("\\ ") // ignore an escaped space
+ | '\\' >> punct_p [actions.raw_char]
+ | "\\u" >> repeat_p(4) [chset<>("0-9a-fA-F")]
+ [actions.escape_unicode]
+ | "\\U" >> repeat_p(8) [chset<>("0-9a-fA-F")]
+ [actions.escape_unicode]
+ | (
+ ("'''" >> !eol) [actions.escape_pre]
+ >> *(anychar_p - "'''") [actions.raw_char]
+ >> str_p("'''") [actions.escape_post]
+ )
+ ;
+
+ macro_identifier =
+ +(anychar_p - (space_p | ']'))
+ ;
+
+ cond_phrase =
+ '?' >> blank
+ >> macro_identifier [actions.cond_phrase_pre]
+ >> (!phrase) [actions.cond_phrase_post]
+ ;
+
+ image =
+ '$' >> blank [clear_a(actions.attributes)]
+ >> if_p(qbk_since(105u)) [
+ (+(
+ *space_p
+ >> +(anychar_p - (space_p | phrase_end | '['))
+ )) [assign_a(actions.image_fileref)]
+ >> hard_space
+ >> *(
+ '['
+ >> (*(alnum_p | '_')) [assign_a(actions.attribute_name)]
+ >> space
+ >> (*(anychar_p - (phrase_end | '[')))
+ [actions.attribute]
+ >> ']'
+ >> space
+ )
+ ].else_p [
+ (*(anychar_p -
+ phrase_end)) [assign_a(actions.image_fileref)]
+ ]
+ >> eps_p(']') [actions.image]
+ ;
+
+ url =
+ '@'
+ >> (*(anychar_p -
+ (']' | hard_space))) [actions.url_pre]
+ >> ( eps_p(']')
+ | (hard_space >> phrase)
+ ) [actions.url_post]
+ ;
+
+ link =
+ "link" >> hard_space
+ >> (*(anychar_p -
+ (']' | hard_space))) [actions.link_pre]
+ >> ( eps_p(']')
+ | (hard_space >> phrase)
+ ) [actions.link_post]
+ ;
+
+ anchor =
+ '#'
+ >> blank
+ >> ( *(anychar_p -
+ phrase_end)
+ ) [actions.anchor]
+ ;
+
+ funcref =
+ "funcref" >> hard_space
+ >> (*(anychar_p -
+ (']' | hard_space))) [actions.funcref_pre]
+ >> ( eps_p(']')
+ | (hard_space >> phrase)
+ ) [actions.funcref_post]
+ ;
+
+ classref =
+ "classref" >> hard_space
+ >> (*(anychar_p -
+ (']' | hard_space))) [actions.classref_pre]
+ >> ( eps_p(']')
+ | (hard_space >> phrase)
+ ) [actions.classref_post]
+ ;
+
+ memberref =
+ "memberref" >> hard_space
+ >> (*(anychar_p -
+ (']' | hard_space))) [actions.memberref_pre]
+ >> ( eps_p(']')
+ | (hard_space >> phrase)
+ ) [actions.memberref_post]
+ ;
+
+ enumref =
+ "enumref" >> hard_space
+ >> (*(anychar_p -
+ (']' | hard_space))) [actions.enumref_pre]
+ >> ( eps_p(']')
+ | (hard_space >> phrase)
+ ) [actions.enumref_post]
+ ;
+
+ macroref =
+ "macroref" >> hard_space
+ >> (*(anychar_p -
+ (']' | hard_space))) [actions.macroref_pre]
+ >> ( eps_p(']')
+ | (hard_space >> phrase)
+ ) [actions.macroref_post]
+ ;
+
+ headerref =
+ "headerref" >> hard_space
+ >> (*(anychar_p -
+ (']' | hard_space))) [actions.headerref_pre]
+ >> ( eps_p(']')
+ | (hard_space >> phrase)
+ ) [actions.headerref_post]
+ ;
+
+ conceptref =
+ "conceptref" >> hard_space
+ >> (*(anychar_p -
+ (']' | hard_space))) [actions.conceptref_pre]
+ >> ( eps_p(']')
+ | (hard_space >> phrase)
+ ) [actions.conceptref_post]
+ ;
+
+ globalref =
+ "globalref" >> hard_space
+ >> (*(anychar_p -
+ (']' | hard_space))) [actions.globalref_pre]
+ >> ( eps_p(']')
+ | (hard_space >> phrase)
+ ) [actions.globalref_post]
+ ;
+
+ bold =
+ ch_p('*') [actions.bold_pre]
+ >> blank >> phrase [actions.bold_post]
+ ;
+
+ italic =
+ ch_p('\'') [actions.italic_pre]
+ >> blank >> phrase [actions.italic_post]
+ ;
+
+ underline =
+ ch_p('_') [actions.underline_pre]
+ >> blank >> phrase [actions.underline_post]
+ ;
+
+ teletype =
+ ch_p('^') [actions.teletype_pre]
+ >> blank >> phrase [actions.teletype_post]
+ ;
+
+ strikethrough =
+ ch_p('-') [actions.strikethrough_pre]
+ >> blank >> phrase [actions.strikethrough_post]
+ ;
+
+ quote =
+ ch_p('"') [actions.quote_pre]
+ >> blank >> phrase [actions.quote_post]
+ ;
+
+ replaceable =
+ ch_p('~') [actions.replaceable_pre]
+ >> blank >> phrase [actions.replaceable_post]
+ ;
+
+ source_mode =
+ (
+ str_p("c++")
+ | "python"
+ | "teletype"
+ ) [assign_a(actions.source_mode)]
+ ;
+
+ footnote =
+ str_p("footnote") [actions.footnote_pre]
+ >> blank >> phrase [actions.footnote_post]
+ ;
+ }
 }
 
 #endif // BOOST_SPIRIT_QUICKBOOK_PHRASE_HPP

Modified: trunk/tools/quickbook/src/quickbook.cpp
==============================================================================
--- trunk/tools/quickbook/src/quickbook.cpp (original)
+++ trunk/tools/quickbook/src/quickbook.cpp 2010-08-29 07:20:24 EDT (Sun, 29 Aug 2010)
@@ -57,7 +57,7 @@
             iterator_type first(it->begin(), it->end(), "command line parameter");
             iterator_type last(it->end(), it->end());
 
- parse(first, last, grammar);
+ call_parse(first, last, grammar);
             // TODO: Check result?
         }
     }
@@ -86,14 +86,14 @@
         iterator_type last(storage.end(), storage.end());
 
         doc_info_grammar l(actor);
- parse_info<iterator_type> info = parse(first, last, l);
+ parse_info<iterator_type> info = call_parse(first, last, l);
 
         if (info.hit || ignore_docinfo)
         {
             pre(actor.out, actor, ignore_docinfo);
 
             block_grammar g(actor);
- info = parse(info.hit ? info.stop : first, last, g);
+ info = call_parse(info.hit ? info.stop : first, last, g);
             if (info.full)
             {
                 post(actor.out, actor, ignore_docinfo);


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk