diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-09-05 08:07:00 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-09-05 08:07:00 +0000 |
commit | 1d9b970a8fc86e69c3eeb9314b9a5de609047115 (patch) | |
tree | 4719707ee1466c01c795cf2a027236826eba7d41 /gcc/ada/g-awk.ads | |
parent | 0759bfdcbc2b16b34d811b699902287f5386df46 (diff) | |
download | gcc-1d9b970a8fc86e69c3eeb9314b9a5de609047115.tar.gz |
2005-09-01 Robert Dewar <dewar@adacore.com>
* a-dirval-mingw.adb, a-direct.adb, a-coinve.adb,
g-dynhta.adb, g-dynhta.ads, cstand.adb, exp_smem.adb, g-debuti.ads,
g-dirope.adb, g-table.adb, lib-sort.adb, sem_maps.adb,
exp_fixd.adb, exp_aggr.adb, a-intnam-mingw.ads, a-intnam-vxworks.ads,
g-arrspl.adb, g-arrspl.ads, g-awk.adb, g-awk.ads, g-boubuf.ads,
g-boubuf.ads, g-boubuf.ads, g-bubsor.ads, g-bubsor.adb, g-busora.adb,
g-busora.ads, g-busorg.adb, g-busorg.ads, g-calend.adb, g-calend.ads,
g-casuti.adb, g-casuti.ads, g-catiio.adb, g-catiio.ads, g-cgi.adb,
g-cgi.ads, g-cgicoo.adb, g-cgicoo.ads, g-cgideb.adb, g-cgideb.ads,
g-comlin.adb, g-comver.ads, g-semaph.ads, g-socthi.ads,
sem_ch7.adb, a-direio.adb, a-caldel.ads, i-cstrea-vms.adb,
a-ztedit.adb, a-ztenau.adb, g-socthi-vms.adb, g-socthi-vms.ads,
g-socthi-mingw.adb, g-socthi-mingw.ads, g-socthi-vxworks.ads,
a-intnam-irix.ads, a-intnam-irix.ads, a-intnam-hpux.ads,
a-intnam-os2.ads, a-intnam-os2.ads, a-caldel-vms.adb, a-calend-vms.adb,
a-calend-vms.ads, g-heasor.adb, g-heasor.ads, g-hesora.adb,
g-hesora.ads, g-hesorg.adb, g-hesorg.ads, g-htable.adb, g-htable.ads,
g-io.adb, g-io.ads, g-io_aux.adb, g-io_aux.ads, g-locfil.ads,
g-memdum.adb, g-memdum.ads, g-traceb.adb, g-traceb.ads, i-cobol.adb,
i-cobol.ads, i-cstrea.ads, i-cstrin.adb, a-wtedit.adb, a-tifiio.adb,
a-wtenau.adb, a-wtenau.adb, a-teioed.adb: Minor reformatting
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@103894 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/g-awk.ads')
-rw-r--r-- | gcc/ada/g-awk.ads | 69 |
1 files changed, 26 insertions, 43 deletions
diff --git a/gcc/ada/g-awk.ads b/gcc/ada/g-awk.ads index 68499b20665..4d7c65f8605 100644 --- a/gcc/ada/g-awk.ads +++ b/gcc/ada/g-awk.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 2000-2003 Ada Core Technologies, Inc. -- +-- Copyright (C) 2000-2005 Ada Core Technologies, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -187,31 +187,30 @@ with GNAT.Regpat; package GNAT.AWK is Session_Error : exception; - -- Raised when a Session is reused but is not closed. + -- Raised when a Session is reused but is not closed File_Error : exception; - -- Raised when there is a file problem (see below). + -- Raised when there is a file problem (see below) End_Error : exception; -- Raised when an attempt is made to read beyond the end of the last -- file of a session. Field_Error : exception; - -- Raised when accessing a field value which does not exist. + -- Raised when accessing a field value which does not exist Data_Error : exception; - -- Raised when it is not possible to convert a field value to a specific - -- type. + -- Raised when it is impossible to convert a field value to a specific type type Count is new Natural; type Widths_Set is array (Positive range <>) of Positive; - -- Used to store a set of columns widths. + -- Used to store a set of columns widths Default_Separators : constant String := " " & ASCII.HT; Use_Current : constant String := ""; - -- Value used when no separator or filename is specified in iterators. + -- Value used when no separator or filename is specified in iterators type Session_Type is limited private; -- This is the main exported type. A session is used to keep the state of @@ -256,7 +255,7 @@ package GNAT.AWK is (Separators : String := Default_Separators; Session : Session_Type := Current_Session) renames Set_Field_Separators; - -- FS is the AWK abbreviation for above service. + -- FS is the AWK abbreviation for above service procedure Set_Field_Widths (Field_Widths : Widths_Set; @@ -294,54 +293,44 @@ package GNAT.AWK is ------------------------------------- function Number_Of_Fields - (Session : Session_Type := Current_Session) - return Count; + (Session : Session_Type := Current_Session) return Count; pragma Inline (Number_Of_Fields); -- Returns the number of fields in the current record. It returns 0 when -- no file is being processed. function NF - (Session : Session_Type := Current_Session) - return Count + (Session : Session_Type := Current_Session) return Count renames Number_Of_Fields; - -- AWK abbreviation for above service. + -- AWK abbreviation for above service function Number_Of_File_Lines - (Session : Session_Type := Current_Session) - return Count; + (Session : Session_Type := Current_Session) return Count; pragma Inline (Number_Of_File_Lines); -- Returns the current line number in the processed file. It returns 0 when -- no file is being processed. - function FNR - (Session : Session_Type := Current_Session) - return Count renames Number_Of_File_Lines; - -- AWK abbreviation for above service. + function FNR (Session : Session_Type := Current_Session) return Count + renames Number_Of_File_Lines; + -- AWK abbreviation for above service function Number_Of_Lines - (Session : Session_Type := Current_Session) - return Count; + (Session : Session_Type := Current_Session) return Count; pragma Inline (Number_Of_Lines); -- Returns the number of line processed until now. This is equal to number -- of line in each already processed file plus FNR. It returns 0 when -- no file is being processed. - function NR - (Session : Session_Type := Current_Session) - return Count + function NR (Session : Session_Type := Current_Session) return Count renames Number_Of_Lines; - -- AWK abbreviation for above service. + -- AWK abbreviation for above service function Number_Of_Files - (Session : Session_Type := Current_Session) - return Natural; + (Session : Session_Type := Current_Session) return Natural; pragma Inline (Number_Of_Files); -- Returns the number of files associated with Session. This is the total -- number of files added with Add_File and Add_Files services. - function File - (Session : Session_Type := Current_Session) - return String; + function File (Session : Session_Type := Current_Session) return String; -- Returns the name of the file being processed. It returns the empty -- string when no file is being processed. @@ -351,24 +340,21 @@ package GNAT.AWK is function Field (Rank : Count; - Session : Session_Type := Current_Session) - return String; + Session : Session_Type := Current_Session) return String; -- Returns field number Rank value of the current record. If Rank = 0 it -- returns the current record (i.e. the line as read in the file). It -- raises Field_Error if Rank > NF or if Session is not open. function Field (Rank : Count; - Session : Session_Type := Current_Session) - return Integer; + Session : Session_Type := Current_Session) return Integer; -- Returns field number Rank value of the current record as an integer. It -- raises Field_Error if Rank > NF or if Session is not open. It -- raises Data_Error if the field value cannot be converted to an integer. function Field (Rank : Count; - Session : Session_Type := Current_Session) - return Float; + Session : Session_Type := Current_Session) return Float; -- Returns field number Rank value of the current record as a float. It -- raises Field_Error if Rank > NF or if Session is not open. It -- raises Data_Error if the field value cannot be converted to a float. @@ -377,8 +363,7 @@ package GNAT.AWK is type Discrete is (<>); function Discrete_Field (Rank : Count; - Session : Session_Type := Current_Session) - return Discrete; + Session : Session_Type := Current_Session) return Discrete; -- Returns field number Rank value of the current record as a type -- Discrete. It raises Field_Error if Rank > NF. It raises Data_Error if -- the field value cannot be converted to type Discrete. @@ -527,16 +512,14 @@ package GNAT.AWK is -- or by an instantiation of For_Every_Line (see below). function End_Of_Data - (Session : Session_Type := Current_Session) - return Boolean; + (Session : Session_Type := Current_Session) return Boolean; pragma Inline (End_Of_Data); -- Returns True if there is no more data to be processed in Session. It -- means that the latest session's file is being processed and that -- there is no more data to be read in this file (End_Of_File is True). function End_Of_File - (Session : Session_Type := Current_Session) - return Boolean; + (Session : Session_Type := Current_Session) return Boolean; pragma Inline (End_Of_File); -- Returns True when there is no more data to be processed on the current -- session's file. |