Boost logo

Boost :

From: Andreas Pokorny (andreas.pokorny_at_[hidden])
Date: 2005-05-02 10:12:34


On Wed, Apr 27, 2005 at 04:51:58PM -0700, Eric Niebler <eric_at_[hidden]> wrote:
> The new release of xpressive is available now. It represents a complete
> rewrite of all of xpressive's meta-programming. This is an important
> milestone on the way to 1.0. I encourage anybody who has been using
> xpressive to grab the latest version and let me know of any problems.

Looks nice!
Could it be possible to write up a small template framework to create
scanners for spirit with xpressive?

I could love a syntax like:

template<typename IteratorT>
struct my_scanner<IteratorT> : public boost::xpressive<my_scanner<IteratorT> >
{
  struct result_type : public boost::xpressive_variant<string, int,
                       pair<IteratorT,IteratorT> >
  {};
  
  enum token_type {
    number,
    literal
  };
    
  struct scanner_definition
  {
    scanner_definition()
    {
      //pseudocode:
      matcher<string,literal> = as_xpr('"') >> _ >> '"';
      matcher<int,number> = range('0', '9');
      // ...
    }
  };
};

Another thing: I always thought one should not use identifier names
starting with an underscore like: "_b"?

Andreas Pokorny


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