analysis/defs.ss
#lang scheme/base

(require "../forth/forth-lex.ss")

;; A re-interpretation of .f files to gather used words and defined words.

;; (define-syntax-rule (analyse file)
;;   (forth-lex-file/cps analyse-begin file))

;; (define-syntax-rule (analyse-begin code ...)
;;   (rpn-parse quasiquote*
;;              (macro)
;;              analyse-cons    ;; save name references
;;              analyse-ignore  ;; ignore immediates and programs
;;              analyse-ignore
;;              void            ;; anonymous quoter not used
;;              (analyse-forth) ;; initial dict
;;              ) code ...)


;; (ns (macro) (define-syntax :
;;               (make-rpn-same-definition-transformer
;;                (lambda (d) ;; get-compile
;;                  (let ((define-it (car (d-last d)))) ;; get last entry's compiler macro
;;                    (head->compile #`(#,define-it)))))))


;;ETC...

;;This is easier with some common functionality factored out.