* gdbcore.h (struct regcache): Add forward declaration.
[deliverable/binutils-gdb.git] / gdb / p-exp.y
index 6132e6eb10c8fdb79e5017d7890a174e7b51ffd8..68e1a15e9e7d5902761ef9a988b8113bd295ea7b 100644 (file)
@@ -1,6 +1,5 @@
 /* YACC parser for Pascal expressions, for GDB.
-   Copyright 2000
-   Free Software Foundation, Inc.
+   Copyright (C) 2000, 2006, 2007 Free Software Foundation, Inc.
 
 This file is part of GDB.
 
@@ -16,7 +15,8 @@ GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+Foundation, Inc., 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA.  */
 
 /* This file is derived from c-exp.y */
 
@@ -521,7 +521,7 @@ exp :       THIS
                          /* we need type of this */
                          this_val = value_of_this (0); 
                          if (this_val)
-                           this_type = this_val->type;
+                           this_type = value_type (this_val);
                          else
                            this_type = NULL;
                          if (this_type)
@@ -672,7 +672,7 @@ variable:   name_not_typename
                              /* we need type of this */
                              this_val = value_of_this (0); 
                              if (this_val)
-                               this_type = this_val->type;
+                               this_type = value_type (this_val);
                              else
                                this_type = NULL;
                              if (this_type)
@@ -717,8 +717,6 @@ ptype       :       typebase
    is a pointer to member type.  Stroustrup loses again!  */
 
 type   :       ptype
-       |       typebase COLONCOLON '*'
-                       { $$ = lookup_member_type (builtin_type_int, $1); }
        ;
 
 typebase  /* Implements (approximately): (type-qualifier)* type-specifier */
@@ -798,23 +796,8 @@ parse_number (p, len, parsed_float, putithere)
       char saved_char = p[len];
 
       p[len] = 0;      /* null-terminate the token */
-      if (sizeof (putithere->typed_val_float.dval) <= sizeof (float))
-       num = sscanf (p, "%g%c", (float *) &putithere->typed_val_float.dval,&c);
-      else if (sizeof (putithere->typed_val_float.dval) <= sizeof (double))
-       num = sscanf (p, "%lg%c", (double *) &putithere->typed_val_float.dval,&c);
-      else
-       {
-#ifdef SCANF_HAS_LONG_DOUBLE
-         num = sscanf (p, "%Lg%c", &putithere->typed_val_float.dval,&c);
-#else
-         /* Scan it into a double, then assign it to the long double.
-            This at least wins with values representable in the range
-            of doubles. */
-         double temp;
-         num = sscanf (p, "%lg%c", &temp,&c);
-         putithere->typed_val_float.dval = temp;
-#endif
-       }
+      num = sscanf (p, DOUBLEST_SCAN_FORMAT "%c",
+                   &putithere->typed_val_float.dval, &c);
       p[len] = saved_char;     /* restore the input stream */
       if (num != 1)            /* check scanf found ONLY a float ... */
        return ERROR;
@@ -1369,29 +1352,29 @@ yylex ()
   switch (namelen)
     {
     case 6:
-      if (STREQ (uptokstart, "OBJECT"))
+      if (DEPRECATED_STREQ (uptokstart, "OBJECT"))
        return CLASS;
-      if (STREQ (uptokstart, "RECORD"))
+      if (DEPRECATED_STREQ (uptokstart, "RECORD"))
        return STRUCT;
-      if (STREQ (uptokstart, "SIZEOF"))
+      if (DEPRECATED_STREQ (uptokstart, "SIZEOF"))
        return SIZEOF;
       break;
     case 5:
-      if (STREQ (uptokstart, "CLASS"))
+      if (DEPRECATED_STREQ (uptokstart, "CLASS"))
        return CLASS;
-      if (STREQ (uptokstart, "FALSE"))
+      if (DEPRECATED_STREQ (uptokstart, "FALSE"))
        {
           yylval.lval = 0;
           return FALSEKEYWORD;
         }
       break;
     case 4:
-      if (STREQ (uptokstart, "TRUE"))
+      if (DEPRECATED_STREQ (uptokstart, "TRUE"))
        {
           yylval.lval = 1;
          return TRUEKEYWORD;
         }
-      if (STREQ (uptokstart, "SELF"))
+      if (DEPRECATED_STREQ (uptokstart, "SELF"))
         {
           /* here we search for 'this' like
              inserted in FPC stabs debug info */
@@ -1611,8 +1594,11 @@ yylex ()
 #endif /* not 0 */
          return TYPENAME;
         }
-    if ((yylval.tsym.type = lookup_primitive_typename (tmp)) != 0)
-       return TYPENAME;
+    yylval.tsym.type
+      = language_lookup_primitive_type_by_name (current_language,
+                                               current_gdbarch, tmp);
+    if (yylval.tsym.type != NULL)
+      return TYPENAME;
 
     /* Input names that aren't symbols but ARE valid hex numbers,
        when the input radix permits them, can be names or numbers
This page took 0.04078 seconds and 4 git commands to generate.