anchor.diff:  
   (defstruct atn
     (table (make-hash-table))
  -  (rules (make-hash-table)))
  +  (rules (make-hash-table))
  +  (extra (make-hash-table)))
   
   ;;; Rule
   
  -(defstruct rule
  -  state
  -  options)
  +(eval-when (:compile-toplevel :load-toplevel)
  +  (defun make-et-accessor (raw-accessor element-getter)
  +    (let ((et-accessor (symbolicate "@" raw-accessor)))
  +      `(progn
  +         (defun ,et-accessor (rule)
  +           (,raw-accessor (,element-getter rule)))
  +         (export ',et-accessor)
  +         (define-setf-expander ,et-accessor (x &environment env)
  +           (multiple-value-bind (dummies vals newval setter getter)
  +               (get-setf-expansion x env)
  +             (declare (ignorable newval setter))
  +             (let ((store (gensym)))
  +               (values dummies
  +                       vals
  +                       `(,store)
  +                       `(progn (setf (,',raw-accessor (,',element-getter ,getter)) ,store) ,store)
  +                       `(,',et-accessor ,getter)))))))))
  +
  +(defmacro defrule (name direct-superclasses direct-slots &rest options)
  +  (let ((accessors (mapcar (lambda (slot)
  +                             (getf (rest slot) :accessor))
  +                           direct-slots)))
  +    `(progn
  +       (defclass ,name ,direct-superclasses
  +         ,direct-slots
  +         ,@options)
  +       ,@(mapcar (rcurry #'make-et-accessor '@get-rule) accessors))))
  +
  +(defrule rule ()
  +  ((state :accessor rule-state
  +          :initarg :state)
  +   (options :accessor rule-options
  +            :initarg :options)))
   
   ;;; Possible states
   
  -(defclass state ()
  +(defmacro defstate (name direct-superclasses direct-slots &rest options)
  +  (let ((accessors (mapcar (lambda (slot)
  +                             (getf (rest slot) :accessor))
  +                           direct-slots)))
  +    `(progn
  +       (defclass ,name ,direct-superclasses
  +         ,direct-slots
  +         ,@options)
  +       ,@(mapcar (rcurry #'make-et-accessor '@get-state) accessors))))
  +
  +(defstate state ()
     ((cond :accessor state-cond
            :initarg :cond
            :initform t)
  
positive.code: 
             #:with-atn
  
             #:@add-state
             #:@state-type
             #:@add-rule
             #:@state-type
             #:@state-cond
             #:@state-nexts
             #:@state-call-to
             #:@state-end-type
             #:@state-end-options
             #:@get-rule
             #:@rule-state
             #:@rule-options
             #:@typep
             #:@rem-rule
             #:@rem-state
             #:@states
             #:@state-nexts-without-end
             #:@state-end-state
             #:delayed-rule
  
             #:with-visiting
  
negative.code: 
             #:def-state-generic
             #:def-state-method
             #:def-rule-generic
             #:def-rule-method
  
             #:atn->dot
             #:@atn->dot))
  