Function: semantic-analyze-scoped-inherited-tag-map
semantic-analyze-scoped-inherited-tag-map is a byte-compiled function
defined in scope.el.gz.
Signature
(semantic-analyze-scoped-inherited-tag-map TYPE FCN SCOPE)
Documentation
Map all parents of TYPE to FCN. Return tags of all the types.
Argument SCOPE specify additional tags that are in scope whose tags can be searched when needed, OR it may be a scope object.
Source Code
;; Defined in /usr/src/emacs/lisp/cedet/semantic/scope.el.gz
(defun semantic-analyze-scoped-inherited-tag-map (type fcn scope)
"Map all parents of TYPE to FCN. Return tags of all the types.
Argument SCOPE specify additional tags that are in scope
whose tags can be searched when needed, OR it may be a scope object."
(require 'semantic/analyze)
(let* (;; PARENTS specifies only the superclasses and not
;; interfaces. Inheriting from an interfaces implies
;; you have a copy of all methods locally. I think.
(parents (semantic-tag-type-superclasses type))
ps pt
(tmpscope scope)
)
(save-excursion
;; Create a SCOPE just for looking up the parent based on where
;; the parent came from.
;;
;; @TODO - Should we cache these mini-scopes around in Emacs
;; for recycling later? Should this become a helpful
;; extra routine?
(when (and parents (semantic-tag-with-position-p type))
(save-excursion
;; If TYPE has a position, go there and get the scope.
(semantic-go-to-tag type)
;; We need to make a mini scope, and only include the misc bits
;; that will help in finding the parent. We don't really need
;; to do any of the stuff related to variables and what-not.
(setq tmpscope (semantic-scope-cache))
(let* ( ;; Step 1:
(scopetypes (cons type (semantic-analyze-scoped-types (point))))
(parents (semantic-analyze-scope-nested-tags (point) scopetypes))
;;(parentinherited (semantic-analyze-scope-lineage-tags parents scopetypes))
(lscope nil)
)
(oset tmpscope scopetypes scopetypes)
(oset tmpscope parents parents)
;;(oset tmpscope parentinheritance parentinherited)
(when (or scopetypes parents)
(setq lscope (semantic-analyze-scoped-tags scopetypes tmpscope))
(oset tmpscope scope lscope))
(oset tmpscope fullscope (append scopetypes lscope parents))
)))
;; END creating tmpscope
;; Look up each parent one at a time.
(dolist (p parents)
(setq ps (cond ((stringp p) p)
((and (semantic-tag-p p) (semantic-tag-prototype-p p))
(semantic-tag-name p))
((and (listp p) (stringp (car p)))
p))
pt (condition-case nil
(or (semantic-analyze-find-tag ps 'type tmpscope)
;; A backup hack.
(semantic-analyze-find-tag ps 'type scope))
(error nil)))
(when pt
(funcall fcn pt)
;; Note that we pass the original SCOPE in while recursing.
;; so that the correct inheritance model is passed along.
(semantic-analyze-scoped-inherited-tag-map pt fcn scope)
)))
nil))