projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
GDB/MI: Add new "--language LANG" command option.
[deliverable/binutils-gdb.git]
/
gdb
/
m2-exp.y
diff --git
a/gdb/m2-exp.y
b/gdb/m2-exp.y
index 3baff791ee5236dccb7730c8024b56636504f1eb..0002e451ce1ef1098bbeafc277322b2a53e1b80d 100644
(file)
--- a/
gdb/m2-exp.y
+++ b/
gdb/m2-exp.y
@@
-1,6
+1,5
@@
/* YACC grammar for Modula-2 expressions, for GDB.
/* YACC grammar for Modula-2 expressions, for GDB.
- Copyright (C) 1986, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1999,
- 2000, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 1986-2013 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.
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.
@@
-34,7
+33,7
@@
generator. Doing this with #defines and trying to control the interaction
with include files (<malloc.h> and <stdlib.h> for example) just became
too messy, particularly when such includes can be inserted at random
generator. Doing this with #defines and trying to control the interaction
with include files (<malloc.h> and <stdlib.h> for example) just became
too messy, particularly when such includes can be inserted at random
- times by the parser generator. */
+ times by the parser generator.
*/
%{
%{
@@
-58,7
+57,7
@@
yacc generated parsers in gdb. Note that these are only the variables
produced by yacc. If other parser generators (bison, byacc, etc) produce
additional global names that conflict at link time, then those parser
yacc generated parsers in gdb. Note that these are only the variables
produced by yacc. If other parser generators (bison, byacc, etc) produce
additional global names that conflict at link time, then those parser
- generators need to be fixed instead of adding those names to this list. */
+ generators need to be fixed instead of adding those names to this list.
*/
#define yymaxdepth m2_maxdepth
#define yyparse m2_parse
#define yymaxdepth m2_maxdepth
#define yyparse m2_parse
@@
-100,6
+99,12
@@
#define yygindex m2_yygindex
#define yytable m2_yytable
#define yycheck m2_yycheck
#define yygindex m2_yygindex
#define yytable m2_yytable
#define yycheck m2_yycheck
+#define yyss m2_yyss
+#define yysslim m2_yysslim
+#define yyssp m2_yyssp
+#define yystacksize m2_yystacksize
+#define yyvs m2_yyvs
+#define yyvsp m2_yyvsp
#ifndef YYDEBUG
#define YYDEBUG 1 /* Default to yydebug support */
#ifndef YYDEBUG
#define YYDEBUG 1 /* Default to yydebug support */
@@
-113,21
+118,11
@@
static int yylex (void);
void yyerror (char *);
void yyerror (char *);
-#if 0
-static char *make_qualname (char *, char *);
-#endif
-
static int parse_number (int);
static int parse_number (int);
-/* The sign of the number being parsed. */
+/* The sign of the number being parsed.
*/
static int number_sign = 1;
static int number_sign = 1;
-/* The block that the module specified by the qualifer on an identifer is
- contained in, */
-#if 0
-static struct block *modblock=0;
-#endif
-
%}
/* Although the yacc "value" of an expression is not used,
%}
/* Although the yacc "value" of an expression is not used,
@@
-329,21
+324,21
@@
exp : set
;
exp : exp IN set
;
exp : exp IN set
- { error
("Sets are not implemented."
);}
+ { error
(_("Sets are not implemented.")
);}
;
exp : INCL '(' exp ',' exp ')'
;
exp : INCL '(' exp ',' exp ')'
- { error
("Sets are not implemented."
);}
+ { error
(_("Sets are not implemented.")
);}
;
exp : EXCL '(' exp ',' exp ')'
;
exp : EXCL '(' exp ',' exp ')'
- { error
("Sets are not implemented."
);}
+ { error
(_("Sets are not implemented.")
);}
;
set : '{' arglist '}'
;
set : '{' arglist '}'
- { error
("Sets are not implemented."
);}
+ { error
(_("Sets are not implemented.")
);}
| type '{' arglist '}'
| type '{' arglist '}'
- { error
("Sets are not implemented."
);}
+ { error
(_("Sets are not implemented.")
);}
;
;
@@
-543,7
+538,7
@@
exp : STRING
write_exp_elt_opcode (OP_M2_STRING); }
;
write_exp_elt_opcode (OP_M2_STRING); }
;
-/* This will be used for extensions later. Like adding modules. */
+/* This will be used for extensions later. Like adding modules.
*/
block : fblock
{ $$ = SYMBOL_BLOCK_VALUE($1); }
;
block : fblock
{ $$ = SYMBOL_BLOCK_VALUE($1); }
;
@@
-562,7
+557,7
@@
fblock : block COLONCOLON BLOCKNAME
= lookup_symbol (copy_name ($3), $1,
VAR_DOMAIN, 0);
if (!tem || SYMBOL_CLASS (tem) != LOC_BLOCK)
= lookup_symbol (copy_name ($3), $1,
VAR_DOMAIN, 0);
if (!tem || SYMBOL_CLASS (tem) != LOC_BLOCK)
- error (
"No function \"%s\" in specified context."
,
+ error (
_("No function \"%s\" in specified context.")
,
copy_name ($3));
$$ = tem;
}
copy_name ($3));
$$ = tem;
}
@@
-586,8
+581,15
@@
variable: block COLONCOLON NAME
sym = lookup_symbol (copy_name ($3), $1,
VAR_DOMAIN, 0);
if (sym == 0)
sym = lookup_symbol (copy_name ($3), $1,
VAR_DOMAIN, 0);
if (sym == 0)
- error (
"No symbol \"%s\" in specified context."
,
+ error (
_("No symbol \"%s\" in specified context.")
,
copy_name ($3));
copy_name ($3));
+ if (symbol_read_needs_frame (sym))
+ {
+ if (innermost_block == 0
+ || contained_in (block_found,
+ innermost_block))
+ innermost_block = block_found;
+ }
write_exp_elt_opcode (OP_VAR_VALUE);
/* block_found is set by lookup_symbol. */
write_exp_elt_opcode (OP_VAR_VALUE);
/* block_found is set by lookup_symbol. */
@@
-596,10
+598,10
@@
variable: block COLONCOLON NAME
write_exp_elt_opcode (OP_VAR_VALUE); }
;
write_exp_elt_opcode (OP_VAR_VALUE); }
;
-/* Base case for variables. */
+/* Base case for variables.
*/
variable: NAME
{ struct symbol *sym;
variable: NAME
{ struct symbol *sym;
-
in
t is_a_field_of_this;
+
struct field_of_this_resul
t is_a_field_of_this;
sym = lookup_symbol (copy_name ($1),
expression_context_block,
sym = lookup_symbol (copy_name ($1),
expression_context_block,
@@
-625,17
+627,17
@@
variable: NAME
}
else
{
}
else
{
- struct
minimal_symbol *
msymbol;
+ struct
bound_minimal_symbol
msymbol;
char *arg = copy_name ($1);
msymbol =
char *arg = copy_name ($1);
msymbol =
- lookup_
minimal_symbol (arg, NULL, NULL
);
- if (msymbol != NULL)
+ lookup_
bound_minimal_symbol (arg
);
+ if (msymbol
.minsym
!= NULL)
write_exp_msymbol (msymbol);
else if (!have_full_symbols () && !have_partial_symbols ())
write_exp_msymbol (msymbol);
else if (!have_full_symbols () && !have_partial_symbols ())
- error (
"No symbol table is loaded. Use the \"symbol-file\" command."
);
+ error (
_("No symbol table is loaded. Use the \"symbol-file\" command.")
);
else
else
- error (
"No symbol \"%s\" in current context."
,
+ error (
_("No symbol \"%s\" in current context.")
,
copy_name ($1));
}
}
copy_name ($1));
}
}
@@
-658,10
+660,9
@@
type
/*** Needs some error checking for the float case ***/
static int
/*** Needs some error checking for the float case ***/
static int
-parse_number (olen)
- int olen;
+parse_number (int olen)
{
{
- char *p = lexptr;
+ c
onst c
har *p = lexptr;
LONGEST n = 0;
LONGEST prevn = 0;
int c,i,ischar=0;
LONGEST n = 0;
LONGEST prevn = 0;
int c,i,ischar=0;
@@
-692,9
+693,9
@@
parse_number (olen)
return FLOAT;
}
if (p[c] == '.' && base != 10)
return FLOAT;
}
if (p[c] == '.' && base != 10)
- error
("Floating point numbers must be base 10."
);
+ error
(_("Floating point numbers must be base 10.")
);
if (base == 10 && (p[c] < '0' || p[c] > '9'))
if (base == 10 && (p[c] < '0' || p[c] > '9'))
- error
("Invalid digit \'%c\' in number."
,p[c]);
+ error
(_("Invalid digit \'%c\' in number.")
,p[c]);
}
while (len-- > 0)
}
while (len-- > 0)
@@
-702,7
+703,7
@@
parse_number (olen)
c = *p++;
n *= base;
if( base == 8 && (c == '8' || c == '9'))
c = *p++;
n *= base;
if( base == 8 && (c == '8' || c == '9'))
- error
("Invalid digit \'%c\' in octal number."
,c);
+ error
(_("Invalid digit \'%c\' in octal number.")
,c);
if (c >= '0' && c <= '9')
i = c - '0';
else
if (c >= '0' && c <= '9')
i = c - '0';
else
@@
-718,12
+719,12
@@
parse_number (olen)
if(!unsigned_p && number_sign == 1 && (prevn >= n))
unsigned_p=1; /* Try something unsigned */
/* Don't do the range check if n==i and i==0, since that special
if(!unsigned_p && number_sign == 1 && (prevn >= n))
unsigned_p=1; /* Try something unsigned */
/* Don't do the range check if n==i and i==0, since that special
- case will give an overflow error. */
+ case will give an overflow error.
*/
if(RANGE_CHECK && n!=i && i)
{
if((unsigned_p && (unsigned)prevn >= (unsigned)n) ||
((!unsigned_p && number_sign==-1) && -prevn <= -n))
if(RANGE_CHECK && n!=i && i)
{
if((unsigned_p && (unsigned)prevn >= (unsigned)n) ||
((!unsigned_p && number_sign==-1) && -prevn <= -n))
- range_error
("Overflow on numeric constant."
);
+ range_error
(_("Overflow on numeric constant.")
);
}
prevn=n;
}
}
prevn=n;
}
@@
-743,7
+744,7
@@
parse_number (olen)
return UINT;
}
else if((unsigned_p && (n<0))) {
return UINT;
}
else if((unsigned_p && (n<0))) {
- range_error
("Overflow on numeric constant -- number too large."
);
+ range_error
(_("Overflow on numeric constant -- number too large.")
);
/* But, this can return if range_check == range_warn. */
}
yylval.lval = n;
/* But, this can return if range_check == range_warn. */
}
yylval.lval = n;
@@
-808,12
+809,12
@@
static struct keyword keytab[] =
compatible */
static int
compatible */
static int
-yylex ()
+yylex (
void
)
{
int c;
int namelen;
int i;
{
int c;
int namelen;
int i;
- char *tokstart;
+ c
onst c
har *tokstart;
char quote;
retry:
char quote;
retry:
@@
-905,7
+906,7
@@
yylex ()
}
}
if(c != quote)
}
}
if(c != quote)
- error
("Unterminated string or character constant."
);
+ error
(_("Unterminated string or character constant.")
);
yylval.sval.ptr = tokstart + 1;
yylval.sval.length = namelen - 1;
lexptr += namelen + 1;
yylval.sval.ptr = tokstart + 1;
yylval.sval.length = namelen - 1;
lexptr += namelen + 1;
@@
-926,7
+927,7
@@
yylex ()
{
/* It's a number. */
int got_dot = 0, got_e = 0;
{
/* It's a number. */
int got_dot = 0, got_e = 0;
- char *p = tokstart;
+ c
onst c
har *p = tokstart;
int toktype;
for (++p ;; ++p)
int toktype;
for (++p ;; ++p)
@@
-952,7
+953,7
@@
yylex ()
memcpy (err_copy, tokstart, p - tokstart);
err_copy[p - tokstart] = 0;
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;
}
lexptr = p;
return toktype;
@@
-961,7
+962,7
@@
yylex ()
if (!(c == '_' || c == '$'
|| (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')))
/* We must have come across a bad character (e.g. ';'). */
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;
/* It's a name. See how long it is. */
namelen = 0;
@@
-1038,20
+1039,20
@@
yylex ()
return BLOCKNAME;
case LOC_UNDEF:
return BLOCKNAME;
case LOC_UNDEF:
- error
("internal: Undefined class in m2lex()"
);
+ error
(_("internal: Undefined class in m2lex()")
);
case LOC_LABEL:
case LOC_UNRESOLVED:
case LOC_LABEL:
case LOC_UNRESOLVED:
- error
("internal: Unforseen case in m2lex()"
);
+ error
(_("internal: Unforseen case in m2lex()")
);
default:
default:
- error (
"unhandled token in m2lex()"
);
+ error (
_("unhandled token in m2lex()")
);
break;
}
}
else
{
break;
}
}
else
{
- /* Built-in BOOLEAN type. This is sort of a hack. */
+ /* Built-in BOOLEAN type. This is sort of a hack.
*/
if (strncmp (tokstart, "TRUE", 4) == 0)
{
yylval.ulval = 1;
if (strncmp (tokstart, "TRUE", 4) == 0)
{
yylval.ulval = 1;
@@
-1064,31
+1065,16
@@
yylex ()
}
}
}
}
- /* Must be another type of name... */
+ /* Must be another type of name...
*/
return NAME;
}
}
return NAME;
}
}
-#if 0 /* Unused */
-static char *
-make_qualname(mod,ident)
- char *mod, *ident;
-{
- char *new = malloc(strlen(mod)+strlen(ident)+2);
-
- strcpy(new,mod);
- strcat(new,".");
- strcat(new,ident);
- return new;
-}
-#endif /* 0 */
-
void
void
-yyerror (msg)
- char *msg;
+yyerror (char *msg)
{
if (prev_lexptr)
lexptr = prev_lexptr;
{
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.028614 seconds
and
4
git commands to generate.