In Dezyne all variables and constants are typed. A number of type constructs are available.

Bool

bool is pre-defined and denotes the boolean type, with constants true and false.

Available boolean operators are:

  • Logical negation, denoted by ! b1.

  • Logical and, denoted by b1 && b2.

  • Logical or, denoted by b1 || b2.

  • Equality of two boolean expressions, denoted by b1 == b2.

  • Inequality of two boolean expressions, denoted by b1 != b2.

where b1 and b2 denote booleans.

Enum

An interface or component can specify a user defined enumerated type. Such a type has a name and a collection of values. An example:

  enum MyEnumType { MyValue1, MyValue2, MyValue3 };

where enum is a keyword; this defines the enum type MyEnumType with three values.

In expressions the enum values are referred to with a dot notation: MyEnumType.MyValue2 . Available enum operators are:

  • Equality of two enum expressions, denoted by e1 == e2.

  • Inequality of two enum expressions, denoted by e1 != e2.

  • Testing the value of an enum variable, denoted by v.MyValue2, which is shorthand for v == MyEnumType.MyValue2

where e1 and e2 denote enum expressions, and v an enum variable.

Subint

The integer type is available in Dezyne in a restricted way: only a finite subset of integers can be used. An explicit type definition is needed for such a subset, where a C++-like syntax is used. An example:

  subint MyIntType {2..5};

where subint is a keyword. This defines the finite type MyIntType with possible values 2, 3, 4, and 5. Available integer operators are:

  • A number of integer comparisons, denoted by:

    • i1 < i2

    • i1 ⇐ i2

    • i1 >= i2

    • i1 > i2

    • i1 == i2

    • i1 != i2

  • Integer addition, denoted by i1 + i2.

  • Integer subtraction, denoted by i1 - i2.

where i1 and i2 denote integers.

Data Types

Apart from the bool, enum, and int types introduced above, which play an important role in the description of interface and component behaviour, so-called 'data types' can be defined. These play a restricted role and are used as types of 'data parameters' in events (see below). A data type is defined as follows:

  extern MyDataType $someExternalTypeExpresssion$;

where extern is a keyword, and in $someExternalTypeExpresssion$ the dollar signs is a type expression in the target language (C++, java, …​).

No Dezyne supported expressions are available for data types, apart from 'dollar expressions': $some expression$ will be passed as-is.