[project Aranea prefix=A_] { // classes in the default namespace are special, therefore don't generate them [namespace Default ignore] { // base class for session messages, used as a base class in many messages [message Session] { session: string notEmpty "Session ID" } } // Special namespace, message classes won't be generated but must be written by hand. [namespace General ignore] { // Message class for N/ACK'ing, including an message string. [message Status] { is_success: boolean "Successful?" message: string "Status Message" } } [namespace Config] { [message Command] { command: string notEmpty "Command to execute" } [message CommandList] { commands: sequence notVoid "List of commands to execute" } [message FileWrite] { name: string notEmpty "The filename to write `content' to." content: string notVoid "The file's content" } [message FileWriteList] { files: sequence notVoid "List of files to write" } } // Messages in this namespace serve as a documenting example on how to use // Aranea's OAW toolchain. The generated messages can also be used as an // example for the implementation (i.e. how to generate and use messages // in your code). // Note that some of the defined properites lack any comment and/or // restrictions - this is done on purpose: in practice you should always provide a // comment and apropriate restrictions! [namespace Example] { // A very simple message, using only basic types. [message Simple] { field_string: string field_integer: integer field_boolean: boolean field_double: double } // A message extending another one. [message simple_extended extends=Aranea.Example.Simple] { field_binary: binary notVoid "a binary field, something that's not in the simple-message" } // This class is used in the `special_message' example in Aranea's Eiffel code. [message special] { field_double_one: double greaterEqualZero field_double_two: double field_unicode: string notEmpty } // A very complex message, probably the most complex one that will ever // be defined, generated and used. // It shows how to use list and map types, and how to define inline record types. [message complex] { // primitive types field_integer: integer greaterZero "an integer field" field_boolean: boolean field_string: string "no comment" field_double: double field_binary: binary notVoid // composite types field_array_integer: sequence notEmpty field_array_boolean: sequence notEmpty field_map_double: map notEmpty field_map_string: map notEmpty // nested composite types field_array_array: sequence> notEmpty field_map_map: map> notEmpty field_array_map: sequence> notEmpty field_map_array: map> notEmpty // inline-defined record field_nested: map< record(nested_message, [open: integer; closed: integer]) > notEmpty "Statistics per project." } } [namespace Mail] { // simple message to send a mail [message Send] { recipient: string notEmpty "Mail address of the recipient" sender: string notEmpty "Name of the sender" subject: string notEmpty "Subject of the message" text: string notEmpty "Text of the message" } } [namespace System] { [message StatusRequest] {} } }