OSDN Git Service

lexical, roast_xml: よしっ、素晴らしい出来た。表示まで出来たぞッ!!
authorMyun2 <myun2@nwhite.info>
Sat, 24 Jul 2010 03:51:11 +0000 (12:51 +0900)
committerMyun2 <myun2@nwhite.info>
Sat, 24 Jul 2010 03:51:11 +0000 (12:51 +0900)
roast/include/roast/lexical/parser_base.hpp
roast/include/roast/lexical/structure_base.hpp
roast/include/roast/xml/roast_xml/roast_xml_sax_parser.hpp
roast/test/lexical_test/parser_test.cpp

index df7cc62..de5979a 100644 (file)
@@ -5,7 +5,7 @@
 #define __SFJP_ROAST__lexical__parser_base_HPP__
 
 #include "roast/lexical/base.hpp"
-#include "roast/lexical/declaration_base.hpp"
+#include "roast/lexical/structure_base.hpp"
 
 namespace roast
 {
@@ -35,7 +35,7 @@ namespace roast
 
                                }*/
                                _Document doc;
-                               doc.analyze(m_it);
+                               doc.analyze(m_it, doc);
                                return doc;
                        }
                };
index 7afad87..e51e273 100644 (file)
@@ -476,7 +476,7 @@ namespace roast
                                        get_string_end_by_analyze_true<T, _It> gs;
                                        if ( gs.analyze(it, param) == false )
                                                return false;
-                                       ///
+                                       param << ::std::make_pair( gs.start_it, gs.end_it );
                                        return true;
                                }
                        };
index 1770faa..710b7de 100644 (file)
@@ -14,15 +14,19 @@ namespace roast
        {
                ////////////////////////////////////////////////////////////////
 
-               /*class sax_parser_impl
+               class sax_parser_impl : public _structure
                {
                public:
-                       bool analyze(const char* s)
+                       void operator << ( ::std::pair<
+                               roast::_linear_iterator_arithmetic<roast::ccharbuf_iterator>,
+                               roast::_linear_iterator_arithmetic<roast::ccharbuf_iterator> > &p)
                        {
-                               return true;
+                               sized_ptr_<const char> str(&*p.first, p.second - p.first);
+                               sized_ccharbuf cb(str.ptr, str.size);
+                               printf( cb.to_string().c_str() );
                        }
-               };*/
-               typedef _structure sax_parser_impl;
+               };
+               //typedef _structure sax_parser_impl;
 
                ////////////////////////////////////////////////////////////////
 
index 5b26e31..2930877 100644 (file)
@@ -6,11 +6,15 @@
 using namespace roast;
 using namespace roast::lexical;
 
+#define BUFF_SIZE              20*1024*1024
+
 int main()
 {
        FILE* fp = fopen("temp.xml","r");
-       char work[256];
-       fread(work,sizeof(work),1,fp);
+       //char work[256];
+       //fread(work,sizeof(work),1,fp);
+       char *work = new char [BUFF_SIZE];
+       fread(work,BUFF_SIZE,1,fp);
 
        //roast_xml::dom_parser wss("aaa");
        roast_xml::sax_parser sax(work);