Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » too big for int
too big for int [message #1299853] Thu, 17 April 2014 06:40 Go to next message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
Hi,

I need to process a numeric string which is too big to fit in an int.
A value which fails:

4294967295

This is actually the exact max size of an unsigned int, but java int is
32bit signed, so this won't fix. So I guess I need a unsigned int here.

I tried changing the return type to EBigDecimal and EBigInteger but I
still get errors/markers in the editor.

terminal INT returns ecore::EInt:
'-'? ('0'..'9')+;

Do I need to implement an IValueConverter or is there a way to handle
this in the grammar directly.?

Thank You,
Christophe
Re: too big for int [message #1300153 is a reply to message #1299853] Thu, 17 April 2014 11:17 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Christophe,

Did you mean to post this to the TMF forum? ELong might be enough...

On 17/04/2014 8:40 AM, Christophe Bouhier wrote:
> Hi,
>
> I need to process a numeric string which is too big to fit in an int.
> A value which fails:
>
> 4294967295
>
> This is actually the exact max size of an unsigned int, but java int
> is 32bit signed, so this won't fix. So I guess I need a unsigned int
> here.
>
> I tried changing the return type to EBigDecimal and EBigInteger but I
> still get errors/markers in the editor.
>
> terminal INT returns ecore::EInt:
> '-'? ('0'..'9')+;
>
> Do I need to implement an IValueConverter or is there a way to handle
> this in the grammar directly.?
>
> Thank You,
> Christophe


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: too big for int [message #1300377 is a reply to message #1300153] Thu, 17 April 2014 14:25 Go to previous message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
On 17-04-14 13:17, Ed Merks wrote:
> Christophe,
>
> Did you mean to post this to the TMF forum? ELong might be enough...
>
yep i did, Elong didn't do the trick btw.
Thanks!

> On 17/04/2014 8:40 AM, Christophe Bouhier wrote:
>> Hi,
>>
>> I need to process a numeric string which is too big to fit in an int.
>> A value which fails:
>>
>> 4294967295
>>
>> This is actually the exact max size of an unsigned int, but java int
>> is 32bit signed, so this won't fix. So I guess I need a unsigned int
>> here.
>>
>> I tried changing the return type to EBigDecimal and EBigInteger but I
>> still get errors/markers in the editor.
>>
>> terminal INT returns ecore::EInt:
>> '-'? ('0'..'9')+;
>>
>> Do I need to implement an IValueConverter or is there a way to handle
>> this in the grammar directly.?
>>
>> Thank You,
>> Christophe
>
Previous Topic:Specifying a description for a structural feature
Next Topic:[Oomph] Preferences not copied and NPE on init
Goto Forum:
  


Current Time: Tue Apr 23 09:37:41 GMT 2024

Powered by FUDForum. Page generated in 0.02987 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top