/* YACC grammar for Modula-2 expressions, for GDB.
- Copyright (C) 1986-2017 Free Software Foundation, Inc.
+ Copyright (C) 1986-2019 Free Software Foundation, Inc.
Generated from expread.y (now c-exp.y) and contributed by the Department
of Computer Science at the State University of New York at Buffalo, 1991.
static int yylex (void);
-void yyerror (const char *);
+static void yyerror (const char *);
static int parse_number (int);
/* The GDB scope operator */
%token COLONCOLON
-%token <voidval> INTERNAL_VAR
+%token <voidval> DOLLAR_VARIABLE
/* M2 tokens */
%left ','
;
/* GDB internal ($foo) variable */
-variable: INTERNAL_VAR
+variable: DOLLAR_VARIABLE
;
/* GDB scope operator */
error (_("No symbol \"%s\" in specified context."),
copy_name ($3));
if (symbol_read_needs_frame (sym.symbol))
- {
- if (innermost_block == 0
- || contained_in (sym.block,
- innermost_block))
- innermost_block = sym.block;
- }
+ innermost_block.update (sym);
write_exp_elt_opcode (pstate, OP_VAR_VALUE);
write_exp_elt_block (pstate, sym.block);
if (sym.symbol)
{
if (symbol_read_needs_frame (sym.symbol))
- {
- if (innermost_block == 0 ||
- contained_in (sym.block,
- innermost_block))
- innermost_block = sym.block;
- }
+ innermost_block.update (sym);
write_exp_elt_opcode (pstate, OP_VAR_VALUE);
write_exp_elt_block (pstate, sym.block);
if (*tokstart == '$')
{
write_dollar_variable (pstate, yylval.sval);
- return INTERNAL_VAR;
+ return DOLLAR_VARIABLE;
}
/* Use token-type BLOCKNAME for symbols that happen to be defined as
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);
}