[antlr-interest] java.g NUM_INT
Terence Parr
parrt at cs.usfca.edu
Fri Oct 17 13:14:09 PDT 2003
Fixed in main line.
Ter
On Wednesday, September 24, 2003, at 02:17 PM, Ray Waldin wrote:
> Yes. There appears to be an extraneous '|' following 'FLOAT_SUFFIX'
> in the predicate causing it to return true in all cases. The
> corrected patch is:
>
> --- old/java.g 2003-09-23 15:20:05.000000000 -0700
> +++ java.g 2003-09-24 14:10:18.000000000 -0700
> @@ -1234,6 +1234,7 @@
> }
> : HEX_DIGIT
> )+
> + | (('0'..'9')+
> ('.'|EXPONENT|FLOAT_SUFFIX)) => ('0'..'9')+ //float or double with
> leading zero
> |
> ('0'..'7')+ // octal
> )?
> | ('1'..'9') ('0'..'9')*
> {isDecimal=true;} // non-zero decimal
>
> Sorry for any confusion this may have caused.
>
> -Ray
>
> Ernest Pasour wrote:
>
> When I tried sticking this fix in, it allowed a number like 083 to
> pass through as an Integer. I'm not sure exactly why no error is
> thrown though. Do you see that behavior?
>
> -----Original Message-----
> From: Ray Waldin [mailto:ray at waldin.net]
> Sent: Tuesday, September 23, 2003 7:38 PM
> To: antlr-interest at yahoogroups.com
> Subject: [antlr-interest] java.g NUM_INT
>
>
> I sent this earlier and it never showed up on the list, so here it is
> again...
>
>
> Hi everyone,
>
> I'm new to this group, so apologies if this issue has been raised
> before. I wasn't able to find any reference to it in the archives. In
> java.g (Version 1.20) it seems that the NUM_INT rule is broken for
> cases
> of floats and doubles which have leading zeros and contain the digits 8
> or 9 in the decimal integer or mantissa part.
>
> While the following cases work (by sheer luck, I believe):
>
>
>
> 07.0f
> 06d
> 07e0
>
>
>
> these do not:
>
>
>
> 08.0f
> 09d
> 08e0
>
>
>
> A quick fix can be found below.
>
> -Ray
>
>
> --- old/java.g 2003-09-23 15:20:05.000000000 -0700
> +++ java.g 2003-09-23 15:21:28.000000000 -0700
> @@ -1234,6 +1234,7 @@
> }
> : HEX_DIGIT
> )+
> + | (('0'..'9')+
> ('.'|EXPONENT|FLOAT_SUFFIX|)) => ('0'..'9')+ // float or double with
> leading zero
> |
> ('0'..'7')+
> // octal
> )?
> | ('1'..'9') ('0'..'9')*
> {isDecimal=true;} // non-zero decimal
>
>
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>
>
>
>
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
--
Professor Comp. Sci., University of San Francisco
Creator, ANTLR Parser Generator, http://www.antlr.org
Co-founder, http://www.jguru.com
Co-founder, http://www.knowspam.net enjoy email again!
Co-founder, http://www.peerscope.com pure link sharing
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list