* alphafbsd-tdep.c: Include "solib-svr4.h".
[deliverable/binutils-gdb.git] / gdb / p-exp.y
index 282d25a065dc5292fee8ec2ec4e631a77c28f197..68d8c08e6cd2ee4e6ffea97e58ecf948210728a6 100644 (file)
@@ -1,5 +1,5 @@
 /* YACC parser for Pascal expressions, for GDB.
-   Copyright 2000
+   Copyright (C) 2000
    Free Software Foundation, Inc.
 
 This file is part of GDB.
@@ -16,7 +16,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 */
 
@@ -158,8 +159,8 @@ parse_number (char *, int, int, YYSTYPE *);
 
 static struct type *current_type;
 
-static void push_current_type ();
-static void pop_current_type ();
+static void push_current_type (void);
+static void pop_current_type (void);
 static int search_field;
 %}
 
@@ -521,7 +522,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 +673,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)
@@ -685,7 +686,7 @@ variable:   name_not_typename
                          else
                            {
                              struct minimal_symbol *msymbol;
-                             register char *arg = copy_name ($1.stoken);
+                             char *arg = copy_name ($1.stoken);
 
                              msymbol =
                                lookup_minimal_symbol (arg, NULL, NULL);
@@ -764,20 +765,20 @@ name_not_typename :       NAME
 
 static int
 parse_number (p, len, parsed_float, putithere)
-     register char *p;
-     register int len;
+     char *p;
+     int len;
      int parsed_float;
      YYSTYPE *putithere;
 {
   /* FIXME: Shouldn't these be unsigned?  We don't deal with negative values
      here, and we do kind of silly things like cast to unsigned.  */
-  register LONGEST n = 0;
-  register LONGEST prevn = 0;
+  LONGEST n = 0;
+  LONGEST prevn = 0;
   ULONGEST un;
 
-  register int i = 0;
-  register int c;
-  register int base = input_radix;
+  int i = 0;
+  int c;
+  int base = input_radix;
   int unsigned_p = 0;
 
   /* Number of "L" suffixes encountered.  */
@@ -992,7 +993,8 @@ struct type_push
 
 static struct type_push *tp_top = NULL;
 
-static void push_current_type ()
+static void
+push_current_type (void)
 {
   struct type_push *tpnew;
   tpnew = (struct type_push *) malloc (sizeof (struct type_push));
@@ -1002,7 +1004,8 @@ static void push_current_type ()
   tp_top = tpnew; 
 }
 
-static void pop_current_type ()
+static void
+pop_current_type (void)
 {
   struct type_push *tp = tp_top;
   if (tp)
@@ -1187,7 +1190,7 @@ yylex ()
       {
        /* It's a number.  */
        int got_dot = 0, got_e = 0, toktype;
-       register char *p = tokstart;
+       char *p = tokstart;
        int hex = input_radix > 10;
 
        if (c == '0' && (p[1] == 'x' || p[1] == 'X'))
@@ -1367,29 +1370,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 */
@@ -1609,8 +1612,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.076148 seconds and 4 git commands to generate.