Hello all,

I've found a very small (but important) missing case in the modified
frontc parser used in CIL.

CIL is currently (as of most recent SVN) unable to correctly parse the
expression "0x1.p1".  This is a hex float literal with no non-whole
part, where the whole part has a trailing period.  CIL seems to parse
it as field membership:

int main(void){
        double x = 0x1.p1;
        printf("%f\n", x);
        return 0;
}
$ cilly.asm.exe hexFloats.c
hexFloats.c:2: Error: Expected an lval in MEMBEROF (field p1)


The fix is very simple.  The current production for hex fractions is:
let hexfraction = hexdigit* '.' hexdigit+ | hexdigit+

I think this should actually be:
let hexfraction = hexdigit* '.' hexdigit+ | hexdigit+ '.'

It seems as though "hexfraction = hexdigit+" is actually a duplicate case since:
let hexfloat = hexprefix hexfraction binexponent | hexprefix hexdigit+
binexponent

Thanks,
-Chucky Ellison
University of Illinois

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
CIL-users mailing list
CIL-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cil-users

Reply via email to