2012-03-01 Pedro Alves <palves@redhat.com>
[deliverable/binutils-gdb.git] / gdb / p-exp.y
index 2b7cb2ab52a2399b008cf484a4a631078ab5fc04..3b7984ecf35702d7cc949930b0adb426d9d0287c 100644 (file)
@@ -1,6 +1,5 @@
 /* YACC parser for Pascal expressions, for GDB.
-   Copyright (C) 2000, 2006, 2007, 2008, 2009, 2010, 2011
-   Free Software Foundation, Inc.
+   Copyright (C) 2000, 2006-2012 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -339,7 +338,7 @@ exp :       field_exp COMPLETE
 
 exp    :       exp '['
                        /* We need to save the current_type value.  */
-                       { char *arrayname;
+                       { const char *arrayname;
                          int arrayfieldindex;
                          arrayfieldindex = is_pascal_string_type (
                                current_type, NULL, NULL,
@@ -612,7 +611,7 @@ exp :       THIS
                          write_exp_elt_opcode (OP_THIS);
                          write_exp_elt_opcode (OP_THIS);
                          /* We need type of this.  */
-                         this_val = value_of_this (0);
+                         this_val = value_of_this_silent (parse_language);
                          if (this_val)
                            this_type = value_type (this_val);
                          else
@@ -644,7 +643,7 @@ block       :       BLOCKNAME
                                $$ = BLOCKVECTOR_BLOCK (BLOCKVECTOR (tem),
                                                        STATIC_BLOCK);
                              else
-                               error ("No file or function \"%s\".",
+                               error (_("No file or function \"%s\"."),
                                       copy_name ($1.stoken));
                            }
                        }
@@ -655,7 +654,7 @@ block       :       block COLONCOLON name
                            = lookup_symbol (copy_name ($3), $1,
                                             VAR_DOMAIN, (int *) NULL);
                          if (!tem || SYMBOL_CLASS (tem) != LOC_BLOCK)
-                           error ("No function \"%s\" in specified context.",
+                           error (_("No function \"%s\" in specified context."),
                                   copy_name ($3));
                          $$ = SYMBOL_BLOCK_VALUE (tem); }
        ;
@@ -665,7 +664,7 @@ variable:   block COLONCOLON name
                          sym = lookup_symbol (copy_name ($3), $1,
                                               VAR_DOMAIN, (int *) NULL);
                          if (sym == 0)
-                           error ("No symbol \"%s\" in specified context.",
+                           error (_("No symbol \"%s\" in specified context."),
                                   copy_name ($3));
 
                          write_exp_elt_opcode (OP_VAR_VALUE);
@@ -680,7 +679,7 @@ qualified_name:     typebase COLONCOLON name
                          struct type *type = $1;
                          if (TYPE_CODE (type) != TYPE_CODE_STRUCT
                              && TYPE_CODE (type) != TYPE_CODE_UNION)
-                           error ("`%s' is not defined as an aggregate type.",
+                           error (_("`%s' is not defined as an aggregate type."),
                                   TYPE_NAME (type));
 
                          write_exp_elt_opcode (OP_SCOPE);
@@ -714,10 +713,10 @@ variable: qualified_name
                            write_exp_msymbol (msymbol);
                          else if (!have_full_symbols ()
                                   && !have_partial_symbols ())
-                           error ("No symbol table is loaded.  "
-                                  "Use the \"file\" command.");
+                           error (_("No symbol table is loaded.  "
+                                  "Use the \"file\" command."));
                          else
-                           error ("No symbol \"%s\" in current context.",
+                           error (_("No symbol \"%s\" in current context."),
                                   name);
                        }
        ;
@@ -760,7 +759,7 @@ variable:   name_not_typename
                              write_exp_string ($1.stoken);
                              write_exp_elt_opcode (STRUCTOP_PTR);
                              /* We need type of this.  */
-                             this_val = value_of_this (0);
+                             this_val = value_of_this_silent (parse_language);
                              if (this_val)
                                this_type = value_type (this_val);
                              else
@@ -783,10 +782,10 @@ variable: name_not_typename
                                write_exp_msymbol (msymbol);
                              else if (!have_full_symbols ()
                                       && !have_partial_symbols ())
-                               error ("No symbol table is loaded.  "
-                                      "Use the \"file\" command.");
+                               error (_("No symbol table is loaded.  "
+                                      "Use the \"file\" command."));
                              else
-                               error ("No symbol \"%s\" in current context.",
+                               error (_("No symbol \"%s\" in current context."),
                                       copy_name ($1.stoken));
                            }
                        }
@@ -961,7 +960,7 @@ parse_number (char *p, int len, int parsed_float, YYSTYPE *putithere)
       if (c != 'l' && c != 'u' && n != 0)
        {
          if ((unsigned_p && (ULONGEST) prevn >= (ULONGEST) n))
-           error ("Numeric constant too large.");
+           error (_("Numeric constant too large."));
        }
       prevn = n;
     }
@@ -1094,9 +1093,8 @@ static const struct token tokentab2[] =
 
 /* Allocate uppercased var: */
 /* make an uppercased copy of tokstart.  */
-static char * uptok (tokstart, namelen)
-  char *tokstart;
-  int namelen;
+static char *
+uptok (char *tokstart, int namelen)
 {
   int i;
   char *uptokstart = (char *)malloc(namelen+1);
@@ -1188,7 +1186,7 @@ yylex (void)
       if (c == '\\')
        c = parse_escape (parse_gdbarch, &lexptr);
       else if (c == '\'')
-       error ("Empty character constant.");
+       error (_("Empty character constant."));
 
       yylval.typed_val_int.val = c;
       yylval.typed_val_int.type = parse_type->builtin_char;
@@ -1201,13 +1199,13 @@ yylex (void)
            {
              lexptr = tokstart + namelen;
              if (lexptr[-1] != '\'')
-               error ("Unmatched single quote.");
+               error (_("Unmatched single quote."));
              namelen -= 2;
               tokstart++;
               uptokstart = uptok(tokstart,namelen);
              goto tryname;
            }
-         error ("Invalid character constant.");
+         error (_("Invalid character constant."));
        }
       return INT;
 
@@ -1299,7 +1297,7 @@ yylex (void)
 
            memcpy (err_copy, tokstart, p - tokstart);
            err_copy[p - tokstart] = 0;
-           error ("Invalid number \"%s\".", err_copy);
+           error (_("Invalid number \"%s\"."), err_copy);
          }
        lexptr = p;
        return toktype;
@@ -1372,7 +1370,7 @@ yylex (void)
       } while ((*tokptr != '"') && (*tokptr != '\0'));
       if (*tokptr++ != '"')
        {
-         error ("Unterminated string in expression.");
+         error (_("Unterminated string in expression."));
        }
       tempbuf[tempbufindex] = '\0';    /* See note above.  */
       yylval.sval.ptr = tempbuf;
@@ -1384,7 +1382,7 @@ yylex (void)
   if (!(c == '_' || c == '$'
        || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')))
     /* We must have come across a bad character (e.g. ';').  */
-    error ("Invalid character '%c' in expression.", c);
+    error (_("Invalid character '%c' in expression."), c);
 
   /* It's a name.  See how long it is.  */
   namelen = 0;
@@ -1733,11 +1731,10 @@ yylex (void)
 }
 
 void
-yyerror (msg)
-     char *msg;
+yyerror (char *msg)
 {
   if (prev_lexptr)
     lexptr = prev_lexptr;
 
-  error ("A %s in expression, near `%s'.", (msg ? msg : "error"), lexptr);
+  error (_("A %s in expression, near `%s'."), (msg ? msg : "error"), lexptr);
 }
This page took 0.033439 seconds and 4 git commands to generate.