*** empty log message ***

original commit: 44159012bf3bffe881adf99cfdb34fccc6d86084
tokens
Scott Owens 23 years ago
parent ce7db455eb
commit 38412c1b66

@ -41,7 +41,7 @@
;; LR-item = (make-item production nat (int | #f))
;; The n field contains the least integer such the item is nullable
;; after the dot if the dot is to the right of the nth position.
(define-struct item (prod dot-pos n))
(define-struct item (prod dot-pos n) (make-inspector))
(define (export-make-item a b)
(make-item a b #f))
@ -120,8 +120,8 @@
;; gram-sym = (make-term symbol int prec)
;; | (make-non-term symbol int)
(define-struct term (sym index prec))
(define-struct non-term (sym index))
(define-struct term (sym index prec) (make-inspector))
(define-struct non-term (sym index) (make-inspector))
(define (non-term<? nt1 nt2)
(< (non-term-index nt1) (non-term-index nt2)))
@ -147,7 +147,7 @@
;; a precedence declaration. the sym should be 'left 'right or 'nonassoc
;; prec = (make-prec int sym)
;; | #f
(define-struct prec (num assoc))
(define-struct prec (num assoc) (make-inspector))
;; ------------------------- Grammar ------------------------------
@ -165,7 +165,8 @@
;; The nulls field is indexed by the index for a non-term and is trus iff
;; the non-term is nullable
(define-struct gram
(nt-prods prods nulls non-terms terms num-prods end-terms))
(nt-prods prods nulls non-terms terms num-prods end-terms)
(make-inspector))
;; get-nt-prods: grammar * non-term -> production list
@ -188,5 +189,5 @@
;; ------------------------ Productions ---------------------------
;; production = (make-prod non-term (gram-sym vector) int prec syntax-object)
(define-struct prod (lhs rhs index prec action))
(define-struct prod (lhs rhs index prec action) (make-inspector))
)

@ -31,9 +31,9 @@
;; be used to compare kernels
;; LR0-automaton = (make-lr0 (trans-key kernel hash-table) (kernel vector))
;; trans-key = (make-trans-key kernel gram-sym)
(define-struct kernel (items index))
(define-struct trans-key (st gs))
(define-struct lr0 (transitions states))
(define-struct kernel (items index) (make-inspector))
(define-struct trans-key (st gs) (make-inspector))
(define-struct lr0 (transitions states) (make-inspector))
;; The kernels in the automaton are represented cannonically.
;; That is (equal? a b) <=> (eq? a b)
@ -226,7 +226,7 @@
(enq! new-kernels (goto (car old-kernels)))
(loop (cdr old-kernels) (cons (car old-kernels) seen-kernels)))))))
(define-struct q (f l))
(define-struct q (f l) (make-inspector))
(define (empty-queue? q)
(null? (q-f q)))
(define (make-queue)

@ -13,7 +13,7 @@
;; | int
;; | #f
(define-struct shift (state))
(define-struct reduce (prod-num lhs-num rhs-length))
(define-struct accept ())
(define-struct shift (state) (make-inspector))
(define-struct reduce (prod-num lhs-num rhs-length) (make-inspector))
(define-struct accept () (make-inspector))
)

Loading…
Cancel
Save