1 ;;; cc-menus.el --- imenu support for CC Mode
3 ;; Copyright (C) 1985,87,92,93,94,95,96,97 Free Software Foundation, Inc.
5 ;; Authors: 1992-1997 Barry A. Warsaw
6 ;; 1987 Dave Detlefs and Stewart Clamen
7 ;; 1985 Richard M. Stallman
8 ;; Maintainer: cc-mode-help@python.org
9 ;; Created: 22-Apr-1997 (split from cc-mode.el)
11 ;; Keywords: c languages oop
13 ;; This file is part of GNU Emacs.
15 ;; GNU Emacs is free software; you can redistribute it and/or modify
16 ;; it under the terms of the GNU General Public License as published by
17 ;; the Free Software Foundation; either version 2, or (at your option)
20 ;; GNU Emacs is distributed in the hope that it will be useful,
21 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
22 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 ;; GNU General Public License for more details.
25 ;; You should have received a copy of the GNU General Public License
26 ;; along with GNU Emacs; see the file COPYING. If not, write to the
27 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
28 ;; Boston, MA 02111-1307, USA.
32 (defvar cc-imenu-c
++-generic-expression
37 "^" ; beginning of line is required
38 "\\(template[ \t]*<[^>]+>[ \t]*\\)?" ; there may be a "template <...>"
39 "\\([a-zA-Z0-9_:]+[ \t]+\\)?" ; type specs; there can be no
40 "\\([a-zA-Z0-9_:]+[ \t]+\\)?" ; more than 3 tokens, right?
42 "\\(" ; last type spec including */&
44 "\\([ \t]*[*&]+[ \t]*\\|[ \t]+\\)" ; either ptr/ref sign or ws
45 "\\)?" ; if there is a last type spec
46 "\\(" ; name, take into the imenu entry
47 "[a-zA-Z0-9_:~]+" ; member func, ctor or dtor...
48 ; (may not contain * because then
49 ; "a::operator char*" would
52 "\\([a-zA-Z0-9_:~]*::\\)?operator"
53 "[^a-zA-Z1-9_][^(]*" ; ...or operator
55 "[ \t]*([^)]*)[ \t\n]*[^ ;]" ; require something other than
56 ; a `;' after the (...) to
57 ; avoid prototypes. Can't
58 ; catch cases with () inside
59 ; the parentheses surrounding
60 ; the parameters. e.g.:
61 ; "int foo(int a=bar()) {...}"
66 "^" ; beginning of line is required
67 "\\(template[ \t]*<[^>]+>[ \t]*\\)?" ; there may be a "template <...>"
69 "\\([a-zA-Z0-9_]+\\)" ; the string we want to get
72 "Imenu generic expression for C++ mode. See `imenu-generic-expression'.")
74 (defvar cc-imenu-c-generic-expression
75 cc-imenu-c
++-generic-expression
76 "Imenu generic expression for C mode. See `imenu-generic-expression'.")
78 ;(defvar cc-imenu-objc-generic-expression
80 ; Please contribute one!
82 (defvar cc-imenu-java-generic-expression
88 "\\([A-Za-z0-9_-]+[ \t]+\\)?" ; type specs; there can be
89 "\\([A-Za-z0-9_-]+[ \t]+\\)?" ; more than 3 tokens, right?
90 "\\([A-Za-z0-9_-]+[ \t]*[[]?[]]?\\)"
92 "\\([A-Za-z0-9_-]+\\)" ; the string we want to get
94 "\\([a-zA-Z,_1-9\n \t]*[[]?[]]?\\)*" ; arguments
97 "[,a-zA-Z_1-9\n \t]*{"
99 "Imenu generic expression for Java mode. See `imenu-generic-expression'.")
103 ;;; cc-menus.el ends here