* gdb.base/corefile.exp: Recognize the message saying that GDB
[deliverable/binutils-gdb.git] / gdb / c-exp.y
index d4291f7b979806d8615d98c7d01171277b9a4648..3d2d1aa661f724b0b87b521359f1fb89b74e2e7b 100644 (file)
@@ -1,5 +1,6 @@
 /* YACC parser for C expressions, for GDB.
-   Copyright (C) 1986, 1989, 1990, 1991, 1993, 1994, 1996, 1997
+   Copyright 1986, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
+   1998, 1999, 2000
    Free Software Foundation, Inc.
 
 This file is part of GDB.
@@ -717,21 +718,26 @@ variable: name_not_typename
                        }
        ;
 
+space_identifier : '@' NAME
+               { push_type_address_space (copy_name ($2.stoken));
+                 push_type (tp_space_identifier);
+               }
+       ;
 
-ptype  :       typebase
-       /* "const" and "volatile" are curently ignored.  A type qualifier
-          before the type is currently handled in the typebase rule.
-          The reason for recognizing these here (shift/reduce conflicts)
-          might be obsolete now that some pointer to member rules have
-          been deleted.  */
-       |       typebase CONST_KEYWORD
-       |       typebase VOLATILE_KEYWORD
-       |       typebase abs_decl
-               { $$ = follow_types ($1); }
-       |       typebase CONST_KEYWORD abs_decl
-               { $$ = follow_types ($1); }
-       |       typebase VOLATILE_KEYWORD abs_decl
-               { $$ = follow_types ($1); }
+const_or_volatile: const_or_volatile_noopt
+       |
+       ;
+
+cv_with_space_id : const_or_volatile space_identifier const_or_volatile
+       ;
+
+const_or_volatile_or_space_identifier_noopt: cv_with_space_id
+       | const_or_volatile_noopt 
+       ;
+
+const_or_volatile_or_space_identifier: 
+               const_or_volatile_or_space_identifier_noopt
+       |
        ;
 
 abs_decl:      '*'
@@ -811,6 +817,10 @@ typebase  /* Implements (approximately): (type-qualifier)* type-specifier */
                        { $$ = builtin_type_unsigned_long_long; }
        |       UNSIGNED LONG LONG INT_KEYWORD
                        { $$ = builtin_type_unsigned_long_long; }
+       |       SIGNED_KEYWORD LONG LONG
+                       { $$ = lookup_signed_typename ("long long"); }
+       |       SIGNED_KEYWORD LONG LONG INT_KEYWORD
+                       { $$ = lookup_signed_typename ("long long"); }
        |       SHORT INT_KEYWORD
                        { $$ = builtin_type_short; }
        |       UNSIGNED SHORT INT_KEYWORD
@@ -846,11 +856,10 @@ typebase  /* Implements (approximately): (type-qualifier)* type-specifier */
                        { $$ = lookup_template_type(copy_name($2), $4,
                                                    expression_context_block);
                        }
-       /* "const" and "volatile" are curently ignored.  A type qualifier
-          after the type is handled in the ptype rule.  I think these could
-          be too.  */
-       |       CONST_KEYWORD typebase { $$ = $2; }
-       |       VOLATILE_KEYWORD typebase { $$ = $2; }
+       | const_or_volatile_or_space_identifier_noopt typebase 
+                       { $$ = follow_types ($2); }
+       | typebase const_or_volatile_or_space_identifier_noopt 
+                       { $$ = follow_types ($1); }
        ;
 
 typename:      TYPENAME
@@ -887,6 +896,25 @@ nonempty_typelist
                }
        ;
 
+ptype  :       typebase
+       |       ptype const_or_volatile_or_space_identifier abs_decl const_or_volatile_or_space_identifier
+               { $$ = follow_types ($1); }
+       ;
+
+const_and_volatile:    CONST_KEYWORD VOLATILE_KEYWORD
+       |               VOLATILE_KEYWORD CONST_KEYWORD
+       ;
+
+const_or_volatile_noopt:       const_and_volatile 
+                       { push_type (tp_const);
+                         push_type (tp_volatile); 
+                       }
+       |               CONST_KEYWORD
+                       { push_type (tp_const); }
+       |               VOLATILE_KEYWORD
+                       { push_type (tp_volatile); }
+       ;
+
 name   :       NAME { $$ = $1.stoken; }
        |       BLOCKNAME { $$ = $1.stoken; }
        |       TYPENAME { $$ = $1.stoken; }
@@ -1680,7 +1708,7 @@ yylex ()
          return TYPENAME;
         }
     if ((yylval.tsym.type = lookup_primitive_typename (tmp)) != 0)
-       return TYPENAME;
+      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.025832 seconds and 4 git commands to generate.