Commits

Anonymous committed 90c9b5d

New restart FUCC:USE-VALUE
Keywords: restart, use-value, doc, package

* doc/ERROR-RECOVERY (FUCC:USE-VALUE):
Documentation on new restart.

* fucc-parser.lisp (parser-lr--reduce!):
New restart FUCC:USE-VALUE.

* fucc-package.lisp (#:fucc):
Export USE-VALUE.

Comments (0)

Files changed (3)

doc/ERROR-RECOVERY

   Use action for recovery.  Action can be selected from list of
   conflicting action or something else.
 
+*** Other condition
+During semantic value evaluation, restart FUCC:USE-VALUE is available.
+You can use it when handling errors in semantic actions.
+
+**** Restarts
+FUCC:USE-VALUE value
+  Use this value instead.
+
 ;;; LocalWords:  FUCC HyperSpec

parser/fucc-package.lisp

   (:export
    #:defparser
    #:parser-lr
+   #:use-value
    #:*next-token*
    #:*next-data*))

parser/fucc-parser.lisp

                                        (reduce-action-term action))))
             (push new-state state-stack)
             (setf data-stack
-                  (cons (apply (reduce-action-function action) data)
-                        rest-data))
+                  (cons
+                   (restart-case
+                       (apply (reduce-action-function action) data)
+                     (use-value (value)
+                       value))
+                   rest-data))
             (setf term-stack
                   (cons (reduce-action-term action)
                         (nthcdr len