santoslab / aadl-translator

Eclipse Public License 1.0
5 stars 3 forks source link

Add support for enumerated types #23

Open sprocter opened 9 years ago

sprocter commented 9 years ago

The translator should really support enumerated types -- this seems like it should be a fairly straightforward translation once we hammer out how we want the AADL to look.

Examples

Modeling Option 1

This option is more verbose, but it more closely aligns with first aggregate type modeling option (see #11):

data EnumTypeExample
properties
    Data_Model::Data_Representation => Enum;
end EnumTypeExample;

data implementation EnumTypeExample.imp
subcomponents
    EmumVal1 : data;
    EmumVal2 : data;
end EnumTypeExample.imp;

Modeling Option 2

This option is more compact, and is probably the way AADL is supposed to model these types:

data EnumTypeExample
properties
    Data_Model::Data_Representation => Enum;
    Data_Model::Enumerators => ("EnumVal1", "EnumVal2");
end EnumTypeTest;

Implementation

The implementation should be just a simple private enumerated type:

private enum EnumTypeExample {
    ENUMVAL1, ENUMVAL2
};