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

Defining a category

A category definition looks like

Identifier :  $\displaystyle \bf Category$ $\displaystyle \bf ==$ Identifier $\displaystyle \bf with$ $\displaystyle \bf\{$ FunctionDeclarationSequence $\displaystyle \bf\}$    

or like

Identifier :  $\displaystyle \bf Category$ $\displaystyle \bf ==$ $\displaystyle \bf with$ $\displaystyle \bf\{$ FunctionDeclarationSequence $\displaystyle \bf\}$    

where in each case The specifications of the so-defined category consists of the function declarations on the right of the with key-word, plus the specifications of the existing category, if present.

A function declaration looks like

Identifier :  $\displaystyle \bf ($ TypeSequence $\displaystyle \bf )$ $\displaystyle \bf ->$ Type (1)

where such that The above constraint is not required in ALDOR and is meant here to ease the type checking in ALLCOT. We shall return to this later.

Some remarks regarding the non-terminal Type. There are circumstances where Type cannot be % or () . For instance, we shall never need to declare of variable of type () . Moreover, in the definition of the main function, we shall never need to declare of variable of type %. These special cases can be treated at the level of the type checking.

Observe that the empty list () can be generated by two different ways: as an empty list of parameter of a function or as the void type.


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