$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-users] Simple fast parsing
From: Christopher Jefferson (chris_at_[hidden])
Date: 2009-06-21 16:28:54
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