[spirit::qi] assertion during parsing

Hello *, I have a strange problem. When parsing some output boost::spirit::qi parser aborts the application stating the following error message: /local/include/boost/spirit/home/support/char_encoding/ascii.hpp:256: static int boost::spirit::char_encoding::ascii::isspace(int): Assertion `isascii_(ch)' failed. Indeed my input sequence is: ~B"þ¯Þº~N But is it really a reason to assert the parser and crash the app? This input would not match my grammar, so from my point of view (as library user) it is just fine: not to match the input, without any assertions. And I should be able to decide what to do next. I use boost 1.44 with gcc (GCC) 3.4.6 20060404 (Red Hat 3.4.6-11) Many thanks for support, Ovanes

On 10/20/10 12:54 AM, Ovanes Markarian wrote:
Hello *,
I have a strange problem. When parsing some output boost::spirit::qi parser aborts the application stating the following error message: /local/include/boost/spirit/home/support/char_encoding/ascii.hpp:256: static int boost::spirit::char_encoding::ascii::isspace(int): Assertion `isascii_(ch)' failed.
Indeed my input sequence is: ~B"þ¯Þº~N
But is it really a reason to assert the parser and crash the app? This input would not match my grammar, so from my point of view (as library user) it is just fine: not to match the input, without any assertions. And I should be able to decide what to do next.
I use boost 1.44 with gcc (GCC) 3.4.6 20060404 (Red Hat 3.4.6-11)
There's a long thread about that. Long story short: just use iso8859_1 or standard. Regards, -- Joel de Guzman http://www.boostpro.com http://spirit.sf.net

On Wed, Oct 20, 2010 at 3:57 AM, Joel de Guzman
On 10/20/10 12:54 AM, Ovanes Markarian wrote:
Hello *, [...]
There's a long thread about that. Long story short: just use iso8859_1 or standard.
Regards, -- Joel de Guzman http://www.boostpro.com http://spirit.sf.net
Joel,
thanks for the answer. I unfortunatelly do not find the required header.
I tried to include #include

On Wed, Oct 20, 2010 at 9:50 AM, Ovanes Markarian
On Wed, Oct 20, 2010 at 3:57 AM, Joel de Guzman
wrote:
On 10/20/10 12:54 AM, Ovanes Markarian wrote:
Hello *, [...]
There's a long thread about that. Long story short: just use iso8859_1 or standard.
Regards, -- Joel de Guzman http://www.boostpro.com http://spirit.sf.net
Joel,
thanks for the answer. I unfortunatelly do not find the required header.
I tried to include #include
But compiler still blames: that namespace iso8859_1 is not found.
With Kind Regards, Ovanes
I opended the appropriate header boost/spirit/home/support/char_encoding/iso8859_1.hpp And see that iso8859_1 is a struct contained in boost::spirit::char_encoding namespace. But I still have compilation errors even with: using namespace boost::spirit::char_encoding::iso8859_1;

On Wed, Oct 20, 2010 at 10:03 AM, Ovanes Markarian
On Wed, Oct 20, 2010 at 9:50 AM, Ovanes Markarian
wrote: On Wed, Oct 20, 2010 at 3:57 AM, Joel de Guzman < joel@boost-consulting.com> wrote:
On 10/20/10 12:54 AM, Ovanes Markarian wrote:
Hello *, [...]
There's a long thread about that. Long story short: just use iso8859_1 or standard.
Regards, -- Joel de Guzman http://www.boostpro.com http://spirit.sf.net
Joel,
thanks for the answer. I unfortunatelly do not find the required header.
I tried to include #include
But compiler still blames: that namespace iso8859_1 is not found.
With Kind Regards, Ovanes
I opended the appropriate header boost/spirit/home/support/char_encoding/iso8859_1.hpp And see that iso8859_1 is a struct contained in boost::spirit::char_encoding namespace.
But I still have compilation errors even with: using namespace boost::spirit::char_encoding::iso8859_1;
Oh, I just had to use another namespace :( boost::spirit:iso8859_1.
One more problem, which arises is that I have to pass the space_type parameter to qi::grammar base class. It seems like boost::spirit::iso8859_1 does not contain a space_type. Many thanks, Ovanes

On Wed, Oct 20, 2010 at 10:19 AM, Ovanes Markarian
On Wed, Oct 20, 2010 at 10:03 AM, Ovanes Markarian
wrote:
On Wed, Oct 20, 2010 at 9:50 AM, Ovanes Markarian
wrote:
On Wed, Oct 20, 2010 at 3:57 AM, Joel de Guzman < joel@boost-consulting.com> wrote:
On 10/20/10 12:54 AM, Ovanes Markarian wrote:
Hello *, [...]
There's a long thread about that. Long story short: just use iso8859_1 or standard.
Regards, -- Joel de Guzman http://www.boostpro.com http://spirit.sf.net
Joel,
thanks for the answer. I unfortunatelly do not find the required header.
I tried to include #include
But compiler still blames: that namespace iso8859_1 is not found.
With Kind Regards, Ovanes
[...]
Oh, I just had to use another namespace :( boost::spirit:iso8859_1.
One more problem, which arises is that I have to pass the space_type parameter to qi::grammar base class. It seems like boost::spirit::iso8859_1 does not contain a space_type.
Sorry for the noise... the problem was that I mixed ascii::space (as phrase_parse parameter) and iso8859_1::space_type (as grammar template parameter). Now everything works great! With Kind Regards, Ovanes
participants (2)
-
Joel de Guzman
-
Ovanes Markarian