We give now a grammar for ALLCOT programs.
Program | DefinitionSequence MainSequence | |
DefinitionSequence | CategoryDefinition DefinitionSequence | |
DefinitionSequence | DomainDefinition DefinitionSequence | |
DefinitionSequence |
CategoryDefinition | id: Category == ParentCategory WithBody | |
ParentCategory | id | |
ParentCategory | ||
WithBody | with { FunctionDeclarationSequence } | |
FunctionDeclarationSequence | FunctionDeclaration ; FunctionDeclarationSequence | |
FunctionDeclarationSequence | ||
FunctionDeclaration | id : ( TypeSequence ) TypeOrVoid | |
TypeSequence | ||
TypeSequence | Type | |
TypeSequence | Type , MoreTypes | |
MoreTypes | Type | |
MoreTypes | Type , MoreTypes | |
Type | % | |
Type | id | |
TypeOrVoid | Type | |
TypeOrVoid | ( ) | |
DomainDefinition | id: id == ParentDomain AddBody | |
ParentDomain | id | |
ParentDomain | ||
AddBody | add { AttribStatement ; | |
FunctionDefinitionSequence } | ||
FunctionDefinitionSequence | FunctionDefinition FunctionDefinitionSequence | |
FunctionDefinitionSequence | ||
FunctionDefinition | id ( FormalParameterSequence ) : | |
TypeOrVoid == FunctionBody | ||
FormalParameterSequence | ||
FormalParameterSequence | FormalParameter | |
FormalParameterSequence | FormalParameter , MoreFormalParameters | |
MoreFormalParameters | FormalParameter | |
MoreFormalParameters | FormalParameter , MoreFormalParameters | |
FormalParameter | id: Type | |
FunctionBody | Statement ; | |
FunctionBody | { StatementSequence } | |
StatementSequence | Statement ; | |
StatementSequence | Statement ; StatementSequence |
MainSequence | MainDefinition MainCall | |
MainDefinition | main (): () == { StatementSequence } | |
MainCall | main () ; |