211 |
;; Example of generic expression for finding prototypes, structs, unions, enums. |
;; Example of generic expression for finding prototypes, structs, unions, enums. |
212 |
;; Uncomment if you want to find these too. It will be a bit slower gathering |
;; Uncomment if you want to find these too. It will be a bit slower gathering |
213 |
;; the indexes. |
;; the indexes. |
214 |
; ("Prototypes" |
;;; ("Prototypes" |
215 |
; (, |
;;; (, |
216 |
; (concat |
;;; (concat |
217 |
; "^" ; beginning of line is required |
;;; "^" ; beginning of line is required |
218 |
; "\\(template[ \t]*<[^>]+>[ \t]*\\)?" ; there may be a "template <...>" |
;;; "\\(template[ \t]*<[^>]+>[ \t]*\\)?" ; there may be a "template <...>" |
219 |
; "\\([a-zA-Z0-9_:]+[ \t]+\\)?" ; type specs; there can be no |
;;; "\\([a-zA-Z0-9_:]+[ \t]+\\)?" ; type specs; there can be no |
220 |
; "\\([a-zA-Z0-9_:]+[ \t]+\\)?" ; more than 3 tokens, right? |
;;; "\\([a-zA-Z0-9_:]+[ \t]+\\)?" ; more than 3 tokens, right? |
221 |
|
|
222 |
; "\\(" ; last type spec including */& |
;;; "\\(" ; last type spec including */& |
223 |
; "[a-zA-Z0-9_:]+" |
;;; "[a-zA-Z0-9_:]+" |
224 |
; "\\([ \t]*[*&]+[ \t]*\\|[ \t]+\\)" ; either pointer/ref sign or whitespace |
;;; "\\([ \t]*[*&]+[ \t]*\\|[ \t]+\\)" ; either pointer/ref sign or whitespace |
225 |
; "\\)?" ; if there is a last type spec |
;;; "\\)?" ; if there is a last type spec |
226 |
; "\\(" ; name; take that into the imenu entry |
;;; "\\(" ; name; take that into the imenu entry |
227 |
; "[a-zA-Z0-9_:~]+" ; member function, ctor or dtor... |
;;; "[a-zA-Z0-9_:~]+" ; member function, ctor or dtor... |
228 |
; ; (may not contain * because then |
;;; ; (may not contain * because then |
229 |
; ; "a::operator char*" would become "char*"!) |
;;; ; "a::operator char*" would become "char*"!) |
230 |
; "\\|" |
;;; "\\|" |
231 |
; "\\([a-zA-Z0-9_:~]*::\\)?operator" |
;;; "\\([a-zA-Z0-9_:~]*::\\)?operator" |
232 |
; "[^a-zA-Z1-9_][^(]*" ; ...or operator |
;;; "[^a-zA-Z1-9_][^(]*" ; ...or operator |
233 |
; " \\)" |
;;; " \\)" |
234 |
; "[ \t]*([^)]*)[ \t\n]*;" ; require ';' after |
;;; "[ \t]*([^)]*)[ \t\n]*;" ; require ';' after |
235 |
; ; the (...) Can't |
;;; ; the (...) Can't |
236 |
; ; catch cases with () inside the parentheses |
;;; ; catch cases with () inside the parentheses |
237 |
; ; surrounding the parameters |
;;; ; surrounding the parameters |
238 |
; ; (like "int foo(int a=bar());" |
;;; ; (like "int foo(int a=bar());" |
239 |
; )) 6) |
;;; )) 6) |
240 |
; ("Struct" |
;;; ("Struct" |
241 |
; (, (concat |
;;; (, (concat |
242 |
; "^" ; beginning of line is required |
;;; "^" ; beginning of line is required |
243 |
; "\\(static[ \t]+\\)?" ; there may be static or const. |
;;; "\\(static[ \t]+\\)?" ; there may be static or const. |
244 |
; "\\(const[ \t]+\\)?" |
;;; "\\(const[ \t]+\\)?" |
245 |
; "struct[ \t]+" |
;;; "struct[ \t]+" |
246 |
; "\\([a-zA-Z0-9_]+\\)" ; this is the string we want to get |
;;; "\\([a-zA-Z0-9_]+\\)" ; this is the string we want to get |
247 |
; "[ \t]*[{]" |
;;; "[ \t]*[{]" |
248 |
; )) 3) |
;;; )) 3) |
249 |
; ("Enum" |
;;; ("Enum" |
250 |
; (, (concat |
;;; (, (concat |
251 |
; "^" ; beginning of line is required |
;;; "^" ; beginning of line is required |
252 |
; "\\(static[ \t]+\\)?" ; there may be static or const. |
;;; "\\(static[ \t]+\\)?" ; there may be static or const. |
253 |
; "\\(const[ \t]+\\)?" |
;;; "\\(const[ \t]+\\)?" |
254 |
; "enum[ \t]+" |
;;; "enum[ \t]+" |
255 |
; "\\([a-zA-Z0-9_]+\\)" ; this is the string we want to get |
;;; "\\([a-zA-Z0-9_]+\\)" ; this is the string we want to get |
256 |
; "[ \t]*[{]" |
;;; "[ \t]*[{]" |
257 |
; )) 3) |
;;; )) 3) |
258 |
; ("Union" |
;;; ("Union" |
259 |
; (, (concat |
;;; (, (concat |
260 |
; "^" ; beginning of line is required |
;;; "^" ; beginning of line is required |
261 |
; "\\(static[ \t]+\\)?" ; there may be static or const. |
;;; "\\(static[ \t]+\\)?" ; there may be static or const. |
262 |
; "\\(const[ \t]+\\)?" |
;;; "\\(const[ \t]+\\)?" |
263 |
; "union[ \t]+" |
;;; "union[ \t]+" |
264 |
; "\\([a-zA-Z0-9_]+\\)" ; this is the string we want to get |
;;; "\\([a-zA-Z0-9_]+\\)" ; this is the string we want to get |
265 |
; "[ \t]*[{]" |
;;; "[ \t]*[{]" |
266 |
; )) 3) |
;;; )) 3) |
267 |
) |
) |
268 |
"Imenu generic expression for C++ mode. See `imenu-generic-expression'.") |
"Imenu generic expression for C++ mode. See `imenu-generic-expression'.") |
269 |
|
|