13 while (is.good() && !is.eof())
15 const int bufferSize = 10240;
16 char buffer[bufferSize];
17 is.read(buffer,bufferSize);
18 const int size = is.gcount();
20 dest.insert(dest.end(),buffer,buffer+size);
24int main(
int argc,
char* argv[])
28 std::cerr <<
"Needs exactly one argument" << std::endl;
31 namespace qi = boost::spirit::qi;
32 namespace ascii = boost::spirit::ascii;
34 typedef std::string::const_iterator iterator_type;
40 std::ifstream file(argv[1], std::ifstream::binary);
43 std::string::const_iterator iter = str.begin();
44 std::string::const_iterator end = str.end();
49 r = phrase_parse(iter, end, tokenizer_parser,
skipper, automaton);
53 std::cout <<
"Parsing succeeded: "<<automaton.size()<<
" states" << std::endl;
57 std::string rest(iter, end);
58 std::cout <<
"Parsing failed. Stopped at: \": " << rest <<
"\"\n";