|
Boost : |
From: Joel de Guzman (djowel_at_[hidden])
Date: 2002-10-13 07:58:52
----- Original Message -----
From: "Hartmut Kaiser" <hartmutkaiser_at_[hidden]>
> Joel de Guzman wrote:
>
> > Another solution that I seem to like would be to simply revert to
> > v1.3 behavior while still using smart pointers. Then, an auxilliary
> > class rule_holder<RuleT> can be used to hold rules for storage
> > in containers. The rule_holder manages the lifetime of the held
> > rule. You can get, set or reset the held rule.
>
> Is it really only a matter of inclsion of rule<>'s into some container?
> I'm not completly sure. If yes, your 2nd suggestion is the better one,
> because it's less intrusive and because it don't add features to the
> rule<>'s template, which aren't used very often. But if there are other
> situations, where copy sematics are required, the first suggestion may
> be preferable.
I think so. If you remember Carl Stoll's experiments on
dynamic parsers, his primary concern was how to store rules
in containers. He built a Spirit parser that parsed EBNF and
built rules on the fly. The rules had to be stored in stacks and
maps. It would be nice to complete the dynamic-spirit project.
I can imagine this plus boost.function (for semantic actions)
would be an awesome pair.
On the other hand, if you think that it should be more than
just being a simple container of rules, then it would be easy
to make it act like a parser. Just ask the embedded rule to
do its task.
Regards,
--Joel
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk