Boost logo

Boost :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2003-05-30 00:43:54


Hi Daryle,

Daryle Walker wrote:

> [I wrote this half-asleep a few days ago. You could add things like
> signals/slots, better list management, etc. Take this suggestion as a
> very general guideline, not as actual code to use.]
>
> I haven't looked at the command-line/config library under review right
> now. I have seen recent discussions over its design, though. Here's
> my idea for such a library; maybe it'll inspire somebody:

Honestly, I'm a bit upset. You first say that haven't looked at my library,
and then go ahead and write down some long proposal. Is this supposed to be
in some respects better than what I propose? If so, could you explain?

> 1. Let's start with a container for the actual command line arguments:
>
> template < typename Ch = char, class Tr = std::char_traits<Ch> >
> struct arguments
> {
> typedef std::basic_string<Ch, Tr> string_type;

[snip lots of code].

If I understand correctly, the idea is simple. For each command line
element, you call several "rules". Each one can declare the element as
consumed. The ones which declare element as consumed are then called to
finalize argument.

Is it the same idea that I explain (less verbosely), in
http://article.gmane.org/gmane.comp.lib.boost.devel/20588/

   It would be possible to pack all styles supported by 'cmdline' as
   separate 'style parsers'.

The idea was the all style parsers would be run on next token, and one will
succeed.

- Volodya


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk