Component description file

## Contents

- Your rights

- Introduction

- Component model

- Component description file

  - Preprocessing

  - Elements of a description file

  - Data type and constant definitions

  - Module declaration

  - Component declaration

  - Interface declaration

  - IDS declaration

  - Port declaration

  - Task declaration

  - Service declaration

  - Codel declaration

  - Identifiers and reserved keywords

  - Pragmas

  - Grammar reference

- GenoM IDL mappings

- Running GenoM

- Tutorials

- Templates

## Component description file

This chapter describes the syntax of the `genom` component description file. This file has by convention a name ending with the `.gen` suffix. It is thus often called the `.gen` file (or `dot gen`).

The `dot gen` file contains the complete formal description of a component in terms of services and data types it provides. Such a description completely defines the interface and the internals of a component. The syntax of this files is a mix between a subset of the OMG IDL for data types definitions and genom specific constructs.

The `dot gen` file is pre-processed by a pre-processor that follows the standard of the `C` preprocessor. See the Preprocessing section for details. The complete grammar definition is available for reference, but the most important constructs are detailed in the following sections.

The description of the `dot gen` grammar uses a syntax notation that is similar to `EBNF` (Extended Backus-Naur Format). The following table lists the symbols used in this format and their meaning.

Table 1. `dotgen` 'EBNF' symbols
Symbol | Meaning
--- | ---
`::=` | Definition
`|` | Alternation
`text` | Non terminals
`"text"` | Terminals
`( …​ )` | Grouping
`{ …​ }` | Repetitions: may occur zero or any number of times
`[ …​ ]` | Option: may occur zero or one time

### Topics

- Preprocessing: Inclusion of definitions from other specifications

- Elements of a description file: Basic elements of a `genom3` specification

- Data type and constant definitions: Definition of new types and constant values

- Module declaration: Namespace for type definitions

- Component declaration

- Interface declaration

- IDS declaration: Private, shared global data.

- Port declaration: Published and imported data.

- Task declaration: Execution context for running actual code.

- Service declaration: Attributes, functions, activities and their parameters.

- Codel declaration

- Identifiers and reserved keywords: Words with a special meaning

- Pragmas: Providing additional information to the parser

- Grammar reference: Extensive `genom3` EBNF grammar reference