Mercurial > emacs
annotate lisp/cedet/semantic/db-ebrowse.el @ 112150:14a97ab281d5
* install-sh, mkinstalldirs, move-if-change: Update from master
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Fri, 07 Jan 2011 12:42:11 -0800 |
parents | 181539c8b6a4 |
children | 376148b31b5e |
rev | line source |
---|---|
104439
da5b2513c225
cedet/cedet.el (cedet-packages): Bump srecode version.
Chong Yidong <cyd@stupidchicken.com>
parents:
104422
diff
changeset
|
1 ;;; semantic/db-ebrowse.el --- Semanticdb backend using ebrowse. |
104420
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
2 |
106815 | 3 ;; Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 |
105340 | 4 ;; Free Software Foundation, Inc. |
104420
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
5 |
105297
15fa7e0523b0
Fix format of Authors: header.
Glenn Morris <rgm@gnu.org>
parents:
105260
diff
changeset
|
6 ;; Authors: Eric M. Ludlam <zappo@gnu.org> |
15fa7e0523b0
Fix format of Authors: header.
Glenn Morris <rgm@gnu.org>
parents:
105260
diff
changeset
|
7 ;; Joakim Verona |
104420
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
8 ;; Keywords: tags |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
9 |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
10 ;; This file is part of GNU Emacs. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
11 |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
12 ;; GNU Emacs is free software: you can redistribute it and/or modify |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
13 ;; it under the terms of the GNU General Public License as published by |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
14 ;; the Free Software Foundation, either version 3 of the License, or |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
15 ;; (at your option) any later version. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
16 |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
17 ;; GNU Emacs is distributed in the hope that it will be useful, |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
20 ;; GNU General Public License for more details. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
21 |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
22 ;; You should have received a copy of the GNU General Public License |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
23 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
24 |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
25 ;;; Commentary: |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
26 ;; |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
27 ;; This program was started by Eric Ludlam, and Joakim Verona finished |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
28 ;; the implementation by adding searches and fixing bugs. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
29 ;; |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
30 ;; Read in custom-created ebrowse BROWSE files into a semanticdb back |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
31 ;; end. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
32 ;; |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
33 ;; Add these databases to the 'system' search. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
34 ;; Possibly use ebrowse for local parsing too. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
35 ;; |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
36 ;; When real details are needed out of the tag system from ebrowse, |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
37 ;; we will need to delve into the originating source and parse those |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
38 ;; files the usual way. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
39 ;; |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
40 ;; COMMANDS: |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
41 ;; `semanticdb-create-ebrowse-database' - Call EBROWSE to create a |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
42 ;; system database for some directory. In general, use this for |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
43 ;; system libraries, such as /usr/include, or include directories |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
44 ;; large software projects. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
45 ;; Customize `semanticdb-ebrowse-file-match' to make sure the correct |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
46 ;; file extensions are matched. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
47 ;; |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
48 ;; `semanticdb-load-ebrowse-caches' - Load all the EBROWSE caches from |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
49 ;; your semanticdb system database directory. Once they are |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
50 ;; loaded, they become searchable as omnipotent databases for |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
51 ;; all C++ files. This is called automatically by semantic-load. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
52 ;; Call it a second time to refresh the Emacs DB with the file. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
53 ;; |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
54 |
105260
bbd7017a25d9
CEDET (development tools) package merged.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
55 (require 'ebrowse) |
bbd7017a25d9
CEDET (development tools) package merged.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
56 (require 'semantic) |
bbd7017a25d9
CEDET (development tools) package merged.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
57 (require 'semantic/db-file) |
bbd7017a25d9
CEDET (development tools) package merged.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
58 |
104420
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
59 (eval-when-compile |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
60 ;; For generic function searching. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
61 (require 'eieio) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
62 (require 'eieio-opt) |
105260
bbd7017a25d9
CEDET (development tools) package merged.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
63 (require 'semantic/find)) |
104439
da5b2513c225
cedet/cedet.el (cedet-packages): Bump srecode version.
Chong Yidong <cyd@stupidchicken.com>
parents:
104422
diff
changeset
|
64 |
da5b2513c225
cedet/cedet.el (cedet-packages): Bump srecode version.
Chong Yidong <cyd@stupidchicken.com>
parents:
104422
diff
changeset
|
65 (declare-function semantic-add-system-include "semantic/dep") |
104420
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
66 |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
67 ;;; Code: |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
68 (defvar semanticdb-ebrowse-default-file-name "BROWSE" |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
69 "The EBROWSE file name used for system caches.") |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
70 |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
71 (defcustom semanticdb-ebrowse-file-match "\\.\\(hh?\\|HH?\\|hpp\\)" |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
72 "Regular expression matching file names for ebrowse to parse. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
73 This expression should exclude C++ headers that have no extension. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
74 By default, include only headers since the semantic use of EBrowse |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
75 is only for searching via semanticdb, and thus only headers would |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
76 be searched." |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
77 :group 'semanticdb |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
78 :type 'string) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
79 |
104439
da5b2513c225
cedet/cedet.el (cedet-packages): Bump srecode version.
Chong Yidong <cyd@stupidchicken.com>
parents:
104422
diff
changeset
|
80 ;;; SEMANTIC Database related Code |
da5b2513c225
cedet/cedet.el (cedet-packages): Bump srecode version.
Chong Yidong <cyd@stupidchicken.com>
parents:
104422
diff
changeset
|
81 ;;; Classes: |
da5b2513c225
cedet/cedet.el (cedet-packages): Bump srecode version.
Chong Yidong <cyd@stupidchicken.com>
parents:
104422
diff
changeset
|
82 (defclass semanticdb-table-ebrowse (semanticdb-table) |
da5b2513c225
cedet/cedet.el (cedet-packages): Bump srecode version.
Chong Yidong <cyd@stupidchicken.com>
parents:
104422
diff
changeset
|
83 ((major-mode :initform c++-mode) |
da5b2513c225
cedet/cedet.el (cedet-packages): Bump srecode version.
Chong Yidong <cyd@stupidchicken.com>
parents:
104422
diff
changeset
|
84 (ebrowse-tree :initform nil |
da5b2513c225
cedet/cedet.el (cedet-packages): Bump srecode version.
Chong Yidong <cyd@stupidchicken.com>
parents:
104422
diff
changeset
|
85 :initarg :ebrowse-tree |
da5b2513c225
cedet/cedet.el (cedet-packages): Bump srecode version.
Chong Yidong <cyd@stupidchicken.com>
parents:
104422
diff
changeset
|
86 :documentation |
da5b2513c225
cedet/cedet.el (cedet-packages): Bump srecode version.
Chong Yidong <cyd@stupidchicken.com>
parents:
104422
diff
changeset
|
87 "The raw ebrowse tree for this file." |
da5b2513c225
cedet/cedet.el (cedet-packages): Bump srecode version.
Chong Yidong <cyd@stupidchicken.com>
parents:
104422
diff
changeset
|
88 ) |
da5b2513c225
cedet/cedet.el (cedet-packages): Bump srecode version.
Chong Yidong <cyd@stupidchicken.com>
parents:
104422
diff
changeset
|
89 (global-extract :initform nil |
da5b2513c225
cedet/cedet.el (cedet-packages): Bump srecode version.
Chong Yidong <cyd@stupidchicken.com>
parents:
104422
diff
changeset
|
90 :initarg :global-extract |
da5b2513c225
cedet/cedet.el (cedet-packages): Bump srecode version.
Chong Yidong <cyd@stupidchicken.com>
parents:
104422
diff
changeset
|
91 :documentation |
da5b2513c225
cedet/cedet.el (cedet-packages): Bump srecode version.
Chong Yidong <cyd@stupidchicken.com>
parents:
104422
diff
changeset
|
92 "Table of ebrowse tags specific to this file. |
106895
181539c8b6a4
Fix typos in docstrings, error messages, etc.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
93 This table is composited from the ebrowse *Globals* section.") |
104439
da5b2513c225
cedet/cedet.el (cedet-packages): Bump srecode version.
Chong Yidong <cyd@stupidchicken.com>
parents:
104422
diff
changeset
|
94 ) |
da5b2513c225
cedet/cedet.el (cedet-packages): Bump srecode version.
Chong Yidong <cyd@stupidchicken.com>
parents:
104422
diff
changeset
|
95 "A table for returning search results from ebrowse.") |
da5b2513c225
cedet/cedet.el (cedet-packages): Bump srecode version.
Chong Yidong <cyd@stupidchicken.com>
parents:
104422
diff
changeset
|
96 |
da5b2513c225
cedet/cedet.el (cedet-packages): Bump srecode version.
Chong Yidong <cyd@stupidchicken.com>
parents:
104422
diff
changeset
|
97 (defclass semanticdb-project-database-ebrowse |
da5b2513c225
cedet/cedet.el (cedet-packages): Bump srecode version.
Chong Yidong <cyd@stupidchicken.com>
parents:
104422
diff
changeset
|
98 (semanticdb-project-database) |
da5b2513c225
cedet/cedet.el (cedet-packages): Bump srecode version.
Chong Yidong <cyd@stupidchicken.com>
parents:
104422
diff
changeset
|
99 ((new-table-class :initform semanticdb-table-ebrowse |
da5b2513c225
cedet/cedet.el (cedet-packages): Bump srecode version.
Chong Yidong <cyd@stupidchicken.com>
parents:
104422
diff
changeset
|
100 :type class |
da5b2513c225
cedet/cedet.el (cedet-packages): Bump srecode version.
Chong Yidong <cyd@stupidchicken.com>
parents:
104422
diff
changeset
|
101 :documentation |
da5b2513c225
cedet/cedet.el (cedet-packages): Bump srecode version.
Chong Yidong <cyd@stupidchicken.com>
parents:
104422
diff
changeset
|
102 "New tables created for this database are of this class.") |
da5b2513c225
cedet/cedet.el (cedet-packages): Bump srecode version.
Chong Yidong <cyd@stupidchicken.com>
parents:
104422
diff
changeset
|
103 (system-include-p :initform nil |
da5b2513c225
cedet/cedet.el (cedet-packages): Bump srecode version.
Chong Yidong <cyd@stupidchicken.com>
parents:
104422
diff
changeset
|
104 :initarg :system-include |
da5b2513c225
cedet/cedet.el (cedet-packages): Bump srecode version.
Chong Yidong <cyd@stupidchicken.com>
parents:
104422
diff
changeset
|
105 :documentation |
da5b2513c225
cedet/cedet.el (cedet-packages): Bump srecode version.
Chong Yidong <cyd@stupidchicken.com>
parents:
104422
diff
changeset
|
106 "Flag indicating this database represents a system include directory.") |
da5b2513c225
cedet/cedet.el (cedet-packages): Bump srecode version.
Chong Yidong <cyd@stupidchicken.com>
parents:
104422
diff
changeset
|
107 (ebrowse-struct :initform nil |
da5b2513c225
cedet/cedet.el (cedet-packages): Bump srecode version.
Chong Yidong <cyd@stupidchicken.com>
parents:
104422
diff
changeset
|
108 :initarg :ebrowse-struct |
da5b2513c225
cedet/cedet.el (cedet-packages): Bump srecode version.
Chong Yidong <cyd@stupidchicken.com>
parents:
104422
diff
changeset
|
109 ) |
da5b2513c225
cedet/cedet.el (cedet-packages): Bump srecode version.
Chong Yidong <cyd@stupidchicken.com>
parents:
104422
diff
changeset
|
110 ) |
da5b2513c225
cedet/cedet.el (cedet-packages): Bump srecode version.
Chong Yidong <cyd@stupidchicken.com>
parents:
104422
diff
changeset
|
111 "Semantic Database deriving tags using the EBROWSE tool. |
da5b2513c225
cedet/cedet.el (cedet-packages): Bump srecode version.
Chong Yidong <cyd@stupidchicken.com>
parents:
104422
diff
changeset
|
112 EBROWSE is a C/C++ parser for use with `ebrowse' Emacs program.") |
da5b2513c225
cedet/cedet.el (cedet-packages): Bump srecode version.
Chong Yidong <cyd@stupidchicken.com>
parents:
104422
diff
changeset
|
113 |
da5b2513c225
cedet/cedet.el (cedet-packages): Bump srecode version.
Chong Yidong <cyd@stupidchicken.com>
parents:
104422
diff
changeset
|
114 |
104420
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
115 (defun semanticdb-ebrowse-C-file-p (file) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
116 "Is FILE a C or C++ file?" |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
117 (or (string-match semanticdb-ebrowse-file-match file) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
118 (and (string-match "/\\w+$" file) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
119 (not (file-directory-p file)) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
120 (let ((tmp (get-buffer-create "*semanticdb-ebrowse-tmp*"))) |
105799
3fe6da4a95a9
* cedet/srecode/srt-mode.el (semantic-analyze-possible-completions):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
105377
diff
changeset
|
121 (with-current-buffer tmp |
104420
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
122 (condition-case nil |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
123 (insert-file-contents file nil 0 100 t) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
124 (error (insert-file-contents file nil nil nil t))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
125 (goto-char (point-min)) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
126 (looking-at "\\s-*/\\(\\*\\|/\\)") |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
127 )) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
128 ))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
129 |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
130 (defun semanticdb-create-ebrowse-database (dir) |
106895
181539c8b6a4
Fix typos in docstrings, error messages, etc.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
131 "Create an EBROWSE database for directory DIR. |
104420
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
132 The database file is stored in ~/.semanticdb, or whichever directory |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
133 is specified by `semanticdb-default-save-directory'." |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
134 (interactive "DDirectory: ") |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
135 (setq dir (file-name-as-directory dir)) ;; for / on end |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
136 (let* ((savein (semanticdb-ebrowse-file-for-directory dir)) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
137 (filebuff (get-buffer-create "*SEMANTICDB EBROWSE TMP*")) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
138 (files (directory-files (expand-file-name dir) t)) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
139 (mma auto-mode-alist) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
140 (regexp nil) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
141 ) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
142 ;; Create the input to the ebrowse command |
105799
3fe6da4a95a9
* cedet/srecode/srt-mode.el (semantic-analyze-possible-completions):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
105377
diff
changeset
|
143 (with-current-buffer filebuff |
104420
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
144 (buffer-disable-undo filebuff) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
145 (setq default-directory (expand-file-name dir)) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
146 |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
147 ;;; @TODO - convert to use semanticdb-collect-matching-filenames |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
148 ;; to get the file names. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
149 |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
150 |
104422
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
104420
diff
changeset
|
151 (mapc (lambda (f) |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
104420
diff
changeset
|
152 (when (semanticdb-ebrowse-C-file-p f) |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
104420
diff
changeset
|
153 (insert f) |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
104420
diff
changeset
|
154 (insert "\n"))) |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
104420
diff
changeset
|
155 files) |
104420
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
156 ;; Cleanup the ebrowse output buffer. |
105799
3fe6da4a95a9
* cedet/srecode/srt-mode.el (semantic-analyze-possible-completions):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
105377
diff
changeset
|
157 (with-current-buffer (get-buffer-create "*EBROWSE OUTPUT*") |
104420
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
158 (erase-buffer)) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
159 ;; Call the EBROWSE command. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
160 (message "Creating ebrowse file: %s ..." savein) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
161 (call-process-region (point-min) (point-max) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
162 "ebrowse" nil "*EBROWSE OUTPUT*" nil |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
163 (concat "--output-file=" savein) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
164 "--very-verbose") |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
165 ) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
166 ;; Create a short LOADER program for loading in this database. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
167 (let* ((lfn (concat savein "-load.el")) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
168 (lf (find-file-noselect lfn))) |
105799
3fe6da4a95a9
* cedet/srecode/srt-mode.el (semantic-analyze-possible-completions):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
105377
diff
changeset
|
169 (with-current-buffer lf |
104420
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
170 (erase-buffer) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
171 (insert "(semanticdb-ebrowse-load-helper \"" |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
172 (expand-file-name dir) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
173 "\")\n") |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
174 (save-buffer) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
175 (kill-buffer (current-buffer))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
176 (message "Creating ebrowse file: %s ... done" savein) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
177 ;; Reload that database |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
178 (load lfn nil t) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
179 ))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
180 |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
181 (defun semanticdb-load-ebrowse-caches () |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
182 "Load all semanticdb controlled EBROWSE caches." |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
183 (interactive) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
184 (let ((f (directory-files semanticdb-default-save-directory |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
185 t (concat semanticdb-ebrowse-default-file-name "-load.el$") t))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
186 (while f |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
187 (load (car f) nil t) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
188 (setq f (cdr f))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
189 )) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
190 |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
191 (defun semanticdb-ebrowse-load-helper (directory) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
192 "Create the semanticdb database via ebrowse for directory. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
193 If DIRECTORY is found to be defunct, it won't load the DB, and will |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
194 warn instead." |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
195 (if (file-directory-p directory) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
196 (semanticdb-create-database semanticdb-project-database-ebrowse |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
197 directory) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
198 (let* ((BF (semanticdb-ebrowse-file-for-directory directory)) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
199 (BFL (concat BF "-load.el")) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
200 (BFLB (concat BF "-load.el~"))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
201 (save-window-excursion |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
202 (with-output-to-temp-buffer "*FILES TO DELETE*" |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
203 (princ "The following BROWSE files are obsolete.\n\n") |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
204 (princ BF) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
205 (princ "\n") |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
206 (princ BFL) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
207 (princ "\n") |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
208 (when (file-exists-p BFLB) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
209 (princ BFLB) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
210 (princ "\n")) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
211 ) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
212 (when (y-or-n-p (format |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
213 "Warning: Obsolete BROWSE file for: %s\nDelete? " |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
214 directory)) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
215 (delete-file BF) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
216 (delete-file BFL) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
217 (when (file-exists-p BFLB) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
218 (delete-file BFLB)) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
219 ))))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
220 |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
221 ;JAVE this just instantiates a default empty ebrowse struct? |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
222 ; how would new instances wind up here? |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
223 ; the ebrowse class isnt singleton, unlike the emacs lisp one |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
224 (defvar-mode-local c++-mode semanticdb-project-system-databases |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
225 () |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
226 "Search Ebrowse for symbols.") |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
227 |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
228 (defmethod semanticdb-needs-refresh-p ((table semanticdb-table-ebrowse)) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
229 "EBROWSE database do not need to be refreshed. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
230 |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
231 JAVE: stub for needs-refresh, because, how do we know if BROWSE files |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
232 are out of date? |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
233 |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
234 EML: Our database should probably remember the timestamp/checksum of |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
235 the most recently read EBROWSE file, and use that." |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
236 nil |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
237 ) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
238 |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
239 |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
240 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
241 |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
242 |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
243 |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
244 ;;; EBROWSE code |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
245 ;; |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
246 ;; These routines deal with part of the ebrowse interface. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
247 (defun semanticdb-ebrowse-file-for-directory (dir) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
248 "Return the file name for DIR where the ebrowse BROWSE file is. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
249 This file should reside in `semanticdb-default-save-directory'." |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
250 (let* ((semanticdb-default-save-directory |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
251 semanticdb-default-save-directory) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
252 (B (semanticdb-file-name-directory |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
253 'semanticdb-project-database-file |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
254 (concat (expand-file-name dir) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
255 semanticdb-ebrowse-default-file-name))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
256 ) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
257 B)) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
258 |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
259 (defun semanticdb-ebrowse-get-ebrowse-structure (dir) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
260 "Return the ebrowse structure for directory DIR. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
261 This assumes semantic manages the BROWSE files, so they are assumed to live |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
262 where semantic cache files live, depending on your settings. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
263 |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
264 For instance: /home/<username>/.semanticdb/!usr!include!BROWSE" |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
265 (let* ((B (semanticdb-ebrowse-file-for-directory dir)) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
266 (buf (get-buffer-create "*semanticdb ebrowse*"))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
267 (message "semanticdb-ebrowse %s" B) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
268 (when (file-exists-p B) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
269 (set-buffer buf) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
270 (buffer-disable-undo buf) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
271 (erase-buffer) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
272 (insert-file-contents B) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
273 (let ((ans nil) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
274 (efcn (symbol-function 'ebrowse-show-progress))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
275 (fset 'ebrowse-show-progress #'(lambda (&rest junk) nil)) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
276 (unwind-protect ;; Protect against errors w/ ebrowse |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
277 (setq ans (list B (ebrowse-read))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
278 ;; These items must always happen |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
279 (erase-buffer) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
280 (fset 'ebrowse-show-fcn efcn) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
281 ) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
282 ans)))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
283 |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
284 ;;; Methods for creating a database or tables |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
285 ;; |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
286 (defmethod semanticdb-create-database :STATIC ((dbeC semanticdb-project-database-ebrowse) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
287 directory) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
288 "Create a new semantic database for DIRECTORY based on ebrowse. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
289 If there is no database for DIRECTORY available, then |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
290 {not implemented yet} create one. Return nil if that is not possible." |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
291 ;; MAKE SURE THAT THE FILE LOADED DOESN'T ALREADY EXIST. |
104439
da5b2513c225
cedet/cedet.el (cedet-packages): Bump srecode version.
Chong Yidong <cyd@stupidchicken.com>
parents:
104422
diff
changeset
|
292 (require 'semantic/dep) |
104420
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
293 (let ((dbs semanticdb-database-list) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
294 (found nil)) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
295 (while (and (not found) dbs) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
296 (when (semanticdb-project-database-ebrowse-p (car dbs)) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
297 (when (string= (oref (car dbs) reference-directory) directory) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
298 (setq found (car dbs)))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
299 (setq dbs (cdr dbs))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
300 ;;STATIC means DBE cant be used as object, only as a class |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
301 (let* ((ebrowse-data (semanticdb-ebrowse-get-ebrowse-structure directory)) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
302 (dat (car (cdr ebrowse-data))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
303 (ebd (car dat)) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
304 (db nil) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
305 (default-directory directory) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
306 ) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
307 (if found |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
308 (setq db found) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
309 (setq db (make-instance |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
310 dbeC |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
311 directory |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
312 :ebrowse-struct ebd |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
313 )) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
314 (oset db reference-directory directory)) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
315 |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
316 ;; Once we recycle or make a new DB, refresh the |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
317 ;; contents from the BROWSE file. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
318 (oset db tables nil) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
319 ;; only possible after object creation, tables inited to nil. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
320 (semanticdb-ebrowse-strip-trees db dat) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
321 |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
322 ;; Once our database is loaded, if we are a system DB, we |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
323 ;; add ourselves to the include list for C++. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
324 (semantic-add-system-include directory 'c++-mode) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
325 (semantic-add-system-include directory 'c-mode) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
326 |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
327 db))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
328 |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
329 (defmethod semanticdb-ebrowse-strip-trees ((dbe semanticdb-project-database-ebrowse) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
330 data) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
331 "For the ebrowse database DBE, strip all tables from DATA." |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
332 ;JAVE what it actually seems to do is split the original tree in "tables" associated with files |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
333 ; im not sure it actually works: |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
334 ; the filename slot sometimes gets to be nil, |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
335 ; apparently for classes which definition cant be found, yet needs to be included in the tree |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
336 ; like library baseclasses |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
337 ; a file can define several classes |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
338 (let ((T (car (cdr data))));1st comes a header, then the tree |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
339 (while T |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
340 |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
341 (let* ((tree (car T)) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
342 (class (ebrowse-ts-class tree)); root class of tree |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
343 ;; Something funny going on with this file thing... |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
344 (filename (or (ebrowse-cs-source-file class) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
345 (ebrowse-cs-file class))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
346 ) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
347 (cond |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
348 ((ebrowse-globals-tree-p tree) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
349 ;; We have the globals tree.. save this special. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
350 (semanticdb-ebrowse-add-globals-to-table dbe tree) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
351 ) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
352 (t |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
353 ;; ebrowse will collect all the info from multiple files |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
354 ;; into one tree. Semantic wants all the bits to be tied |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
355 ;; into different files. We need to do a full dissociation |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
356 ;; into semantic parsable tables. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
357 (semanticdb-ebrowse-add-tree-to-table dbe tree) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
358 )) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
359 (setq T (cdr T)))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
360 )) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
361 |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
362 ;;; Filename based methods |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
363 ;; |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
364 (defun semanticdb-ebrowse-add-globals-to-table (dbe tree) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
365 "For database DBE, add the ebrowse TREE into the table." |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
366 (if (or (not (ebrowse-ts-p tree)) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
367 (not (ebrowse-globals-tree-p tree))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
368 (signal 'wrong-type-argument (list 'ebrowse-ts-p tree))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
369 |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
370 (let* ((class (ebrowse-ts-class tree)) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
371 (fname (or (ebrowse-cs-source-file class) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
372 (ebrowse-cs-file class) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
373 ;; Not def'd here, assume our current |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
374 ;; file |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
375 (concat default-directory "/unknown-proxy.hh"))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
376 (vars (ebrowse-ts-member-functions tree)) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
377 (fns (ebrowse-ts-member-variables tree)) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
378 (toks nil) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
379 ) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
380 (while vars |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
381 (let ((nt (semantic-tag (ebrowse-ms-name (car vars)) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
382 'variable)) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
383 (defpoint (ebrowse-bs-point class))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
384 (when defpoint |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
385 (semantic--tag-set-overlay nt |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
386 (vector defpoint defpoint))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
387 (setq toks (cons nt toks))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
388 (setq vars (cdr vars))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
389 (while fns |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
390 (let ((nt (semantic-tag (ebrowse-ms-name (car fns)) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
391 'function)) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
392 (defpoint (ebrowse-bs-point class))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
393 (when defpoint |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
394 (semantic--tag-set-overlay nt |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
395 (vector defpoint defpoint))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
396 (setq toks (cons nt toks))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
397 (setq fns (cdr fns))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
398 |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
399 )) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
400 |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
401 (defun semanticdb-ebrowse-add-tree-to-table (dbe tree &optional fname baseclasses) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
402 "For database DBE, add the ebrowse TREE into the table for FNAME. |
105340 | 403 Optional argument BASECLASSES specifies a baseclass to the tree being provided." |
104420
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
404 (if (not (ebrowse-ts-p tree)) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
405 (signal 'wrong-type-argument (list 'ebrowse-ts-p tree))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
406 |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
407 ;; Strategy overview: |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
408 ;; 1) Calculate the filename for this tree. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
409 ;; 2) Find a matching namespace in TAB, or create a new one. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
410 ;; 3) Fabricate a tag proxy for CLASS |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
411 ;; 4) Add it to the namespace |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
412 ;; 5) Add subclasses |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
413 |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
414 ;; 1 - Find the filename |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
415 (if (not fname) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
416 (setq fname (or (ebrowse-cs-source-file (ebrowse-ts-class tree)) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
417 (ebrowse-cs-file (ebrowse-ts-class tree)) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
418 ;; Not def'd here, assume our current |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
419 ;; file |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
420 (concat default-directory "/unknown-proxy.hh")))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
421 |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
422 (let* ((tab (or (semanticdb-file-table dbe fname) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
423 (semanticdb-create-table dbe fname))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
424 (class (ebrowse-ts-class tree)) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
425 (scope (ebrowse-cs-scope class)) |
104439
da5b2513c225
cedet/cedet.el (cedet-packages): Bump srecode version.
Chong Yidong <cyd@stupidchicken.com>
parents:
104422
diff
changeset
|
426 (ns (when scope (split-string scope ":" t))) |
104420
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
427 (nst nil) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
428 (cls nil) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
429 ) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
430 |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
431 ;; 2 - Get the namespace tag |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
432 (when ns |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
433 (let ((taglst (if (slot-boundp tab 'tags) (oref tab tags) nil))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
434 (setq nst (semantic-find-first-tag-by-name (car ns) taglst)) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
435 (when (not nst) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
436 (setq nst (semantic-tag (car ns) 'type :type "namespace")) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
437 (oset tab tags (cons nst taglst)) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
438 ))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
439 |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
440 ;; 3 - Create a proxy tg. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
441 (setq cls (semantic-tag (ebrowse-cs-name class) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
442 'type |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
443 :type "class" |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
444 :superclasses baseclasses |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
445 :faux t |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
446 :filename fname |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
447 )) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
448 (let ((defpoint (ebrowse-bs-point class))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
449 (when defpoint |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
450 (semantic--tag-set-overlay cls |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
451 (vector defpoint defpoint)))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
452 |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
453 ;; 4 - add to namespace |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
454 (if nst |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
455 (semantic-tag-put-attribute |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
456 nst :members (cons cls (semantic-tag-get-attribute nst :members))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
457 (oset tab tags (cons cls (when (slot-boundp tab 'tags) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
458 (oref tab tags))))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
459 |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
460 ;; 5 - Subclasses |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
461 (let* ((subclass (ebrowse-ts-subclasses tree)) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
462 (pname (ebrowse-cs-name class))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
463 (when (ebrowse-cs-scope class) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
464 (setq pname (concat (mapconcat (lambda (a) a) (cdr ns) "::") "::" pname))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
465 |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
466 (while subclass |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
467 (let* ((scc (ebrowse-ts-class (car subclass))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
468 (fname (or (ebrowse-cs-source-file scc) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
469 (ebrowse-cs-file scc) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
470 ;; Not def'd here, assume our current |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
471 ;; file |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
472 fname |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
473 ))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
474 (when fname |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
475 (semanticdb-ebrowse-add-tree-to-table |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
476 dbe (car subclass) fname pname))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
477 (setq subclass (cdr subclass)))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
478 )) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
479 |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
480 ;;; |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
481 ;; Overload for converting the simple faux tag into something better. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
482 ;; |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
483 (defmethod semanticdb-normalize-tags ((obj semanticdb-table-ebrowse) tags) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
484 "Convert in Ebrowse database OBJ a list of TAGS into a complete tag. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
485 The default tag provided by searches exclude many features of a |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
486 semantic parsed tag. Look up the file for OBJ, and match TAGS |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
487 against a semantic parsed tag that has all the info needed, and |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
488 return that." |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
489 (let ((tagret nil) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
490 ) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
491 ;; SemanticDB will automatically create a regular database |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
492 ;; on top of the file just loaded by ebrowse during the set |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
493 ;; buffer. Fetch that table, and use it's tag list to look |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
494 ;; up the tag we just got, and thus turn it into a full semantic |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
495 ;; tag. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
496 (while tags |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
497 (let ((tag (car tags))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
498 (save-excursion |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
499 (semanticdb-set-buffer obj) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
500 (let ((ans nil)) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
501 ;; Gee, it would be nice to do this, but ebrowse LIES. Oi. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
502 (when (semantic-tag-with-position-p tag) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
503 (goto-char (semantic-tag-start tag)) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
504 (let ((foundtag (semantic-current-tag))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
505 ;; Make sure the discovered tag is the same as what we started with. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
506 (when (string= (semantic-tag-name tag) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
507 (semantic-tag-name foundtag)) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
508 ;; We have a winner! |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
509 (setq ans foundtag)))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
510 ;; Sometimes ebrowse lies. Do a generic search |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
511 ;; to find it within this file. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
512 (when (not ans) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
513 ;; We might find multiple hits for this tag, and we have no way |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
514 ;; of knowing which one the user wanted. Return the first one. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
515 (setq ans (semantic-deep-find-tags-by-name |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
516 (semantic-tag-name tag) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
517 (semantic-fetch-tags)))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
518 (if (semantic-tag-p ans) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
519 (setq tagret (cons ans tagret)) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
520 (setq tagret (append ans tagret))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
521 )) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
522 (setq tags (cdr tags)))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
523 tagret)) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
524 |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
525 (defmethod semanticdb-normalize-one-tag ((obj semanticdb-table-ebrowse) tag) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
526 "Convert in Ebrowse database OBJ one TAG into a complete tag. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
527 The default tag provided by searches exclude many features of a |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
528 semantic parsed tag. Look up the file for OBJ, and match TAG |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
529 against a semantic parsed tag that has all the info needed, and |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
530 return that." |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
531 (let ((tagret nil) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
532 (objret nil)) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
533 ;; SemanticDB will automatically create a regular database |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
534 ;; on top of the file just loaded by ebrowse during the set |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
535 ;; buffer. Fetch that table, and use it's tag list to look |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
536 ;; up the tag we just got, and thus turn it into a full semantic |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
537 ;; tag. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
538 (save-excursion |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
539 (semanticdb-set-buffer obj) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
540 (setq objret semanticdb-current-table) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
541 (when (not objret) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
542 ;; What to do?? |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
543 (debug)) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
544 (let ((ans nil)) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
545 ;; Gee, it would be nice to do this, but ebrowse LIES. Oi. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
546 (when (semantic-tag-with-position-p tag) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
547 (goto-char (semantic-tag-start tag)) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
548 (let ((foundtag (semantic-current-tag))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
549 ;; Make sure the discovered tag is the same as what we started with. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
550 (when (string= (semantic-tag-name tag) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
551 (semantic-tag-name foundtag)) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
552 ;; We have a winner! |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
553 (setq ans foundtag)))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
554 ;; Sometimes ebrowse lies. Do a generic search |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
555 ;; to find it within this file. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
556 (when (not ans) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
557 ;; We might find multiple hits for this tag, and we have no way |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
558 ;; of knowing which one the user wanted. Return the first one. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
559 (setq ans (semantic-deep-find-tags-by-name |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
560 (semantic-tag-name tag) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
561 (semantic-fetch-tags)))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
562 (if (semantic-tag-p ans) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
563 (setq tagret ans) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
564 (setq tagret (car ans))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
565 )) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
566 (cons objret tagret))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
567 |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
568 ;;; Search Overrides |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
569 ;; |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
570 ;; NOTE WHEN IMPLEMENTING: Be sure to add doc-string updates explaining |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
571 ;; how your new search routines are implemented. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
572 ;; |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
573 (defmethod semanticdb-find-tags-by-name-method |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
574 ((table semanticdb-table-ebrowse) name &optional tags) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
575 "Find all tags named NAME in TABLE. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
576 Return a list of tags." |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
577 ;;(message "semanticdb-find-tags-by-name-method name -- %s" name) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
578 (if tags |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
579 ;; If TAGS are passed in, then we don't need to do work here. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
580 (call-next-method) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
581 ;; If we ever need to do something special, add here. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
582 ;; Since ebrowse tags are converted into semantic tags, we can |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
583 ;; get away with this sort of thing. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
584 (call-next-method) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
585 ) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
586 ) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
587 |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
588 (defmethod semanticdb-find-tags-by-name-regexp-method |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
589 ((table semanticdb-table-ebrowse) regex &optional tags) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
590 "Find all tags with name matching REGEX in TABLE. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
591 Optional argument TAGS is a list of tags to search. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
592 Return a list of tags." |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
593 (if tags (call-next-method) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
594 ;; YOUR IMPLEMENTATION HERE |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
595 (call-next-method) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
596 )) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
597 |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
598 (defmethod semanticdb-find-tags-for-completion-method |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
599 ((table semanticdb-table-ebrowse) prefix &optional tags) |
106895
181539c8b6a4
Fix typos in docstrings, error messages, etc.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
600 "In TABLE, find all occurrences of tags matching PREFIX. |
104420
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
601 Optional argument TAGS is a list of tags to search. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
602 Returns a table of all matching tags." |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
603 (if tags (call-next-method) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
604 ;; YOUR IMPLEMENTATION HERE |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
605 (call-next-method) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
606 )) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
607 |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
608 (defmethod semanticdb-find-tags-by-class-method |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
609 ((table semanticdb-table-ebrowse) class &optional tags) |
106895
181539c8b6a4
Fix typos in docstrings, error messages, etc.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
610 "In TABLE, find all occurrences of tags of CLASS. |
104420
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
611 Optional argument TAGS is a list of tags to search. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
612 Returns a table of all matching tags." |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
613 (if tags (call-next-method) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
614 (call-next-method))) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
615 |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
616 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
617 |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
618 ;;; Deep Searches |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
619 ;; |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
620 ;; If your language does not have a `deep' concept, these can be left |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
621 ;; alone, otherwise replace with implementations similar to those |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
622 ;; above. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
623 ;; |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
624 |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
625 (defmethod semanticdb-deep-find-tags-by-name-method |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
626 ((table semanticdb-table-ebrowse) name &optional tags) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
627 "Find all tags name NAME in TABLE. |
106895
181539c8b6a4
Fix typos in docstrings, error messages, etc.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
628 Optional argument TAGS is a list of tags to search. |
104420
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
629 Like `semanticdb-find-tags-by-name-method' for ebrowse." |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
630 ;;(semanticdb-find-tags-by-name-method table name tags) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
631 (call-next-method)) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
632 |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
633 (defmethod semanticdb-deep-find-tags-by-name-regexp-method |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
634 ((table semanticdb-table-ebrowse) regex &optional tags) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
635 "Find all tags with name matching REGEX in TABLE. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
636 Optional argument TAGS is a list of tags to search. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
637 Like `semanticdb-find-tags-by-name-method' for ebrowse." |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
638 ;;(semanticdb-find-tags-by-name-regexp-method table regex tags) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
639 (call-next-method)) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
640 |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
641 (defmethod semanticdb-deep-find-tags-for-completion-method |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
642 ((table semanticdb-table-ebrowse) prefix &optional tags) |
106895
181539c8b6a4
Fix typos in docstrings, error messages, etc.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
643 "In TABLE, find all occurrences of tags matching PREFIX. |
104420
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
644 Optional argument TAGS is a list of tags to search. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
645 Like `semanticdb-find-tags-for-completion-method' for ebrowse." |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
646 ;;(semanticdb-find-tags-for-completion-method table prefix tags) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
647 (call-next-method)) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
648 |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
649 ;;; Advanced Searches |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
650 ;; |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
651 (defmethod semanticdb-find-tags-external-children-of-type-method |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
652 ((table semanticdb-table-ebrowse) type &optional tags) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
653 "Find all nonterminals which are child elements of TYPE |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
654 Optional argument TAGS is a list of tags to search. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
655 Return a list of tags." |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
656 (if tags (call-next-method) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
657 ;; Ebrowse collects all this type of stuff together for us. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
658 ;; but we can't use it.... yet. |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
659 nil |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
660 )) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
661 |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
662 (provide 'semantic/db-ebrowse) |
2e15afd37998
cedet/semantic/adebug.el, cedet/semantic/chart.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
663 |
105377 | 664 ;; arch-tag: e7d15223-6074-4c87-baf0-98fdd22ff873 |
104439
da5b2513c225
cedet/cedet.el (cedet-packages): Bump srecode version.
Chong Yidong <cyd@stupidchicken.com>
parents:
104422
diff
changeset
|
665 ;;; semantic/db-ebrowse.el ends here |