Inspirel banner

Programming Distributed Systems with YAMI4

10.4 YDL Language Mappings

Language mapping is the way in which declarative YAMI4 Definition Language descriptions are transformed into types, classes, functions and procedures in the given target programming language.

This section describes the rules for language mapping for Ada, C++ and Java, which are supported in the current version of yami4idl.

Example code is taken from the calculator client-server pair, which involved the following YDL description:

package Calculator is

   type Operands is
      A : Integer;
      B : Integer;
   end Operands;

   type Results is
      Sum : Integer;
      Difference : Integer;
      Product : Integer;
      Ratio : optional Integer; -- does not exist if B = 0
   end Results;

   interface Operations is
      message Calculate (Op : in Operands; Res : out Results);
   end Operations;

end Calculator;

10.4.1 Ada

10.4.2 C++

10.4.3 Java