Function: srecode-compile-template-table
srecode-compile-template-table is a byte-compiled function defined in
compile.el.gz.
Signature
(srecode-compile-template-table TEMPLATES MODE PRIORITY APPLICATION FRAMEWORK PROJECT VARS)
Documentation
Compile a list of TEMPLATES into an semantic recode table.
The table being compiled is for MODE, or the string "default". PRIORITY is a numerical value that indicates this tables location in an ordered search. APPLICATION is the name of the application these templates belong to. FRAMEWORK is the name of the framework these templates belong to. PROJECT is a directory name which these templates scope to. A list of defined variables VARS provides a variable table.
Source Code
;; Defined in /usr/src/emacs/lisp/cedet/srecode/compile.el.gz
(defun srecode-compile-template-table (templates mode priority application framework project vars)
"Compile a list of TEMPLATES into an semantic recode table.
The table being compiled is for MODE, or the string \"default\".
PRIORITY is a numerical value that indicates this tables location
in an ordered search.
APPLICATION is the name of the application these templates belong to.
FRAMEWORK is the name of the framework these templates belong to.
PROJECT is a directory name which these templates scope to.
A list of defined variables VARS provides a variable table."
(let ((namehash (make-hash-table :test 'equal
:size (length templates)))
(contexthash (make-hash-table :test 'equal :size 10))
(lp templates)
)
(while lp
(let* ((objname (oref (car lp) object-name))
(context (oref (car lp) context))
(globalname (concat context ":" objname))
)
;; Place this template object into the global name hash.
(puthash globalname (car lp) namehash)
;; Place this template into the specific context name hash.
(let ((hs (gethash context contexthash)))
;; Make a new context if none was available.
(when (not hs)
(setq hs (make-hash-table :test 'equal :size 20))
(puthash context hs contexthash))
;; Put into that context's hash.
(puthash objname (car lp) hs)
)
(setq lp (cdr lp))))
(when (stringp project)
(setq project (expand-file-name project)))
(let* ((table (srecode-mode-table-new mode (buffer-file-name)
:templates (nreverse templates)
:namehash namehash
:contexthash contexthash
:variables vars
:major-mode mode
:priority priority
:application application
:framework framework
:project project))
(tmpl (oref table templates)))
;; Loop over all the templates, and xref.
(while tmpl
(oset (car tmpl) table table)
(setq tmpl (cdr tmpl))))
))