Gscanner: can I get the text of scanned floating point numbers


I am currently using the Lexical Scanner from glib
for my application (the appl converts files written
in verilog to xml).

My problem: my scanner scans floating point numbers (for
instance 1.22222e-24). It returns G_TOKEN_FLOAT when a
floating point number is found. I would like to save the
text that has been scanned (and that served to create the
value of  scanner->value.v_float). Is-there a way to have
access to the scanned text?



PS: with the automatic conversion str->float I can loose
precision (that is bad for my application :-( )
More specifically here is what I am doing to get the text back:
txt = g_strdup_printf ("%e",scanner->value.v_float);

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]