Boost logo

Boost Users :

Subject: Re: [Boost-users] Simple fast parsing
From: Cory Nelson (phrosty_at_[hidden])
Date: 2009-06-21 17:48:02


Just write the parser to use forward iterators, then it is trivial to support any source you have.

-----Original Message-----
From: Christopher Jefferson <chris_at_[hidden]>
Sent: Sunday, June 21, 2009 1:28 PM
To: boost-users_at_[hidden]
Subject: [Boost-users] Simple fast parsing

I am currently using in a project a custom-writen recursive-decent
parser, which uses an filtering_istream so I can support compressed
input.

The only functionality used is peekchar, getchar and integer
extraction with 'stream >> i'.

I am finding that C++ streams, particularly when it comes to integer
extraction, are giving terrible performance. In a small test,
uncompressing to a buffer and then writing a simple custom reader on
that memory buffer gives 10x performance.

I would perfer not to write and support such a tool if possible. Is
there a boost library which easily supports a parser with 1 character
lookahead and simple things like integer extraction?

Looking at the documentation, Boost::Spirit seems like a very big
hammer to crack this quite small nut, and it is unclear to me how well
it would fit into an existing recursive decent parser. Has anyone ever
used it as such? Is there a simple alternative?

Chris
_______________________________________________
Boost-users mailing list
Boost-users_at_[hidden]
http://lists.boost.org/mailman/listinfo.cgi/boost-users


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net