anchor.diff:  
     /**
      * Attaches an action [function] to an existing production [name]. The code
  -   * raises a [StateError] if [name] is an undefined production. Only call this
  -   * method from [initialize].
  +   * raises an [UndefinedProductionError] if [name] is an undefined production.
  +   * Only call this method from [initialize].
      *
      * The following example attaches an action returning the size of list of
      * the previously defined list production:
      *
      *     action('list', (list) => list.length);
  -   *
      */
     void action(String name, dynamic function(Dynamic)) {
       redef(name, (parser) => parser.map(function));
     }
   
   }
  +
  +/**
  + * Error raised when somebody tries to modify a [CompositeParser] outside
  + * the [CompositeParser#initialize] method.
  + */
  +class CompletedParserError implements Error {
  +  CompletedParserError();
  +  String toString() => 'Completed parser error';
  +}
  +
  +/**
  + * Error raised when an undefined production is accessed.
  + */
  +class UndefinedProductionError implements Error {
  +  final String name;
  +  UndefinedProductionError(this.name);
  +  String toString() => 'Undefined production: $name';
  +}
  +
  +/**
  + * Error raised when a production is accidentally redefined.
  + */
  +class RedefinedProductionError implements Error {
  +  final String name;
  +  RedefinedProductionError(this.name);
  +  String toString() => 'Redefined production: $name';
  +}
positive.code: 
    /**
     * Redefinies an existing production with a [name] and a [replacement]
     * parser or function producing a new parser. The code raises a [StateError]
     * if [name] is an undefined production. Only call this method from
     * [initialize].
     *
     * The following example redefines the previously defined list production
     * by making it optional:
  
negative.code:       if (_defined.containsKey(name)) {
          return _defined[name];
        } else {
          throw new UndefinedProductionError(name);
        }
      } else {
        return _undefined.putIfAbsent(name, () {
  