* inftarg.c (child_thread_alive): New function to see if a
[deliverable/binutils-gdb.git] / gdb / c-exp.y
index c3befb71e32c1f3b8a1b8c8c2c19097c629e4ffb..74b962d8d2bf774ee17bf210a95c6e0741c7377f 100644 (file)
@@ -84,6 +84,15 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #define        yylloc  c_lloc
 #define yyreds c_reds          /* With YYDEBUG defined */
 #define yytoks c_toks          /* With YYDEBUG defined */
+#define yylhs  c_yylhs
+#define yylen  c_yylen
+#define yydefred c_yydefred
+#define yydgoto        c_yydgoto
+#define yysindex c_yysindex
+#define yyrindex c_yyrindex
+#define yygindex c_yygindex
+#define yytable         c_yytable
+#define yycheck         c_yycheck
 
 #ifndef YYDEBUG
 #define        YYDEBUG 0               /* Default to no yydebug support */
@@ -539,8 +548,7 @@ block       :       BLOCKNAME
                              struct symtab *tem =
                                  lookup_symtab (copy_name ($1.stoken));
                              if (tem)
-                               $$ = BLOCKVECTOR_BLOCK
-                                        (BLOCKVECTOR (tem), STATIC_BLOCK);
+                               $$ = BLOCKVECTOR_BLOCK (BLOCKVECTOR (tem), STATIC_BLOCK);
                              else
                                error ("No file or function \"%s\".",
                                       copy_name ($1.stoken));
@@ -633,8 +641,7 @@ variable:   qualified_name
                              break;
                            }
 
-                         msymbol = lookup_minimal_symbol (name,
-                                     (struct objfile *) NULL);
+                         msymbol = lookup_minimal_symbol (name, NULL, NULL);
                          if (msymbol != NULL)
                            {
                              write_exp_msymbol (msymbol,
@@ -689,8 +696,8 @@ variable:   name_not_typename
                              struct minimal_symbol *msymbol;
                              register char *arg = copy_name ($1.stoken);
 
-                             msymbol = lookup_minimal_symbol (arg,
-                                         (struct objfile *) NULL);
+                             msymbol =
+                               lookup_minimal_symbol (arg, NULL, NULL);
                              if (msymbol != NULL)
                                {
                                  write_exp_msymbol (msymbol,
@@ -1056,7 +1063,8 @@ parse_number (p, len, parsed_float, putithere)
                  << 16);
       if (high_bit == 0)
        /* A long long does not fit in a LONGEST.  */
-       high_bit = (unsigned LONGEST)1 << sizeof (LONGEST) * HOST_CHAR_BIT - 1;
+       high_bit =
+         (unsigned LONGEST)1 << (sizeof (LONGEST) * HOST_CHAR_BIT - 1);
       unsigned_type = builtin_type_unsigned_long_long;
       signed_type = builtin_type_long_long;
     }
@@ -1169,6 +1177,8 @@ yylex ()
       c = *lexptr++;
       if (c == '\\')
        c = parse_escape (&lexptr);
+      else if (c == '\'')
+       error ("Empty character constant.");
 
       yylval.typed_val.val = c;
       yylval.typed_val.type = builtin_type_char;
@@ -1362,9 +1372,17 @@ 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 == '<')
+        {
+          int i = namelen;
+          while (tokstart[++i] && tokstart[i] != '>');
+          if (tokstart[i] == '>')
+            namelen = i;
+         }
+       c = tokstart[++namelen];
+     }
 
   /* The token "if" terminates the expression and is NOT 
      removed from the input stream.  */
@@ -1573,11 +1591,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)
This page took 0.024362 seconds and 4 git commands to generate.