anchor.diff:    (do* ((i 0 (+ i 1)) (ps productions (cdr ps)) (p (car ps) (car ps)))
          ((null ps))
       (setf (production-id p) i))
  -  (%make-grammar :name name :terminals terminals :precedence precedence
  -                 :productions productions))
  +  (let ((term-id 1)
  +        (terms (make-hash-table :test #'eq)))
  +    (dolist (term terminals)
  +      (setf (gethash term terms) term-id)
  +      (incf term-id))
  +    (%make-grammar :name name
  +                   :terminals terms
  +                   :precedence precedence
  +                   :productions productions)))
   
   (defun grammar-discard-memos (grammar)
     (setf (grammar-%symbols grammar) :undefined)
  -  (setf (grammar-derives-epsilon grammar) '())
  -  (setf (grammar-derives-first grammar) '())
  -  (setf (grammar-derives-first-terminal grammar) '()))
  -
  +  (setf (grammar-derives-epsilon grammar) (make-hash-table))
  +  (setf (grammar-derives-first grammar) (make-hash-table))
  +  (setf (grammar-derives-first-terminal grammar) (make-hash-table)))
  +
  +(declaim (inline terminal-p))
   (defun terminal-p (symbol grammar)
  +  (declare #.standard-optimize-settings)
     (declare (symbol symbol) (type grammar grammar))
     (or (eq symbol 'propagate)
  -      (and (member symbol (grammar-terminals grammar)) t)))
  +      (memhash symbol (grammar-terminals grammar))))
   
   (defun grammar-symbols (grammar)
     "The set of symbols (both terminal and nonterminal) of GRAMMAR."
  
positive.code:         (warn (make-condition 'conflict-summary-warning
                                :shift-reduce sr-conflicts
                                :reduce-reduce rr-conflicts)))
        (%make-parser numkernels goto action))))
  
  (defun make-parser (grammar
                      &key (discard-memos t) (muffle-conflicts nil)
  
negative.code: 
  (defun compute-all-lookaheads (kernels grammar)
    "Compute the LR(1) lookaheads for all the collections in KERNELS."
    (declare #.standard-optimize-settings)
    (declare (list kernels) (type grammar grammar))
    (setf (item-lookaheads (kernel-item (car kernels))) (list 'yacc-eof-symbol))
    (let ((previously-changed (make-hash-table :test #'eq))
          (changed (make-hash-table :test #'eq))
          (propagate-only nil))
      (dolist (kernel kernels)
        (addhash kernel previously-changed))
      (loop
        (dolist (kernel kernels)
          (when (memhash kernel previously-changed)
            (let ((lookaheads (compute-lookaheads kernel grammar propagate-only)))
              (declare (list lookaheads))
              (dolist (goto (kernel-gotos kernel))
                (declare (type goto goto))
                (let ((target (goto-target goto)) (new nil))
                  (flet ((new-lookahead (item lookahead)
                           (declare (type lr1-item item) (symbol lookahead))
                           (let ((i (find item (kernel-items target)
                                          :test #'item-equal-p)))
                             (when i
                               (unless (memq lookahead (item-lookaheads i))
                                 (push lookahead (item-lookaheads i))
                                 (setq new t))))))
                    (dolist (e lookaheads)
                      (let ((i (car e)) (ni (cdr e)))
                        (declare (type lr0-item i) (type lr1-item ni))
                        (cond
                          ((eq 'propagate (item-lookahead ni))
                           ;; propagate
                           (let ((item (find i (kernel-items kernel)
                                             :test #'item-equal-p)))
                             (when item
                               (dolist (s (item-lookaheads item))
                                 (new-lookahead ni s)))))
                          (t
                           ;; spontaneous generation
                           (new-lookahead ni (item-lookahead ni)))))))
                  (when new
                    (addhash target changed)))))))
        (when (zerop (hash-table-count changed))
          (return))
        (rotatef previously-changed changed)
        (clrhash changed)
        (setq propagate-only t)))
    kernels)
  
  (defun print-states (kernels lookaheads &optional (stream *standard-output*))
  