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