RE: parsing long primitives

"Daniel Leuck" <[email protected]> Mon, 15 Aug 2005 11:22:12 -1000
Newsgroups gmane.comp.java.beanshell.devel
Message-ID <[email protected]>
Hi Philippe,

Thank you again for the patch.

I haven't heard back yet, but I assume Pat is going to set JRE 1.2 or higher
as the base so I went ahead and fixed this for you.  The parser now supports
hex and octal long literals.

BTW - Parser.java is a generated file.  The build process is:

bsh.jjt -> bsh.jj -> Parser.java

Changes to the parser should be made in bsh.jjt.

Cheers,
Dan

> -----Original Message-----
> From: beanshell-developers-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org [mailto:beanshell-
> developers-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org] On Behalf Of Philippe Faes
> Sent: Tuesday, August 09, 2005 2:38 AM
> To: beanshell-developers
> Subject: [Beanshell-dev] parsing long primitives
> 
> Hi,
> 
> In src/bsh/Parser.java it says:
> <quote>
> // This really should be Long.decode, but there isn't one. As a result,
> // hex and octal literals ending in 'l' or 'L' don't work.
> </quote>
> But I've noticed that Long.decode has existed since 1.2
> http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Long.html#decode
> (java.lang.String)
> 
> I propose we use Long.decode instead of Integer.decode for long numbers.
> 
> Patch attached.
> 
> grtz
> Ph
> 
> --
> ir. Philippe Faes
> Ghent University - Department ELIS
> Sint-Pietersnieuwstraat 41 -- B-9000 Gent
> Tel:+32 9 264 95 25 - Fax:+32 9 264 35 94
>     http://www.elis.UGent.be/~pfaes
> ON5DEU   --   LPIC1  --  gpg-key:173720B6



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf