projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make print_command_trace varargs
[deliverable/binutils-gdb.git]
/
gdb
/
m2-exp.y
diff --git
a/gdb/m2-exp.y
b/gdb/m2-exp.y
index a8b431e366d8cfe66bbec0a8c54a1e775331e0d9..2cf026c77a5c8c257e102af418d005cc8013f2f7 100644
(file)
--- a/
gdb/m2-exp.y
+++ b/
gdb/m2-exp.y
@@
-1,5
+1,5
@@
/* YACC grammar for Modula-2 expressions, for GDB.
/* YACC grammar for Modula-2 expressions, for GDB.
- Copyright (C) 1986-201
6
Free Software Foundation, Inc.
+ Copyright (C) 1986-201
8
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.
@@
-65,7
+65,7
@@
int yyparse (void);
static int yylex (void);
static int yylex (void);
-void yyerror (char *);
+void yyerror (c
onst c
har *);
static int parse_number (int);
static int parse_number (int);
@@
-82,7
+82,7
@@
static int number_sign = 1;
{
LONGEST lval;
ULONGEST ulval;
{
LONGEST lval;
ULONGEST ulval;
-
DOUBLEST dval
;
+
gdb_byte val[16]
;
struct symbol *sym;
struct type *tval;
struct stoken sval;
struct symbol *sym;
struct type *tval;
struct stoken sval;
@@
-103,7
+103,7
@@
static int number_sign = 1;
%token <lval> INT HEX ERROR
%token <ulval> UINT M2_TRUE M2_FALSE CHAR
%token <lval> INT HEX ERROR
%token <ulval> UINT M2_TRUE M2_FALSE CHAR
-%token <
d
val> FLOAT
+%token <val> FLOAT
/* Both NAME and TYPENAME tokens represent symbols in the input,
and both convey their data as strings.
/* Both NAME and TYPENAME tokens represent symbols in the input,
and both convey their data as strings.
@@
-474,12
+474,12
@@
exp : CHAR
exp : FLOAT
exp : FLOAT
- { write_exp_elt_opcode (pstate, OP_
DOUBLE
);
+ { write_exp_elt_opcode (pstate, OP_
FLOAT
);
write_exp_elt_type (pstate,
parse_m2_type (pstate)
->builtin_real);
write_exp_elt_type (pstate,
parse_m2_type (pstate)
->builtin_real);
- write_exp_elt_
dbl
cst (pstate, $1);
- write_exp_elt_opcode (pstate, OP_
DOUBLE
); }
+ write_exp_elt_
float
cst (pstate, $1);
+ write_exp_elt_opcode (pstate, OP_
FLOAT
); }
;
exp : variable
;
exp : variable
@@
-548,12
+548,7
@@
variable: block COLONCOLON NAME
error (_("No symbol \"%s\" in specified context."),
copy_name ($3));
if (symbol_read_needs_frame (sym.symbol))
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);
write_exp_elt_opcode (pstate, OP_VAR_VALUE);
write_exp_elt_block (pstate, sym.block);
@@
-574,12
+569,7
@@
variable: NAME
if (sym.symbol)
{
if (symbol_read_needs_frame (sym.symbol))
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);
write_exp_elt_opcode (pstate, OP_VAR_VALUE);
write_exp_elt_block (pstate, sym.block);
@@
-650,7
+640,11
@@
parse_number (int olen)
if (p[c] == '.' && base == 10)
{
/* It's a float since it contains a point. */
if (p[c] == '.' && base == 10)
{
/* It's a float since it contains a point. */
- yylval.dval = atof (p);
+ if (!parse_float (p, len,
+ parse_m2_type (pstate)->builtin_real,
+ yylval.val))
+ return ERROR;
+
lexptr += len;
return FLOAT;
}
lexptr += len;
return FLOAT;
}
@@
-1036,21
+1030,16
@@
yylex (void)
int
m2_parse (struct parser_state *par_state)
{
int
m2_parse (struct parser_state *par_state)
{
- int result;
- struct cleanup *c = make_cleanup_clear_parser_state (&pstate);
-
/* Setting up the parser state. */
/* Setting up the parser state. */
+ scoped_restore pstate_restore = make_scoped_restore (&pstate);
gdb_assert (par_state != NULL);
pstate = par_state;
gdb_assert (par_state != NULL);
pstate = par_state;
- result = yyparse ();
- do_cleanups (c);
-
- return result;
+ return yyparse ();
}
void
}
void
-yyerror (char *msg)
+yyerror (c
onst c
har *msg)
{
if (prev_lexptr)
lexptr = prev_lexptr;
{
if (prev_lexptr)
lexptr = prev_lexptr;
This page took
0.025378 seconds
and
4
git commands to generate.