Listing 7: A rule's assignment operator
//  Copyright (c) 2001, Joel de Guzman and Dan Nuffer
//  Permission is granted to use this code without restriction as
//  long as this copyright notice appears in all source files.

template <typename ParserT>
rule& operator = (ParserT const& parser)
{
    assert(meta == 0);
    meta = new impl::concrete_parser<ParserT, IteratorT>(parser);
    return *this;
}