Community
Participate
Working Groups
In bug 366782 a problem of porting a model to Java is described. This is due to the fact that Java doesn't support unsigned integer types but ROOM has them in the list of primitive types. A general solution for this could be that primitive types are modeled too. E.g. PrimitiveType JavaPrimitives { int8 -> byte int16 -> short int32 -> int // etc. } Then this could be used in an ActorClass like ActorClass Act { Structure { Attribute number: JavaPrimitives.int8 } } A standard collection of primitive types could be defined as part of the modellib.
for more convenience I would suggest: PrimitiveType int8 -> byte PrimitiveType int16 -> short PrimitiveType int32 -> int // etc. this would allow a shorter notation: ActorClass Act { Structure { Attribute number: int8 } } imho the clustering of PrimitiveTypes (e.g. JavaPrimitives ) is not needed
for future functionality, especially model checking and test generators more detailed information about the types will be needed PrimitiveType int8 -> byte { range=-128..127 } There might also be requirements for more exotic types PrimitiveType int40 -> int40 (on some DSPs) PrimitiveType fixed1616 -> fixed1616 { fixpoint=16.16 }
(In reply to comment #1) > imho the clustering of PrimitiveTypes (e.g. JavaPrimitives ) is not needed I thought clustering those type declarations in a namespace would be a good idea. But if this is desired it can be achieved by moving the declarations to a separate model. This would allow one to write RoomModel JavaPrimitiveTypes { PrimitiveType int8 -> byte PrimitiveType int16 -> short PrimitiveType int32 -> int // etc. } RoomModel MyModel { import model "JavaPrimitiveTypes.room" ActorClass Act { Structure { Attribute number: JavaPrimitiveTypes.int8 } }} or by importing the namespace RoomModel MyModel { import JavaPrimitiveTypes.* from "JavaPrimitiveTypes.room" ActorClass Act { Structure { Attribute number: int8 } }}
That is exactly how I would use the type definitions. Every Project can define the types in a separate model.
Done with 12d085d0c849291049c7fe1bf82508570518d592
closing bugs that went into 0.2.0M1