[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.tmf] How to mix long and int?

Hi,

I have an existing model with long and int attributes:

  class Foo {
     attr int intValue;
     attr long longValue;
  }

How can I set the int and the long without having to
change the existing model?

  Foo returns my::Foo:
    'int' intValue=INT
    'long' longValue=LONG;

How to define LONG and INT? It is essentially the
same lexically but I need different converters:

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

Or is there a way to "cast" the assignment?

  terminal LONG_STRING: '-'? ('0'..'9')+;

  Foo returns my::Foo:
    'int' intValue=(ecore::EInt)LONG_STRING;
    'long' longValue=(ecore::ELong)LONG_STRING;



Michael

--
Michael Scharf
Wind River Systems GmbH
http://www.WindRiver.com
http://MichaelScharf.blogspot.com/