Update of /project/climacs/cvsroot/climacs In directory common-lisp.net:/tmp/cvs-serv4425
Modified Files: syntax.lisp Log Message: An incomplete item now stores its state of origin. The chain of states of origin will define a "parse stack" that can be exploited by syntax modules and display code.
Date: Wed Mar 2 05:07:26 2005 Author: rstrandh
Index: climacs/syntax.lisp diff -u climacs/syntax.lisp:1.30 climacs/syntax.lisp:1.31 --- climacs/syntax.lisp:1.30 Sat Feb 5 07:49:53 2005 +++ climacs/syntax.lisp Wed Mar 2 05:07:26 2005 @@ -143,7 +143,8 @@ (defclass rule-item () ())
(defclass incomplete-item (rule-item) - ((rule :initarg :rule :reader rule) + ((orig-state :initarg :orig-state :reader orig-state) + (rule :initarg :rule :reader rule) (dot-position :initarg :dot-position :reader dot-position) (parse-trees :initarg :parse-trees :reader parse-trees) (suffix :initarg :suffix :reader suffix))) @@ -171,6 +172,7 @@ nil) ((functionp remaining) (make-instance 'incomplete-item + :orig-state (orig-state prev-item) :rule (rule prev-item) :dot-position (1+ (dot-position prev-item)) :parse-trees (cons parse-tree (parse-trees prev-item)) @@ -249,6 +251,7 @@ (or (subtypep sym1 sym2) (subtypep sym2 sym1))) (handle-item (if (functionp (right-hand-side rule)) (make-instance 'incomplete-item + :orig-state to-state :rule rule :dot-position 0 :parse-trees '() @@ -273,6 +276,7 @@ (subtypep sym (target parser)))) (handle-item (if (functionp (right-hand-side rule)) (make-instance 'incomplete-item + :orig-state initial-state :rule rule :dot-position 0 :parse-trees '()