Boost logo

Boost :

From: rogeeff (rogeeff_at_[hidden])
Date: 2002-01-17 11:02:34


--- In boost_at_y..., Vladimir Prus <ghost_at_c...> wrote:
> joel de guzman wrote:
> > ----- Original Message -----
> > From: "Vladimir Prus"
> >
> > > The only question is if Spirit will make any much difference
for users
> > > that will justify making it a requirement. Yes, David Greene
expressed a
> > > wish for an elaborated command line syntax, but it remains to
be decided
> > > if it can'be be supported without using full-blown parser.
> >
> > That's exactly what David Held meant by reinventing
> > the wheel. We have the functionality here and now.
>
> I think we better stop this discussion, as it brings us nowhere. I
can use
> YACC, or ANTRL or Spirit or whatever. I won't use Spirit unless
I'm shown
> that Spirit is appropriate for the task. So far, no concrete
examples were
> shown.
>
> > > > Also, forgive me but why isn't nondeterministic RD not
> > > > acceptable for parsing command lines?
> > >
> > > Becase command line syntax can be ambiguious. Checking for those
> > > ambiguities and *documented* resolution of those resolvable are
a must.
> > > Can
> > > nonterministic parsing give me that?
> >
> > I don't see a reason why not. I think you got this one
incorrectly.
> > You are looking at the parser while instead you should be looking
> > at the parser generated by the parser. Your grammar should be
> > the one to allow / disallow and check / ignore ambiguity.
>
> "-bar" can be interpreted, depending on the styles user wants
> as either:
> 1) Three short options
> 2) Short option followed by parameter
> 3) Long option
> Can you give an *example* of how this can be handled with Spirit.
>
> - Volodya

Since I still do not see relationship between generic parse and
Spirit (other than user can use it for custom argument implementation)
I agree an example would be extremly helpful. Here what I would like
to see:

main.cpp:

#include <boost/spirit/spirit.hpp> // or whatever I need to include
                                   // with current version od Spirit

int main( int argc, char* argv[] )
{
   // Here I would like to see the definition of CLA parser that
   // will accept following options:
   // -repeat_number <integer value>
   // -roll
   // -help
   // substrings are accepted (i.e. -repeat 3 should pass)
   // -help should automatically generate usage message to std::cout
   // it also should be generated in case of parsing errors like
   // -rep 3.5

   // ...

   // Here I would like to see How will I parse using the parser
   // defined
 
   // ...

   // Here I would like to see CLA values access

   // ...
}

In addition I would like to see how would I access CLA value from
different file in my project:

second.cpp:
#include ??

void foo()
{
   // Here I would like to see CLA values access

   // ...
}

Also it would be helpful to estimate size of headers that will need
to be inclued and number of template instantiations (approximately at
least)

Gennadiy.


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