next up previous
Next: Statements Up: The ALLCOT syntax Previous: Defining a category

Defining a domain

A domain definition looks like

Identifier :  Identifier $\displaystyle \bf ==$ Identifier $\displaystyle \bf add$ $\displaystyle \bf\{$ DomainBody $\displaystyle \bf\}$    

or like

Identifier :  Identifier $\displaystyle \bf ==$ $\displaystyle \bf add$ $\displaystyle \bf\{$ DomainBody $\displaystyle \bf\}$    

where in each case The inheritance mechanism will be discussed later.

The DomainBody starts with an attrib-statement, that is a statement of the form

$\displaystyle \tt attrib$ $\displaystyle \bf ($ FormalParameterSequence $\displaystyle \bf )$ $\displaystyle \bf ;$    

and continues with a sequence of function definitions. A function definition looks like

Identifier $\displaystyle \bf ($ FormalParameterSequence $\displaystyle \bf )$ :  Type $\displaystyle \bf ==$ Statement$\displaystyle \bf ;$    

or like

Identifier $\displaystyle \bf ($ FormalParameterSequence $\displaystyle \bf )$ :  Type $\displaystyle \bf ==$ $\displaystyle \bf\{$ StatementSequence $\displaystyle \bf\}$    

These function definitions must satisfy the category of the domain.

A sequence of formal parameters is a sequence of declarations of the form

Identifier :  Type    

separated by commas.

The goal of the attrib-statement is to declare the attributes of a value (or object) of the domain (or class) being defined. In the case of

Note that attrib is also used as a private creator. Public creators have to use attrib directly or indirectly in order to initialize a new value.


next up previous
Next: Statements Up: The ALLCOT syntax Previous: Defining a category
Marc Moreno Maza
2004-12-01