Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r75525 - branches/quickbook-dev/tools/quickbook/src
From: dnljms_at_[hidden]
Date: 2011-11-17 16:03:07


Author: danieljames
Date: 2011-11-17 16:03:06 EST (Thu, 17 Nov 2011)
New Revision: 75525
URL: http://svn.boost.org/trac/boost/changeset/75525

Log:
Quickbook: Split up the doc info parser.
Text files modified:
   branches/quickbook-dev/tools/quickbook/src/doc_info_grammar.cpp | 60 ++++++++++++++++++++++++----------------
   1 files changed, 36 insertions(+), 24 deletions(-)

Modified: branches/quickbook-dev/tools/quickbook/src/doc_info_grammar.cpp
==============================================================================
--- branches/quickbook-dev/tools/quickbook/src/doc_info_grammar.cpp (original)
+++ branches/quickbook-dev/tools/quickbook/src/doc_info_grammar.cpp 2011-11-17 16:03:06 EST (Thu, 17 Nov 2011)
@@ -67,6 +67,7 @@
         };
 
         cl::rule<scanner>
+ doc_info_block, doc_attribute, doc_info_attribute,
                         doc_title, doc_simple, doc_phrase, doc_fallback,
                         doc_authors, doc_author,
                         doc_copyright, doc_copyright_holder,
@@ -112,44 +113,55 @@
         
         doc_info_details =
                 space
- >> *( '['
- >> space
- >> local.doc_attributes [local.assign_attribute]
- >> hard_space
- >> actions.values.list(ph::var(local.attribute_tag))
- [ cl::eps_p [actions.values.entry(ph::arg1, ph::arg2, doc_info_tags::before_docinfo)]
- >> local.attribute_rule
- ]
- >> space
- >> ']'
+ >> *( local.doc_attribute
>> space
                 )
- >> '['
+ >> local.doc_info_block
+ ;
+
+ local.doc_info_block =
+ '['
>> space
>> (local.doc_types >> cl::eps_p)
                                             [actions.values.entry(ph::arg1, ph::arg2, doc_info_tags::type)]
>> hard_space
>> actions.to_value(doc_info_tags::title)
                 [ *(~cl::eps_p(cl::ch_p('[') | ']' | cl::eol_p) >> local.char_) ]
- >> *(
- space
- >> '['
+ >> space
+ >> (*( local.doc_info_attribute
>> space
- >> ( local.doc_info_attributes
+ )) [actions.values.sort()]
+ >> ']'
+ >> (+eol | cl::end_p)
+ ;
+
+ local.doc_attribute =
+ '['
+ >> space
+ >> local.doc_attributes [local.assign_attribute]
+ >> hard_space
+ >> actions.values.list(ph::var(local.attribute_tag))
+ [ cl::eps_p [actions.values.entry(ph::arg1, ph::arg2, doc_info_tags::before_docinfo)]
+ >> local.attribute_rule
+ ]
+ >> space
+ >> ']'
+ ;
+
+ local.doc_info_attribute =
+ '['
+ >> space
+ >> ( local.doc_info_attributes
                                             [local.assign_attribute]
- | (+(cl::alnum_p | '_' | '-'))
+ | (+(cl::alnum_p | '_' | '-'))
                                             [local.fallback_attribute]
                                             [actions.error("Unrecognized document attribute: '%s'.")]
- )
- >> hard_space
- >> actions.values.list(ph::var(local.attribute_tag))
- [local.attribute_rule]
- >> space
- >> ']'
                 )
- >> space [actions.values.sort()]
+ >> hard_space
+ >> actions.values.list(ph::var(local.attribute_tag))
+ [local.attribute_rule]
+ >> space
>> ']'
- >> (+eol | cl::end_p)
             ;
 
         // TODO: Clear phrase afterwards?


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