Function: semantic-tag-components-with-overlays-default

semantic-tag-components-with-overlays-default is a byte-compiled function defined in tag.el.gz.

Signature

(semantic-tag-components-with-overlays-default TAG)

Documentation

Return the list of top level components belonging to TAG.

Children are any sub-tags which contain overlays. The default action collects regular components of TAG, in addition to any components belonging to an anonymous type.

Source Code

;; Defined in /usr/src/emacs/lisp/cedet/semantic/tag.el.gz
(defun semantic-tag-components-with-overlays-default (tag)
  "Return the list of top level components belonging to TAG.
Children are any sub-tags which contain overlays.
The default action collects regular components of TAG, in addition
to any components belonging to an anonymous type."
  (let ((explicit-children (semantic-tag-components tag))
	(type (semantic-tag-type tag))
	(anon-type-children nil)
	(all-children nil))
    ;; Identify if this tag has an anonymous structure as
    ;; its type.  This implies it may have children with overlays.
    (when (and type (semantic-tag-p type))
      (setq anon-type-children (semantic-tag-components type))
      ;; Add anonymous children
      (while anon-type-children
	(when (semantic-tag-with-position-p (car anon-type-children))
	  (setq all-children (cons (car anon-type-children) all-children)))
	(setq anon-type-children (cdr anon-type-children))))
    ;; Add explicit children
    (while explicit-children
      (when (semantic-tag-with-position-p (car explicit-children))
	(setq all-children (cons (car explicit-children) all-children)))
      (setq explicit-children (cdr explicit-children)))
    ;; Return
    (nreverse all-children)))