/* YACC parser for Fortran expressions, for GDB.
- Copyright (C) 1986, 1989, 1990, 1991, 1993, 1994, 1995, 1996, 2000, 2001,
- 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
- Free Software Foundation, Inc.
+ Copyright (C) 1986-2013 Free Software Foundation, Inc.
Contributed by Motorola. Adapted from the C parser by Farooq Butt
(fmbutt@engage.sps.mot.com).
#define yygindex f_yygindex
#define yytable f_yytable
#define yycheck f_yycheck
+#define yyss f_yyss
+#define yysslim f_yysslim
+#define yyssp f_yyssp
+#define yystacksize f_yystacksize
+#define yyvs f_yyvs
+#define yyvsp f_yyvsp
#ifndef YYDEBUG
#define YYDEBUG 1 /* Default to yydebug support */
if (msymbol != NULL)
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));
}
}
/*** Needs some error checking for the float case ***/
static int
-parse_number (p, len, parsed_float, putithere)
- char *p;
- int len;
- int parsed_float;
- YYSTYPE *putithere;
+parse_number (char *p, int len, int parsed_float, YYSTYPE *putithere)
{
LONGEST n = 0;
LONGEST prevn = 0;
if (RANGE_CHECK && n != 0)
{
if ((unsigned_p && (unsigned)prevn >= (unsigned)n))
- range_error("Overflow on numeric constant.");
+ range_error (_("Overflow on numeric constant."));
}
prevn = n;
}
/* If the number is too big to be an int, or it's got an l suffix
then it's a long. Work out if this has to be a long by
- shifting right and and seeing if anything remains, and the
+ shifting right and seeing if anything remains, and the
target int size is different to the target long size.
In the expression below, we could have tested
first one on demand. */
static void
-growbuf_by_size (count)
- int count;
+growbuf_by_size (int count)
{
int growby;
a string, it is simply doubled (I.E. 'this''is''one''string') */
static int
-match_string_literal ()
+match_string_literal (void)
{
char *tokptr = lexptr;
/* Read one token, getting characters through lexptr. */
static int
-yylex ()
+yylex (void)
{
int c;
int namelen;
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;
if (!(c == '_' || 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);
namelen = 0;
for (c = tokstart[namelen];
{
char *tmp = copy_name (yylval.sval);
struct symbol *sym;
- int is_a_field_of_this = 0;
+ struct field_of_this_result is_a_field_of_this;
int hextype;
+ /* Initialize this in case we *don't* use it in this call; that
+ way we can refer to it unconditionally below. */
+ memset (&is_a_field_of_this, 0, sizeof (is_a_field_of_this));
+
sym = lookup_symbol (tmp, expression_context_block,
VAR_DOMAIN,
parse_language->la_language == language_cplus
if (hextype == INT)
{
yylval.ssym.sym = sym;
- yylval.ssym.is_a_field_of_this = is_a_field_of_this;
+ yylval.ssym.is_a_field_of_this = is_a_field_of_this.type != NULL;
return NAME_OR_INT;
}
}
/* Any other kind of symbol */
yylval.ssym.sym = sym;
- yylval.ssym.is_a_field_of_this = is_a_field_of_this;
+ yylval.ssym.is_a_field_of_this = is_a_field_of_this.type != NULL;
return NAME;
}
}
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);
}