|
Boost : |
From: Joel de Guzman (djowel_at_[hidden])
Date: 2002-10-12 00:28:47
----- Original Message -----
From: "Carl Daniel" <cpdaniel_at_[hidden]>
> More nits:
>
> Exception classes thrown by Spirit (parser_error<>, illegal_backtracking)
> don't derive from std::exception - shouldn't they?
I'm not sure. Should it? What will be the benefits in doing so?
The truth is, I'm not quite happy with the standard C++ exceptions.
For one, it's hard coded the what() to be a string.
Perhaps the language lawyers will correct me if I'm lost. :-)
> parser_error<> derives from parser_error_base, but illegal_backtracking
> (multi_pass.hpp) doesn't - shouldn't it?
Multi-pass is designed to be independent from Spirit. Doing
so will make it dependent.
> fixed_size_queue (usable with multi_pass_iterator) silently fails if too
> much source text is pushed. Wouldn't throwing an exception be more
> appropriate?
The fixed sized queue is designed to be used in cases where the lookahead
is known. There are lots of grammars that require only very limited lookahead
for example; many times, only 1. In such cases, a fixed lookahead is
guaranteed not to be overrun. fixed_size_queue is optional however.
If the user is unsure, she can always use the std::queue.
--Joel
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk