-
Notifications
You must be signed in to change notification settings - Fork 1
/
qi.cpp
30 lines (26 loc) · 1.14 KB
/
qi.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include "common.h"
#include "strategies.h"
#include <boost/spirit/include/qi.hpp>
#include <iostream>
namespace qi = boost::spirit::qi;
namespace strategies
{
template <typename data_t, typename source_it>
size_t qi_phrase_parse<data_t, source_it>::parse(source_it f, source_it l, data_t& data) const {
using namespace qi;
bool ok = phrase_parse(f,l,(double_ > double_ > double_) % eol, blank, data);
#ifdef DEBUG
if (ok)
std::cout << "parse success\n";
else
std::cerr << "parse failed: '" << std::string(f,l) << "'\n";
if (f!=l) std::cerr << "trailing unparsed: '" << std::string(f,l) << "'\n";
std::cout << "data.size(): " << data.size() << "\n";
#endif
return data.size();
}
template struct qi_phrase_parse<std::vector<float>, char const*>;
template struct qi_phrase_parse<std::vector<float>, std::vector<char>::const_iterator>;
template struct qi_phrase_parse<std::vector<data::float3>, char const*>;
template struct qi_phrase_parse<std::vector<data::float3>, std::vector<char>::const_iterator>;
}