Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r69175 - branches/quickbook-filenames/tools/quickbook/src
From: dnljms_at_[hidden]
Date: 2011-02-22 15:36:53


Author: danieljames
Date: 2011-02-22 15:36:46 EST (Tue, 22 Feb 2011)
New Revision: 69175
URL: http://svn.boost.org/trac/boost/changeset/69175

Log:
Phrase elements.
Added:
   branches/quickbook-filenames/tools/quickbook/src/phrase_tags.hpp (contents, props changed)
Text files modified:
   branches/quickbook-filenames/tools/quickbook/src/actions.cpp | 123 +++++++++++++++++-----------
   branches/quickbook-filenames/tools/quickbook/src/actions.hpp | 77 ------------------
   branches/quickbook-filenames/tools/quickbook/src/actions_class.cpp | 32 -------
   branches/quickbook-filenames/tools/quickbook/src/actions_class.hpp | 32 -------
   branches/quickbook-filenames/tools/quickbook/src/markups.cpp | 27 ++++++
   branches/quickbook-filenames/tools/quickbook/src/markups.hpp | 3
   branches/quickbook-filenames/tools/quickbook/src/phrase_element_grammar.cpp | 166 ++++++---------------------------------
   7 files changed, 132 insertions(+), 328 deletions(-)

Modified: branches/quickbook-filenames/tools/quickbook/src/actions.cpp
==============================================================================
--- branches/quickbook-filenames/tools/quickbook/src/actions.cpp (original)
+++ branches/quickbook-filenames/tools/quickbook/src/actions.cpp 2011-02-22 15:36:46 EST (Tue, 22 Feb 2011)
@@ -25,6 +25,7 @@
 #include "input_path.hpp"
 #include "template_tags.hpp"
 #include "block_tags.hpp"
+#include "phrase_tags.hpp"
 
 namespace quickbook
 {
@@ -60,6 +61,10 @@
     void xinclude_action(quickbook::actions&, value);
     void import_action(quickbook::actions&, value);
     void include_action(quickbook::actions&, value);
+ void image_action(quickbook::actions&, value);
+ void anchor_action(quickbook::actions&, value);
+ void link_action(quickbook::actions&, value);
+ void phrase_action_(quickbook::actions&, value);
 
     void element_action::operator()(iterator first, iterator) const
     {
@@ -105,6 +110,30 @@
             return import_action(actions, v);
         case block_tags::include:
             return include_action(actions, v);
+ case phrase_tags::image:
+ return image_action(actions, v);
+ case phrase_tags::anchor:
+ return anchor_action(actions, v);
+ case phrase_tags::url:
+ case phrase_tags::link:
+ case phrase_tags::funcref:
+ case phrase_tags::classref:
+ case phrase_tags::memberref:
+ case phrase_tags::enumref:
+ case phrase_tags::macroref:
+ case phrase_tags::headerref:
+ case phrase_tags::conceptref:
+ case phrase_tags::globalref:
+ return link_action(actions, v);
+ case phrase_tags::bold:
+ case phrase_tags::italic:
+ case phrase_tags::underline:
+ case phrase_tags::teletype:
+ case phrase_tags::strikethrough:
+ case phrase_tags::quote:
+ case phrase_tags::replaceable:
+ case phrase_tags::footnote:
+ return phrase_action_(actions, v);
         default:
             break;
         }
@@ -159,14 +188,6 @@
         ++actions.error_count;
     }
 
- void tagged_action::operator()(iterator, iterator) const
- {
- if(!actions.output_pre(out)) return;
-
- value_consumer values = actions.values.get();
- out << pre << values.consume().get_boostbook() << post;
- }
-
     void block_action(quickbook::actions& actions, value block)
     {
         if(!actions.output_pre(actions.out)) return;
@@ -186,6 +207,16 @@
         out << pre << str << post;
     }
 
+ void phrase_action_(quickbook::actions& actions, value phrase)
+ {
+ if(!actions.output_pre(actions.phrase)) return;
+ detail::markup markup = detail::markups[phrase.get_tag()];
+
+ value_consumer values = phrase;
+ actions.phrase << markup.pre << values.consume().get_boostbook() << markup.post;
+ assert(!values.is());
+ }
+
     void implicit_paragraph_action::operator()() const
     {
         if(actions.suppress) return;
@@ -439,10 +470,13 @@
         out << "</phrase>";
     }
 
- void anchor_action::operator()(iterator first, iterator last) const
+ void anchor_action(quickbook::actions& actions, value anchor)
     {
- if(!actions.suppress)
- actions.anchors.push_back(std::string(first, last));
+ if(actions.suppress) return;
+
+ value_consumer values = anchor;
+ actions.anchors.push_back(values.consume().get_quickbook());
+ assert(!values.is());
     }
 
     void do_macro_action::operator()(std::string const& str) const
@@ -584,14 +618,14 @@
         }
     }
 
- void image_action::operator()(iterator, iterator) const
+ void image_action(quickbook::actions& actions, value image)
     {
- if(!actions.output_pre(phrase)) return;
+ if(!actions.output_pre(actions.phrase)) return;
 
         typedef std::map<std::string, value> attribute_map;
         attribute_map attributes;
 
- value_consumer values = actions.values.get();
+ value_consumer values = image;
         attributes["fileref"] = values.consume();
 
         BOOST_FOREACH(value pair_, values)
@@ -717,13 +751,13 @@
            }
         }
 
- phrase << "<inlinemediaobject>";
+ actions.phrase << "<inlinemediaobject>";
 
- phrase << "<imageobject><imagedata";
+ actions.phrase << "<imageobject><imagedata";
         
         BOOST_FOREACH(attribute_map::value_type const& attr, attributes)
         {
- phrase << " " << attr.first << "=\"";
+ actions.phrase << " " << attr.first << "=\"";
 
             std::string value = attr.second.get_quickbook();
             for(std::string::const_iterator
@@ -731,21 +765,21 @@
                 first != last; ++first)
             {
                 if (*first == '\\' && ++first == last) break;
- detail::print_char(*first, phrase.get());
+ detail::print_char(*first, actions.phrase.get());
             }
 
- phrase << "\"";
+ actions.phrase << "\"";
         }
 
- phrase << "></imagedata></imageobject>";
+ actions.phrase << "></imagedata></imageobject>";
 
         // Add a textobject containing the alt tag from earlier.
         // This will be used for the alt tag in html.
- phrase << "<textobject><phrase>";
- detail::print_string(alt_text, phrase.get());
- phrase << "</phrase></textobject>";
+ actions.phrase << "<textobject><phrase>";
+ detail::print_string(alt_text, actions.phrase.get());
+ actions.phrase << "</phrase></textobject>";
 
- phrase << "</inlinemediaobject>";
+ actions.phrase << "</inlinemediaobject>";
     }
 
     void macro_definition_action(quickbook::actions& actions, quickbook::value macro_definition)
@@ -1205,27 +1239,26 @@
         --actions.template_depth;
     }
 
- void link_action::operator()(iterator first, iterator last) const
+ void link_action(quickbook::actions& actions, value link)
     {
- if(!actions.output_pre(phrase)) return;
+ if(!actions.output_pre(actions.phrase)) return;
+ detail::markup markup = detail::markups[link.get_tag()];
 
- iterator save = first;
- phrase << tag;
- while (first != last)
- detail::print_char(*first++, phrase.get());
- phrase << "\">";
+ value_consumer values = link;
+ value dst = values.consume();
+ value content = values.consume();
+ assert(!values.is());
+
+ actions.phrase << markup.pre;
+ detail::print_string(dst.get_quickbook(), actions.phrase.get());
+ actions.phrase << "\">";
 
- // Yes, it is safe to dereference last here. When we
- // reach here, *last is certainly valid. We test if
- // *last == ']'. In which case, the url is the text.
- // Example: [@http://spirit.sourceforge.net/]
+ if (content.is_empty())
+ detail::print_string(dst.get_quickbook(), actions.phrase.get());
+ else
+ actions.phrase << content.get_boostbook();
 
- if (*last == ']')
- {
- first = save;
- while (first != last)
- detail::print_char(*first++, phrase.get());
- }
+ actions.phrase << markup.post;
     }
 
     void variable_list_action(quickbook::actions& actions, value variable_list)
@@ -1637,14 +1670,6 @@
         //~ actions.templates = templates; $$$ fixme $$$
     }
 
- void phrase_to_string_action::operator()(iterator first, iterator last) const
- {
- if(!actions.output_pre(phrase)) return;
-
- out.clear();
- phrase.swap(out);
- }
-
     void phrase_to_docinfo_action_impl::operator()(iterator first, iterator last,
             value::tag_type tag) const
     {

Modified: branches/quickbook-filenames/tools/quickbook/src/actions.hpp
==============================================================================
--- branches/quickbook-filenames/tools/quickbook/src/actions.hpp (original)
+++ branches/quickbook-filenames/tools/quickbook/src/actions.hpp 2011-02-22 15:36:46 EST (Tue, 22 Feb 2011)
@@ -117,26 +117,6 @@
         quickbook::actions& actions;
     };
 
- struct tagged_action
- {
- tagged_action(
- collector& out,
- std::string const& pre,
- std::string const& post,
- quickbook::actions& actions)
- : out(out)
- , pre(pre)
- , post(post)
- , actions(actions) {}
-
- void operator()(iterator, iterator) const;
-
- collector& out;
- std::string pre;
- std::string post;
- quickbook::actions& actions;
- };
-
     struct phrase_action
     {
         // blurb, blockquote, preformatted, list_item,
@@ -311,18 +291,6 @@
         quickbook::actions& actions;
     };
 
- struct anchor_action
- {
- // Handles anchors
-
- anchor_action(quickbook::actions& actions)
- : actions(actions) {}
-
- void operator()(iterator first, iterator last) const;
-
- quickbook::actions& actions;
- };
-
     extern char const* quickbook_get_date;
     extern char const* quickbook_get_time;
 
@@ -422,22 +390,6 @@
         quickbook::actions& actions;
     };
 
- struct image_action
- {
- // Handles inline images
-
- image_action(
- collector& phrase
- , quickbook::actions& actions)
- : phrase(phrase)
- , actions(actions) {}
-
- void operator()(iterator first, iterator last) const;
-
- collector& phrase;
- quickbook::actions& actions;
- };
-
     struct markup_action
     {
         // A generic markup action
@@ -528,23 +480,6 @@
         quickbook::actions& actions;
     };
 
- struct link_action
- {
- // Handles links (URL, XML refentry, function, class, member)
-
- link_action(
- collector& phrase,
- char const* tag,
- quickbook::actions& actions)
- : phrase(phrase), tag(tag), actions(actions) {}
-
- void operator()(iterator first, iterator last) const;
-
- collector& phrase;
- char const* tag;
- quickbook::actions& actions;
- };
-
    struct element_id_warning_action
    {
         element_id_warning_action(quickbook::actions& actions_)
@@ -558,18 +493,6 @@
     void pre(collector& out, quickbook::actions& actions, bool ignore_docinfo = false);
     void post(collector& out, quickbook::actions& actions, bool ignore_docinfo = false);
 
- struct phrase_to_string_action
- {
- phrase_to_string_action(std::string& out, collector& phrase, quickbook::actions& actions)
- : out(out) , phrase(phrase), actions(actions) {}
-
- void operator()(iterator first, iterator last) const;
-
- std::string& out;
- collector& phrase;
- quickbook::actions& actions;
- };
-
     struct phrase_to_docinfo_action_impl
     {
         template <typename Arg1, typename Arg2, typename Arg3 = void>

Modified: branches/quickbook-filenames/tools/quickbook/src/actions_class.cpp
==============================================================================
--- branches/quickbook-filenames/tools/quickbook/src/actions_class.cpp (original)
+++ branches/quickbook-filenames/tools/quickbook/src/actions_class.cpp 2011-02-22 15:36:46 EST (Tue, 22 Feb 2011)
@@ -79,38 +79,11 @@
         , plain_char(phrase, *this)
         , raw_char(phrase, *this)
         , escape_unicode(phrase, *this)
- , image(phrase, *this)
 
         , list(out, list_buffer, list_indent, list_marks, *this)
         , list_format(list_buffer, list_indent, list_marks, error_count, *this)
         , list_item(list_buffer, phrase, list_item_pre, list_item_post, *this)
 
- , funcref_pre(phrase, funcref_pre_, *this)
- , funcref_post(phrase, funcref_post_, *this)
- , classref_pre(phrase, classref_pre_, *this)
- , classref_post(phrase, classref_post_, *this)
- , memberref_pre(phrase, memberref_pre_, *this)
- , memberref_post(phrase, memberref_post_, *this)
- , enumref_pre(phrase, enumref_pre_, *this)
- , enumref_post(phrase, enumref_post_, *this)
- , macroref_pre(phrase, macroref_pre_, *this)
- , macroref_post(phrase, macroref_post_, *this)
- , headerref_pre(phrase, headerref_pre_, *this)
- , headerref_post(phrase, headerref_post_, *this)
- , conceptref_pre(phrase, conceptref_pre_, *this)
- , conceptref_post(phrase, conceptref_post_, *this)
- , globalref_pre(phrase, globalref_pre_, *this)
- , globalref_post(phrase, globalref_post_, *this)
-
- , bold(phrase, bold_pre_, bold_post_, *this)
- , italic(phrase, italic_pre_, italic_post_, *this)
- , underline(phrase, underline_pre_, underline_post_, *this)
- , teletype(phrase, teletype_pre_, teletype_post_, *this)
- , strikethrough(phrase, strikethrough_pre_, strikethrough_post_, *this)
- , quote(phrase, quote_pre_, quote_post_, *this)
- , replaceable(phrase, replaceable_pre_, replaceable_post_, *this)
- , footnote(phrase, footnote_pre_, footnote_post_, *this)
-
         , simple_bold(phrase, bold_pre_, bold_post_, macro, *this)
         , simple_italic(phrase, italic_pre_, italic_post_, macro, *this)
         , simple_underline(phrase, underline_pre_, underline_post_, macro, *this)
@@ -120,11 +93,6 @@
         , break_(phrase, *this)
         , do_macro(phrase, *this)
         , do_template(*this)
- , url_pre(phrase, url_pre_, *this)
- , url_post(phrase, url_post_, *this)
- , link_pre(phrase, link_pre_, *this)
- , link_post(phrase, link_post_, *this)
- , anchor(*this)
 
         , element_id_warning(*this)
 

Modified: branches/quickbook-filenames/tools/quickbook/src/actions_class.hpp
==============================================================================
--- branches/quickbook-filenames/tools/quickbook/src/actions_class.hpp (original)
+++ branches/quickbook-filenames/tools/quickbook/src/actions_class.hpp 2011-02-22 15:36:46 EST (Tue, 22 Feb 2011)
@@ -123,38 +123,11 @@
         plain_char_action plain_char;
         raw_char_action raw_char;
         escape_unicode_action escape_unicode;
- image_action image;
 
         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;
- link_action macroref_pre;
- markup_action macroref_post;
- link_action headerref_pre;
- markup_action headerref_post;
- link_action conceptref_pre;
- markup_action conceptref_post;
- link_action globalref_pre;
- markup_action globalref_post;
-
- tagged_action bold;
- tagged_action italic;
- tagged_action underline;
- tagged_action teletype;
- tagged_action strikethrough;
- tagged_action quote;
- tagged_action replaceable;
- tagged_action footnote;
-
         simple_phrase_action simple_bold;
         simple_phrase_action simple_italic;
         simple_phrase_action simple_underline;
@@ -164,11 +137,6 @@
         break_action break_;
         do_macro_action do_macro;
         do_template_action do_template;
- link_action url_pre;
- markup_action url_post;
- link_action link_pre;
- markup_action link_post;
- anchor_action anchor;
 
         element_id_warning_action element_id_warning;
 

Modified: branches/quickbook-filenames/tools/quickbook/src/markups.cpp
==============================================================================
--- branches/quickbook-filenames/tools/quickbook/src/markups.cpp (original)
+++ branches/quickbook-filenames/tools/quickbook/src/markups.cpp 2011-02-22 15:36:46 EST (Tue, 22 Feb 2011)
@@ -11,7 +11,9 @@
 #include "quickbook.hpp"
 #include "markups.hpp"
 #include "block_tags.hpp"
+#include "phrase_tags.hpp"
 #include <boost/foreach.hpp>
+#include <ostream>
 
 namespace quickbook
 {
@@ -104,7 +106,25 @@
                 { block_tags::caution, caution_pre, caution_post },
                 { block_tags::important, important_pre, important_post },
                 { block_tags::note, note_pre, note_post },
- { block_tags::tip, tip_pre, tip_post }
+ { block_tags::tip, tip_pre, tip_post },
+ { phrase_tags::url, url_pre_, url_post_ },
+ { phrase_tags::link, link_pre_, link_post_ },
+ { phrase_tags::funcref, funcref_pre_, funcref_post_ },
+ { phrase_tags::classref, classref_pre_, classref_post_ },
+ { phrase_tags::memberref, memberref_pre_, memberref_post_ },
+ { phrase_tags::enumref, enumref_pre_, enumref_post_ },
+ { phrase_tags::macroref, macroref_pre_, macroref_post_ },
+ { phrase_tags::headerref, headerref_pre_, headerref_post_ },
+ { phrase_tags::conceptref, conceptref_pre_, conceptref_post_ },
+ { phrase_tags::globalref, globalref_pre_, globalref_post_ },
+ { phrase_tags::bold, bold_pre_, bold_post_ },
+ { phrase_tags::italic, italic_pre_, italic_post_ },
+ { phrase_tags::underline, underline_pre_, underline_post_ },
+ { phrase_tags::teletype, teletype_pre_, teletype_post_ },
+ { phrase_tags::strikethrough, strikethrough_pre_, strikethrough_post_ },
+ { phrase_tags::quote, quote_pre_, quote_post_ },
+ { phrase_tags::replaceable, replaceable_pre_, replaceable_post_ },
+ { phrase_tags::footnote, footnote_pre_, footnote_post_ }
             };
 
             BOOST_FOREACH(markup m, init_markups)
@@ -112,5 +132,10 @@
                 markups[m.tag] = m;
             }
         }
+
+ std::ostream& operator<<(std::ostream& out, markup const& m)
+ {
+ return out<<"{"<<m.tag<<": \""<<m.pre<<"\", \""<<m.post<<"\"}";
+ }
     }
 }

Modified: branches/quickbook-filenames/tools/quickbook/src/markups.hpp
==============================================================================
--- branches/quickbook-filenames/tools/quickbook/src/markups.hpp (original)
+++ branches/quickbook-filenames/tools/quickbook/src/markups.hpp 2011-02-22 15:36:46 EST (Tue, 22 Feb 2011)
@@ -11,6 +11,7 @@
 #define BOOST_SPIRIT_MARKUPS_HPP
 
 #include <map>
+#include <iosfwd>
 #include "values.hpp"
 
 namespace quickbook
@@ -111,6 +112,8 @@
         };
         
         extern std::map<value::tag_type, markup> markups;
+
+ std::ostream& operator<<(std::ostream&, markup const&);
     }
 }
 

Modified: branches/quickbook-filenames/tools/quickbook/src/phrase_element_grammar.cpp
==============================================================================
--- branches/quickbook-filenames/tools/quickbook/src/phrase_element_grammar.cpp (original)
+++ branches/quickbook-filenames/tools/quickbook/src/phrase_element_grammar.cpp 2011-02-22 15:36:46 EST (Tue, 22 Feb 2011)
@@ -11,6 +11,7 @@
 #include "grammar_impl.hpp"
 #include "actions_class.hpp"
 #include "utils.hpp"
+#include "phrase_tags.hpp"
 #include <boost/spirit/include/classic_core.hpp>
 #include <boost/spirit/include/classic_assign_actor.hpp>
 #include <boost/spirit/include/classic_clear_actor.hpp>
@@ -25,13 +26,8 @@
     struct phrase_element_grammar_local
     {
         cl::rule<scanner>
- image,
- bold, italic, underline, teletype,
- strikethrough, url, funcref, classref,
- memberref, enumref, macroref, headerref, conceptref, globalref,
- anchor, link,
+ image, anchor, link, url,
                         source_mode_cpp, source_mode_python, source_mode_teletype,
- quote, footnote, replaceable,
                         cond_phrase, inner_phrase
                         ;
     };
@@ -54,7 +50,7 @@
             ;
 
         elements.add
- ("$", element_info(element_info::phrase, &local.image))
+ ("$", element_info(element_info::phrase, &local.image, phrase_tags::image))
             ;
 
         local.image =
@@ -79,159 +75,60 @@
                         (*(cl::anychar_p - phrase_end))
                                                 [actions.values.entry(ph::arg1, ph::arg2)]
                 ]
- >> cl::eps_p(']') [actions.image]
+ >> cl::eps_p(']')
             ;
             
         elements.add
- ("@", element_info(element_info::phrase, &local.url))
+ ("@", element_info(element_info::phrase, &local.url, phrase_tags::url))
             ;
 
         local.url =
- (*(cl::anychar_p -
- (']' | hard_space))) [actions.url_pre]
+ (*(cl::anychar_p - (']' | hard_space)))
+ [actions.values.entry(ph::arg1, ph::arg2)]
>> hard_space
- >> phrase [actions.url_post]
+ >> local.inner_phrase
             ;
 
         elements.add
- ("link", element_info(element_info::phrase, &local.link))
+ ("link", element_info(element_info::phrase, &local.link, phrase_tags::link))
             ;
 
         local.link =
                 space
>> (*(cl::anychar_p - (']' | hard_space)))
- [actions.link_pre]
+ [actions.values.entry(ph::arg1, ph::arg2)]
>> hard_space
- >> phrase [actions.link_post]
+ >> local.inner_phrase
             ;
 
         elements.add
- ("#", element_info(element_info::phrase, &local.anchor))
+ ("#", element_info(element_info::phrase, &local.anchor, phrase_tags::anchor))
             ;
 
         local.anchor =
                 blank
- >> (*(cl::anychar_p - phrase_end)) [actions.anchor]
+ >> (*(cl::anychar_p - phrase_end)) [actions.values.entry(ph::arg1, ph::arg2)]
             ;
 
         elements.add
- ("funcref", element_info(element_info::phrase, &local.funcref))
- ("classref", element_info(element_info::phrase, &local.classref))
- ("memberref", element_info(element_info::phrase, &local.memberref))
- ("enumref", element_info(element_info::phrase, &local.enumref))
- ("macroref", element_info(element_info::phrase, &local.macroref))
- ("headerref", element_info(element_info::phrase, &local.headerref))
- ("conceptref", element_info(element_info::phrase, &local.conceptref))
- ("globalref", element_info(element_info::phrase, &local.globalref))
- ;
-
- local.funcref =
- space
- >> (*(cl::anychar_p -
- (']' | hard_space))) [actions.funcref_pre]
- >> hard_space
- >> phrase [actions.funcref_post]
- ;
-
- local.classref =
- space
- >> (*(cl::anychar_p -
- (']' | hard_space))) [actions.classref_pre]
- >> hard_space
- >> phrase [actions.classref_post]
- ;
-
- local.memberref =
- space
- >> (*(cl::anychar_p -
- (']' | hard_space))) [actions.memberref_pre]
- >> hard_space
- >> phrase [actions.memberref_post]
- ;
-
- local.enumref =
- space
- >> (*(cl::anychar_p -
- (']' | hard_space))) [actions.enumref_pre]
- >> hard_space
- >> phrase [actions.enumref_post]
- ;
-
- local.macroref =
- space
- >> (*(cl::anychar_p -
- (']' | hard_space))) [actions.macroref_pre]
- >> hard_space
- >> phrase [actions.macroref_post]
- ;
-
- local.headerref =
- space
- >> (*(cl::anychar_p -
- (']' | hard_space))) [actions.headerref_pre]
- >> hard_space
- >> phrase [actions.headerref_post]
- ;
-
- local.conceptref =
- space
- >> (*(cl::anychar_p -
- (']' | hard_space))) [actions.conceptref_pre]
- >> hard_space
- >> phrase [actions.conceptref_post]
- ;
-
- local.globalref =
- space
- >> (*(cl::anychar_p -
- (']' | hard_space))) [actions.globalref_pre]
- >> hard_space
- >> phrase [actions.globalref_post]
+ ("funcref", element_info(element_info::phrase, &local.link, phrase_tags::funcref))
+ ("classref", element_info(element_info::phrase, &local.link, phrase_tags::classref))
+ ("memberref", element_info(element_info::phrase, &local.link, phrase_tags::memberref))
+ ("enumref", element_info(element_info::phrase, &local.link, phrase_tags::enumref))
+ ("macroref", element_info(element_info::phrase, &local.link, phrase_tags::macroref))
+ ("headerref", element_info(element_info::phrase, &local.link, phrase_tags::headerref))
+ ("conceptref", element_info(element_info::phrase, &local.link, phrase_tags::conceptref))
+ ("globalref", element_info(element_info::phrase, &local.link, phrase_tags::globalref))
             ;
 
         elements.add
- ("*", element_info(element_info::phrase, &local.bold))
- ("'", element_info(element_info::phrase, &local.italic))
- ("_", element_info(element_info::phrase, &local.underline))
- ("^", element_info(element_info::phrase, &local.teletype))
- ("-", element_info(element_info::phrase, &local.strikethrough))
- ("\"", element_info(element_info::phrase, &local.quote))
- ("~", element_info(element_info::phrase, &local.replaceable))
- ;
-
- local.bold =
- blank
- >> local.inner_phrase [actions.bold]
- ;
-
- local.italic =
- blank
- >> local.inner_phrase [actions.italic]
- ;
-
- local.underline =
- blank
- >> local.inner_phrase [actions.underline]
- ;
-
- local.teletype =
- blank
- >> local.inner_phrase [actions.teletype]
- ;
-
- local.strikethrough =
- blank
- >> local.inner_phrase [actions.strikethrough]
- ;
-
- local.quote =
- blank
- >> local.inner_phrase [actions.quote]
- ;
-
- local.replaceable =
- blank
- >> local.inner_phrase [actions.replaceable]
+ ("*", element_info(element_info::phrase, &local.inner_phrase, phrase_tags::bold))
+ ("'", element_info(element_info::phrase, &local.inner_phrase, phrase_tags::italic))
+ ("_", element_info(element_info::phrase, &local.inner_phrase, phrase_tags::underline))
+ ("^", element_info(element_info::phrase, &local.inner_phrase, phrase_tags::teletype))
+ ("-", element_info(element_info::phrase, &local.inner_phrase, phrase_tags::strikethrough))
+ ("\"", element_info(element_info::phrase, &local.inner_phrase, phrase_tags::quote))
+ ("~", element_info(element_info::phrase, &local.inner_phrase, phrase_tags::replaceable))
             ;
 
         elements.add
@@ -245,12 +142,7 @@
         local.source_mode_teletype = cl::eps_p [cl::assign_a(actions.source_mode, "teletype")];
 
         elements.add
- ("footnote", element_info(element_info::phrase, &local.footnote))
- ;
-
- local.footnote =
- blank
- >> local.inner_phrase [actions.footnote]
+ ("footnote", element_info(element_info::phrase, &local.inner_phrase, phrase_tags::footnote))
             ;
 
         local.inner_phrase =

Added: branches/quickbook-filenames/tools/quickbook/src/phrase_tags.hpp
==============================================================================
--- (empty file)
+++ branches/quickbook-filenames/tools/quickbook/src/phrase_tags.hpp 2011-02-22 15:36:46 EST (Tue, 22 Feb 2011)
@@ -0,0 +1,26 @@
+/*=============================================================================
+ Copyright (c) 2011 Daniel James
+
+ 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_PHRASE_TAGS_HPP)
+#define BOOST_SPIRIT_QUICKBOOK_PHRASE_TAGS_HPP
+
+#include "value_tags.hpp"
+
+namespace quickbook
+{
+ QUICKBOOK_VALUE_TAGS(phrase_tags, 0x500,
+ (image)
+ (url)(link)(anchor)
+ (funcref)(classref)(memberref)(enumref)
+ (macroref)(headerref)(conceptref)(globalref)
+ (bold)(italic)(underline)(teletype)(strikethrough)(quote)(replaceable)
+ (footnote)
+ )
+}
+
+#endif


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