Syntax von Prozeduren

 [Vorheriges Kapitel]  [Vorherige Seite]  [Inhaltsverzeichnis]  [Nächste Seite]  [Nächstes Kapitel]

AddressBook2.om
PROCEDURE SearchByName(addressBook: AddressBook;
                       name: Name;
                       VAR index: INTEGER) : BOOLEAN;

*Die formale Parameterliste sieht ähnlich aus wie Variablendeklarationen. Allerdings hat VAR hier eine völlig andere Bedeutung.
 
*Vollständige Syntax für Prozeduren:
⟨ ProcedureDeclaration ⟩---> ⟨ ProcedureHeading ⟩ ``;''
⟨ ProcedureBody ⟩ ⟨ Ident ⟩
⟨ ProcedureHeading ⟩---> ``PROCEDURE'' [``*''] ⟨ Ident ⟩
[⟨ FormalParameters ⟩]
⟨ ForwardDeclaration ⟩---> ``PROCEDURE'' `` ^ '' ⟨ Ident ⟩
[⟨ FormalParameters ⟩]
⟨ FormalParameters ⟩---> ``('' [ ⟨ FPSection ⟩
{ ``;'' ⟨ FPSection ⟩ } ] ``)''
[``:'' ⟨ QualIdent ⟩]
⟨ FPSection ⟩---> [ ``VAR''] ⟨ IdentList ⟩ ``:'' ⟨ FormalType ⟩
⟨ FormalType ⟩---> { ``ARRAY'' ``OF'' } ⟨ QualIdent ⟩
⟨ QualIdent ⟩---> [⟨ Ident ⟩ ``.''] ⟨ Ident ⟩
⟨ ProcedureBody ⟩---> ⟨ DeclarationSequence ⟩
[``BEGIN'' ⟨ StatementSequence ⟩]
``END''

 

 [Vorheriges Kapitel]  [Vorherige Seite]  [Inhaltsverzeichnis]  [Nächste Seite]  [Nächstes Kapitel]
Copyright © 2004, 2005 Andreas Borchert, in HTML konvertiert am 18.02.2005