compilation ::= {compilation_unit}
compilation_unit ::= context_clause library_item | context_clause subunit
library_item ::= [private] library_unit_declaration | library_unit_body | [private] library_unit_renaming_declaration
library_unit_declaration ::= subprogram_declaration | package_declaration | generic_declaration | generic_instantiation
library_unit_renaming_declaration ::= package_renaming_declaration | generic_renaming_declaration | subprogram_renaming_declaration
library_unit_body ::= subprogram_body | package_body
parent_unit_name ::= name
NOTES
package Rational_Numbers.IO is -- public child of Rational_Numbers, See section 7.1 Package Specifications and Declarations procedure Put(R : in Rational); procedure Get(R : out Rational); end Rational_Numbers.IO;
private procedure Rational_Numbers.Reduce(R : in out Rational); -- private child of Rational_Numbers
with Rational_Numbers.Reduce; -- refer to a private child package body Rational_Numbers is ... end Rational_Numbers;
with Rational_Numbers.IO; use Rational_Numbers; with Ada.Text_io; -- See section A.10 Text Input-Output procedure Main is -- a root library procedure R : Rational; begin R := 5/3; -- construct a rational number, See section 7.1 Package Specifications and Declarations Ada.Text_IO.Put("The answer is: "); IO.Put(R); Ada.Text_IO.New_Line; end Main;
with Rational_Numbers.IO; package Rational_IO renames Rational_Numbers.IO; -- a library unit renaming declaration
Go to the first, previous, next, last section, table of contents.