Stephen Henry wrote:
Hi all,
I am having a problem with the following snippet of code. What I want to do is parse a line of alpha numeric characters from a file_iterator and then use the read characters to construct a new object which takes a std::string and integer argument for it's constructor. To do this I am using the statement below:
p >> (+alpha_p)[ create_dfa( self.m_dfa, construct_<DFA>( construct_std::string( arg1 ), var(500) ) ) ];
First of all, please post questions about spirit to gmane.comp.parsers.spirit.general! You forgot to make self.m_dfa lazy: p >> (+alpha_p) [ create_dfa( var(self.m_dfa), // <--- construct_<DFA>( construct_std::string( arg1 ), var(500) )) ];
This is the code I've got:
[...]
Script_parser p(vDFA); parser_info
info = parse( first, last, p );
This must be parse_info!
This doesn't even compile, and I have absolutely no idea why. All the compiler shows is pages and pages of garbage that means absolutely nothing. Please help!
I guess you have never really seen a compiler printing pages and pages... Cheers, Stefan