/* YACC parser for Fortran expressions, for GDB.
- Copyright (C) 1986-2018 Free Software Foundation, Inc.
+ Copyright (C) 1986-2019 Free Software Foundation, Inc.
Contributed by Motorola. Adapted from the C parser by Farooq Butt
(fmbutt@engage.sps.mot.com).
static int yylex (void);
-void yyerror (const char *);
+static void yyerror (const char *);
static void growbuf_by_size (int);
%token BOOL_AND BOOL_OR BOOL_NOT
%token <lval> CHARACTER
-%token <voidval> VARIABLE
+%token <voidval> DOLLAR_VARIABLE
%token <opcode> ASSIGN_MODIFY
exp : variable
;
-exp : VARIABLE
+exp : DOLLAR_VARIABLE
;
exp : SIZEOF '(' type ')' %prec UNARY
{
int c;
int namelen;
- unsigned int i,token;
+ unsigned int token;
const char *tokstart;
retry:
if (*lexptr == '.')
{
- for (i = 0; boolean_values[i].name != NULL; i++)
+ for (int i = 0; boolean_values[i].name != NULL; i++)
{
if (strncmp (tokstart, boolean_values[i].name,
strlen (boolean_values[i].name)) == 0)
/* See if it is a special .foo. operator. */
- for (i = 0; dot_ops[i].oper != NULL; i++)
+ for (int i = 0; dot_ops[i].oper != NULL; i++)
if (strncmp (tokstart, dot_ops[i].oper,
strlen (dot_ops[i].oper)) == 0)
{
/* Catch specific keywords. */
- for (i = 0; f77_keywords[i].oper != NULL; i++)
+ for (int i = 0; f77_keywords[i].oper != NULL; i++)
if (strlen (f77_keywords[i].oper) == namelen
&& strncmp (tokstart, f77_keywords[i].oper, namelen) == 0)
{
if (*tokstart == '$')
{
write_dollar_variable (pstate, yylval.sval);
- return VARIABLE;
+ return DOLLAR_VARIABLE;
}
/* Use token-type TYPENAME for symbols that happen to be defined
VAR_DOMAIN,
MODULE_DOMAIN
};
- int i;
int hextype;
- for (i = 0; i < ARRAY_SIZE (lookup_domains); ++i)
+ for (int i = 0; i < ARRAY_SIZE (lookup_domains); ++i)
{
/* Initialize this in case we *don't* use it in this call; that
way we can refer to it unconditionally below. */
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);
}