|
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:
--help
- prints the short description of usage syntax and all options.--ada
- generates Ada code, where default identifier translation is ident
.--cpp
- generates C++ code, where default identifier translation is lower_case
.--idl
- regenerates ydl files.--java
- generates Java code, where default identifier translation is camel_case
.--casing
- selects the desired casing translation mode for user identifiers.-I
- adds the given directory to the list of directories where imported packages will be searched for.--output-dir
- points to the target directory for generated files.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:
ident
- user identifiers are not modified in any way and are literally used in the resulting code - that is, Say_Hello
will be left as Say_Hello
; this is a default setting for Adalower_case
- user identifiers are converted to lower case, with underscores separating individual words left in place - that is, Say_Hello
will be left as say_hello
; this is a default setting for C++camel_case
- where Say_Hello
becomes sayHello
; this is a default setting for Java
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