|
Boost : |
From: rogeeff (rogeeff_at_[hidden])
Date: 2002-01-18 14:58:18
--- In boost_at_y..., "Stewart, Robert" <stewart_at_s...> wrote:
> From: rogeeff [SMTP:rogeeff_at_m...]
> >
> > --- In boost_at_y..., "Stewart, Robert" <stewart_at_s...> wrote:
> > > > From: rogeeff [SMTP:rogeeff_at_m...]
> >
> > > of the CLA component. However, if the CLA is implemented using
> > Spirit, then
> > > any other parsing the programmer requires can use Spirit
without
> > any further
> > > impact on executable size (other than the parser-related logic
they
> > write,
> > > of course).
> >
> > It depends. Since Spirit is implemented inline every module that
uses
> > it will be affected.
>
> But the various template instantiations will be for common types
like bool,
> int, std::string, etc. Some things will not be well shared among the
> different uses of Spirit, but many things will be built upon common
pieces.
Is it written in standard? It depends on compiler implemntation.
>
> > > Obviously, if a custom -- not Spirit-implemented -- CLA were to
> > > depend upon other standard/Boost components, then the same
argument
> > holds;
> > > this doesn't apply to Spirit alone.
> >
> > Generic parser should not rely on ANY parser. It should not even
need
> > not know about existance such beast like complex parser. It can
[...]
> > handle fixed range of argument iddentification/value parsing
rules
> > (but wide enough to cover most of CLA parsing needs) and provide
an
> > abstract interface for user to add custom argument. This argument
> > encapsulate and implement somehow custon parsing logic, that
include
> > custom identification and custom value parse. That's it. And let
> > everybody decide whatever they want to use.
>
> Any interface that allows users to add custom argument handling
exposes some
> sort of parsing implementation.
That is a key point. This statement is false. class argument can have
interface like this:
class argument {
public:
virtual bool match( argv_stream_iterator it ) = 0;
virtual void construct( argv_stream_iterator it ) = 0;
};
argv_stream_iterator is an iterator over stream constructed from
argc,argv.
That's it. Framework has list of arguments and do something liek this:
while argv_stream is not empty
for each argument
{
if ( argument match ) {
if another argument match => error
construct argument
if fail to construct => error
break
}
}
[...]
>
> Rob
> Susquehanna International Group, LLP
> http://www.sig.com
Gennadiy.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk