From: Myun2 Date: Sun, 25 Jul 2010 02:52:27 +0000 (+0900) Subject: lexical/structure_base.hpp: test Add. X-Git-Tag: 20111130_shapeup_prev~305 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=1a8133a11d93b22c06020e39bd49db6923b46411;p=roast%2Froast.git lexical/structure_base.hpp: test Add. roast_xml: テキストとかコメントとか --- diff --git a/roast/include/roast/lexical/structure_base.hpp b/roast/include/roast/lexical/structure_base.hpp index 5dad89c2..056985cc 100644 --- a/roast/include/roast/lexical/structure_base.hpp +++ b/roast/include/roast/lexical/structure_base.hpp @@ -34,6 +34,21 @@ namespace roast } }; + template + class test + { + public: + template + bool analyze(_It& it, _Param& param) + { + _It it_work = it; + T t; + return t.analyze(it, param); + } + }; + // Alias : test -> check + template class check : public test {}; + //////////////////////////////////////////////////////////////// /*template @@ -231,7 +246,7 @@ namespace roast //////////////////// template - class repeat + class repeat // optional_repeat { public: template diff --git a/roast/include/roast/xml/roast_xml/structure.hpp b/roast/include/roast/xml/roast_xml/structure.hpp index a2a76e4d..a2bafd71 100644 --- a/roast/include/roast/xml/roast_xml/structure.hpp +++ b/roast/include/roast/xml/roast_xml/structure.hpp @@ -61,6 +61,8 @@ namespace roast > // > > comment; + typedef repeat opt_comments; + /*class optcomm { };*/ @@ -99,37 +101,44 @@ namespace roast { };*/ typedef seq< - //get_string_end_by< lesser >, - //optional< comment >, + // comments repeat< comment >, - push_num<20>, - repeat< - seq, optional, - not< seq > > + + repeat< + seq< + // text body + push_num<20>, + get_string_end_by, + push_num<11>, + + // comments + repeat, + + // end when tag start. + test< not< + seq< + lesser, // < + not // not ! + > + > > > - >, - push_num<11> + > > text; // Element, Body - /*typedef normal_tag; - typedef empty_elem_tag; - typedef or tag;*/ - - /*typedef startend_element_impl; - typedef empty_element_impl; - typedef or element_impl;*/ - class element_; typedef seq< greater, + + // Texts and Elements. text, - //lesser, repeat< - seq< element_, text > + seq< _debug_print<21>,element_,_debug_print<211>, text, _debug_print<213> > >, + + _debug_print<1>, push_num<62>, // Close Tag Name start get_string_end_by< or >, noreqws, @@ -144,8 +153,8 @@ namespace roast push_num<11>, // Start Tag Name end attrs, or< - seq< slash, push_num<69> >, - startend_element_impl + seq< slash, push_num<69> >, // for Empty Element Tag + startend_element_impl // Normal Tag > > element_impl;