From: Hartmut K. <har...@t-...> - 2004-10-05 00:49:07
|
Sonny Falk wrote: > I'm using Spirit 1.8.0. I noticed that there's no version of > ast_parse() that will accept a custom AstFactory without a > skip parser. Below is my code for such a version of > ast_parse(). My question now is, am I misssing something? > > template <typename AstFactoryT, typename IteratorT, typename > ParserT> inline tree_parse_info<IteratorT,AstFactoryT> > ast_parse( > IteratorT const& first_, > IteratorT const& last, > parser<ParserT> const& parser, > AstFactoryT const & /*dummy_*/ = AstFactoryT()) > { > IteratorT first = first_; > scanner< > IteratorT, > scanner_policies<iteration_policy, > ast_match_policy<IteratorT,AstFactoryT> > > > scan(first, last); > tree_match<IteratorT,AstFactoryT> hit = > parser.derived().parse(scan); > return tree_parse_info<IteratorT,AstFactoryT>(first, hit, > hit && (first == last), > hit.length(), hit.trees); > } That's an ommission, indeed. If you really think, that we should add this to the distro please provide not only the code patch, but the doc's patch as well. Is it possible for you to provide a test case for this function (maybe as an extension of the existing tests) or an example how to use this funtion as well? Regards Hartmut BTW the corresponding functionality for the parse tree related parse functions is missing as well. |