Inspirel banner

Programming Distributed Systems with YAMI4

10.3 YDL Compiler

The YAMI4 Definition Language compiler is a command-line tool that allows to process package descriptions and generate code in selected programming languages with appropriate definitions that can be easily integrated with both the application code and the YAMI4 agent API.

The compiler accepts the following command-line syntax:

$ yami4idl [options] [file1.ydl file2.ydl ...]

Possible options, which can be freely intermixed with provided file names, are:

Even though the code generation rules are fixed with regard to language mapping, the user can influence the way identifiers are converted to the target programming language, so that the resulting code can be smoothly integrated with the rest of the application. The available casing options are:

It should be noted that the casing style does not influence the wire compatibility of communicating modules written in different languages. The identifiers only refer to language entities and the actual names of messages and fields in underlying parameters objects are uniformly converted in the lower_case style to ensure that separate programs are compatible with each other. This guarantee also allows to implement distributed systems where some components are implemented with the help of YAMI4 Definition Language while others are implemented directly in terms of regular API.

The yami4idl compiler reads all .ydl files named as remaining arguments and builds internal data structures with relevant definitions. This process can involve reading files for imported packages, which are searched in the current directory or else in the list of search directories. Once all the files are read, the code generation is performed for the requested target language.

For example, the invocation that generates code for the calculator example in C++ is:

$ yami4idl calculator.ydl -cpp