anchor.diff:  
   (in-package #:yacc-tests)
   
  +(defmacro expect (form expected)
  +  (let ((value (gensym "VALUE")))
  +    `(let ((,value ,form))
  +      (unless (equal ,value ,expected)
  +        (error "Test failed: ~S yielded ~S, expected ~S"
  +               ',form ,value ,expected)))))
  +
   (defmacro expect-condition (class &body body)
     (let ((name (gensym "EXPECT-CONDITION")))
     `(block ,name
  
positive.code:    int
     (|(| expression |)| #'k-2-3)))
  
  (defun parse-left-expression (e)
    (with-input-from-string (s e)
      (parse-with-lexer #'(lambda () (simple-lexer s))
                        *left-expression-parser*)))
  
  (define-parser *precedence-expression-parser*
    (:start-symbol expression)
    (:terminals (int id + - * / |(| |)|))
    (:precedence ((:left * /) (:left + -)))
  
negative.code:    int
     (|(| expression |)| #'k-2-3)))
  
  (define-parser *precedence-right-expression-parser*
    (:start-symbol expression)
    (:terminals (int id + - * / |(| |)|))
    (:precedence ((:right * /) (:right + -)))
  
    (expression
     (expression + expression)
     (expression - expression)
     (expression * expression)
     (expression / expression)
     id
     int
     (|(| expression |)| #'k-2-3)))
  
  (define-parser *precedence-nonassoc-expression-parser*
    (:start-symbol expression)
    (:terminals (int id + - * / |(| |)|))
    (:precedence ((:nonassoc * /) (:nonassoc + -)))
  
    (expression
     (expression + expression)
     (expression - expression)
     (expression * expression)
     (expression / expression)
     id
     int
     (|(| expression |)| #'k-2-3)))
  
  (defun tests-hi ()
    (flet ((parse (parser e) 
             (with-input-from-string (s e)
               (parse-with-lexer #'(lambda () (simple-lexer s)) parser))))
      (let ((*package* (find-package '#:yacc-tests)))
        (let ((e "(x+3)+y*z") (v '(("x" + 3) + ("y" * "z"))))
          (expect (parse *left-expression-parser* e) v)
          (expect (parse *precedence-left-expression-parser* e) v)
          (expect (parse *precedence-right-expression-parser* e) v)
          (expect (parse *precedence-nonassoc-expression-parser* e) v))
        (let ((e "x+5/3*(12+y)/3+z"))
          (let ((v '(("x" + (((5 / 3) * (12 + "y")) / 3)) + "z")))
            (expect (parse *left-expression-parser* e) v)
            (expect (parse *precedence-left-expression-parser* e) v))
          (let ((v '("x" + ((5 / (3 * ((12 + "y") / 3))) + "z"))))
            (expect (parse *precedence-right-expression-parser* e) v))
          (expect-condition yacc-parse-error
            (parse *precedence-nonassoc-expression-parser* e)))
        (dolist (e '("5/3*(" "5/3)"))
          (expect-condition yacc-parse-error
            (parse *left-expression-parser* e))
          (expect-condition yacc-parse-error
            (parse *precedence-left-expression-parser* e))
          (expect-condition yacc-parse-error
            (parse *precedence-right-expression-parser* e)))))
    t)
  
  (defun tests ()
  