Boost logo

Boost :

From: Korcan Hussein (korcan_h_at_[hidden])
Date: 2005-10-24 08:06:00


"Larry Evans" <cppljevans_at_[hidden]> wrote in message
news:djiene$hps$1_at_sea.gmane.org...
>
> I'm unfamiliar with polymorphic variants. Could you please give a brief
> explanation or reference? Is it any way related to the topic discussed
> here:
>
> http://groups.google.com/group/comp.std.c++/msg/8a90765a6e61ce82
>

OCaml supports normal varaint types and some called polymorphic types, i'm
not sure if i understood them correctly myself but from what i think
understand of them is that the set of (possible) types are not closed,
allows of for code-reuse etc but i might be wrong. OCaml's definition can be
found here: http://caml.inria.fr/pub/docs/manual-ocaml/manual012.html (in
the variant types section).

"Larry Evans" <cppljevans_at_[hidden]> wrote in message
news:djihj1$qnv$1_at_sea.gmane.org...
> On 10/24/2005 04:08 AM, Korcan Hussein wrote:
> [snip]
>> I relized this when i was reading Spirit's documentation. I did mention
>> from
>> the begining all terminal leaf node types must be given, like in an MPL
>
> What's a "terminal leaf node type"?
>

Sorry i couldn't think of a better term/word to use, but basically the types
of operands of an overloaded operator (excluding composite type). In the
case of Boost.Spirit these would be all the primitive parsers. As Joel de
Guzman was saying the problem is Boost.Spirit allows you to add not only new
primitive parsers but composite parsers too, it is open to extension.

>
> where Expression is some nonterminal in the grammar. Is Tp what
> you refer to as a "terminal leaf node type"?
>

Essentially yes, if this was generalized one way this could work is the user
gives a boost.mpl sequence of types of operands (possibly give a sequence
types for composite types depending on the context). Unfortunately this
doesn't scale to well for Boost.Spirit since new types of either kind could
be added later on which requires adding a new type to either type sequence
and then recompilation.


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