#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
{
}*/
_Document doc;
- doc.analyze(m_it);
+ doc.analyze(m_it, doc);
return doc;
}
};
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;
}
};
{
////////////////////////////////////////////////////////////////
- /*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;
////////////////////////////////////////////////////////////////
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);