X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fp-exp.y;h=31e8c4bea665acf3ce50f44e88ffcbf35267ee45;hb=be6d4f74c77c6f521afc873d226480e001cb99c2;hp=d527b776d9f14ccfd943adc881f88b2eae29d333;hpb=86a73007627a3c52d1c624ed430ac0e74fb8cc3e;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/p-exp.y b/gdb/p-exp.y index d527b776d9..31e8c4bea6 100644 --- a/gdb/p-exp.y +++ b/gdb/p-exp.y @@ -1,5 +1,5 @@ /* YACC parser for Pascal expressions, for GDB. - Copyright (C) 2000-2018 Free Software Foundation, Inc. + Copyright (C) 2000-2019 Free Software Foundation, Inc. This file is part of GDB. @@ -72,7 +72,7 @@ int yyparse (void); static int yylex (void); -void yyerror (const char *); +static void yyerror (const char *); static char *uptok (const char *, int); %} @@ -158,7 +158,7 @@ static int search_field; /* Special type cases, put in to allow the parser to distinguish different legal basetypes. */ -%token VARIABLE +%token DOLLAR_VARIABLE /* Object pascal */ @@ -521,7 +521,7 @@ exp : FLOAT exp : variable ; -exp : VARIABLE +exp : DOLLAR_VARIABLE /* Already written by write_dollar_variable. Handle current_type. */ { if (intvar) { @@ -1112,7 +1112,6 @@ yylex (void) { int c; int namelen; - unsigned int i; const char *tokstart; char *uptokstart; const char *tokptr; @@ -1129,7 +1128,7 @@ yylex (void) /* See if it is a special token of length 3. */ if (explen > 2) - for (i = 0; i < sizeof (tokentab3) / sizeof (tokentab3[0]); i++) + for (int i = 0; i < sizeof (tokentab3) / sizeof (tokentab3[0]); i++) if (strncasecmp (tokstart, tokentab3[i].oper, 3) == 0 && (!isalpha (tokentab3[i].oper[0]) || explen == 3 || (!isalpha (tokstart[3]) @@ -1142,7 +1141,7 @@ yylex (void) /* See if it is a special token of length 2. */ if (explen > 1) - for (i = 0; i < sizeof (tokentab2) / sizeof (tokentab2[0]); i++) + for (int i = 0; i < sizeof (tokentab2) / sizeof (tokentab2[0]); i++) if (strncasecmp (tokstart, tokentab2[i].oper, 2) == 0 && (!isalpha (tokentab2[i].oper[0]) || explen == 2 || (!isalpha (tokstart[2]) @@ -1493,7 +1492,7 @@ yylex (void) tmp[namelen] = '\0'; intvar = lookup_only_internalvar (tmp + 1); free (uptokstart); - return VARIABLE; + return DOLLAR_VARIABLE; } /* Use token-type BLOCKNAME for symbols that happen to be defined as @@ -1519,7 +1518,7 @@ yylex (void) /* second chance uppercased (as Free Pascal does). */ if (!sym && is_a_field_of_this.type == NULL && !is_a_field) { - for (i = 0; i <= namelen; i++) + for (int i = 0; i <= namelen; i++) { if ((tmp[i] >= 'a' && tmp[i] <= 'z')) tmp[i] -= ('a'-'A'); @@ -1535,7 +1534,7 @@ yylex (void) /* Third chance Capitalized (as GPC does). */ if (!sym && is_a_field_of_this.type == NULL && !is_a_field) { - for (i = 0; i <= namelen; i++) + for (int i = 0; i <= namelen; i++) { if (i == 0) { @@ -1722,11 +1721,11 @@ pascal_parse (struct parser_state *par_state) return yyparse (); } -void +static void yyerror (const 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, lexptr); }