244 |
;; Example of generic expression for finding prototypes, structs, unions, enums. |
;; Example of generic expression for finding prototypes, structs, unions, enums. |
245 |
;; 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 |
246 |
;; the indexes. |
;; the indexes. |
247 |
; ("Prototypes" |
;;; ("Prototypes" |
248 |
; (, |
;;; (, |
249 |
; (concat |
;;; (concat |
250 |
; "^" ; beginning of line is required |
;;; "^" ; beginning of line is required |
251 |
; "\\(template[ \t]*<[^>]+>[ \t]*\\)?" ; there may be a "template <...>" |
;;; "\\(template[ \t]*<[^>]+>[ \t]*\\)?" ; there may be a "template <...>" |
252 |
; "\\([a-zA-Z0-9_:]+[ \t]+\\)?" ; type specs; there can be no |
;;; "\\([a-zA-Z0-9_:]+[ \t]+\\)?" ; type specs; there can be no |
253 |
; "\\([a-zA-Z0-9_:]+[ \t]+\\)?" ; more than 3 tokens, right? |
;;; "\\([a-zA-Z0-9_:]+[ \t]+\\)?" ; more than 3 tokens, right? |
254 |
|
|
255 |
; "\\(" ; last type spec including */& |
;;; "\\(" ; last type spec including */& |
256 |
; "[a-zA-Z0-9_:]+" |
;;; "[a-zA-Z0-9_:]+" |
257 |
; "\\([ \t]*[*&]+[ \t]*\\|[ \t]+\\)" ; either pointer/ref sign or whitespace |
;;; "\\([ \t]*[*&]+[ \t]*\\|[ \t]+\\)" ; either pointer/ref sign or whitespace |
258 |
; "\\)?" ; if there is a last type spec |
;;; "\\)?" ; if there is a last type spec |
259 |
; "\\(" ; name; take that into the imenu entry |
;;; "\\(" ; name; take that into the imenu entry |
260 |
; "[a-zA-Z0-9_:~]+" ; member function, ctor or dtor... |
;;; "[a-zA-Z0-9_:~]+" ; member function, ctor or dtor... |
261 |
; ; (may not contain * because then |
;;; ; (may not contain * because then |
262 |
; ; "a::operator char*" would become "char*"!) |
;;; ; "a::operator char*" would become "char*"!) |
263 |
; "\\|" |
;;; "\\|" |
264 |
; "\\([a-zA-Z0-9_:~]*::\\)?operator" |
;;; "\\([a-zA-Z0-9_:~]*::\\)?operator" |
265 |
; "[^a-zA-Z1-9_][^(]*" ; ...or operator |
;;; "[^a-zA-Z1-9_][^(]*" ; ...or operator |
266 |
; " \\)" |
;;; " \\)" |
267 |
; "[ \t]*([^)]*)[ \t\n]*;" ; require ';' after |
;;; "[ \t]*([^)]*)[ \t\n]*;" ; require ';' after |
268 |
; ; the (...) Can't |
;;; ; the (...) Can't |
269 |
; ; catch cases with () inside the parentheses |
;;; ; catch cases with () inside the parentheses |
270 |
; ; surrounding the parameters |
;;; ; surrounding the parameters |
271 |
; ; (like "int foo(int a=bar());" |
;;; ; (like "int foo(int a=bar());" |
272 |
; )) 6) |
;;; )) 6) |
273 |
; ("Struct" |
;;; ("Struct" |
274 |
; (, (concat |
;;; (, (concat |
275 |
; "^" ; beginning of line is required |
;;; "^" ; beginning of line is required |
276 |
; "\\(static[ \t]+\\)?" ; there may be static or const. |
;;; "\\(static[ \t]+\\)?" ; there may be static or const. |
277 |
; "\\(const[ \t]+\\)?" |
;;; "\\(const[ \t]+\\)?" |
278 |
; "struct[ \t]+" |
;;; "struct[ \t]+" |
279 |
; "\\([a-zA-Z0-9_]+\\)" ; this is the string we want to get |
;;; "\\([a-zA-Z0-9_]+\\)" ; this is the string we want to get |
280 |
; "[ \t]*[{]" |
;;; "[ \t]*[{]" |
281 |
; )) 3) |
;;; )) 3) |
282 |
; ("Enum" |
;;; ("Enum" |
283 |
; (, (concat |
;;; (, (concat |
284 |
; "^" ; beginning of line is required |
;;; "^" ; beginning of line is required |
285 |
; "\\(static[ \t]+\\)?" ; there may be static or const. |
;;; "\\(static[ \t]+\\)?" ; there may be static or const. |
286 |
; "\\(const[ \t]+\\)?" |
;;; "\\(const[ \t]+\\)?" |
287 |
; "enum[ \t]+" |
;;; "enum[ \t]+" |
288 |
; "\\([a-zA-Z0-9_]+\\)" ; this is the string we want to get |
;;; "\\([a-zA-Z0-9_]+\\)" ; this is the string we want to get |
289 |
; "[ \t]*[{]" |
;;; "[ \t]*[{]" |
290 |
; )) 3) |
;;; )) 3) |
291 |
; ("Union" |
;;; ("Union" |
292 |
; (, (concat |
;;; (, (concat |
293 |
; "^" ; beginning of line is required |
;;; "^" ; beginning of line is required |
294 |
; "\\(static[ \t]+\\)?" ; there may be static or const. |
;;; "\\(static[ \t]+\\)?" ; there may be static or const. |
295 |
; "\\(const[ \t]+\\)?" |
;;; "\\(const[ \t]+\\)?" |
296 |
; "union[ \t]+" |
;;; "union[ \t]+" |
297 |
; "\\([a-zA-Z0-9_]+\\)" ; this is the string we want to get |
;;; "\\([a-zA-Z0-9_]+\\)" ; this is the string we want to get |
298 |
; "[ \t]*[{]" |
;;; "[ \t]*[{]" |
299 |
; )) 3) |
;;; )) 3) |
300 |
) |
) |
301 |
"Imenu generic expression for C mode. See `imenu-generic-expression'.") |
"Imenu generic expression for C mode. See `imenu-generic-expression'.") |
302 |
|
|