Nesting Grammars with boost::spirit
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@yourchoice.com w/No Ads, 6MB, POP & more! http://www.everyone.net/selectmail?campaign=tag
participants (1)
-
Dan Nuffer