* c-exp.y (yylex): scan template names, and scan nested class
authorKung Hsu <kung@cygnus>
Wed, 2 Nov 1994 23:11:47 +0000 (23:11 +0000)
committerKung Hsu <kung@cygnus>
Wed, 2 Nov 1994 23:11:47 +0000 (23:11 +0000)
        names.

gdb/ChangeLog
gdb/c-exp.y

index e4aecb7c93bcf1fbaf21f97ed8d2b0563bf2c9aa..68540bb3061c130b1bf4edaad4d91535b3a40d16 100644 (file)
@@ -1,3 +1,8 @@
+Wed Nov  2 15:05:39 1994  Kung Hsu  (kung@mexican.cygnus.com)
+
+       * c-exp.y (yylex): scan template names, and scan nested class
+       names.
+
 Wed Nov  2 11:01:55 1994  J.T. Conklin  (jtc@phishhead.cygnus.com)
 
        * nlm/Makefile.in: install gdbserve.nlm.
index 399b2aaa4a020c72e21cb2a720cf103243cc14e5..bb87545f7ce8785d4cfb86953d7799f90f875dee 100644 (file)
@@ -1363,9 +1363,12 @@ yylex ()
   namelen = 0;
   for (c = tokstart[namelen];
        (c == '_' || c == '$' || (c >= '0' && c <= '9')
-       || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'));
-       c = tokstart[++namelen])
-    ;
+       || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '<');)
+    {
+       if (c == '<')
+        while (tokstart[++namelen] != '>');
+       c = tokstart[++namelen];
+     }
 
   /* The token "if" terminates the expression and is NOT 
      removed from the input stream.  */
@@ -1574,11 +1577,17 @@ yylex ()
                      struct symbol *cur_sym;
                      /* As big as the whole rest of the expression, which is
                         at least big enough.  */
-                     char *tmp = alloca (strlen (namestart)+1);
-
-                     memcpy (tmp, namestart, p - namestart);
-                     tmp[p - namestart] = '\0';
-                     cur_sym = lookup_symbol (tmp, expression_context_block,
+                     char *ncopy = alloca (strlen (tmp)+strlen (namestart)+3);
+                     char *tmp1;
+
+                     tmp1 = ncopy;
+                     memcpy (tmp1, tmp, strlen (tmp));
+                     tmp1 += strlen (tmp);
+                     memcpy (tmp1, "::", 2);
+                     tmp1 += 2;
+                     memcpy (tmp1, namestart, p - namestart);
+                     tmp1[p - namestart] = '\0';
+                     cur_sym = lookup_symbol (ncopy, expression_context_block,
                                               VAR_NAMESPACE, (int *) NULL,
                                               (struct symtab **) NULL);
                      if (cur_sym)