Skip to end of metadata
Go to start of metadata

Each module begins with a header.

Syntax

MODULE name;
[REQUIRE moduleName1, ..., moduleNameN;]
[PRIORITY namespaceName1, ..., namespaceNameM;]
[NAMESPACE namespaceName;]

Description

The module header can consist of four special instructions, in the following order:

The MODULE  instruction defines the module name. It is required. Each module within one project must have a unique name.

The REQUIRE instruction defines the list of modules on which the current module depends. If the REQUIRE instruction is absent, that is equivalent to depending only on the System module.

The PRIORITY instruction defines the list of additional namespaces that will have priority in finding system elements.

The NAMESPACE instruction defines the module's namespace.  


Parameters

name

The name of the module. Simple ID. Module names cannot contain an underscore.

moduleName1, ..., moduleNameN

A list of the names of modules that the current module depends on. Each name is a simple ID. 

namespaceName1, ..., namespaceNameM

A list of namespace names. Each name is a simple ID. 

namespaceName

The name of the module namespace. A simple ID that cannot contain an underscore. If the NAMESPACE instruction is not used in the header, the name of the current module's namespace will be equal to the name of the module.  

Examples

1
2
3
4
5
6
7
8
9
 MODULE EmployeeExample;	 	// Defining the module name

REQUIRE System, Utils;	 	// Listing the modules that the Employee module depends on
NAMESPACE Employee;		 	// Setting the namespace
 
CLASS Employee 'Employee';	// Creating a class
CLASS Position 'Position'; // Creating another class
 
employeePosition(employee) = DATA Position (Employee); // Creating property

  • No labels