Function: srecode-extract-code-stream
srecode-extract-code-stream is a byte-compiled function defined in
extract.el.gz.
Signature
(srecode-extract-code-stream CODE DICTIONARY STATE)
Documentation
Extract CODE from buffer text into DICTIONARY.
Uses string constants in CODE to split up the buffer. Uses STATE to maintain the current extraction state.
Source Code
;; Defined in /usr/src/emacs/lisp/cedet/srecode/extract.el.gz
(defun srecode-extract-code-stream (code dictionary state)
"Extract CODE from buffer text into DICTIONARY.
Uses string constants in CODE to split up the buffer.
Uses STATE to maintain the current extraction state."
(while code
(cond
;; constant strings need mark the end of old inserters that
;; need to extract values, or are just there.
((stringp (car code))
(srecode-extract-state-set-anchor state)
;; When we have a string, find it in the collection, then extract
;; that start point as the end point of the inserter
(unless (re-search-forward (regexp-quote (car code))
(point-max) t)
(error "Unable to extract all dictionary entries"))
(srecode-extract-state-extract state (match-beginning 0))
(goto-char (match-end 0))
)
;; Some inserters are simple, and need to be extracted after
;; we find our next block of static text.
((eq (srecode-inserter-do-extract-p (car code)) 'later)
(srecode-extract-state-set state (car code) dictionary)
)
;; Some inserter want to start extraction now, such as sections.
;; We can't predict the end point till we parse out the middle.
((eq (srecode-inserter-do-extract-p (car code)) 'now)
(srecode-extract-state-set-anchor state)
(srecode-inserter-extract (car code) (point) nil dictionary state))
)
(setq code (cdr code))
))