Boost logo

Boost Users :

From: Dan Nuffer (nuffer_at_[hidden])
Date: 2003-05-26 19:56:07


I have two grammars defined (value and variable). I'll paste value here, variable is very similar:

struct value : public grammar<value>
{
        template <typename ScannerT>
        struct definition
        {
                definition(value const &self)
                {
                        val = real_p[&do_real] | ('-' >> val)[&do_neg] | '+' >> val;
                }
                
                rule<ScannerT> val;
                rule<ScannerT> const &start() const
                {
                        return val;
                }
        };
};

Now I want to define a grammar that uses both of these, for instance part of it might be (value | variable)... how can I do this? Thanks.

_____________________________________________________________
<a href="http://www.gamedev.net">GameDev.net Email Service</a> - "Plenty of 1's and 0's"

_____________________________________________________________
Select your own custom email address for FREE! Get you_at_[hidden] w/No Ads, 6MB, POP & more! http://www.everyone.net/selectmail?campaign=tag


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net