emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lib-src/ebrowse.c


From: Gerd Moellmann
Subject: [Emacs-diffs] Changes to emacs/lib-src/ebrowse.c
Date: Fri, 29 Mar 2002 06:19:00 -0500

Index: emacs/lib-src/ebrowse.c
diff -c emacs/lib-src/ebrowse.c:1.30 emacs/lib-src/ebrowse.c:1.31
*** emacs/lib-src/ebrowse.c:1.30        Fri Dec 21 22:15:55 2001
--- emacs/lib-src/ebrowse.c     Fri Mar 29 06:18:56 2002
***************
*** 1,7 ****
  /* ebrowse.c --- parsing files for the ebrowse C++ browser
  
     Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 99,
!                  2000, 2001   Free Software Foundation Inc.
  
     This file is part of GNU Emacs.
  
--- 1,7 ----
  /* ebrowse.c --- parsing files for the ebrowse C++ browser
  
     Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 99,
!                  2000, 2001, 2002   Free Software Foundation Inc.
  
     This file is part of GNU Emacs.
  
***************
*** 2423,2428 ****
--- 2423,2452 ----
      }
  }
  
+ int
+ skip_initializer ()
+ {
+   for (;;)
+     {
+       switch (LA1)
+       {
+       case ';':
+       case ',':
+       case YYEOF:
+         return;
+ 
+       case '{':
+       case '[':
+       case '(':
+         skip_matching ();
+         break;
+ 
+       default:
+         MATCH ();
+         break;
+       }
+     }
+ }
  
  /* Build qualified namespace alias (A::B::c) and return it. */
  
***************
*** 3205,3210 ****
--- 3229,3282 ----
      }
  }
  
+ /* Add to class *CLS information for the declaration of variable or
+    type *ID.  If *CLS is null, this means a global declaration.  SC is
+    the storage class of *ID.  FLAGS is a bit set giving additional
+    information about the member (see the F_* defines).  */
+ 
+ void
+ add_declarator (cls, id, flags, sc)
+      struct sym **cls;
+      char **id;
+      int flags, sc;
+ {
+   if (LOOKING_AT2 (';', ','))
+     {
+       /* The end of a member variable or of an access declaration
+          `X::f'.  To distinguish between them we have to know whether
+          type information has been seen.  */
+       if (*id)
+         {
+           char *regexp = matching_regexp ();
+           int pos = BUFFER_POS ();
+ 
+           if (cls)
+           add_member_defn (cls, *id, regexp, pos, 0, 1, SC_UNKNOWN, flags);
+           else
+             add_global_defn (*id, regexp, pos, 0, 1, sc, flags);
+         }
+ 
+       MATCH ();
+       print_info ();
+     }
+   else if (LOOKING_AT ('{'))
+     {
+       if (sc == SC_TYPE && *id)
+         {
+           /* A named enumeration.  */
+           char *regexp = matching_regexp ();
+           int pos = BUFFER_POS ();
+           add_global_defn (*id, regexp, pos, 0, 1, sc, flags);
+         }
+ 
+       skip_matching ();
+       print_info ();
+     }
+ 
+   xfree (*id);
+   *id = NULL;
+   *cls = NULL;
+ }
  
  /* Parse a declaration.  */
  
***************
*** 3259,3269 ****
            }
  
          case '=':
!           /* Assumed to be the start of an initialization in this context.
!              Skip over everything up to ';'.  */
!           skip_to (';');
            break;
  
          case OPERATOR:
          {
            char *s = operator_name (&sc);
--- 3331,3345 ----
            }
  
          case '=':
!           /* Assumed to be the start of an initialization in this
!            context.  */
!         skip_initializer ();
            break;
  
+       case ',':
+         add_declarator (&cls, &id, flags, sc);
+         break;
+ 
          case OPERATOR:
          {
            char *s = operator_name (&sc);
***************
*** 3350,3389 ****
          }
      }
  
!   if (LOOKING_AT (';'))
!     {
!       /* The end of a member variable or of an access declaration
!          `X::f'.  To distinguish between them we have to know whether
!          type information has been seen.  */
!       if (id)
!         {
!           char *regexp = matching_regexp ();
!           int pos = BUFFER_POS ();
! 
!           if (cls)
!           add_member_defn (cls, id, regexp, pos, 0, 1, SC_UNKNOWN, flags);
!           else
!             add_global_defn (id, regexp, pos, 0, 1, sc, flags);
!         }
! 
!       MATCH ();
!       print_info ();
!     }
!   else if (LOOKING_AT ('{'))
!     {
!       if (sc == SC_TYPE && id)
!         {
!           /* A named enumeration.  */
!           regexp = matching_regexp ();
!           pos = BUFFER_POS ();
!           add_global_defn (id, regexp, pos, 0, 1, sc, flags);
!         }
! 
!       skip_matching ();
!       print_info ();
!     }
! 
!   xfree (id);
  }
  
  
--- 3426,3432 ----
          }
      }
  
!   add_declarator (&cls, &id, flags, sc);
  }
  
  



reply via email to

[Prev in Thread] Current Thread [Next in Thread]