[climacs-cvs] CVS update: climacs/syntax.lisp
Christophe Rhodes
crhodes at common-lisp.net
Mon Jul 4 13:55:56 UTC 2005
Update of /project/climacs/cvsroot/climacs
In directory common-lisp.net:/tmp/cvs-serv5285
Modified Files:
syntax.lisp
Log Message:
Maybe get the initial state of the initial lexeme in the Earley parser
right. (See climacs-devel "html syntax buglet" 2005-06-29)
Date: Mon Jul 4 15:55:56 2005
Author: crhodes
Index: climacs/syntax.lisp
diff -u climacs/syntax.lisp:1.52 climacs/syntax.lisp:1.53
--- climacs/syntax.lisp:1.52 Mon May 30 11:33:39 2005
+++ climacs/syntax.lisp Mon Jul 4 15:55:56 2005
@@ -520,14 +520,20 @@
(or (subtypep (target parser) sym)
(subtypep sym (target parser))))
(if (functionp (right-hand-side rule))
- (handle-incomplete-item
- (make-instance 'incomplete-item
- :orig-state initial-state
- :predicted-from nil
- :rule rule
- :dot-position 0
- :suffix (right-hand-side rule))
- initial-state initial-state)
+ (let ((predicted-rules (slot-value initial-state 'predicted-rules))
+ (rule-number (slot-value rule 'number))
+ (predict-test (predict-test rule)))
+ (when (zerop (sbit predicted-rules rule-number))
+ (setf (sbit predicted-rules rule-number) 1)
+ (when (null predict-test)
+ (handle-and-predict-incomplete-item
+ (make-instance 'incomplete-item
+ :orig-state initial-state
+ :predicted-from nil
+ :rule rule
+ :dot-position 0
+ :suffix (right-hand-side rule))
+ initial-state nil))))
(potentially-handle-parse-tree
(right-hand-side rule) initial-state initial-state))))))
More information about the Climacs-cvs
mailing list