{
LONGEST lval;
ULONGEST ulval;
- DOUBLEST dval;
+ gdb_byte val[16];
struct symbol *sym;
struct type *tval;
struct stoken sval;
%token <lval> INT HEX ERROR
%token <ulval> UINT M2_TRUE M2_FALSE CHAR
-%token <dval> FLOAT
+%token <val> FLOAT
/* Both NAME and TYPENAME tokens represent symbols in the input,
and both convey their data as strings.
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_dblcst (pstate, $1);
- write_exp_elt_opcode (pstate, OP_DOUBLE); }
+ write_exp_elt_floatcst (pstate, $1);
+ write_exp_elt_opcode (pstate, OP_FLOAT); }
;
exp : variable
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;
}