annotate lisp/cedet/semantic/tag.el @ 104442:b22b44e953cb

cedet/semantic/chart.el: Don't require semantic/find. cedet/semantic/complete.el: Don't require semantic/find. cedet/semantic/decorate.el: Require semantic/tag-file. (semantic-set-tag-folded-isearch): Require semantic/find. cedet/semantic/dep.el: Change semantic--dependency-find-file-on-path into a macro, to avoid compiler warning. Defvar ede-minor-mode and ede-object. Declare ede-system-include-path. cedet/semantic/doc.el: Require semantic/tag-file and semantic/find. cedet/semantic/edit.el: Require semantic/find and semantic/format. cedet/semantic/find.el: Defvar semantic-case-fold. Require semantic. (semantic-find-tags-external-children-of-type): Require semantic/sort. (semantic-find-tags-by-scope-protection-default): Require semantic/tag-ls. cedet/semantic/format.el: Require semantic/tag-ls. eval-when-compile semantic/find. (semantic-format-tag-name): Move up to avoid compiler error. (semantic-format-tag-prototype): Move up to avoid compiler error. (semantic--format-tag-parent-tree): Require semantic/tag-file. (semantic-format-tag-short-doc-default): Require semantic/doc.
author Chong Yidong <cyd@stupidchicken.com>
date Mon, 31 Aug 2009 02:16:34 +0000
parents da5b2513c225
children 2bf481006ba4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
104416
c13af98da4d6 Fix renamed filenames in file headers.
Chong Yidong <cyd@stupidchicken.com>
parents: 104412
diff changeset
1 ;;; tag.el --- tag creation and access
104412
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
2
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
3 ;;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007,
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
4 ;;; 2008, 2009 Free Software Foundation, Inc.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
5
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
6 ;; Author: Eric M. Ludlam <zappo@gnu.org>
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
7
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
8 ;; This file is part of GNU Emacs.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
9
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
10 ;; GNU Emacs is free software: you can redistribute it and/or modify
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
11 ;; it under the terms of the GNU General Public License as published by
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
12 ;; the Free Software Foundation, either version 3 of the License, or
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
13 ;; (at your option) any later version.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
14
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
15 ;; GNU Emacs is distributed in the hope that it will be useful,
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
18 ;; GNU General Public License for more details.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
19
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
20 ;; You should have received a copy of the GNU General Public License
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
21 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
22
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
23 ;;; Commentary:
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
24 ;;
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
25 ;; I. The core production of semantic is the list of tags produced by the
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
26 ;; different parsers. This file provides 3 APIs related to tag access:
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
27 ;;
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
28 ;; 1) Primitive Tag Access
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
29 ;; There is a set of common features to all tags. These access
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
30 ;; functions can get these values.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
31 ;; 2) Standard Tag Access
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
32 ;; A Standard Tag should be produced by most traditional languages
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
33 ;; with standard styles common to typed object oriented languages.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
34 ;; These functions can access these data elements from a tag.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
35 ;; 3) Generic Tag Access
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
36 ;; Access to tag structure in a more direct way.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
37 ;; ** May not be forward compatible.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
38 ;;
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
39 ;; II. There is also an API for tag creation. Use `semantic-tag' to create
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
40 ;; a new tag.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
41 ;;
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
42 ;; III. Tag Comparison. Allows explicit or comparitive tests to see
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
43 ;; if two tags are the same.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
44
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
45 ;;; History:
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
46 ;;
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
47
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
48 ;;; Code:
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
49 ;;
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
50
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
51 ;; Keep this only so long as we have obsolete fcns.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
52 (require 'semantic/fw)
104418
12884dc43872 * cedet/semantic/tag.el: Add declare-function statements for
Chong Yidong <cyd@stupidchicken.com>
parents: 104416
diff changeset
53 (require 'semantic/lex)
12884dc43872 * cedet/semantic/tag.el: Add declare-function statements for
Chong Yidong <cyd@stupidchicken.com>
parents: 104416
diff changeset
54
12884dc43872 * cedet/semantic/tag.el: Add declare-function statements for
Chong Yidong <cyd@stupidchicken.com>
parents: 104416
diff changeset
55 (declare-function semantic-current-tag "semantic/find")
12884dc43872 * cedet/semantic/tag.el: Add declare-function statements for
Chong Yidong <cyd@stupidchicken.com>
parents: 104416
diff changeset
56 (declare-function semantic-find-first-tag-by-name "semantic/find")
12884dc43872 * cedet/semantic/tag.el: Add declare-function statements for
Chong Yidong <cyd@stupidchicken.com>
parents: 104416
diff changeset
57 (declare-function semantic-ctxt-current-mode "semantic/ctxt")
12884dc43872 * cedet/semantic/tag.el: Add declare-function statements for
Chong Yidong <cyd@stupidchicken.com>
parents: 104416
diff changeset
58 (declare-function semantic-analyze-split-name "semantic/analyze/fcn")
12884dc43872 * cedet/semantic/tag.el: Add declare-function statements for
Chong Yidong <cyd@stupidchicken.com>
parents: 104416
diff changeset
59 (declare-function semantic-fetch-tags "semantic")
12884dc43872 * cedet/semantic/tag.el: Add declare-function statements for
Chong Yidong <cyd@stupidchicken.com>
parents: 104416
diff changeset
60 (declare-function semantic-clear-toplevel-cache "semantic")
12884dc43872 * cedet/semantic/tag.el: Add declare-function statements for
Chong Yidong <cyd@stupidchicken.com>
parents: 104416
diff changeset
61 (declare-function semantic-documentation-for-tag "semantic/doc")
12884dc43872 * cedet/semantic/tag.el: Add declare-function statements for
Chong Yidong <cyd@stupidchicken.com>
parents: 104416
diff changeset
62 (declare-function semantic-format-tag-prototype "semantic/format")
12884dc43872 * cedet/semantic/tag.el: Add declare-function statements for
Chong Yidong <cyd@stupidchicken.com>
parents: 104416
diff changeset
63 (declare-function semantic-format-tag-summarize "semantic/format")
12884dc43872 * cedet/semantic/tag.el: Add declare-function statements for
Chong Yidong <cyd@stupidchicken.com>
parents: 104416
diff changeset
64 (declare-function semantic-format-tag-name "semantic/format")
104412
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
65
104439
da5b2513c225 cedet/cedet.el (cedet-packages): Bump srecode version.
Chong Yidong <cyd@stupidchicken.com>
parents: 104418
diff changeset
66 (defconst semantic-tag-version "2.0pre7"
104412
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
67 "Version string of semantic tags made with this code.")
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
68
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
69 (defconst semantic-tag-incompatible-version "1.0"
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
70 "Version string of semantic tags which are not currently compatible.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
71 These old style tags may be loaded from a file with semantic db.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
72 In this case, we must flush the old tags and start over.")
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
73
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
74 ;;; Primitive Tag access system:
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
75 ;;
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
76 ;; Raw tags in semantic are lists of 5 elements:
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
77 ;;
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
78 ;; (NAME CLASS ATTRIBUTES PROPERTIES OVERLAY)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
79 ;;
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
80 ;; Where:
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
81 ;;
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
82 ;; - NAME is a string that represents the tag name.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
83 ;;
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
84 ;; - CLASS is a symbol that represent the class of the tag (for
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
85 ;; example, usual classes are `type', `function', `variable',
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
86 ;; `include', `package', `code').
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
87 ;;
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
88 ;; - ATTRIBUTES is a public list of attributes that describes
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
89 ;; language data represented by the tag (for example, a variable
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
90 ;; can have a `:constant-flag' attribute, a function an `:arguments'
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
91 ;; attribute, etc.).
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
92 ;;
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
93 ;; - PROPERTIES is a private list of properties used internally.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
94 ;;
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
95 ;; - OVERLAY represent the location of data described by the tag.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
96 ;;
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
97
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
98 (defsubst semantic-tag-name (tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
99 "Return the name of TAG.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
100 For functions, variables, classes, typedefs, etc., this is the identifier
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
101 that is being defined. For tags without an obvious associated name, this
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
102 may be the statement type, e.g., this may return @code{print} for python's
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
103 print statement."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
104 (car tag))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
105
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
106 (defsubst semantic-tag-class (tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
107 "Return the class of TAG.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
108 That is, the symbol 'variable, 'function, 'type, or other.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
109 There is no limit to the symbols that may represent the class of a tag.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
110 Each parser generates tags with classes defined by it.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
111
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
112 For functional languages, typical tag classes are:
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
113
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
114 @table @code
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
115 @item type
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
116 Data types, named map for a memory block.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
117 @item function
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
118 A function or method, or named execution location.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
119 @item variable
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
120 A variable, or named storage for data.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
121 @item include
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
122 Statement that represents a file from which more tags can be found.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
123 @item package
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
124 Statement that declairs this file's package name.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
125 @item code
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
126 Code that has not name or binding to any other symbol, such as in a script.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
127 @end table
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
128 "
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
129 (nth 1 tag))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
130
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
131 (defsubst semantic-tag-attributes (tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
132 "Return the list of public attributes of TAG.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
133 That is a property list: (ATTRIBUTE-1 VALUE-1 ATTRIBUTE-2 VALUE-2...)."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
134 (nth 2 tag))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
135
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
136 (defsubst semantic-tag-properties (tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
137 "Return the list of private properties of TAG.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
138 That is a property list: (PROPERTY-1 VALUE-1 PROPERTY-2 VALUE-2...)."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
139 (nth 3 tag))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
140
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
141 (defsubst semantic-tag-overlay (tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
142 "Return the OVERLAY part of TAG.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
143 That is, an overlay or an unloaded buffer representation.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
144 This function can also return an array of the form [ START END ].
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
145 This occurs for tags that are not currently linked into a buffer."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
146 (nth 4 tag))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
147
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
148 (defsubst semantic--tag-overlay-cdr (tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
149 "Return the cons cell whose car is the OVERLAY part of TAG.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
150 That function is for internal use only."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
151 (nthcdr 4 tag))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
152
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
153 (defsubst semantic--tag-set-overlay (tag overlay)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
154 "Set the overlay part of TAG with OVERLAY.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
155 That function is for internal use only."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
156 (setcar (semantic--tag-overlay-cdr tag) overlay))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
157
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
158 (defsubst semantic-tag-start (tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
159 "Return the start location of TAG."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
160 (let ((o (semantic-tag-overlay tag)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
161 (if (semantic-overlay-p o)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
162 (semantic-overlay-start o)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
163 (aref o 0))))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
164
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
165 (defsubst semantic-tag-end (tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
166 "Return the end location of TAG."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
167 (let ((o (semantic-tag-overlay tag)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
168 (if (semantic-overlay-p o)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
169 (semantic-overlay-end o)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
170 (aref o 1))))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
171
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
172 (defsubst semantic-tag-bounds (tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
173 "Return the location (START END) of data TAG describes."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
174 (list (semantic-tag-start tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
175 (semantic-tag-end tag)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
176
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
177 (defun semantic-tag-set-bounds (tag start end)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
178 "In TAG, set the START and END location of data it describes."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
179 (let ((o (semantic-tag-overlay tag)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
180 (if (semantic-overlay-p o)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
181 (semantic-overlay-move o start end)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
182 (semantic--tag-set-overlay tag (vector start end)))))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
183
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
184 (defun semantic-tag-in-buffer-p (tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
185 "Return the buffer TAG resides in IFF tag is already in a buffer.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
186 If a tag is not in a buffer, return nil."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
187 (let ((o (semantic-tag-overlay tag)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
188 ;; TAG is currently linked to a buffer, return it.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
189 (when (and (semantic-overlay-p o)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
190 (semantic-overlay-live-p o))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
191 (semantic-overlay-buffer o))))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
192
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
193 (defsubst semantic--tag-get-property (tag property)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
194 "From TAG, extract the value of PROPERTY.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
195 Return the value found, or nil if PROPERTY is not one of the
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
196 properties of TAG.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
197 That function is for internal use only."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
198 (plist-get (semantic-tag-properties tag) property))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
199
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
200 (defun semantic-tag-buffer (tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
201 "Return the buffer TAG resides in.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
202 If TAG has an originating file, read that file into a (maybe new)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
203 buffer, and return it.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
204 Return nil if there is no buffer for this tag."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
205 (let ((buff (semantic-tag-in-buffer-p tag)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
206 (if buff
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
207 buff
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
208 ;; TAG has an originating file, read that file into a buffer, and
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
209 ;; return it.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
210 (if (semantic--tag-get-property tag :filename)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
211 (find-file-noselect (semantic--tag-get-property tag :filename))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
212 ;; TAG is not in Emacs right now, no buffer is available.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
213 ))))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
214
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
215 (defun semantic-tag-mode (&optional tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
216 "Return the major mode active for TAG.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
217 TAG defaults to the tag at point in current buffer.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
218 If TAG has a :mode property return it.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
219 If point is inside TAG bounds, return the major mode active at point.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
220 Return the major mode active at beginning of TAG otherwise.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
221 See also the function `semantic-ctxt-current-mode'."
104418
12884dc43872 * cedet/semantic/tag.el: Add declare-function statements for
Chong Yidong <cyd@stupidchicken.com>
parents: 104416
diff changeset
222 (require 'semantic/find)
104412
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
223 (or tag (setq tag (semantic-current-tag)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
224 (or (semantic--tag-get-property tag :mode)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
225 (let ((buffer (semantic-tag-buffer tag))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
226 (start (semantic-tag-start tag))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
227 (end (semantic-tag-end tag)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
228 (save-excursion
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
229 (and buffer (set-buffer buffer))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
230 ;; Unless point is inside TAG bounds, move it to the
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
231 ;; beginning of TAG.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
232 (or (and (>= (point) start) (< (point) end))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
233 (goto-char start))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
234 (require 'semantic/ctxt)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
235 (semantic-ctxt-current-mode)))))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
236
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
237 (defsubst semantic--tag-attributes-cdr (tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
238 "Return the cons cell whose car is the ATTRIBUTES part of TAG.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
239 That function is for internal use only."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
240 (nthcdr 2 tag))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
241
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
242 (defsubst semantic-tag-put-attribute (tag attribute value)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
243 "Change value in TAG of ATTRIBUTE to VALUE.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
244 If ATTRIBUTE already exists, its value is set to VALUE, otherwise the
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
245 new ATTRIBUTE VALUE pair is added.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
246 Return TAG.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
247 Use this function in a parser when not all attributes are known at the
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
248 same time."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
249 (let* ((plist-cdr (semantic--tag-attributes-cdr tag)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
250 (when (consp plist-cdr)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
251 (setcar plist-cdr
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
252 (semantic-tag-make-plist
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
253 (plist-put (car plist-cdr) attribute value))))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
254 tag))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
255
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
256 (defun semantic-tag-put-attribute-no-side-effect (tag attribute value)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
257 "Change value in TAG of ATTRIBUTE to VALUE without side effects.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
258 All cons cells in the attribute list are replicated so that there
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
259 are no side effects if TAG is in shared lists.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
260 If ATTRIBUTE already exists, its value is set to VALUE, otherwise the
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
261 new ATTRIBUTE VALUE pair is added.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
262 Return TAG."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
263 (let* ((plist-cdr (semantic--tag-attributes-cdr tag)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
264 (when (consp plist-cdr)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
265 (setcar plist-cdr
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
266 (semantic-tag-make-plist
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
267 (plist-put (copy-sequence (car plist-cdr))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
268 attribute value))))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
269 tag))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
270
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
271 (defsubst semantic-tag-get-attribute (tag attribute)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
272 "From TAG, return the value of ATTRIBUTE.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
273 ATTRIBUTE is a symbol whose specification value to get.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
274 Return the value found, or nil if ATTRIBUTE is not one of the
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
275 attributes of TAG."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
276 (plist-get (semantic-tag-attributes tag) attribute))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
277
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
278 ;; These functions are for internal use only!
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
279 (defsubst semantic--tag-properties-cdr (tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
280 "Return the cons cell whose car is the PROPERTIES part of TAG.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
281 That function is for internal use only."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
282 (nthcdr 3 tag))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
283
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
284 (defun semantic--tag-put-property (tag property value)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
285 "Change value in TAG of PROPERTY to VALUE.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
286 If PROPERTY already exists, its value is set to VALUE, otherwise the
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
287 new PROPERTY VALUE pair is added.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
288 Return TAG.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
289 That function is for internal use only."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
290 (let* ((plist-cdr (semantic--tag-properties-cdr tag)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
291 (when (consp plist-cdr)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
292 (setcar plist-cdr
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
293 (semantic-tag-make-plist
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
294 (plist-put (car plist-cdr) property value))))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
295 tag))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
296
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
297 (defun semantic--tag-put-property-no-side-effect (tag property value)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
298 "Change value in TAG of PROPERTY to VALUE without side effects.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
299 All cons cells in the property list are replicated so that there
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
300 are no side effects if TAG is in shared lists.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
301 If PROPERTY already exists, its value is set to VALUE, otherwise the
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
302 new PROPERTY VALUE pair is added.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
303 Return TAG.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
304 That function is for internal use only."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
305 (let* ((plist-cdr (semantic--tag-properties-cdr tag)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
306 (when (consp plist-cdr)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
307 (setcar plist-cdr
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
308 (semantic-tag-make-plist
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
309 (plist-put (copy-sequence (car plist-cdr))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
310 property value))))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
311 tag))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
312
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
313 (defun semantic-tag-file-name (tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
314 "Return the name of the file from which TAG originated.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
315 Return nil if that information can't be obtained.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
316 If TAG is from a loaded buffer, then that buffer's filename is used.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
317 If TAG is unlinked, but has a :filename property, then that is used."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
318 (let ((buffer (semantic-tag-in-buffer-p tag)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
319 (if buffer
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
320 (buffer-file-name buffer)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
321 (semantic--tag-get-property tag :filename))))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
322
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
323 ;;; Tag tests and comparisons.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
324 (defsubst semantic-tag-p (tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
325 "Return non-nil if TAG is most likely a semantic tag."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
326 (condition-case nil
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
327 (and (consp tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
328 (stringp (car tag)) ; NAME
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
329 (symbolp (nth 1 tag)) (nth 1 tag) ; TAG-CLASS
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
330 (listp (nth 2 tag)) ; ATTRIBUTES
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
331 (listp (nth 3 tag)) ; PROPERTIES
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
332 )
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
333 ;; If an error occurs, then it most certainly is not a tag.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
334 (error nil)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
335
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
336 (defsubst semantic-tag-of-class-p (tag class)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
337 "Return non-nil if class of TAG is CLASS."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
338 (eq (semantic-tag-class tag) class))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
339
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
340 (defsubst semantic-tag-type-members (tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
341 "Return the members of the type that TAG describes.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
342 That is the value of the `:members' attribute."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
343 (semantic-tag-get-attribute tag :members))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
344
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
345 (defun semantic-tag-with-position-p (tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
346 "Return non-nil if TAG has positional information."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
347 (and (semantic-tag-p tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
348 (let ((o (semantic-tag-overlay tag)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
349 (or (and (semantic-overlay-p o)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
350 (semantic-overlay-live-p o))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
351 (arrayp o)))))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
352
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
353 (defun semantic-equivalent-tag-p (tag1 tag2)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
354 "Compare TAG1 and TAG2 and return non-nil if they are equivalent.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
355 Use `equal' on elements the name, class, and position.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
356 Use this function if tags are being copied and regrouped to test
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
357 for if two tags represent the same thing, but may be constructed
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
358 of different cons cells."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
359 (and (equal (semantic-tag-name tag1) (semantic-tag-name tag2))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
360 (semantic-tag-of-class-p tag1 (semantic-tag-class tag2))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
361 (or (and (not (semantic-tag-overlay tag1))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
362 (not (semantic-tag-overlay tag2)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
363 (and (semantic-tag-overlay tag1)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
364 (semantic-tag-overlay tag2)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
365 (equal (semantic-tag-bounds tag1)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
366 (semantic-tag-bounds tag2))))))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
367
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
368 (defsubst semantic-tag-type (tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
369 "Return the value of the `:type' attribute of TAG.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
370 For a function it would be the data type of the return value.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
371 For a variable, it is the storage type of that variable.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
372 For a data type, the type is the style of datatype, such as
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
373 struct or union."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
374 (semantic-tag-get-attribute tag :type))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
375
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
376 (defun semantic-tag-similar-p (tag1 tag2 &rest ignorable-attributes)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
377 "Test to see if TAG1 and TAG2 are similar.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
378 Two tags are similar if their name, datatype, and various attributes
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
379 are the same.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
380
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
381 Similar tags that have sub-tags such as arg lists or type members,
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
382 are similar w/out checking the sub-list of tags.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
383 Optional argument IGNORABLE-ATTRIBUTES are attributes to ignore while comparing similarity."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
384 (let* ((A1 (and (equal (semantic-tag-name tag1) (semantic-tag-name tag2))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
385 (semantic-tag-of-class-p tag1 (semantic-tag-class tag2))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
386 (semantic-tag-of-type-p tag1 (semantic-tag-type tag2))))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
387 (attr1 (semantic-tag-attributes tag1))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
388 (A2 (= (length attr1) (length (semantic-tag-attributes tag2))))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
389 (A3 t)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
390 )
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
391 (when (and (not A2) ignorable-attributes)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
392 (setq A2 t))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
393 (while (and A2 attr1 A3)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
394 (let ((a (car attr1))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
395 (v (car (cdr attr1))))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
396
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
397 (cond ((or (eq a :type) ;; already tested above.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
398 (memq a ignorable-attributes)) ;; Ignore them...
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
399 nil)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
400
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
401 ;; Don't test sublists of tags
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
402 ((and (listp v) (semantic-tag-p (car v)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
403 nil)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
404
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
405 ;; The attributes are not the same?
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
406 ((not (equal v (semantic-tag-get-attribute tag2 a)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
407 (setq A3 nil))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
408 (t
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
409 nil))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
410 )
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
411 (setq attr1 (cdr (cdr attr1))))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
412
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
413 (and A1 A2 A3)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
414 ))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
415
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
416 (defun semantic-tag-similar-with-subtags-p (tag1 tag2 &rest ignorable-attributes)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
417 "Test to see if TAG1 and TAG2 are similar.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
418 Uses `semantic-tag-similar-p' but also recurses through sub-tags, such
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
419 as argument lists and type members.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
420 Optional argument IGNORABLE-ATTRIBUTES is passed down to
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
421 `semantic-tag-similar-p'."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
422 (let ((C1 (semantic-tag-components tag1))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
423 (C2 (semantic-tag-components tag2))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
424 )
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
425 (if (or (/= (length C1) (length C2))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
426 (not (semantic-tag-similar-p tag1 tag2 ignorable-attributes))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
427 )
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
428 ;; Basic test fails.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
429 nil
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
430 ;; Else, check component lists.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
431 (catch 'component-dissimilar
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
432 (while C1
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
433
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
434 (if (not (semantic-tag-similar-with-subtags-p
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
435 (car C1) (car C2) ignorable-attributes))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
436 (throw 'component-dissimilar nil))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
437
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
438 (setq C1 (cdr C1))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
439 (setq C2 (cdr C2))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
440 )
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
441 ;; If we made it this far, we are ok.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
442 t) )))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
443
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
444
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
445 (defun semantic-tag-of-type-p (tag type)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
446 "Compare TAG's type against TYPE. Non nil if equivalent.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
447 TYPE can be a string, or a tag of class 'type.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
448 This can be complex since some tags might have a :type that is a tag,
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
449 while other tags might just have a string. This function will also be
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
450 return true of TAG's type is compared directly to the declaration of a
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
451 data type."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
452 (let* ((tagtype (semantic-tag-type tag))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
453 (tagtypestring (cond ((stringp tagtype)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
454 tagtype)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
455 ((and (semantic-tag-p tagtype)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
456 (semantic-tag-of-class-p tagtype 'type))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
457 (semantic-tag-name tagtype))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
458 (t "")))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
459 (typestring (cond ((stringp type)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
460 type)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
461 ((and (semantic-tag-p type)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
462 (semantic-tag-of-class-p type 'type))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
463 (semantic-tag-name type))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
464 (t "")))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
465 )
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
466 (and
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
467 tagtypestring
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
468 (or
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
469 ;; Matching strings (input type is string)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
470 (and (stringp type)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
471 (string= tagtypestring type))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
472 ;; Matching strings (tag type is string)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
473 (and (stringp tagtype)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
474 (string= tagtype typestring))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
475 ;; Matching tokens, and the type of the type is the same.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
476 (and (string= tagtypestring typestring)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
477 (if (and (semantic-tag-type tagtype) (semantic-tag-type type))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
478 (equal (semantic-tag-type tagtype) (semantic-tag-type type))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
479 t))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
480 ))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
481 ))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
482
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
483 (defun semantic-tag-type-compound-p (tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
484 "Return non-nil the type of TAG is compound.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
485 Compound implies a structure or similar data type.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
486 Returns the list of tag members if it is compound."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
487 (let* ((tagtype (semantic-tag-type tag))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
488 )
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
489 (when (and (semantic-tag-p tagtype)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
490 (semantic-tag-of-class-p tagtype 'type))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
491 ;; We have the potential of this being a nifty compound type.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
492 (semantic-tag-type-members tagtype)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
493 )))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
494
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
495 (defun semantic-tag-faux-p (tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
496 "Return non-nil if TAG is a FAUX tag.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
497 FAUX tags are created to represent a construct that is
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
498 not known to exist in the code.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
499
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
500 Example: When the class browser sees methods to a class, but
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
501 cannot find the class, it will create a faux tag to represent the
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
502 class to store those methods."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
503 (semantic--tag-get-property tag :faux-flag))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
504
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
505 ;;; Tag creation
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
506 ;;
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
507
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
508 ;; Is this function still necessary?
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
509 (defun semantic-tag-make-plist (args)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
510 "Create a property list with ARGS.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
511 Args is a property list of the form (KEY1 VALUE1 ... KEYN VALUEN).
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
512 Where KEY is a symbol, and VALUE is the value for that symbol.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
513 The return value will be a new property list, with these KEY/VALUE
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
514 pairs eliminated:
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
515
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
516 - KEY associated to nil VALUE.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
517 - KEY associated to an empty string VALUE.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
518 - KEY associated to a zero VALUE."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
519 (let (plist key val)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
520 (while args
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
521 (setq key (car args)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
522 val (nth 1 args)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
523 args (nthcdr 2 args))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
524 (or (member val '("" nil))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
525 (and (numberp val) (zerop val))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
526 (setq plist (cons key (cons val plist)))))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
527 ;; It is not useful to reverse the new plist.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
528 plist))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
529
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
530 (defsubst semantic-tag (name class &rest attributes)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
531 "Create a generic semantic tag.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
532 NAME is a string representing the name of this tag.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
533 CLASS is the symbol that represents the class of tag this is,
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
534 such as 'variable, or 'function.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
535 ATTRIBUTES is a list of additional attributes belonging to this tag."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
536 (list name class (semantic-tag-make-plist attributes) nil nil))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
537
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
538 (defsubst semantic-tag-new-variable (name type &optional default-value &rest attributes)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
539 "Create a semantic tag of class 'variable.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
540 NAME is the name of this variable.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
541 TYPE is a string or semantic tag representing the type of this variable.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
542 Optional DEFAULT-VALUE is a string representing the default value of this variable.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
543 ATTRIBUTES is a list of additional attributes belonging to this tag."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
544 (apply 'semantic-tag name 'variable
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
545 :type type
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
546 :default-value default-value
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
547 attributes))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
548
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
549 (defsubst semantic-tag-new-function (name type arg-list &rest attributes)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
550 "Create a semantic tag of class 'function.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
551 NAME is the name of this function.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
552 TYPE is a string or semantic tag representing the type of this function.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
553 ARG-LIST is a list of strings or semantic tags representing the
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
554 arguments of this function.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
555 ATTRIBUTES is a list of additional attributes belonging to this tag."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
556 (apply 'semantic-tag name 'function
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
557 :type type
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
558 :arguments arg-list
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
559 attributes))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
560
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
561 (defsubst semantic-tag-new-type (name type members parents &rest attributes)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
562 "Create a semantic tag of class 'type.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
563 NAME is the name of this type.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
564 TYPE is a string or semantic tag representing the type of this type.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
565 MEMBERS is a list of strings or semantic tags representing the
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
566 elements that make up this type if it is a composite type.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
567 PARENTS is a cons cell. (EXPLICIT-PARENTS . INTERFACE-PARENTS)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
568 EXPLICIT-PARENTS can be a single string (Just one parent) or a
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
569 list of parents (in a multiple inheritance situation). It can also
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
570 be nil.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
571 INTERFACE-PARENTS is a list of strings representing the names of
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
572 all INTERFACES, or abstract classes inherited from. It can also be
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
573 nil.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
574 This slot can be interesting because the form:
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
575 ( nil \"string\")
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
576 is a valid parent where there is no explicit parent, and only an
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
577 interface.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
578 ATTRIBUTES is a list of additional attributes belonging to this tag."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
579 (apply 'semantic-tag name 'type
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
580 :type type
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
581 :members members
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
582 :superclasses (car parents)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
583 :interfaces (cdr parents)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
584 attributes))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
585
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
586 (defsubst semantic-tag-new-include (name system-flag &rest attributes)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
587 "Create a semantic tag of class 'include.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
588 NAME is the name of this include.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
589 SYSTEM-FLAG represents that we were able to identify this include as belonging
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
590 to the system, as opposed to belonging to the local project.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
591 ATTRIBUTES is a list of additional attributes belonging to this tag."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
592 (apply 'semantic-tag name 'include
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
593 :system-flag system-flag
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
594 attributes))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
595
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
596 (defsubst semantic-tag-new-package (name detail &rest attributes)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
597 "Create a semantic tag of class 'package.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
598 NAME is the name of this package.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
599 DETAIL is extra information about this package, such as a location where
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
600 it can be found.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
601 ATTRIBUTES is a list of additional attributes belonging to this tag."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
602 (apply 'semantic-tag name 'package
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
603 :detail detail
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
604 attributes))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
605
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
606 (defsubst semantic-tag-new-code (name detail &rest attributes)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
607 "Create a semantic tag of class 'code.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
608 NAME is a name for this code.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
609 DETAIL is extra information about the code.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
610 ATTRIBUTES is a list of additional attributes belonging to this tag."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
611 (apply 'semantic-tag name 'code
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
612 :detail detail
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
613 attributes))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
614
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
615 (defsubst semantic-tag-set-faux (tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
616 "Set TAG to be a new FAUX tag.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
617 FAUX tags represent constructs not found in the source code.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
618 You can identify a faux tag with `semantic-tag-faux-p'"
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
619 (semantic--tag-put-property tag :faux-flag t))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
620
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
621 (defsubst semantic-tag-set-name (tag name)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
622 "Set TAG name to NAME."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
623 (setcar tag name))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
624
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
625 ;;; Copying and cloning tags.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
626 ;;
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
627 (defsubst semantic-tag-clone (tag &optional name)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
628 "Clone TAG, creating a new TAG.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
629 If optional argument NAME is not nil it specifies a new name for the
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
630 cloned tag."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
631 ;; Right now, TAG is a list.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
632 (list (or name (semantic-tag-name tag))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
633 (semantic-tag-class tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
634 (copy-sequence (semantic-tag-attributes tag))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
635 (copy-sequence (semantic-tag-properties tag))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
636 (semantic-tag-overlay tag)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
637
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
638 (defun semantic-tag-copy (tag &optional name keep-file)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
639 "Return a copy of TAG unlinked from the originating buffer.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
640 If optional argument NAME is non-nil it specifies a new name for the
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
641 copied tag.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
642 If optional argument KEEP-FILE is non-nil, and TAG was linked to a
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
643 buffer, the originating buffer file name is kept in the `:filename'
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
644 property of the copied tag.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
645 If KEEP-FILE is a string, and the orginating buffer is NOT available,
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
646 then KEEP-FILE is stored on the `:filename' property.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
647 This runs the tag hook `unlink-copy-hook`."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
648 ;; Right now, TAG is a list.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
649 (let ((copy (semantic-tag-clone tag name)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
650
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
651 ;; Keep the filename if needed.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
652 (when keep-file
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
653 (semantic--tag-put-property
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
654 copy :filename (or (semantic-tag-file-name copy)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
655 (and (stringp keep-file)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
656 keep-file)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
657 )))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
658
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
659 (when (semantic-tag-with-position-p tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
660 ;; Convert the overlay to a vector, effectively 'unlinking' the tag.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
661 (semantic--tag-set-overlay
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
662 copy (vector (semantic-tag-start copy) (semantic-tag-end copy)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
663
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
664 ;; Force the children to be copied also.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
665 ;;(let ((chil (semantic--tag-copy-list
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
666 ;; (semantic-tag-components-with-overlays tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
667 ;; keep-file)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
668 ;;;; Put the list into TAG.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
669 ;;)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
670
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
671 ;; Call the unlink-copy hook. This should tell tools that
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
672 ;; this tag is not part of any buffer.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
673 (when (semantic-overlay-p (semantic-tag-overlay tag))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
674 (semantic--tag-run-hooks copy 'unlink-copy-hook))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
675 )
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
676 copy))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
677
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
678 ;;(defun semantic--tag-copy-list (tags &optional keep-file)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
679 ;; "Make copies of TAGS and return the list of TAGS."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
680 ;; (let ((out nil))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
681 ;; (dolist (tag tags out)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
682 ;; (setq out (cons (semantic-tag-copy tag nil keep-file)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
683 ;; out))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
684 ;; )))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
685
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
686 (defun semantic--tag-copy-properties (tag1 tag2)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
687 "Copy private properties from TAG1 to TAG2.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
688 Return TAG2.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
689 This function is for internal use only."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
690 (let ((plist (semantic-tag-properties tag1)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
691 (while plist
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
692 (semantic--tag-put-property tag2 (car plist) (nth 1 plist))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
693 (setq plist (nthcdr 2 plist)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
694 tag2))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
695
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
696 ;;; DEEP COPIES
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
697 ;;
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
698 (defun semantic-tag-deep-copy-one-tag (tag &optional filter)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
699 "Make a deep copy of TAG, applying FILTER to each child-tag.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
700 Properties and overlay info are not copied.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
701 FILTER takes TAG as an argument, and should returns a semantic-tag.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
702 It is safe for FILTER to modify the input tag and return it."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
703 (when (not filter) (setq filter 'identity))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
704 (when (not (semantic-tag-p tag))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
705 (signal 'wrong-type-argument (list tag 'semantic-tag-p)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
706 (funcall filter (list (semantic-tag-name tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
707 (semantic-tag-class tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
708 (semantic--tag-deep-copy-attributes
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
709 (semantic-tag-attributes tag) filter)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
710 nil
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
711 nil)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
712
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
713 (defun semantic--tag-deep-copy-attributes (attrs &optional filter)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
714 "Make a deep copy of ATTRS, applying FILTER to each child-tag.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
715
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
716 It is safe to modify ATTR, and return a permutaion of that list.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
717
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
718 FILTER takes TAG as an argument, and should returns a semantic-tag.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
719 It is safe for FILTER to modify the input tag and return it."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
720 (when (car attrs)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
721 (when (not (symbolp (car attrs))) (error "Bad Attribute List in tag"))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
722 (cons (car attrs)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
723 (cons (semantic--tag-deep-copy-value (nth 1 attrs) filter)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
724 (semantic--tag-deep-copy-attributes (nthcdr 2 attrs) filter)))))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
725
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
726 (defun semantic--tag-deep-copy-value (value &optional filter)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
727 "Make a deep copy of VALUE, applying FILTER to each child-tag.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
728
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
729 It is safe to modify VALUE, and return a permutaion of that list.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
730
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
731 FILTER takes TAG as an argument, and should returns a semantic-tag.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
732 It is safe for FILTER to modify the input tag and return it."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
733 (cond
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
734 ;; Another tag.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
735 ((semantic-tag-p value)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
736 (semantic-tag-deep-copy-one-tag value filter))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
737
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
738 ;; A list of more tags
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
739 ((and (listp value) (semantic-tag-p (car value)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
740 (semantic--tag-deep-copy-tag-list value filter))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
741
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
742 ;; Some arbitrary data.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
743 (t value)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
744
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
745 (defun semantic--tag-deep-copy-tag-list (tags &optional filter)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
746 "Make a deep copy of TAGS, applying FILTER to each child-tag.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
747
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
748 It is safe to modify the TAGS list, and return a permutaion of that list.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
749
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
750 FILTER takes TAG as an argument, and should returns a semantic-tag.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
751 It is safe for FILTER to modify the input tag and return it."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
752 (when (car tags)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
753 (if (semantic-tag-p (car tags))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
754 (cons (semantic-tag-deep-copy-one-tag (car tags) filter)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
755 (semantic--tag-deep-copy-tag-list (cdr tags) filter))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
756 (cons (car tags) (semantic--tag-deep-copy-tag-list (cdr tags) filter)))))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
757
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
758
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
759 ;;; Standard Tag Access
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
760 ;;
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
761
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
762 ;;; Common
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
763 ;;
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
764
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
765 (defsubst semantic-tag-modifiers (tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
766 "Return the value of the `:typemodifiers' attribute of TAG."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
767 (semantic-tag-get-attribute tag :typemodifiers))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
768
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
769 (defun semantic-tag-docstring (tag &optional buffer)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
770 "Return the documentation of TAG.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
771 That is the value defined by the `:documentation' attribute.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
772 Optional argument BUFFER indicates where to get the text from.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
773 If not provided, then only the POSITION can be provided.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
774
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
775 If you want to get documentation for languages that do not store
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
776 the documentation string in the tag itself, use
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
777 `semantic-documentation-for-tag' instead."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
778 (let ((p (semantic-tag-get-attribute tag :documentation)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
779 (cond
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
780 ((stringp p) p) ;; it is the doc string.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
781
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
782 ((semantic-lex-token-with-text-p p)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
783 (semantic-lex-token-text p))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
784
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
785 ((and (semantic-lex-token-without-text-p p)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
786 buffer)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
787 (with-current-buffer buffer
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
788 (semantic-lex-token-text (car (semantic-lex p (1+ p))))))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
789
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
790 (t nil))))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
791
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
792 ;;; Generic attributes for tags of any class.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
793 ;;
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
794 (defsubst semantic-tag-named-parent (tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
795 "Return the parent of TAG.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
796 That is the value of the `:parent' attribute.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
797 If a definition can occur outside an actual parent structure, but
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
798 refers to that parent by name, then the :parent attribute should be used."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
799 (semantic-tag-get-attribute tag :parent))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
800
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
801 ;;; Tags of class `type'
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
802
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
803 (defun semantic-tag-type-superclasses (tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
804 "Return the list of superclass names of the type that TAG describes."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
805 (let ((supers (semantic-tag-get-attribute tag :superclasses)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
806 (cond ((stringp supers)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
807 ;; If we have a string, make it a list.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
808 (list supers))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
809 ((semantic-tag-p supers)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
810 ;; If we have one tag, return just the name.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
811 (list (semantic-tag-name supers)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
812 ((and (consp supers) (semantic-tag-p (car supers)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
813 ;; If we have a tag list, then return the names.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
814 (mapcar (lambda (s) (semantic-tag-name s))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
815 supers))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
816 ((consp supers)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
817 ;; A list of something, return it.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
818 supers))))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
819
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
820 (defun semantic--tag-find-parent-by-name (name supers)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
821 "Find the superclass NAME in the list of SUPERS.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
822 If a simple search doesn't do it, try splitting up the names
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
823 in SUPERS."
104418
12884dc43872 * cedet/semantic/tag.el: Add declare-function statements for
Chong Yidong <cyd@stupidchicken.com>
parents: 104416
diff changeset
824 (require 'semantic/find)
104412
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
825 (let ((stag nil))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
826 (setq stag (semantic-find-first-tag-by-name name supers))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
827
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
828 (when (not stag)
104418
12884dc43872 * cedet/semantic/tag.el: Add declare-function statements for
Chong Yidong <cyd@stupidchicken.com>
parents: 104416
diff changeset
829 (require 'semantic/analyze/fcn)
104412
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
830 (dolist (S supers)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
831 (let* ((sname (semantic-tag-name S))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
832 (splitparts (semantic-analyze-split-name sname))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
833 (parts (if (stringp splitparts)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
834 (list splitparts)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
835 (nreverse splitparts))))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
836 (when (string= name (car parts))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
837 (setq stag S))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
838 )))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
839
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
840 stag))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
841
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
842 (defun semantic-tag-type-superclass-protection (tag parentstring)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
843 "Return the inheritance protection in TAG from PARENTSTRING.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
844 PARENTSTRING is the name of the parent being inherited.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
845 The return protection is a symbol, 'public, 'protection, and 'private."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
846 (let ((supers (semantic-tag-get-attribute tag :superclasses)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
847 (cond ((stringp supers)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
848 'public)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
849 ((semantic-tag-p supers)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
850 (let ((prot (semantic-tag-get-attribute supers :protection)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
851 (or (cdr (assoc prot '(("public" . public)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
852 ("protected" . protected)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
853 ("private" . private))))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
854 'public)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
855 ((and (consp supers) (stringp (car supers)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
856 'public)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
857 ((and (consp supers) (semantic-tag-p (car supers)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
858 (let* ((stag (semantic--tag-find-parent-by-name parentstring supers))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
859 (prot (when stag
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
860 (semantic-tag-get-attribute stag :protection))))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
861 (or (cdr (assoc prot '(("public" . public)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
862 ("protected" . protected)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
863 ("private" . private))))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
864 (when (equal prot "unspecified")
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
865 (if (semantic-tag-of-type-p tag "class")
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
866 'private
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
867 'public))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
868 'public))))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
869 ))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
870
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
871 (defsubst semantic-tag-type-interfaces (tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
872 "Return the list of interfaces of the type that TAG describes."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
873 ;; @todo - make this as robust as the above.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
874 (semantic-tag-get-attribute tag :interfaces))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
875
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
876 ;;; Tags of class `function'
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
877 ;;
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
878 (defsubst semantic-tag-function-arguments (tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
879 "Return the arguments of the function that TAG describes.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
880 That is the value of the `:arguments' attribute."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
881 (semantic-tag-get-attribute tag :arguments))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
882
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
883 (defsubst semantic-tag-function-throws (tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
884 "Return the exceptions the function that TAG describes can throw.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
885 That is the value of the `:throws' attribute."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
886 (semantic-tag-get-attribute tag :throws))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
887
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
888 (defsubst semantic-tag-function-parent (tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
889 "Return the parent of the function that TAG describes.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
890 That is the value of the `:parent' attribute.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
891 A function has a parent if it is a method of a class, and if the
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
892 function does not appear in body of it's parent class."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
893 (semantic-tag-named-parent tag))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
894
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
895 (defsubst semantic-tag-function-destructor-p (tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
896 "Return non-nil if TAG describes a destructor function.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
897 That is the value of the `:destructor-flag' attribute."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
898 (semantic-tag-get-attribute tag :destructor-flag))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
899
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
900 (defsubst semantic-tag-function-constructor-p (tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
901 "Return non-nil if TAG describes a constructor function.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
902 That is the value of the `:constructor-flag' attribute."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
903 (semantic-tag-get-attribute tag :constructor-flag))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
904
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
905 ;;; Tags of class `variable'
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
906 ;;
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
907 (defsubst semantic-tag-variable-default (tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
908 "Return the default value of the variable that TAG describes.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
909 That is the value of the attribute `:default-value'."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
910 (semantic-tag-get-attribute tag :default-value))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
911
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
912 (defsubst semantic-tag-variable-constant-p (tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
913 "Return non-nil if the variable that TAG describes is a constant.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
914 That is the value of the attribute `:constant-flag'."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
915 (semantic-tag-get-attribute tag :constant-flag))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
916
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
917 ;;; Tags of class `include'
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
918 ;;
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
919 (defsubst semantic-tag-include-system-p (tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
920 "Return non-nil if the include that TAG describes is a system include.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
921 That is the value of the attribute `:system-flag'."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
922 (semantic-tag-get-attribute tag :system-flag))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
923
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
924 (define-overloadable-function semantic-tag-include-filename (tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
925 "Return a filename representation of TAG.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
926 The default action is to return the `semantic-tag-name'.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
927 Some languages do not use full filenames in their include statements.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
928 Override this method to translate the code represenation
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
929 into a filename. (A relative filename if necessary.)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
930
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
931 See `semantic-dependency-tag-file' to expand an include
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
932 tag to a full file name.")
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
933
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
934 (defun semantic-tag-include-filename-default (tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
935 "Return a filename representation of TAG.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
936 Returns `semantic-tag-name'."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
937 (semantic-tag-name tag))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
938
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
939 ;;; Tags of class `code'
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
940 ;;
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
941 (defsubst semantic-tag-code-detail (tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
942 "Return detail information from code that TAG describes.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
943 That is the value of the attribute `:detail'."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
944 (semantic-tag-get-attribute tag :detail))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
945
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
946 ;;; Tags of class `alias'
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
947 ;;
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
948 (defsubst semantic-tag-new-alias (name meta-tag-class value &rest attributes)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
949 "Create a semantic tag of class alias.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
950 NAME is a name for this alias.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
951 META-TAG-CLASS is the class of the tag this tag is an alias.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
952 VALUE is the aliased definition.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
953 ATTRIBUTES is a list of additional attributes belonging to this tag."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
954 (apply 'semantic-tag name 'alias
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
955 :aliasclass meta-tag-class
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
956 :definition value
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
957 attributes))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
958
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
959 (defsubst semantic-tag-alias-class (tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
960 "Return the class of tag TAG is an alias."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
961 (semantic-tag-get-attribute tag :aliasclass))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
962
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
963 (define-overloadable-function semantic-tag-alias-definition (tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
964 "Return the definition TAG is an alias.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
965 The returned value is a tag of the class that
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
966 `semantic-tag-alias-class' returns for TAG.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
967 The default is to return the value of the :definition attribute.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
968 Return nil if TAG is not of class 'alias."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
969 (when (semantic-tag-of-class-p tag 'alias)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
970 (:override
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
971 (semantic-tag-get-attribute tag :definition))))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
972
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
973 ;;; Language Specific Tag access via overload
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
974 ;;
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
975 (define-overloadable-function semantic-tag-components (tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
976 "Return a list of components for TAG.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
977 A Component is a part of TAG which itself may be a TAG.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
978 Examples include the elements of a structure in a
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
979 tag of class `type, or the list of arguments to a
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
980 tag of class 'function."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
981 )
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
982
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
983 (defun semantic-tag-components-default (tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
984 "Return a list of components for TAG.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
985 Perform the described task in `semantic-tag-components'."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
986 (cond ((semantic-tag-of-class-p tag 'type)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
987 (semantic-tag-type-members tag))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
988 ((semantic-tag-of-class-p tag 'function)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
989 (semantic-tag-function-arguments tag))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
990 (t nil)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
991
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
992 (define-overloadable-function semantic-tag-components-with-overlays (tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
993 "Return the list of top level components belonging to TAG.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
994 Children are any sub-tags which contain overlays.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
995
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
996 Default behavior is to get `semantic-tag-components' in addition
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
997 to the components of an anonymous types (if applicable.)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
998
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
999 Note for language authors:
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1000 If a mode defines a language tag that has tags in it with overlays
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1001 you should still return them with this function.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1002 Ignoring this step will prevent several features from working correctly."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1003 )
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1004
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1005 (defun semantic-tag-components-with-overlays-default (tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1006 "Return the list of top level components belonging to TAG.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1007 Children are any sub-tags which contain overlays.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1008 The default action collects regular components of TAG, in addition
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1009 to any components beloning to an anonymous type."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1010 (let ((explicit-children (semantic-tag-components tag))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1011 (type (semantic-tag-type tag))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1012 (anon-type-children nil)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1013 (all-children nil))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1014 ;; Identify if this tag has an anonymous structure as
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1015 ;; its type. This implies it may have children with overlays.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1016 (when (and type (semantic-tag-p type))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1017 (setq anon-type-children (semantic-tag-components type))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1018 ;; Add anonymous children
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1019 (while anon-type-children
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1020 (when (semantic-tag-with-position-p (car anon-type-children))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1021 (setq all-children (cons (car anon-type-children) all-children)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1022 (setq anon-type-children (cdr anon-type-children))))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1023 ;; Add explicit children
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1024 (while explicit-children
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1025 (when (semantic-tag-with-position-p (car explicit-children))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1026 (setq all-children (cons (car explicit-children) all-children)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1027 (setq explicit-children (cdr explicit-children)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1028 ;; Return
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1029 (nreverse all-children)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1030
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1031 (defun semantic-tag-children-compatibility (tag &optional positiononly)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1032 "Return children of TAG.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1033 If POSITIONONLY is nil, use `semantic-tag-components'.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1034 If POSITIONONLY is non-nil, use `semantic-tag-components-with-overlays'.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1035 DO NOT use this fcn in new code. Use one of the above instead."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1036 (if positiononly
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1037 (semantic-tag-components-with-overlays tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1038 (semantic-tag-components tag)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1039
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1040 ;;; Tag Region
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1041 ;;
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1042 ;; A Tag represents a region in a buffer. You can narrow to that tag.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1043 ;;
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1044 (defun semantic-narrow-to-tag (&optional tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1045 "Narrow to the region specified by the bounds of TAG.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1046 See `semantic-tag-bounds'."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1047 (interactive)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1048 (if (not tag) (setq tag (semantic-current-tag)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1049 (narrow-to-region (semantic-tag-start tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1050 (semantic-tag-end tag)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1051
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1052 (defmacro semantic-with-buffer-narrowed-to-current-tag (&rest body)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1053 "Execute BODY with the buffer narrowed to the current tag."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1054 `(save-restriction
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1055 (semantic-narrow-to-tag (semantic-current-tag))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1056 ,@body))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1057 (put 'semantic-with-buffer-narrowed-to-current-tag 'lisp-indent-function 0)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1058 (add-hook 'edebug-setup-hook
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1059 (lambda ()
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1060 (def-edebug-spec semantic-with-buffer-narrowed-to-current-tag
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1061 (def-body))))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1062
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1063 (defmacro semantic-with-buffer-narrowed-to-tag (tag &rest body)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1064 "Narrow to TAG, and execute BODY."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1065 `(save-restriction
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1066 (semantic-narrow-to-tag ,tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1067 ,@body))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1068 (put 'semantic-with-buffer-narrowed-to-tag 'lisp-indent-function 1)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1069 (add-hook 'edebug-setup-hook
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1070 (lambda ()
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1071 (def-edebug-spec semantic-with-buffer-narrowed-to-tag
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1072 (def-body))))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1073
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1074 ;;; Tag Hooks
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1075 ;;
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1076 ;; Semantic may want to provide special hooks when specific operations
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1077 ;; are about to happen on a given tag. These routines allow for hook
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1078 ;; maintenance on a tag.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1079
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1080 ;; Internal global variable used to manage tag hooks. For example,
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1081 ;; some implementation of `remove-hook' checks that the hook variable
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1082 ;; is `default-boundp'.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1083 (defvar semantic--tag-hook-value)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1084
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1085 (defun semantic-tag-add-hook (tag hook function &optional append)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1086 "Onto TAG, add to the value of HOOK the function FUNCTION.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1087 FUNCTION is added (if necessary) at the beginning of the hook list
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1088 unless the optional argument APPEND is non-nil, in which case
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1089 FUNCTION is added at the end.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1090 HOOK should be a symbol, and FUNCTION may be any valid function.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1091 See also the function `add-hook'."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1092 (let ((semantic--tag-hook-value (semantic--tag-get-property tag hook)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1093 (add-hook 'semantic--tag-hook-value function append)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1094 (semantic--tag-put-property tag hook semantic--tag-hook-value)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1095 semantic--tag-hook-value))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1096
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1097 (defun semantic-tag-remove-hook (tag hook function)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1098 "Onto TAG, remove from the value of HOOK the function FUNCTION.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1099 HOOK should be a symbol, and FUNCTION may be any valid function. If
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1100 FUNCTION isn't the value of HOOK, or, if FUNCTION doesn't appear in
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1101 the list of hooks to run in HOOK, then nothing is done.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1102 See also the function `remove-hook'."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1103 (let ((semantic--tag-hook-value (semantic--tag-get-property tag hook)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1104 (remove-hook 'semantic--tag-hook-value function)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1105 (semantic--tag-put-property tag hook semantic--tag-hook-value)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1106 semantic--tag-hook-value))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1107
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1108 (defun semantic--tag-run-hooks (tag hook &rest args)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1109 "Run for TAG all expressions saved on the property HOOK.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1110 Each hook expression must take at least one argument, the TAG.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1111 For any given situation, additional ARGS may be passed."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1112 (let ((semantic--tag-hook-value (semantic--tag-get-property tag hook))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1113 (arglist (cons tag args)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1114 (condition-case err
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1115 ;; If a hook bombs, ignore it! Usually this is tied into
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1116 ;; some sort of critical system.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1117 (apply 'run-hook-with-args 'semantic--tag-hook-value arglist)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1118 (error (message "Error: %S" err)))))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1119
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1120 ;;; Tags and Overlays
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1121 ;;
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1122 ;; Overlays are used so that we can quickly identify tags from
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1123 ;; buffer positions and regions using built in Emacs commands.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1124 ;;
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1125
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1126 (defsubst semantic--tag-unlink-list-from-buffer (tags)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1127 "Convert TAGS from using an overlay to using an overlay proxy.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1128 This function is for internal use only."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1129 (mapcar 'semantic--tag-unlink-from-buffer tags))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1130
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1131 (defun semantic--tag-unlink-from-buffer (tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1132 "Convert TAG from using an overlay to using an overlay proxy.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1133 This function is for internal use only."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1134 (when (semantic-tag-p tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1135 (let ((o (semantic-tag-overlay tag)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1136 (when (semantic-overlay-p o)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1137 (semantic--tag-set-overlay
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1138 tag (vector (semantic-overlay-start o)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1139 (semantic-overlay-end o)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1140 (semantic-overlay-delete o))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1141 ;; Look for a link hook on TAG.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1142 (semantic--tag-run-hooks tag 'unlink-hook)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1143 ;; Fix the sub-tags which contain overlays.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1144 (semantic--tag-unlink-list-from-buffer
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1145 (semantic-tag-components-with-overlays tag)))))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1146
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1147 (defsubst semantic--tag-link-list-to-buffer (tags)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1148 "Convert TAGS from using an overlay proxy to using an overlay.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1149 This function is for internal use only."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1150 (mapcar 'semantic--tag-link-to-buffer tags))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1151
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1152 (defun semantic--tag-link-to-buffer (tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1153 "Convert TAG from using an overlay proxy to using an overlay.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1154 This function is for internal use only."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1155 (when (semantic-tag-p tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1156 (let ((o (semantic-tag-overlay tag)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1157 (when (and (vectorp o) (= (length o) 2))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1158 (setq o (semantic-make-overlay (aref o 0) (aref o 1)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1159 (current-buffer)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1160 (semantic--tag-set-overlay tag o)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1161 (semantic-overlay-put o 'semantic tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1162 ;; Clear the :filename property
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1163 (semantic--tag-put-property tag :filename nil))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1164 ;; Look for a link hook on TAG.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1165 (semantic--tag-run-hooks tag 'link-hook)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1166 ;; Fix the sub-tags which contain overlays.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1167 (semantic--tag-link-list-to-buffer
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1168 (semantic-tag-components-with-overlays tag)))))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1169
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1170 (defun semantic--tag-unlink-cache-from-buffer ()
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1171 "Convert all tags in the current cache to use overlay proxys.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1172 This function is for internal use only."
104418
12884dc43872 * cedet/semantic/tag.el: Add declare-function statements for
Chong Yidong <cyd@stupidchicken.com>
parents: 104416
diff changeset
1173 (require 'semantic)
104412
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1174 (semantic--tag-unlink-list-from-buffer
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1175 ;; @todo- use fetch-tags-fast?
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1176 (semantic-fetch-tags)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1177
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1178 (defvar semantic--buffer-cache)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1179
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1180 (defun semantic--tag-link-cache-to-buffer ()
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1181 "Convert all tags in the current cache to use overlays.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1182 This function is for internal use only."
104418
12884dc43872 * cedet/semantic/tag.el: Add declare-function statements for
Chong Yidong <cyd@stupidchicken.com>
parents: 104416
diff changeset
1183 (require 'semantic)
104412
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1184 (condition-case nil
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1185 ;; In this unique case, we cannot call the usual toplevel fn.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1186 ;; because we don't want a reparse, we want the old overlays.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1187 (semantic--tag-link-list-to-buffer
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1188 semantic--buffer-cache)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1189 ;; Recover when there is an error restoring the cache.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1190 (error (message "Error recovering tag list")
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1191 (semantic-clear-toplevel-cache)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1192 nil)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1193
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1194 ;;; Tag Cooking
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1195 ;;
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1196 ;; Raw tags from a parser follow a different positional format than
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1197 ;; those used in the buffer cache. Raw tags need to be cooked into
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1198 ;; semantic cache friendly tags for use by the masses.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1199 ;;
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1200 (defsubst semantic--tag-expanded-p (tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1201 "Return non-nil if TAG is expanded.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1202 This function is for internal use only.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1203 See also the function `semantic--expand-tag'."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1204 ;; In fact a cooked tag is actually a list of cooked tags
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1205 ;; because a raw tag can be expanded in several cooked ones!
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1206 (when (consp tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1207 (while (and (semantic-tag-p (car tag))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1208 (vectorp (semantic-tag-overlay (car tag))))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1209 (setq tag (cdr tag)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1210 (null tag)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1211
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1212 (defvar semantic-tag-expand-function nil
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1213 "Function used to expand a tag.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1214 It is passed each tag production, and must return a list of tags
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1215 derived from it, or nil if it does not need to be expanded.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1216
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1217 Languages with compound definitions should use this function to expand
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1218 from one compound symbol into several. For example, in C or Java the
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1219 following definition is easily parsed into one tag:
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1220
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1221 int a, b;
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1222
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1223 This function should take this compound tag and turn it into two tags,
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1224 one for A, and the other for B.")
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1225 (make-variable-buffer-local 'semantic-tag-expand-function)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1226
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1227 (defun semantic--tag-expand (tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1228 "Convert TAG from a raw state to a cooked state, and expand it.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1229 Returns a list of cooked tags.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1230
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1231 The parser returns raw tags with positional data START END at the
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1232 end of the tag data structure (a list for now). We convert it from
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1233 that to a cooked state that uses an overlay proxy, that is, a vector
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1234 \[START END].
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1235
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1236 The raw tag is changed with side effects and maybe expanded in
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1237 several derived tags when the variable `semantic-tag-expand-function'
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1238 is set.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1239
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1240 This function is for internal use only."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1241 (if (semantic--tag-expanded-p tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1242 ;; Just return TAG if it is already expanded (by a grammar
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1243 ;; semantic action), or if it isn't recognized as a valid
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1244 ;; semantic tag.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1245 tag
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1246
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1247 ;; Try to cook the tag. This code will be removed when tag will
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1248 ;; be directly created with the right format.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1249 (condition-case nil
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1250 (let ((ocdr (semantic--tag-overlay-cdr tag)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1251 ;; OCDR contains the sub-list of TAG whose car is the
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1252 ;; OVERLAY part of TAG. That is, a list (OVERLAY START END).
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1253 ;; Convert it into an overlay proxy ([START END]).
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1254 (semantic--tag-set-overlay
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1255 tag (vector (nth 1 ocdr) (nth 2 ocdr)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1256 ;; Remove START END positions at end of tag.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1257 (setcdr ocdr nil)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1258 ;; At this point (length TAG) must be 5!
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1259 ;;(unless (= (length tag) 5)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1260 ;; (error "Tag expansion failed"))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1261 )
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1262 (error
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1263 (message "A Rule must return a single tag-line list!")
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1264 (debug tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1265 nil))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1266
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1267 ;; @todo - I think we've waited long enough. Lets find out.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1268 ;;
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1269 ;; ;; Compatibility code to be removed in future versions.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1270 ;; (unless semantic-tag-expand-function
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1271 ;; ;; This line throws a byte compiler warning.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1272 ;; (setq semantic-tag-expand-function semantic-expand-nonterminal)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1273 ;; )
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1274
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1275 ;; Expand based on local configuration
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1276 (if semantic-tag-expand-function
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1277 (or (funcall semantic-tag-expand-function tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1278 (list tag))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1279 (list tag))))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1280
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1281 ;; Foreign tags
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1282 ;;
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1283 (defmacro semantic-foreign-tag-invalid (tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1284 "Signal that TAG is an invalid foreign tag."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1285 `(signal 'wrong-type-argument '(semantic-foreign-tag-p ,tag)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1286
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1287 (defsubst semantic-foreign-tag-p (tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1288 "Return non-nil if TAG is a foreign tag.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1289 That is, a tag unlinked from the originating buffer, which carries the
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1290 originating buffer file name, and major mode."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1291 (and (semantic-tag-p tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1292 (semantic--tag-get-property tag :foreign-flag)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1293
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1294 (defsubst semantic-foreign-tag-check (tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1295 "Check that TAG is a valid foreign tag.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1296 Signal an error if not."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1297 (or (semantic-foreign-tag-p tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1298 (semantic-foreign-tag-invalid tag)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1299
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1300 (defun semantic-foreign-tag (&optional tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1301 "Return a copy of TAG as a foreign tag, or nil if it can't be done.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1302 TAG defaults to the tag at point in current buffer.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1303 See also `semantic-foreign-tag-p'."
104418
12884dc43872 * cedet/semantic/tag.el: Add declare-function statements for
Chong Yidong <cyd@stupidchicken.com>
parents: 104416
diff changeset
1304 (require 'semantic/doc)
104412
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1305 (or tag (setq tag (semantic-current-tag)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1306 (when (semantic-tag-p tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1307 (let ((ftag (semantic-tag-copy tag nil t))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1308 ;; Do extra work for the doc strings, since this is a
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1309 ;; common use case.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1310 (doc (condition-case nil
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1311 (semantic-documentation-for-tag tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1312 (error nil))))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1313 ;; A foreign tag must carry its originating buffer file name!
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1314 (when (semantic--tag-get-property ftag :filename)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1315 (semantic--tag-put-property ftag :mode (semantic-tag-mode tag))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1316 (semantic--tag-put-property ftag :documentation doc)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1317 (semantic--tag-put-property ftag :foreign-flag t)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1318 ftag))))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1319
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1320 ;; High level obtain/insert foreign tag overloads
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1321 (define-overloadable-function semantic-obtain-foreign-tag (&optional tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1322 "Obtain a foreign tag from TAG.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1323 TAG defaults to the tag at point in current buffer.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1324 Return the obtained foreign tag or nil if failed."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1325 (semantic-foreign-tag tag))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1326
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1327 (defun semantic-insert-foreign-tag-default (foreign-tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1328 "Insert FOREIGN-TAG into the current buffer.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1329 The default behavior assumes the current buffer is a language file,
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1330 and attempts to insert a prototype/function call."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1331 ;; Long term goal: Have a mechanism for a tempo-like template insert
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1332 ;; for the given tag.
104418
12884dc43872 * cedet/semantic/tag.el: Add declare-function statements for
Chong Yidong <cyd@stupidchicken.com>
parents: 104416
diff changeset
1333 (require 'semantic/format)
104412
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1334 (insert (semantic-format-tag-prototype foreign-tag)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1335
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1336 (define-overloadable-function semantic-insert-foreign-tag (foreign-tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1337 "Insert FOREIGN-TAG into the current buffer.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1338 Signal an error if FOREIGN-TAG is not a valid foreign tag.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1339 This function is overridable with the symbol `insert-foreign-tag'."
104418
12884dc43872 * cedet/semantic/tag.el: Add declare-function statements for
Chong Yidong <cyd@stupidchicken.com>
parents: 104416
diff changeset
1340 (require 'semantic/format)
104412
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1341 (semantic-foreign-tag-check foreign-tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1342 (:override)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1343 (message (semantic-format-tag-summarize foreign-tag)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1344
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1345 ;;; Support log modes here
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1346 (define-mode-local-override semantic-insert-foreign-tag
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1347 log-edit-mode (foreign-tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1348 "Insert foreign tags into log-edit mode."
104418
12884dc43872 * cedet/semantic/tag.el: Add declare-function statements for
Chong Yidong <cyd@stupidchicken.com>
parents: 104416
diff changeset
1349 (require 'semantic/format)
104412
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1350 (insert (concat "(" (semantic-format-tag-name foreign-tag) "): ")))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1351
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1352 (define-mode-local-override semantic-insert-foreign-tag
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1353 change-log-mode (foreign-tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1354 "Insert foreign tags into log-edit mode."
104418
12884dc43872 * cedet/semantic/tag.el: Add declare-function statements for
Chong Yidong <cyd@stupidchicken.com>
parents: 104416
diff changeset
1355 (require 'semantic/format)
104412
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1356 (insert (concat "(" (semantic-format-tag-name foreign-tag) "): ")))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1357
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1358
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1359 ;;; EDEBUG display support
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1360 ;;
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1361 (eval-after-load "cedet-edebug"
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1362 '(progn
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1363 (cedet-edebug-add-print-override
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1364 '(semantic-tag-p object)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1365 '(concat "#<TAG " (semantic-format-tag-name object) ">"))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1366 (cedet-edebug-add-print-override
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1367 '(and (listp object) (semantic-tag-p (car object)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1368 '(cedet-edebug-prin1-recurse object))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1369 ))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1370
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1371 ;;; Compatibility
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1372 ;;
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1373 (defconst semantic-token-version
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1374 semantic-tag-version)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1375 (defconst semantic-token-incompatible-version
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1376 semantic-tag-incompatible-version)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1377
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1378 (semantic-alias-obsolete 'semantic-token-name
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1379 'semantic-tag-name)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1380
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1381 (semantic-alias-obsolete 'semantic-token-token
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1382 'semantic-tag-class)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1383
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1384 (semantic-alias-obsolete 'semantic-token-extra-specs
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1385 'semantic-tag-attributes)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1386
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1387 (semantic-alias-obsolete 'semantic-token-properties
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1388 'semantic-tag-properties)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1389
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1390 (semantic-alias-obsolete 'semantic-token-properties-cdr
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1391 'semantic--tag-properties-cdr)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1392
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1393 (semantic-alias-obsolete 'semantic-token-overlay
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1394 'semantic-tag-overlay)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1395
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1396 (semantic-alias-obsolete 'semantic-token-overlay-cdr
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1397 'semantic--tag-overlay-cdr)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1398
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1399 (semantic-alias-obsolete 'semantic-token-start
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1400 'semantic-tag-start)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1401
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1402 (semantic-alias-obsolete 'semantic-token-end
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1403 'semantic-tag-end)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1404
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1405 (semantic-alias-obsolete 'semantic-token-extent
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1406 'semantic-tag-bounds)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1407
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1408 (semantic-alias-obsolete 'semantic-token-buffer
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1409 'semantic-tag-buffer)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1410
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1411 (semantic-alias-obsolete 'semantic-token-put
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1412 'semantic--tag-put-property)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1413
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1414 (semantic-alias-obsolete 'semantic-token-put-no-side-effect
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1415 'semantic--tag-put-property-no-side-effect)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1416
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1417 (semantic-alias-obsolete 'semantic-token-get
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1418 'semantic--tag-get-property)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1419
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1420 (semantic-alias-obsolete 'semantic-token-add-extra-spec
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1421 'semantic-tag-put-attribute)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1422
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1423 (semantic-alias-obsolete 'semantic-token-extra-spec
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1424 'semantic-tag-get-attribute)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1425
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1426 (semantic-alias-obsolete 'semantic-token-type
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1427 'semantic-tag-type)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1428
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1429 (semantic-alias-obsolete 'semantic-token-modifiers
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1430 'semantic-tag-modifiers)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1431
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1432 (semantic-alias-obsolete 'semantic-token-docstring
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1433 'semantic-tag-docstring)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1434
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1435 (semantic-alias-obsolete 'semantic-token-type-parts
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1436 'semantic-tag-type-members)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1437
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1438 (defsubst semantic-token-type-parent (tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1439 "Return the parent of the type that TAG describes.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1440 The return value is a list. A value of nil means no parents.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1441 The `car' of the list is either the parent class, or a list
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1442 of parent classes. The `cdr' of the list is the list of
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1443 interfaces, or abstract classes which are parents of TAG."
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1444 (cons (semantic-tag-get-attribute tag :superclasses)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1445 (semantic-tag-type-interfaces tag)))
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1446 (make-obsolete 'semantic-token-type-parent
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1447 "\
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1448 use `semantic-tag-type-superclass' \
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1449 and `semantic-tag-type-interfaces' instead")
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1450
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1451 (semantic-alias-obsolete 'semantic-token-type-parent-superclass
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1452 'semantic-tag-type-superclasses)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1453
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1454 (semantic-alias-obsolete 'semantic-token-type-parent-implement
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1455 'semantic-tag-type-interfaces)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1456
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1457 (semantic-alias-obsolete 'semantic-token-type-extra-specs
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1458 'semantic-tag-attributes)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1459
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1460 (semantic-alias-obsolete 'semantic-token-type-extra-spec
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1461 'semantic-tag-get-attribute)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1462
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1463 (semantic-alias-obsolete 'semantic-token-type-modifiers
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1464 'semantic-tag-modifiers)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1465
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1466 (semantic-alias-obsolete 'semantic-token-function-args
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1467 'semantic-tag-function-arguments)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1468
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1469 (semantic-alias-obsolete 'semantic-token-function-extra-specs
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1470 'semantic-tag-attributes)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1471
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1472 (semantic-alias-obsolete 'semantic-token-function-extra-spec
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1473 'semantic-tag-get-attribute)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1474
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1475 (semantic-alias-obsolete 'semantic-token-function-modifiers
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1476 'semantic-tag-modifiers)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1477
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1478 (semantic-alias-obsolete 'semantic-token-function-throws
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1479 'semantic-tag-function-throws)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1480
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1481 (semantic-alias-obsolete 'semantic-token-function-parent
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1482 'semantic-tag-function-parent)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1483
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1484 (semantic-alias-obsolete 'semantic-token-function-destructor
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1485 'semantic-tag-function-destructor-p)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1486
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1487 (semantic-alias-obsolete 'semantic-token-variable-default
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1488 'semantic-tag-variable-default)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1489
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1490 (semantic-alias-obsolete 'semantic-token-variable-extra-specs
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1491 'semantic-tag-attributes)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1492
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1493 (semantic-alias-obsolete 'semantic-token-variable-extra-spec
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1494 'semantic-tag-get-attribute)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1495
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1496 (semantic-alias-obsolete 'semantic-token-variable-modifiers
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1497 'semantic-tag-modifiers)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1498
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1499 (semantic-alias-obsolete 'semantic-token-variable-const
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1500 'semantic-tag-variable-constant-p)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1501
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1502 (semantic-alias-obsolete 'semantic-token-variable-optsuffix
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1503 'semantic-tag-variable-optsuffix)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1504
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1505 (semantic-alias-obsolete 'semantic-token-include-system
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1506 'semantic-tag-include-system-p)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1507
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1508 (semantic-alias-obsolete 'semantic-token-p
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1509 'semantic-tag-p)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1510
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1511 (semantic-alias-obsolete 'semantic-token-with-position-p
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1512 'semantic-tag-with-position-p)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1513
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1514 (semantic-alias-obsolete 'semantic-tag-make-assoc-list
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1515 'semantic-tag-make-plist)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1516
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1517 (semantic-alias-obsolete 'semantic-nonterminal-children
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1518 'semantic-tag-children-compatibility)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1519
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1520 (semantic-alias-obsolete 'semantic-narrow-to-token
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1521 'semantic-narrow-to-tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1522
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1523 (semantic-alias-obsolete 'semantic-with-buffer-narrowed-to-current-token
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1524 'semantic-with-buffer-narrowed-to-current-tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1525
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1526 (semantic-alias-obsolete 'semantic-with-buffer-narrowed-to-token
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1527 'semantic-with-buffer-narrowed-to-tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1528
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1529 (semantic-alias-obsolete 'semantic-deoverlay-token
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1530 'semantic--tag-unlink-from-buffer)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1531
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1532 (semantic-alias-obsolete 'semantic-overlay-token
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1533 'semantic--tag-link-to-buffer)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1534
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1535 (semantic-alias-obsolete 'semantic-deoverlay-list
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1536 'semantic--tag-unlink-list-from-buffer)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1537
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1538 (semantic-alias-obsolete 'semantic-overlay-list
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1539 'semantic--tag-link-list-to-buffer)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1540
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1541 (semantic-alias-obsolete 'semantic-deoverlay-cache
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1542 'semantic--tag-unlink-cache-from-buffer)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1543
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1544 (semantic-alias-obsolete 'semantic-overlay-cache
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1545 'semantic--tag-link-cache-to-buffer)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1546
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1547 (semantic-alias-obsolete 'semantic-cooked-token-p
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1548 'semantic--tag-expanded-p)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1549
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1550 (semantic-varalias-obsolete 'semantic-expand-nonterminal
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1551 'semantic-tag-expand-function)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1552
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1553 (semantic-alias-obsolete 'semantic-raw-to-cooked-token
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1554 'semantic--tag-expand)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1555
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1556 ;; Lets test this out during this short transition.
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1557 (semantic-alias-obsolete 'semantic-clone-tag
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1558 'semantic-tag-clone)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1559
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1560 (semantic-alias-obsolete 'semantic-token
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1561 'semantic-tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1562
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1563 (semantic-alias-obsolete 'semantic-token-new-variable
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1564 'semantic-tag-new-variable)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1565
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1566 (semantic-alias-obsolete 'semantic-token-new-function
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1567 'semantic-tag-new-function)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1568
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1569 (semantic-alias-obsolete 'semantic-token-new-type
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1570 'semantic-tag-new-type)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1571
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1572 (semantic-alias-obsolete 'semantic-token-new-include
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1573 'semantic-tag-new-include)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1574
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1575 (semantic-alias-obsolete 'semantic-token-new-package
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1576 'semantic-tag-new-package)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1577
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1578 (semantic-alias-obsolete 'semantic-equivalent-tokens-p
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1579 'semantic-equivalent-tag-p)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1580
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1581 (provide 'semantic/tag)
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1582
05443eb58935 cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1583 ;;; semantic-tag.el ends here