Ada Conformity Assessment Authority      Home Conformity Assessment   Test Suite ARGAda Standard
 
Ada Reference ManualLegal Information
Contents   Index   References   Search   Previous   Next 

6.7 Null Procedures

1/2
A null_procedure_declaration provides a shorthand to declare a procedure with an empty body. 

Syntax

2/3
null_procedure_declaration ::= 
   [overriding_indicator]
   procedure_specification is null
       [aspect_specification];

Legality Rules

2.1/3
  If a null_procedure_declaration is a completion, it shall be the completion of a subprogram_declaration or generic_subprogram_declaration. The profile of a null_procedure_declaration that completes a declaration shall conform fully to that of the declaration.

Static Semantics

3/3
A null_procedure_declaration declares a null procedure. A completion is not allowed for a null_procedure_declaration; however, a null_procedure_declaration can complete a previous declaration. 

Dynamic Semantics

4/2
The execution of a null procedure is invoked by a subprogram call. For the execution of a subprogram call on a null procedure, the execution of the subprogram_body has no effect. 
5/3
The elaboration of a null_procedure_declaration has no other effect than to establish that the null procedure can be called without failing the Elaboration_Check. 

Examples

6/2
procedure Simplify(Expr : in out Expression) is null; -- see 3.9
-- By default, Simplify does nothing, but it may be overridden in extensions of Expression

Contents   Index   References   Search   Previous   Next 
Ada-Europe Ada 2005 and 2012 Editions sponsored in part by Ada-Europe