diff options
Diffstat (limited to 'lib-src')
| -rw-r--r-- | lib-src/ChangeLog | 5 | ||||
| -rw-r--r-- | lib-src/ebrowse.c | 119 |
2 files changed, 86 insertions, 38 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 05bbbbe5598..baa43bba37e 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2002-03-29 Gerd Moellmann <gerd@gnu.org> | ||
| 2 | |||
| 3 | * ebrowse.c (add_declarator, skip_initializer): New functions. | ||
| 4 | (declaration): Use them. | ||
| 5 | |||
| 1 | 2002-03-28 Jason Rumney <jasonr@gnu.org> | 6 | 2002-03-28 Jason Rumney <jasonr@gnu.org> |
| 2 | 7 | ||
| 3 | * makefile.w32-in (lisp): Move backquote.elc into emacs-lisp. | 8 | * makefile.w32-in (lisp): Move backquote.elc into emacs-lisp. |
diff --git a/lib-src/ebrowse.c b/lib-src/ebrowse.c index f54e18ebed2..47ab0d1c9e3 100644 --- a/lib-src/ebrowse.c +++ b/lib-src/ebrowse.c | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /* ebrowse.c --- parsing files for the ebrowse C++ browser | 1 | /* ebrowse.c --- parsing files for the ebrowse C++ browser |
| 2 | 2 | ||
| 3 | Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 99, | 3 | Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 99, |
| 4 | 2000, 2001 Free Software Foundation Inc. | 4 | 2000, 2001, 2002 Free Software Foundation Inc. |
| 5 | 5 | ||
| 6 | This file is part of GNU Emacs. | 6 | This file is part of GNU Emacs. |
| 7 | 7 | ||
| @@ -2423,6 +2423,30 @@ skip_matching () | |||
| 2423 | } | 2423 | } |
| 2424 | } | 2424 | } |
| 2425 | 2425 | ||
| 2426 | int | ||
| 2427 | skip_initializer () | ||
| 2428 | { | ||
| 2429 | for (;;) | ||
| 2430 | { | ||
| 2431 | switch (LA1) | ||
| 2432 | { | ||
| 2433 | case ';': | ||
| 2434 | case ',': | ||
| 2435 | case YYEOF: | ||
| 2436 | return; | ||
| 2437 | |||
| 2438 | case '{': | ||
| 2439 | case '[': | ||
| 2440 | case '(': | ||
| 2441 | skip_matching (); | ||
| 2442 | break; | ||
| 2443 | |||
| 2444 | default: | ||
| 2445 | MATCH (); | ||
| 2446 | break; | ||
| 2447 | } | ||
| 2448 | } | ||
| 2449 | } | ||
| 2426 | 2450 | ||
| 2427 | /* Build qualified namespace alias (A::B::c) and return it. */ | 2451 | /* Build qualified namespace alias (A::B::c) and return it. */ |
| 2428 | 2452 | ||
| @@ -3205,6 +3229,54 @@ class_definition (containing, tag, flags, nested) | |||
| 3205 | } | 3229 | } |
| 3206 | } | 3230 | } |
| 3207 | 3231 | ||
| 3232 | /* Add to class *CLS information for the declaration of variable or | ||
| 3233 | type *ID. If *CLS is null, this means a global declaration. SC is | ||
| 3234 | the storage class of *ID. FLAGS is a bit set giving additional | ||
| 3235 | information about the member (see the F_* defines). */ | ||
| 3236 | |||
| 3237 | void | ||
| 3238 | add_declarator (cls, id, flags, sc) | ||
| 3239 | struct sym **cls; | ||
| 3240 | char **id; | ||
| 3241 | int flags, sc; | ||
| 3242 | { | ||
| 3243 | if (LOOKING_AT2 (';', ',')) | ||
| 3244 | { | ||
| 3245 | /* The end of a member variable or of an access declaration | ||
| 3246 | `X::f'. To distinguish between them we have to know whether | ||
| 3247 | type information has been seen. */ | ||
| 3248 | if (*id) | ||
| 3249 | { | ||
| 3250 | char *regexp = matching_regexp (); | ||
| 3251 | int pos = BUFFER_POS (); | ||
| 3252 | |||
| 3253 | if (cls) | ||
| 3254 | add_member_defn (cls, *id, regexp, pos, 0, 1, SC_UNKNOWN, flags); | ||
| 3255 | else | ||
| 3256 | add_global_defn (*id, regexp, pos, 0, 1, sc, flags); | ||
| 3257 | } | ||
| 3258 | |||
| 3259 | MATCH (); | ||
| 3260 | print_info (); | ||
| 3261 | } | ||
| 3262 | else if (LOOKING_AT ('{')) | ||
| 3263 | { | ||
| 3264 | if (sc == SC_TYPE && *id) | ||
| 3265 | { | ||
| 3266 | /* A named enumeration. */ | ||
| 3267 | char *regexp = matching_regexp (); | ||
| 3268 | int pos = BUFFER_POS (); | ||
| 3269 | add_global_defn (*id, regexp, pos, 0, 1, sc, flags); | ||
| 3270 | } | ||
| 3271 | |||
| 3272 | skip_matching (); | ||
| 3273 | print_info (); | ||
| 3274 | } | ||
| 3275 | |||
| 3276 | xfree (*id); | ||
| 3277 | *id = NULL; | ||
| 3278 | *cls = NULL; | ||
| 3279 | } | ||
| 3208 | 3280 | ||
| 3209 | /* Parse a declaration. */ | 3281 | /* Parse a declaration. */ |
| 3210 | 3282 | ||
| @@ -3259,11 +3331,15 @@ declaration (flags) | |||
| 3259 | } | 3331 | } |
| 3260 | 3332 | ||
| 3261 | case '=': | 3333 | case '=': |
| 3262 | /* Assumed to be the start of an initialization in this context. | 3334 | /* Assumed to be the start of an initialization in this |
| 3263 | Skip over everything up to ';'. */ | 3335 | context. */ |
| 3264 | skip_to (';'); | 3336 | skip_initializer (); |
| 3265 | break; | 3337 | break; |
| 3266 | 3338 | ||
| 3339 | case ',': | ||
| 3340 | add_declarator (&cls, &id, flags, sc); | ||
| 3341 | break; | ||
| 3342 | |||
| 3267 | case OPERATOR: | 3343 | case OPERATOR: |
| 3268 | { | 3344 | { |
| 3269 | char *s = operator_name (&sc); | 3345 | char *s = operator_name (&sc); |
| @@ -3350,40 +3426,7 @@ declaration (flags) | |||
| 3350 | } | 3426 | } |
| 3351 | } | 3427 | } |
| 3352 | 3428 | ||
| 3353 | if (LOOKING_AT (';')) | 3429 | add_declarator (&cls, &id, flags, sc); |
| 3354 | { | ||
| 3355 | /* The end of a member variable or of an access declaration | ||
| 3356 | `X::f'. To distinguish between them we have to know whether | ||
| 3357 | type information has been seen. */ | ||
| 3358 | if (id) | ||
| 3359 | { | ||
| 3360 | char *regexp = matching_regexp (); | ||
| 3361 | int pos = BUFFER_POS (); | ||
| 3362 | |||
| 3363 | if (cls) | ||
| 3364 | add_member_defn (cls, id, regexp, pos, 0, 1, SC_UNKNOWN, flags); | ||
| 3365 | else | ||
| 3366 | add_global_defn (id, regexp, pos, 0, 1, sc, flags); | ||
| 3367 | } | ||
| 3368 | |||
| 3369 | MATCH (); | ||
| 3370 | print_info (); | ||
| 3371 | } | ||
| 3372 | else if (LOOKING_AT ('{')) | ||
| 3373 | { | ||
| 3374 | if (sc == SC_TYPE && id) | ||
| 3375 | { | ||
| 3376 | /* A named enumeration. */ | ||
| 3377 | regexp = matching_regexp (); | ||
| 3378 | pos = BUFFER_POS (); | ||
| 3379 | add_global_defn (id, regexp, pos, 0, 1, sc, flags); | ||
| 3380 | } | ||
| 3381 | |||
| 3382 | skip_matching (); | ||
| 3383 | print_info (); | ||
| 3384 | } | ||
| 3385 | |||
| 3386 | xfree (id); | ||
| 3387 | } | 3430 | } |
| 3388 | 3431 | ||
| 3389 | 3432 | ||