2011-06-13 18:46:03 +04:00
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#include "pcrepp.hh"
|
|
|
|
#include "data_scanner.hh"
|
2011-06-14 07:07:39 +04:00
|
|
|
#include "data_parser.hh"
|
2011-06-13 18:46:03 +04:00
|
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
pcre_context_static<30> pc;
|
|
|
|
|
|
|
|
data_scanner ds("a=1 b=2");
|
2011-06-14 07:07:39 +04:00
|
|
|
data_scanner ds2("a=1 b=2");
|
2011-06-13 18:46:03 +04:00
|
|
|
data_token_t token;
|
|
|
|
|
|
|
|
while (ds.tokenize(pc, token)) {
|
|
|
|
printf("tok %d %d:%d\n", token,
|
|
|
|
pc.begin()->c_begin,
|
|
|
|
pc.begin()->c_end);
|
|
|
|
}
|
2011-06-14 07:07:39 +04:00
|
|
|
|
|
|
|
data_parser dp(&ds2);
|
|
|
|
|
|
|
|
dp.parse();
|
2011-06-13 18:46:03 +04:00
|
|
|
}
|