boost is not the problem. The problem is 2 files ... in boost: vector250 and vector100 each generates tens of thousands entries...
(both files are auto-generated)
On my machine, I have boost in the path, and it parses it un-noticable
But I am using the more standard headers: boost/shared_ptr.hpp and the like.
Can you give me an example of include files to add to my project so it will start parse like crazy?
EDIT: I tried to use the example code from wikipedia to boost.spirit and codelite parsed the files in < second
this is the code I was using:
Code: Select all
#include <boost/spirit.hpp>
#include <boost/spirit/actor.hpp>
#include <string>
#include <iostream>
using namespace std;
using namespace boost::spirit;
int main()
{
string input;
cout << "Input a line.\n";
getline(cin, input);
cout << "Got '" << input << "'.\n";
unsigned count = 0;
/*
Next line parses the input (input.c_str()),
using a parser constructed with the following semantics
(identation matches source for clarity):
Zero or more occurrences of (
literal string "cat" ( when matched, increment the counter "count" )
or any character (to move on finding the next occurrence of "cat")
)
*/
parse(input.c_str(),
*( str_p("cat") [ increment_a(count) ]
| anychar_p
));
/*
The parser is constructed by the compiler using operator
overloading and template matching, so the actual work is
done within spirit::parse(), and the expression starting
with * only initializes the rule object that the parse
function uses.
*/
// last, show results.
cout << "The input had " << count
<< " occurrences of 'cat'\n";
return 0;
}
Eran