Programming Distributed Systems with YAMI4
10.2 YDL Syntax
The YAMI4 Definition Language supports the following declarative elements:
- Packages, which are top-level elements that provide name scoping for all other declarations. Packages can be related by the parent-child relationship and can refer to each other by means of importing.
- User-defined record types, which can then be used as payload types for messages and replies. Record types have fields, which are of any YAMI4 data type (integers, strings, etc. and arrays of these) or are of any user-defined type. This way of composing data types reflects the existing rules for parameters objects, which can contain fields or other nested objects.
- Interfaces, which group together a set of messages.
- Messages, which describe a single request-response (or oneway) interaction with optional payloads of any user-defined data type.
An example, very simple package definition that describes a single user-define type and a single interface with single oneway message that carries the payload of the user-defined type can look like:
package Hello_World is
type Text is
Content : String;
end Text;
interface Greetings is
oneway message Say_Hello (T : in Text);
end Greetings;
end Hello_World;
The YAMI4 Definition Language elements are described in the following subsections.
10.2.1 General Conventions
10.2.2 Packages
10.2.3 Record Types
10.2.4 Interfaces And Messages