Target FP: Use target format throughout expression parsing
[deliverable/binutils-gdb.git] / gdb / m2-exp.y
index 02dc36f48036e882fbfdb4e3f223abf3864934b0..3998d2b9f99b0d6b4c521e0673bbd1ed75a1477d 100644 (file)
@@ -82,7 +82,7 @@ static int number_sign = 1;
   {
     LONGEST lval;
     ULONGEST ulval;
-    DOUBLEST dval;
+    gdb_byte val[16];
     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 <dval> FLOAT
+%token <val> FLOAT
 
 /* 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
-                       { 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
@@ -650,7 +650,11 @@ parse_number (int olen)
     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;
       }
This page took 0.029255 seconds and 4 git commands to generate.