Ada Programlama Dili Temelleri

Bölüm 2

Başlangıç Bilgileri

Bölüm 2 Sayfa 3

2.17 - Ada 2012 Öntanımlı Paketleri

Ada çekirdek sisteminde tanımlanmamış olan veri giriş çıkışları, dosya sistemleri, işletim sistemi ile ilişki kurulması gibi yöntemler, Ada derleyicisi ile birlikte verilen öntanımlı paketler halinde verilir. Ada 2012 spesifikasyonu derleyici ile birlikte verilmesi gereken öntanımlı paketleri belirlemiştir. Bu paketlere Standard Kitaplıklar (Standart Libraries) adı verilmiştir.

Ada 2012 spesifikasyonu Standard paketi, program dilinin ayrılmaz bir parçası olarak kabul eder ve Standard paket, her programın otomatik olarak tanıyacağı bir bilgi olarak düşünülür. Bir program with bildirimine gerek duymadan Standard paketten yararlanır. Bu pakette Boolean, Integer, Float, Character, Wide_Character, Wide_Wide_Character, String, Wide_String, Wide_Wide_String, Duration tipi veriler tanımlanır. Standard paket, bu şekilde,tüm öntanımlı veri sistemini tanımlar ve kullanıcının yaralanmasına hazır hale getirir. Bu nedenle, Ada 2012 spesifikasyonu, Standard paketi diğer öntanımlı kitaplık paketleri arasında saymaz ve daha çok Ada derleyicisi ile kaynaşmış olarak kabul eder.

Ada 2012 spesifikasyonu, Öntanımlı Ada Programlama Dili Ortamının üç tane kök kitaplık biriminden oluşacağını belirtmiştir. Bunlar,

paketleridir. Diğer paketler bunların alt paketleridir.

Ada öntanımlı kitaplık paketleri masif bir kaynak olarak programcıların yararlanması için hazırlanmıştır. Yaklaşık 860 sayfadan oluşan Ada 2012 spesifikasyonunun sadece ilk 350 sayfası Ada çekirdek dili tanımına ayrılmışken, geri kalan kısmı standart kitaplıkların tanımı için kullanılmıştır.

Ada 2012 spesifikasyonunda, standart kitaplıkların sadece kullanım yöntemlerini belirten spesifikasyon kısımları açıklanır. Kitaplıkların iç yazılımları yani gövde (body) kısımları, yerleşim (implementation) yani derleyici yazılımını yapanlara bırakılmıştır. Kullanıcıların, kitaplıkların iç yazılımına gereksinmeleri yoktur. Fakat, GNAT derleyicisi GNU açık kaynak lisansı ile dağıtıldığından, kullanıcıların kaynak kodlarına ulaşabilmesi olanağı bulunabilmektedir.

Ada 2012 spesifikasyonunda, standart kitaplıkların kullanımı kolay anlaşılabilir ve açık bir şekilde açıklanmıştır. Kitaplıklar, kolayca çağrılabilecek prosedürler halinde düzenlenmiştir. Standart kitaplıklar, programcıların temel gereksinmelerini büyük ölçüde karşılayabilecek sayı ve niteliktedir. Kitaplıkları ile birlikte, Ada Programlama Ortamı, birçok programcının katıldığı düşünceye göre dünyanın en üstün programlama dili niteliğindedir.

Ada standart kitaplıkları içinde Ada kitaplığının Text_IO alt kitaplıkları (paketleri), kullanıcılarının giriş/ çıkış prosedürleri için en çok kullandığı genel kolaylıkları içeren kitaplıklardır. Bu paketin alt paketleri aşağıda görülmektedir:

Text_IO (Metin giriş/çıkışları için)

Text_IO Alt Paketleri :

Integer_IO :(Ada.Text_IO.Integer_IO) (Tamsayı tipleri giriş/çıkışları için)

Float_IO :(Ada.Text_IO.Float_IO) (Ondalıklı (sayı temeli değişebilen) veri tipleri giriş/çıkışları için)

Fixed_IO :(Ada.Text_IO.Fixed_IO) (Sabit ondalık sayısı olan ondalıklı veri tipleri giriş/çıkışları için)

Modular_IO :(Ada.Text_IO.Modular_IO) (Modüler sayısal veri tipleri giriş/çıkışları için)

Enumeration_IO :(Ada.Text_IO.Enumeration_IO) (Sayılabilir veri tipleri giriş/çıkışları için)

Decimal_IO :(Ada.Text_IO.Decimal_IO) (Ondalıklı (10 temeline göre) veri tipleri giriş/çıkışları için)

Tüm öntanımlı kitaplık paketlerinin listesi için Ada 2012 spesifikasyonunun incelenmesi gerekir.

Bundan sonraki konumuzda Ada veri sisteminin öntanımlı verilerini inceleyecek ve standart giriş ve çıkışlar için öntanımlı kitaplıklardan yararlanacağız. Ada öntanımlı kitaplık paketlerinin kullanımı için ek-2 de tüm Ada 2012 draft spesifikasyonunu görebiliriz. Programlarda kullanılabilecek basit giriş/çıkış prosedürleri için tanıtım ve uygulama örnekleri ek3 de verilmiştir.

Standard ve Ada.Text_Io paketleri, çalışmalarda çok kullanıldığı için, aşağıda verilmiştir.

A.1 The Package Standard
This clause outlines the specification of the package Standard containing all predefined identifiers in the
language. The corresponding package body is not specified by the language.
The operators that are predefined for the types declared in the package Standard are given in comments
since they are implicitly declared. Italics are used for pseudo-names of anonymous types (such as
root_real) and for undefined information (such as implementation-defined).
Static Semantics
The library package Standard has the following declaration:
package Standard is
pragma Pure(Standard);
type Boolean is (False, True);
-- The predefined relational operators for this type are as follows:
-- function "=" (Left, Right : Boolean'Base) return Boolean;
-- function "/=" (Left, Right : Boolean'Base) return Boolean;
-- function "<" (Left, Right : Boolean'Base) return Boolean;
-- function "<=" (Left, Right : Boolean'Base) return Boolean;
-- function ">" (Left, Right : Boolean'Base) return Boolean;
-- function ">=" (Left, Right : Boolean'Base) return Boolean;
-- The predefined logical operators and the predefined logical
-- negation operator are as follows:
-- function "and" (Left, Right : Boolean'Base) return Boolean'Base;
-- function "or" (Left, Right : Boolean'Base) return Boolean'Base;
-- function "xor" (Left, Right : Boolean'Base) return Boolean'Base;
-- function "not" (Right : Boolean'Base) return Boolean'Base;
-- The integer type root_integer and the
-- corresponding universal type universal_integer are predefined.
type Integer is range implementation-defined;
subtype Natural is Integer range 0 .. Integer'Last;
subtype Positive is Integer range 1 .. Integer'Last;
-- The predefined operators for type Integer are as follows:
-- function "=" (Left, Right : Integer'Base) return Boolean;
-- function "/=" (Left, Right : Integer'Base) return Boolean;
-- function "<" (Left, Right : Integer'Base) return Boolean;
-- function "<=" (Left, Right : Integer'Base) return Boolean;
-- function ">" (Left, Right : Integer'Base) return Boolean;
-- function ">=" (Left, Right : Integer'Base) return Boolean;
-- function "+" (Right : Integer'Base) return Integer'Base;
-- function "-" (Right : Integer'Base) return Integer'Base;
-- function "abs" (Right : Integer'Base) return Integer'Base;
-- function "+" (Left, Right : Integer'Base) return Integer'Base;
-- function "-" (Left, Right : Integer'Base) return Integer'Base;
-- function "*" (Left, Right : Integer'Base) return Integer'Base;
-- function "/" (Left, Right : Integer'Base) return Integer'Base;
-- function "rem" (Left, Right : Integer'Base) return Integer'Base;
-- function "mod" (Left, Right : Integer'Base) return Integer'Base;
-- function "**" (Left : Integer'Base; Right : Natural)
-- return Integer'Base;

ISO/IEC 8652:201z(E) Ed. 3 — Ada Reference Manual
A.1 The Package Standard 11 June 2010 324
-- The specification of each operator for the type
-- root_integer, or for any additional predefined integer
-- type, is obtained by replacing Integer by the name of the type
-- in the specification of the corresponding operator of the type
-- Integer. The right operand of the exponentiation operator
-- remains as subtype Natural.
-- The floating point type root_real and the
-- corresponding universal type universal_real are predefined.
type Float is digits implementation-defined;
-- The predefined operators for this type are as follows:
-- function "=" (Left, Right : Float) return Boolean;
-- function "/=" (Left, Right : Float) return Boolean;
-- function "<" (Left, Right : Float) return Boolean;
-- function "<=" (Left, Right : Float) return Boolean;
-- function ">" (Left, Right : Float) return Boolean;
-- function ">=" (Left, Right : Float) return Boolean;
-- function "+" (Right : Float) return Float;
-- function "-" (Right : Float) return Float;
-- function "abs" (Right : Float) return Float;
-- function "+" (Left, Right : Float) return Float;
-- function "-" (Left, Right : Float) return Float;
-- function "*" (Left, Right : Float) return Float;
-- function "/" (Left, Right : Float) return Float;
-- function "**" (Left : Float; Right : Integer'Base) return Float;
-- The specification of each operator for the type root_real, or for
-- any additional predefined floating point type, is obtained by
-- replacing Float by the name of the type in the specification of the
-- corresponding operator of the type Float.
-- In addition, the following operators are predefined for the root
-- numeric types:
function "*" (Left : root_integer; Right : root_real)
return root_real;
function "*" (Left : root_real; Right : root_integer)
return root_real;
function "/" (Left : root_real; Right : root_integer)
return root_real;
-- The type universal_fixed is predefined.
-- The only multiplying operators defined between
-- fixed point types are
function "*" (Left : universal_fixed; Right : universal_fixed)
return universal_fixed;
function "/" (Left : universal_fixed; Right : universal_fixed)
return universal_fixed;
-- The type universal_access is predefined.
-- The following equality operators are predefined:
function "=" (Left, Right: universal_access) return Boolean;
function "/=" (Left, Right: universal_access) return Boolean;

ISO/IEC 8652:201z(E) Ed. 3 — Ada Reference Manual
325 11 June 2010 The Package Standard A.1
-- The declaration of type Character is based on the standard ISO 8859-1 character set.
-- There are no character literals corresponding to the positions for control characters.
-- They are indicated in italics in this definition. See 3.5.2.
type Character is
(nul, soh, stx, etx, eot, enq, ack, bel, --0 (16#00#) .. 7 (16#07#)
bs, ht, lf, vt, ff, cr, so, si, --8 (16#08#) .. 15 (16#0F#)
dle, dc1, dc2, dc3, dc4, nak, syn, etb, --16 (16#10#) .. 23 (16#17#)
can, em, sub, esc, fs, gs, rs, us, --24 (16#18#) .. 31 (16#1F#)
' ', '!', '"', '#', '$', '%', '&', ''', --32 (16#20#) .. 39 (16#27#)
'(', ')', '*', '+', ',', '-', '.', '/', --40 (16#28#) .. 47 (16#2F#)
'0', '1', '2', '3', '4', '5', '6', '7', --48 (16#30#) .. 55 (16#37#)
'8', '9', ':', ';', '<', '=', '>', '?', --56 (16#38#) .. 63 (16#3F#)
'@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', --64 (16#40#) .. 71 (16#47#)
'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', --72 (16#48#) .. 79 (16#4F#)
'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', --80 (16#50#) .. 87 (16#57#)
'X', 'Y', 'Z', '[', '\', ']', '^', '_', --88 (16#58#) .. 95 (16#5F#)
'`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', --96 (16#60#) .. 103 (16#67#)
'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', --104 (16#68#) .. 111 (16#6F#)
'p', 'q', 'r', 's', 't', 'u', 'v', 'w', --112 (16#70#) .. 119 (16#77#)
'x', 'y', 'z', '{', '|', '}', '~', del, --120 (16#78#) .. 127 (16#7F#)
reserved_128, reserved_129, bph, nbh, --128 (16#80#) .. 131 (16#83#)
reserved_132, nel, ssa, esa, --132 (16#84#) .. 135 (16#87#)
hts, htj, vts, pld, plu, ri, ss2, ss3, --136 (16#88#) .. 143 (16#8F#)
dcs, pu1, pu2, sts, cch, mw, spa, epa, --144 (16#90#) .. 151 (16#97#)
sos, reserved_153, sci, csi, --152 (16#98#) .. 155 (16#9B#)
st, osc, pm, apc, --156 (16#9C#) .. 159 (16#9F#)
' ', '¡', '¢', '£', '¤', '¥', '¦', '§', --160 (16#A0#) .. 167 (16#A7#)
'¨', '©', 'ª', '«', '¬', soft_hyphen, '®', '¯', --168 (16#A8#) ..
175 (16#AF#)
'°', '±', '²', '³', '´', 'μ', '¶', '·', --176 (16#B0#) .. 183 (16#B7#)
'¸', '¹', 'º', '»', '¼', '½', '¾', '¿', --184 (16#B8#) .. 191 (16#BF#)
'À', 'Á', 'Â', 'Ã', 'Ä', 'Å', 'Æ', 'Ç', --192 (16#C0#) .. 199 (16#C7#)
'È', 'É', 'Ê', 'Ë', 'Ì', 'Í', 'Î', 'Ï', --200 (16#C8#) .. 207 (16#CF#)
'Ð', 'Ñ', 'Ò', 'Ó', 'Ô', 'Õ', 'Ö', '×', --208 (16#D0#) .. 215 (16#D7#)
'Ø', 'Ù', 'Ú', 'Û', 'Ü', 'Ý', 'Þ', 'ß', --216 (16#D8#) .. 223 (16#DF#)
'à', 'á', 'â', 'ã', 'ä', 'å', 'æ', 'ç', --224 (16#E0#) .. 231 (16#E7#)
'è', 'é', 'ê', 'ë', 'ì', 'í', 'î', 'ï', --232 (16#E8#) .. 239 (16#EF#)
'ð', 'ñ', 'ò', 'ó', 'ô', 'õ', 'Ö', '÷', --240 (16#F0#) .. 247 (16#F7#)
'ø', 'ù', 'ú', 'û', 'ü', 'ý', 'þ', 'ÿ');--248 (16#F8#) .. 255 (16#FF#)
-- The predefined operators for the type Character are the same as for
-- any enumeration type.
-- The declaration of type Wide_Character is based on the standard ISO/IEC 10646:2003 BMP character
-- set. The first 256 positions have the same contents as type Character. See 3.5.2.
type Wide_Character is (nul, soh ... Hex_0000FFFE, Hex_0000FFFF);
35/3
36
36.1/2
ISO/IEC 8652:201z(E) Ed. 3 — Ada Reference Manual
A.1 The Package Standard 11 June 2010 326
-- The declaration of type Wide_Wide_Character is based on the full
-- ISO/IEC 10646:2003 character set. The first 65536 positions have the
-- same contents as type Wide_Character. See 3.5.2.
type Wide_Wide_Character is (nul, soh ... Hex_7FFFFFFE, Hex_7FFFFFFF);
for Wide_Wide_Character'Size use 32;
package ASCII is ... end ASCII; --Obsolescent; see J.5
-- Predefined string types:
type String is array(Positive range <>) of Character;
pragma Pack(String);
-- The predefined operators for this type are as follows:
-- function "=" (Left, Right: String) return Boolean;
-- function "/=" (Left, Right: String) return Boolean;
-- function "<" (Left, Right: String) return Boolean;
-- function "<=" (Left, Right: String) return Boolean;
-- function ">" (Left, Right: String) return Boolean;
-- function ">=" (Left, Right: String) return Boolean;
-- function "&" (Left: String; Right: String) return String;
-- function "&" (Left: Character; Right: String) return String;
-- function "&" (Left: String; Right: Character) return String;
-- function "&" (Left: Character; Right: Character) return String;
type Wide_String is array(Positive range <>) of Wide_Character;
pragma Pack(Wide_String);
-- The predefined operators for this type correspond to those for String.
type Wide_Wide_String is array (Positive range <>)
of Wide_Wide_Character;
pragma Pack (Wide_Wide_String);
-- The predefined operators for this type correspond to those for String.
type Duration is delta implementation-defined range implementation-defined;
-- The predefined operators for the type Duration are the same as for
-- any fixed point type.
-- The predefined exceptions:
Constraint_Error: exception;
Program_Error : exception;
Storage_Error : exception;
Tasking_Error : exception;
end Standard;
Standard has no private part.
In each of the types Character, Wide_Character, and Wide_Wide_Character, the character literals for the
space character (position 32) and the non-breaking space character (position 160) correspond to different
values. Unless indicated otherwise, each occurrence of the character literal ' ' in this International Standard
refers to the space character. Similarly, the character literals for hyphen (position 45) and soft hyphen
(position 173) correspond to different values. Unless indicated otherwise, each occurrence of the character
literal '–' in this International Standard refers to the hyphen character.
Dynamic Semantics
Elaboration of the body of Standard has no effect.
Implementation Permissions
An implementation may provide additional predefined integer types and additional predefined floating
point types. Not all of these types need have names.

ISO/IEC 8652:201z(E) Ed. 3 — Ada Reference Manual
327 11 June 2010 The Package Standard A.1
Implementation Advice
If an implementation provides additional named predefined integer types, then the names should end with
"Integer" as in "Long_Integer". If an implementation provides additional named predefined floating point
types, then the names should end with "Float" as in "Long_Float".
NOTES
1 Certain aspects of the predefined entities cannot be completely described in the language itself. For example, although
the enumeration type Boolean can be written showing the two enumeration literals False and True, the short-circuit
control forms cannot be expressed in the language.
2 As explained in 8.1, "Declarative Region" and 10.1.4, "The Compilation Process", the declarative region of the package
Standard encloses every library unit and consequently the main subprogram; the declaration of every library unit is
assumed to occur within this declarative region. Library_items are assumed to be ordered in such a way that there are no
forward semantic dependences. However, as explained in 8.3, "Visibility", the only library units that are visible within a
given compilation unit are the library units named by all with_clauses that apply to the given unit, and moreover, within
the declarative region of a given library unit, that library unit itself.
3 If all block_statements of a program are named, then the name of each program unit can always be written as an
expanded name starting with Standard (unless Standard is itself hidden). The name of a library unit cannot be a
homograph of a name (such as Integer) that is already declared in Standard.
4 The exception Standard.Numeric_Error is defined in J.6.

Ada.Text_IO paketi aşağıda görülmektedir.

A.10.1 The Package Text_IO
Static Semantics
The library package Text_IO has the following declaration:
with Ada.IO_Exceptions;
package Ada.Text_IO is
type File_Type is limited private;
type File_Mode is (In_File, Out_File, Append_File);
type Count is range 0 .. implementation-defined;
subtype Positive_Count is Count range 1 .. Count'Last;
Unbounded : constant Count := 0; -- line and page length
subtype Field is Integer range 0 .. implementation-defined;
subtype Number_Base is Integer range 2 .. 16;
type Type_Set is (Lower_Case, Upper_Case);
-- File Management

ISO/IEC 8652:201z(E) Ed. 3 — Ada Reference Manual
A.10.1 The Package Text_IO 11 June 2010 398
procedure Create (File : in out File_Type;
Mode : in File_Mode := Out_File;
Name : in String := "";
Form : in String := "");
procedure Open (File : in out File_Type;
Mode : in File_Mode;
Name : in String;
Form : in String := "");
procedure Close (File : in out File_Type);
procedure Delete (File : in out File_Type);
procedure Reset (File : in out File_Type; Mode : in File_Mode);
procedure Reset (File : in out File_Type);
function Mode (File : in File_Type) return File_Mode;
function Name (File : in File_Type) return String;
function Form (File : in File_Type) return String;
function Is_Open(File : in File_Type) return Boolean;
-- Control of default input and output files
procedure Set_Input (File : in File_Type);
procedure Set_Output(File : in File_Type);
procedure Set_Error (File : in File_Type);
function Standard_Input return File_Type;
function Standard_Output return File_Type;
function Standard_Error return File_Type;
function Current_Input return File_Type;
function Current_Output return File_Type;
function Current_Error return File_Type;
type File_Access is access constant File_Type;
function Standard_Input return File_Access;
function Standard_Output return File_Access;
function Standard_Error return File_Access;
function Current_Input return File_Access;
function Current_Output return File_Access;
function Current_Error return File_Access;
--Buffer control
procedure Flush (File : in File_Type);
procedure Flush;
-- Specification of line and page lengths
procedure Set_Line_Length(File : in File_Type; To : in Count);
procedure Set_Line_Length(To : in Count);
procedure Set_Page_Length(File : in File_Type; To : in Count);
procedure Set_Page_Length(To : in Count);
function Line_Length(File : in File_Type) return Count;
function Line_Length return Count;
function Page_Length(File : in File_Type) return Count;
function Page_Length return Count;
-- Column, Line, and Page Control
procedure New_Line (File : in File_Type;
Spacing : in Positive_Count := 1);
procedure New_Line (Spacing : in Positive_Count := 1);
procedure Skip_Line (File : in File_Type;
Spacing : in Positive_Count := 1);
procedure Skip_Line (Spacing : in Positive_Count := 1);
function End_Of_Line(File : in File_Type) return Boolean;
function End_Of_Line return Boolean;
procedure New_Page (File : in File_Type);
procedure New_Page;

ISO/IEC 8652:201z(E) Ed. 3 — Ada Reference Manual
399 11 June 2010 The Package Text_IO A.10.1
procedure Skip_Page (File : in File_Type);
procedure Skip_Page;
function End_Of_Page(File : in File_Type) return Boolean;
function End_Of_Page return Boolean;
function End_Of_File(File : in File_Type) return Boolean;
function End_Of_File return Boolean;
procedure Set_Col (File : in File_Type; To : in Positive_Count);
procedure Set_Col (To : in Positive_Count);
procedure Set_Line(File : in File_Type; To : in Positive_Count);
procedure Set_Line(To : in Positive_Count);
function Col (File : in File_Type) return Positive_Count;
function Col return Positive_Count;
function Line(File : in File_Type) return Positive_Count;
function Line return Positive_Count;
function Page(File : in File_Type) return Positive_Count;
function Page return Positive_Count;
-- Character Input-Output
procedure Get(File : in File_Type; Item : out Character);
procedure Get(Item : out Character);
procedure Put(File : in File_Type; Item : in Character);
procedure Put(Item : in Character);
procedure Look_Ahead (File : in File_Type;
Item : out Character;
End_Of_Line : out Boolean);
procedure Look_Ahead (Item : out Character;
End_Of_Line : out Boolean);
procedure Get_Immediate(File : in File_Type;
Item : out Character);
procedure Get_Immediate(Item : out Character);
procedure Get_Immediate(File : in File_Type;
Item : out Character;
Available : out Boolean);
procedure Get_Immediate(Item : out Character;
Available : out Boolean);
-- String Input-Output
procedure Get(File : in File_Type; Item : out String);
procedure Get(Item : out String);
procedure Put(File : in File_Type; Item : in String);
procedure Put(Item : in String);
procedure Get_Line(File : in File_Type;
Item : out String;
Last : out Natural);
procedure Get_Line(Item : out String; Last : out Natural);
function Get_Line(File : in File_Type) return String;
function Get_Line return String;
procedure Put_Line(File : in File_Type; Item : in String);
procedure Put_Line(Item : in String);
-- Generic packages for Input-Output of Integer Types
generic
type Num is range <>;
package Integer_IO is
Default_Width : Field := Num'Width;
Default_Base : Number_Base := 10;

ISO/IEC 8652:201z(E) Ed. 3 — Ada Reference Manual
A.10.1 The Package Text_IO 11 June 2010 400
procedure Get(File : in File_Type;
Item : out Num;
Width : in Field := 0);
procedure Get(Item : out Num;
Width : in Field := 0);
procedure Put(File : in File_Type;
Item : in Num;
Width : in Field := Default_Width;
Base : in Number_Base := Default_Base);
procedure Put(Item : in Num;
Width : in Field := Default_Width;
Base : in Number_Base := Default_Base);
procedure Get(From : in String;
Item : out Num;
Last : out Positive);
procedure Put(To : out String;
Item : in Num;
Base : in Number_Base := Default_Base);
end Integer_IO;
generic
type Num is mod <>;
package Modular_IO is
Default_Width : Field := Num'Width;
Default_Base : Number_Base := 10;
procedure Get(File : in File_Type;
Item : out Num;
Width : in Field := 0);
procedure Get(Item : out Num;
Width : in Field := 0);
procedure Put(File : in File_Type;
Item : in Num;
Width : in Field := Default_Width;
Base : in Number_Base := Default_Base);
procedure Put(Item : in Num;
Width : in Field := Default_Width;
Base : in Number_Base := Default_Base);
procedure Get(From : in String;
Item : out Num;
Last : out Positive);
procedure Put(To : out String;
Item : in Num;
Base : in Number_Base := Default_Base);
end Modular_IO;
-- Generic packages for Input-Output of Real Types
generic
type Num is digits <>;
package Float_IO is
Default_Fore : Field := 2;
Default_Aft : Field := Num'Digits-1;
Default_Exp : Field := 3;
procedure Get(File : in File_Type;
Item : out Num;
Width : in Field := 0);
procedure Get(Item : out Num;
Width : in Field := 0);

ISO/IEC 8652:201z(E) Ed. 3 — Ada Reference Manual
401 11 June 2010 The Package Text_IO A.10.1
procedure Put(File : in File_Type;
Item : in Num;
Fore : in Field := Default_Fore;
Aft : in Field := Default_Aft;
Exp : in Field := Default_Exp);
procedure Put(Item : in Num;
Fore : in Field := Default_Fore;
Aft : in Field := Default_Aft;
Exp : in Field := Default_Exp);
procedure Get(From : in String;
Item : out Num;
Last : out Positive);
procedure Put(To : out String;
Item : in Num;
Aft : in Field := Default_Aft;
Exp : in Field := Default_Exp);
end Float_IO;
generic
type Num is delta <>;
package Fixed_IO is
Default_Fore : Field := Num'Fore;
Default_Aft : Field := Num'Aft;
Default_Exp : Field := 0;
procedure Get(File : in File_Type;
Item : out Num;
Width : in Field := 0);
procedure Get(Item : out Num;
Width : in Field := 0);
procedure Put(File : in File_Type;
Item : in Num;
Fore : in Field := Default_Fore;
Aft : in Field := Default_Aft;
Exp : in Field := Default_Exp);
procedure Put(Item : in Num;
Fore : in Field := Default_Fore;
Aft : in Field := Default_Aft;
Exp : in Field := Default_Exp);
procedure Get(From : in String;
Item : out Num;
Last : out Positive);
procedure Put(To : out String;
Item : in Num;
Aft : in Field := Default_Aft;
Exp : in Field := Default_Exp);
end Fixed_IO;
generic
type Num is delta <> digits <>;
package Decimal_IO is
Default_Fore : Field := Num'Fore;
Default_Aft : Field := Num'Aft;
Default_Exp : Field := 0;
procedure Get(File : in File_Type;
Item : out Num;
Width : in Field := 0);
procedure Get(Item : out Num;
Width : in Field := 0);

ISO/IEC 8652:201z(E) Ed. 3 — Ada Reference Manual
A.10.1 The Package Text_IO 11 June 2010 402
procedure Put(File : in File_Type;
Item : in Num;
Fore : in Field := Default_Fore;
Aft : in Field := Default_Aft;
Exp : in Field := Default_Exp);
procedure Put(Item : in Num;
Fore : in Field := Default_Fore;
Aft : in Field := Default_Aft;
Exp : in Field := Default_Exp);
procedure Get(From : in String;
Item : out Num;
Last : out Positive);
procedure Put(To : out String;
Item : in Num;
Aft : in Field := Default_Aft;
Exp : in Field := Default_Exp);
end Decimal_IO;
-- Generic package for Input-Output of Enumeration Types
generic
type Enum is (<>);
package Enumeration_IO is
Default_Width : Field := 0;
Default_Setting : Type_Set := Upper_Case;
procedure Get(File : in File_Type;
Item : out Enum);
procedure Get(Item : out Enum);
procedure Put(File : in File_Type;
Item : in Enum;
Width : in Field := Default_Width;
Set : in Type_Set := Default_Setting);
procedure Put(Item : in Enum;
Width : in Field := Default_Width;
Set : in Type_Set := Default_Setting);
procedure Get(From : in String;
Item : out Enum;
Last : out Positive);
procedure Put(To : out String;
Item : in Enum;
Set : in Type_Set := Default_Setting);
end Enumeration_IO;
-- Exceptions
Status_Error : exception renames IO_Exceptions.Status_Error;
Mode_Error : exception renames IO_Exceptions.Mode_Error;
Name_Error : exception renames IO_Exceptions.Name_Error;
Use_Error : exception renames IO_Exceptions.Use_Error;
Device_Error : exception renames IO_Exceptions.Device_Error;
End_Error : exception renames IO_Exceptions.End_Error;
Data_Error : exception renames IO_Exceptions.Data_Error;
Layout_Error : exception renames IO_Exceptions.Layout_Error;
private
... -- not specified by the language
end Ada.Text_IO;
The type File_Type needs finalization (see 7.6)

Valid XHTML 1.1