anchor.diff:  ;;                                                                    (sentence-node-attribute (first rest-sentence))))
   ;;                                                 (first-set grammar (first sentence))))
   ;;              rest-sentence))))
  -
  -(defun process-sentence (grammar nt sentence)
  -  (if (null sentence)
  -      (list (make-sentence-node :word nil :attribute (follow-set grammar nt)))
  -      (let ((rest-sentence (process-sentence grammar nt (rest sentence))))
  -       (cons (make-sentence-node :word (first sentence)
  -                                 :attribute (if (nullablep grammar (first sentence))
  -                                                (remove nil (union (first-set grammar (first sentence))
  -                                                                   (sentence-node-attribute (first rest-sentence))))
  -                                                (first-set grammar (first sentence))))
  -             rest-sentence))))
  -
  +;;
  +;; (defun process-sentence (grammar nt sentence)
  +;;   (if (null sentence)
  +;;       (list (make-sentence-node :word nil :attribute (follow-set grammar nt)))
  +;;       (let ((rest-sentence (process-sentence grammar nt (rest sentence))))
  +;;        (cons (make-sentence-node :word (first sentence)
  +;;                                  :attribute (if (nullablep grammar (first sentence))
  +;;                                                 (remove nil (union (first-set grammar (first sentence))
  +;;                                                                    (sentence-node-attribute (first rest-sentence))))
  +;;                                                 (first-set grammar (first sentence))))
  +;;              rest-sentence))))
  +
  +
  +;;;------------------------------------------------------------
  +;;; RDP Parser Generator
  +;;;------------------------------------------------------------
  +
  +(defvar *non-terminal-stack* '()
  +  "For error reporting.")
  +
  +(defmacro with-non-terminal (non-terminal &body body)
  +  `(let ((*non-terminal-stack* (cons ',non-terminal *non-terminal-stack*)))
  +     ;; (print *non-terminal-stack*)
  +     ,@body))
  +
  +(defmethod gen-parse-function-name ((target (eql :lisp)) (grammar grammar) non-terminal)
  +  (intern (format nil "~:@(~A/PARSE-~A~)" (grammar-name grammar) non-terminal)))
  +
  +(defmethod gen-in-firsts ((target (eql :lisp)) firsts)
  +  (if (null (cdr firsts))
  +      `(word-equal (scanner-current-token scanner) ',(car firsts))
  +      `(member  (scanner-current-token scanner) ',firsts
  +                :test (function word-equal))))
   
   (defmethod gen-parsing-statement ((target (eql :lisp)) (grammar grammar) item)
     ;; If we want to generate the parser directly from the grammar with
  
positive.code:      `',(grammar-scanner grammar))))
  
  
  (defmethod gen-parse-function-name ((target (eql :lisp)) (grammar grammar) non-terminal)
    (intern (format nil "~:@(~A/PARSE-~A~)" (grammar-name grammar) non-terminal)))
  
  (defmethod gen-in-firsts ((target (eql :lisp)) firsts)
    (if (null (cdr firsts))
        `(word-equal (scanner-current-token scanner) ',(car firsts))
        `(member  (scanner-current-token scanner) ',firsts
                  :test (function word-equal))))
  
  
  
  
  ;; (com.informatimago.rdp::find-rules (grammar-named 'normalized-encoding) 'request)
  (defstruct sentence-node word attribute)
  
  ;; Not finished.
  ;; (defun attribute-rule (grammar nt item)
  ;;   (ecase item
  
negative.code: ;;              (format nil "^([~{~C~}]+)" '(#\space #\newline #\tab)))))))
  
  
  
  
  (defgeneric gen-scanner-function-name (target grammar))
  