1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
11 -- Copyright (C) 1992-2001 Free Software Foundation, Inc. --
13 -- GNAT is free software; you can redistribute it and/or modify it under --
14 -- terms of the GNU General Public License as published by the Free Soft- --
15 -- ware Foundation; either version 2, or (at your option) any later ver- --
16 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
17 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
18 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
19 -- for more details. You should have received a copy of the GNU General --
20 -- Public License distributed with GNAT; see file COPYING. If not, write --
21 -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
22 -- MA 02111-1307, USA. --
24 -- As a special exception, if other files instantiate generics from this --
25 -- unit, or you link this unit with other files to produce an executable, --
26 -- this unit does not by itself cause the resulting executable to be --
27 -- covered by the GNU General Public License. This exception does not --
28 -- however invalidate any other reasons why the executable file might be --
29 -- covered by the GNU Public License. --
31 -- GNAT was originally developed by the GNAT team at New York University. --
32 -- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
34 ------------------------------------------------------------------------------
36 pragma Style_Checks
(All_Checks
);
37 -- Subprograms not all in alpha order
39 with Debug
; use Debug
;
40 with Namet
; use Namet
;
42 with Output
; use Output
;
43 with Tree_IO
; use Tree_IO
;
44 with System
; use System
;
46 with Unchecked_Conversion
;
47 with Unchecked_Deallocation
;
49 package body Sinput
is
52 -- Make control characters visible
54 First_Time_Around
: Boolean := True;
56 ---------------------------
57 -- Add_Line_Tables_Entry --
58 ---------------------------
60 procedure Add_Line_Tables_Entry
61 (S
: in out Source_File_Record
;
64 LL
: Physical_Line_Number
;
67 -- Reallocate the lines tables if necessary.
69 -- Note: the reason we do not use the normal Table package
70 -- mechanism is that we have several of these tables. We could
71 -- use the new GNAT.Dynamic_Tables package and that would probably
74 if S
.Last_Source_Line
= S
.Lines_Table_Max
then
77 Int
(S
.Last_Source_Line
) *
78 ((100 + Alloc
.Lines_Increment
) / 100));
81 Write_Str
("--> Reallocating lines table, size = ");
82 Write_Int
(Int
(S
.Lines_Table_Max
));
87 S
.Last_Source_Line
:= S
.Last_Source_Line
+ 1;
88 LL
:= S
.Last_Source_Line
;
90 S
.Lines_Table
(LL
) := P
;
92 -- Deal with setting new entry in logical lines table if one is
93 -- present. Note that there is always space (because the call to
94 -- Alloc_Line_Tables makes sure both tables are the same length),
96 if S
.Logical_Lines_Table
/= null then
98 -- We can always set the entry from the previous one, because
99 -- the processing for a Source_Reference pragma ensures that
100 -- at least one entry following the pragma is set up correctly.
102 S
.Logical_Lines_Table
(LL
) := S
.Logical_Lines_Table
(LL
- 1) + 1;
104 end Add_Line_Tables_Entry
;
106 -----------------------
107 -- Alloc_Line_Tables --
108 -----------------------
110 procedure Alloc_Line_Tables
111 (S
: in out Source_File_Record
;
115 (memblock
: Lines_Table_Ptr
;
117 return Lines_Table_Ptr
;
118 pragma Import
(C
, realloc
, "realloc");
121 (memblock
: Logical_Lines_Table_Ptr
;
123 return Logical_Lines_Table_Ptr
;
124 pragma Import
(C
, reallocl
, "realloc");
128 return Lines_Table_Ptr
;
129 pragma Import
(C
, malloc
, "malloc");
133 return Logical_Lines_Table_Ptr
;
134 pragma Import
(C
, mallocl
, "malloc");
136 New_Table
: Lines_Table_Ptr
;
138 New_Logical_Table
: Logical_Lines_Table_Ptr
;
140 New_Size
: constant size_t
:=
141 size_t
(New_Max
* Lines_Table_Type
'Component_Size /
145 if S
.Lines_Table
= null then
146 New_Table
:= malloc
(New_Size
);
150 realloc
(memblock
=> S
.Lines_Table
, size
=> New_Size
);
153 if New_Table
= null then
156 S
.Lines_Table
:= New_Table
;
157 S
.Lines_Table_Max
:= Physical_Line_Number
(New_Max
);
160 if S
.Num_SRef_Pragmas
/= 0 then
161 if S
.Logical_Lines_Table
= null then
162 New_Logical_Table
:= mallocl
(New_Size
);
165 reallocl
(memblock
=> S
.Logical_Lines_Table
, size
=> New_Size
);
168 if New_Logical_Table
= null then
171 S
.Logical_Lines_Table
:= New_Logical_Table
;
174 end Alloc_Line_Tables
;
180 procedure Backup_Line
(P
: in out Source_Ptr
) is
181 Sindex
: constant Source_File_Index
:= Get_Source_File_Index
(P
);
182 Src
: constant Source_Buffer_Ptr
:=
183 Source_File
.Table
(Sindex
).Source_Text
;
184 Sfirst
: constant Source_Ptr
:=
185 Source_File
.Table
(Sindex
).Source_First
;
195 if Src
(P
- 1) = LF
then
200 if Src
(P
- 1) = CR
then
205 -- Now find first character of the previous line
208 and then Src
(P
- 1) /= LF
209 and then Src
(P
- 1) /= CR
215 ---------------------------
216 -- Build_Location_String --
217 ---------------------------
219 procedure Build_Location_String
(Loc
: Source_Ptr
) is
225 -- Loop through instantiations
229 Get_Name_String_And_Append
230 (Reference_Name
(Get_Source_File_Index
(Ptr
)));
231 Add_Char_To_Name_Buffer
(':');
232 Add_Nat_To_Name_Buffer
233 (Nat
(Get_Logical_Line_Number
(Ptr
)));
235 Ptr
:= Instantiation_Location
(Ptr
);
236 exit when Ptr
= No_Location
;
237 Add_Str_To_Name_Buffer
(" instantiated at ");
240 Name_Buffer
(Name_Len
+ 1) := NUL
;
242 end Build_Location_String
;
244 -----------------------
245 -- Get_Column_Number --
246 -----------------------
248 function Get_Column_Number
(P
: Source_Ptr
) return Column_Number
is
251 Sindex
: Source_File_Index
;
252 Src
: Source_Buffer_Ptr
;
255 -- If the input source pointer is not a meaningful value then return
256 -- at once with column number 1. This can happen for a file not found
257 -- condition for a file loaded indirectly by RTE, and also perhaps on
258 -- some unknown internal error conditions. In either case we certainly
259 -- don't want to blow up.
265 Sindex
:= Get_Source_File_Index
(P
);
266 Src
:= Source_File
.Table
(Sindex
).Source_Text
;
272 C
:= (C
- 1) / 8 * 8 + (8 + 1);
282 end Get_Column_Number
;
284 -----------------------------
285 -- Get_Logical_Line_Number --
286 -----------------------------
288 function Get_Logical_Line_Number
290 return Logical_Line_Number
292 SFR
: Source_File_Record
293 renames Source_File
.Table
(Get_Source_File_Index
(P
));
295 L
: constant Physical_Line_Number
:= Get_Physical_Line_Number
(P
);
298 if SFR
.Num_SRef_Pragmas
= 0 then
299 return Logical_Line_Number
(L
);
301 return SFR
.Logical_Lines_Table
(L
);
303 end Get_Logical_Line_Number
;
305 ------------------------------
306 -- Get_Physical_Line_Number --
307 ------------------------------
309 function Get_Physical_Line_Number
311 return Physical_Line_Number
313 Sfile
: Source_File_Index
;
314 Table
: Lines_Table_Ptr
;
315 Lo
: Physical_Line_Number
;
316 Hi
: Physical_Line_Number
;
317 Mid
: Physical_Line_Number
;
321 -- If the input source pointer is not a meaningful value then return
322 -- at once with line number 1. This can happen for a file not found
323 -- condition for a file loaded indirectly by RTE, and also perhaps on
324 -- some unknown internal error conditions. In either case we certainly
325 -- don't want to blow up.
330 -- Otherwise we can do the binary search
333 Sfile
:= Get_Source_File_Index
(P
);
334 Loc
:= P
+ Source_File
.Table
(Sfile
).Sloc_Adjust
;
335 Table
:= Source_File
.Table
(Sfile
).Lines_Table
;
337 Hi
:= Source_File
.Table
(Sfile
).Last_Source_Line
;
340 Mid
:= (Lo
+ Hi
) / 2;
342 if Loc
< Table
(Mid
) then
345 else -- Loc >= Table (Mid)
348 Loc
< Table
(Mid
+ 1)
359 end Get_Physical_Line_Number
;
361 ---------------------------
362 -- Get_Source_File_Index --
363 ---------------------------
365 Source_Cache_First
: Source_Ptr
:= 1;
366 Source_Cache_Last
: Source_Ptr
:= 0;
367 -- Records the First and Last subscript values for the most recently
368 -- referenced entry in the source table, to optimize the common case
369 -- of repeated references to the same entry. The initial values force
370 -- an initial search to set the cache value.
372 Source_Cache_Index
: Source_File_Index
:= No_Source_File
;
373 -- Contains the index of the entry corresponding to Source_Cache
375 function Get_Source_File_Index
377 return Source_File_Index
380 if S
in Source_Cache_First
.. Source_Cache_Last
then
381 return Source_Cache_Index
;
384 for J
in 1 .. Source_File
.Last
loop
385 if S
in Source_File
.Table
(J
).Source_First
..
386 Source_File
.Table
(J
).Source_Last
388 Source_Cache_Index
:= J
;
389 Source_Cache_First
:=
390 Source_File
.Table
(Source_Cache_Index
).Source_First
;
392 Source_File
.Table
(Source_Cache_Index
).Source_Last
;
393 return Source_Cache_Index
;
398 -- We must find a matching entry in the above loop!
401 end Get_Source_File_Index
;
407 procedure Initialize
is
412 -------------------------
413 -- Instantiation_Depth --
414 -------------------------
416 function Instantiation_Depth
(S
: Source_Ptr
) return Nat
is
417 Sind
: Source_File_Index
;
426 Sind
:= Get_Source_File_Index
(Sval
);
427 Sval
:= Instantiation
(Sind
);
428 exit when Sval
= No_Location
;
433 end Instantiation_Depth
;
435 ----------------------------
436 -- Instantiation_Location --
437 ----------------------------
439 function Instantiation_Location
(S
: Source_Ptr
) return Source_Ptr
is
441 return Instantiation
(Get_Source_File_Index
(S
));
442 end Instantiation_Location
;
444 ----------------------
445 -- Last_Source_File --
446 ----------------------
448 function Last_Source_File
return Source_File_Index
is
450 return Source_File
.Last
;
451 end Last_Source_File
;
457 function Line_Start
(P
: Source_Ptr
) return Source_Ptr
is
458 Sindex
: constant Source_File_Index
:= Get_Source_File_Index
(P
);
459 Src
: constant Source_Buffer_Ptr
:=
460 Source_File
.Table
(Sindex
).Source_Text
;
461 Sfirst
: constant Source_Ptr
:=
462 Source_File
.Table
(Sindex
).Source_First
;
469 and then Src
(S
- 1) /= CR
470 and then Src
(S
- 1) /= LF
479 (L
: Physical_Line_Number
;
480 S
: Source_File_Index
)
484 return Source_File
.Table
(S
).Lines_Table
(L
);
493 Source_File
.Locked
:= True;
497 ----------------------
498 -- Num_Source_Files --
499 ----------------------
501 function Num_Source_Files
return Nat
is
503 return Int
(Source_File
.Last
) - Int
(Source_File
.First
) + 1;
504 end Num_Source_Files
;
506 ----------------------
507 -- Num_Source_Lines --
508 ----------------------
510 function Num_Source_Lines
(S
: Source_File_Index
) return Nat
is
512 return Nat
(Source_File
.Table
(S
).Last_Source_Line
);
513 end Num_Source_Lines
;
515 -----------------------
516 -- Original_Location --
517 -----------------------
519 function Original_Location
(S
: Source_Ptr
) return Source_Ptr
is
520 Sindex
: Source_File_Index
;
521 Tindex
: Source_File_Index
;
524 if S
<= No_Location
then
528 Sindex
:= Get_Source_File_Index
(S
);
530 if Instantiation
(Sindex
) = No_Location
then
534 Tindex
:= Template
(Sindex
);
535 while Instantiation
(Tindex
) /= No_Location
loop
536 Tindex
:= Template
(Tindex
);
539 return S
- Source_First
(Sindex
) + Source_First
(Tindex
);
542 end Original_Location
;
544 -------------------------
545 -- Physical_To_Logical --
546 -------------------------
548 function Physical_To_Logical
549 (Line
: Physical_Line_Number
;
550 S
: Source_File_Index
)
551 return Logical_Line_Number
553 SFR
: Source_File_Record
renames Source_File
.Table
(S
);
556 if SFR
.Num_SRef_Pragmas
= 0 then
557 return Logical_Line_Number
(Line
);
559 return SFR
.Logical_Lines_Table
(Line
);
561 end Physical_To_Logical
;
563 --------------------------------
564 -- Register_Source_Ref_Pragma --
565 --------------------------------
567 procedure Register_Source_Ref_Pragma
568 (File_Name
: Name_Id
;
569 Stripped_File_Name
: Name_Id
;
571 Line_After_Pragma
: Physical_Line_Number
)
573 SFR
: Source_File_Record
renames Source_File
.Table
(Current_Source_File
);
577 return Logical_Lines_Table_Ptr
;
578 pragma Import
(C
, malloc
);
580 ML
: Logical_Line_Number
;
583 if File_Name
/= No_Name
then
584 SFR
.Full_Ref_Name
:= File_Name
;
586 if not Debug_Generated_Code
then
587 SFR
.Debug_Source_Name
:= File_Name
;
590 SFR
.Reference_Name
:= Stripped_File_Name
;
591 SFR
.Num_SRef_Pragmas
:= SFR
.Num_SRef_Pragmas
+ 1;
594 if SFR
.Num_SRef_Pragmas
= 1 then
595 SFR
.First_Mapped_Line
:= Logical_Line_Number
(Mapped_Line
);
598 if SFR
.Logical_Lines_Table
= null then
599 SFR
.Logical_Lines_Table
:=
601 (size_t
(SFR
.Lines_Table_Max
*
602 Logical_Lines_Table_Type
'Component_Size /
606 SFR
.Logical_Lines_Table
(Line_After_Pragma
- 1) := No_Line_Number
;
608 ML
:= Logical_Line_Number
(Mapped_Line
);
609 for J
in Line_After_Pragma
.. SFR
.Last_Source_Line
loop
610 SFR
.Logical_Lines_Table
(J
) := ML
;
613 end Register_Source_Ref_Pragma
;
615 ---------------------------
616 -- Skip_Line_Terminators --
617 ---------------------------
619 -- There are two distinct concepts of line terminator in GNAT
621 -- A logical line terminator is what corresponds to the "end of a line"
622 -- as described in RM 2.2 (13). Any of the characters FF, LF, CR or VT
623 -- acts as an end of logical line in this sense, and it is essentially
624 -- irrelevant whether one or more appears in sequence (since if a
625 -- sequence of such characters is regarded as separate ends of line,
626 -- then the intervening logical lines are null in any case).
628 -- A physical line terminator is a sequence of format effectors that
629 -- is treated as ending a physical line. Physical lines have no Ada
630 -- semantic significance, but they are significant for error reporting
631 -- purposes, since errors are identified by line and column location.
633 -- In GNAT, a physical line is ended by any of the sequences LF, CR/LF,
634 -- CR or LF/CR. LF is used in typical Unix systems, CR/LF in DOS systems,
635 -- and CR alone in System 7. We don't know of any system using LF/CR, but
636 -- it seems reasonable to include this case for consistency. In addition,
637 -- we recognize any of these sequences in any of the operating systems,
638 -- for better behavior in treating foreign files (e.g. a Unix file with
639 -- LF terminators transferred to a DOS system).
641 procedure Skip_Line_Terminators
642 (P
: in out Source_Ptr
;
643 Physical
: out Boolean)
646 pragma Assert
(Source
(P
) in Line_Terminator
);
648 if Source
(P
) = CR
then
649 if Source
(P
+ 1) = LF
then
655 elsif Source
(P
) = LF
then
656 if Source
(P
+ 1) = CR
then
662 else -- Source (P) = FF or else Source (P) = VT
668 -- Fall through in the physical line terminator case. First deal with
669 -- making a possible entry into the lines table if one is needed.
671 -- Note: we are dealing with a real source file here, this cannot be
672 -- the instantiation case, so we need not worry about Sloc adjustment.
675 S
: Source_File_Record
676 renames Source_File
.Table
(Current_Source_File
);
681 -- Make entry in lines table if not already made (in some scan backup
682 -- cases, we will be rescanning previously scanned source, so the
683 -- entry may have already been made on the previous forward scan).
686 and then P
> S
.Lines_Table
(S
.Last_Source_Line
)
688 Add_Line_Tables_Entry
(S
, P
);
691 end Skip_Line_Terminators
;
697 function Source_Offset
(S
: Source_Ptr
) return Nat
is
698 Sindex
: constant Source_File_Index
:= Get_Source_File_Index
(S
);
699 Sfirst
: constant Source_Ptr
:=
700 Source_File
.Table
(Sindex
).Source_First
;
703 return Nat
(S
- Sfirst
);
706 ------------------------
707 -- Top_Level_Location --
708 ------------------------
710 function Top_Level_Location
(S
: Source_Ptr
) return Source_Ptr
is
718 Newloc
:= Instantiation_Location
(Oldloc
);
719 exit when Newloc
= No_Location
;
723 end Top_Level_Location
;
729 procedure Tree_Read
is
731 -- First we must free any old source buffer pointers
733 if not First_Time_Around
then
734 for J
in Source_File
.First
.. Source_File
.Last
loop
736 S
: Source_File_Record
renames Source_File
.Table
(J
);
738 procedure Free_Ptr
is new Unchecked_Deallocation
739 (Big_Source_Buffer
, Source_Buffer_Ptr
);
741 -- Note: we are using free here, because we used malloc
742 -- or realloc directly to allocate the tables. That is
743 -- because we were playing the big array trick.
745 procedure free
(X
: Lines_Table_Ptr
);
746 pragma Import
(C
, free
, "free");
748 procedure freel
(X
: Logical_Lines_Table_Ptr
);
749 pragma Import
(C
, freel
, "free");
751 function To_Source_Buffer_Ptr
is new
752 Unchecked_Conversion
(Address
, Source_Buffer_Ptr
);
754 Tmp1
: Source_Buffer_Ptr
;
757 if S
.Instantiation
/= No_Location
then
761 -- We have to recreate a proper pointer to the actual array
762 -- from the zero origin pointer stored in the source table.
766 (S
.Source_Text
(S
.Source_First
)'Address);
769 if S
.Lines_Table
/= null then
770 free
(S
.Lines_Table
);
771 S
.Lines_Table
:= null;
774 if S
.Logical_Lines_Table
/= null then
775 freel
(S
.Logical_Lines_Table
);
776 S
.Logical_Lines_Table
:= null;
783 -- Reset source cache pointers to force new read
785 Source_Cache_First
:= 1;
786 Source_Cache_Last
:= 0;
788 -- Read in source file table
790 Source_File
.Tree_Read
;
792 -- The pointers we read in there for the source buffer and lines
793 -- table pointers are junk. We now read in the actual data that
794 -- is referenced by these two fields.
796 for J
in Source_File
.First
.. Source_File
.Last
loop
798 S
: Source_File_Record
renames Source_File
.Table
(J
);
801 -- For the instantiation case, we do not read in any data. Instead
802 -- we share the data for the generic template entry. Since the
803 -- template always occurs first, we can safetly refer to its data.
805 if S
.Instantiation
/= No_Location
then
807 ST
: Source_File_Record
renames
808 Source_File
.Table
(S
.Template
);
811 -- The lines tables are copied from the template entry
814 Source_File
.Table
(S
.Template
).Lines_Table
;
815 S
.Logical_Lines_Table
:=
816 Source_File
.Table
(S
.Template
).Logical_Lines_Table
;
818 -- In the case of the source table pointer, we share the
819 -- same data as the generic template, but the virtual origin
820 -- is adjusted. For example, if the first subscript of the
821 -- template is 100, and that of the instantiation is 200,
822 -- then the instantiation pointer is obtained by subtracting
823 -- 100 from the template pointer.
826 pragma Suppress
(All_Checks
);
828 function To_Source_Buffer_Ptr
is new
829 Unchecked_Conversion
(Address
, Source_Buffer_Ptr
);
835 (ST
.Source_First
- S
.Source_First
)'Address);
839 -- Normal case (non-instantiation)
842 First_Time_Around
:= False;
843 S
.Lines_Table
:= null;
844 S
.Logical_Lines_Table
:= null;
845 Alloc_Line_Tables
(S
, Int
(S
.Last_Source_Line
));
847 for J
in 1 .. S
.Last_Source_Line
loop
848 Tree_Read_Int
(Int
(S
.Lines_Table
(J
)));
851 if S
.Num_SRef_Pragmas
/= 0 then
852 for J
in 1 .. S
.Last_Source_Line
loop
853 Tree_Read_Int
(Int
(S
.Logical_Lines_Table
(J
)));
857 -- Allocate source buffer and read in the data and then set the
858 -- virtual origin to point to the logical zero'th element. This
859 -- address must be computed with subscript checks turned off.
862 subtype B
is Text_Buffer
(S
.Source_First
.. S
.Source_Last
);
863 type Text_Buffer_Ptr
is access B
;
866 pragma Suppress
(All_Checks
);
868 function To_Source_Buffer_Ptr
is new
869 Unchecked_Conversion
(Address
, Source_Buffer_Ptr
);
874 Tree_Read_Data
(T
(S
.Source_First
)'Address,
875 Int
(S
.Source_Last
) - Int
(S
.Source_First
) + 1);
877 S
.Source_Text
:= To_Source_Buffer_Ptr
(T
(0)'Address);
888 procedure Tree_Write
is
890 Source_File
.Tree_Write
;
892 -- The pointers we wrote out there for the source buffer and lines
893 -- table pointers are junk, we now write out the actual data that
894 -- is referenced by these two fields.
896 for J
in Source_File
.First
.. Source_File
.Last
loop
898 S
: Source_File_Record
renames Source_File
.Table
(J
);
901 -- For instantiations, there is nothing to do, since the data is
902 -- shared with the generic template. When the tree is read, the
903 -- pointers must be set, but no extra data needs to be written.
905 if S
.Instantiation
/= No_Location
then
908 -- For the normal case, write out the data of the tables
913 for J
in 1 .. S
.Last_Source_Line
loop
914 Tree_Write_Int
(Int
(S
.Lines_Table
(J
)));
917 -- Logical lines table if present
919 if S
.Num_SRef_Pragmas
/= 0 then
920 for J
in 1 .. S
.Last_Source_Line
loop
921 Tree_Write_Int
(Int
(S
.Logical_Lines_Table
(J
)));
928 (S
.Source_Text
(S
.Source_First
)'Address,
929 Int
(S
.Source_Last
) - Int
(S
.Source_First
) + 1);
939 procedure Write_Location
(P
: Source_Ptr
) is
941 if P
= No_Location
then
942 Write_Str
("<no location>");
944 elsif P
<= Standard_Location
then
945 Write_Str
("<standard location>");
949 SI
: constant Source_File_Index
:= Get_Source_File_Index
(P
);
952 Write_Name
(Debug_Source_Name
(SI
));
954 Write_Int
(Int
(Get_Logical_Line_Number
(P
)));
956 Write_Int
(Int
(Get_Column_Number
(P
)));
958 if Instantiation
(SI
) /= No_Location
then
960 Write_Location
(Instantiation
(SI
));
967 ----------------------
968 -- Write_Time_Stamp --
969 ----------------------
971 procedure Write_Time_Stamp
(S
: Source_File_Index
) is
972 T
: constant Time_Stamp_Type
:= Time_Stamp
(S
);
985 Write_Char
(T
(P
+ 1));
986 Write_Char
(T
(P
+ 2));
989 Write_Char
(T
(P
+ 3));
990 Write_Char
(T
(P
+ 4));
993 Write_Char
(T
(P
+ 5));
994 Write_Char
(T
(P
+ 6));
997 Write_Char
(T
(P
+ 7));
998 Write_Char
(T
(P
+ 8));
1001 Write_Char
(T
(P
+ 9));
1002 Write_Char
(T
(P
+ 10));
1005 Write_Char
(T
(P
+ 11));
1006 Write_Char
(T
(P
+ 12));
1007 end Write_Time_Stamp
;
1009 ----------------------------------------------
1010 -- Access Subprograms for Source File Table --
1011 ----------------------------------------------
1013 function Debug_Source_Name
(S
: SFI
) return File_Name_Type
is
1015 return Source_File
.Table
(S
).Debug_Source_Name
;
1016 end Debug_Source_Name
;
1018 function File_Name
(S
: SFI
) return File_Name_Type
is
1020 return Source_File
.Table
(S
).File_Name
;
1023 function First_Mapped_Line
(S
: SFI
) return Logical_Line_Number
is
1025 return Source_File
.Table
(S
).First_Mapped_Line
;
1026 end First_Mapped_Line
;
1028 function Full_File_Name
(S
: SFI
) return File_Name_Type
is
1030 return Source_File
.Table
(S
).Full_File_Name
;
1033 function Full_Ref_Name
(S
: SFI
) return File_Name_Type
is
1035 return Source_File
.Table
(S
).Full_Ref_Name
;
1038 function Identifier_Casing
(S
: SFI
) return Casing_Type
is
1040 return Source_File
.Table
(S
).Identifier_Casing
;
1041 end Identifier_Casing
;
1043 function Instantiation
(S
: SFI
) return Source_Ptr
is
1045 return Source_File
.Table
(S
).Instantiation
;
1048 function Keyword_Casing
(S
: SFI
) return Casing_Type
is
1050 return Source_File
.Table
(S
).Keyword_Casing
;
1053 function Last_Source_Line
(S
: SFI
) return Physical_Line_Number
is
1055 return Source_File
.Table
(S
).Last_Source_Line
;
1056 end Last_Source_Line
;
1058 function License
(S
: SFI
) return License_Type
is
1060 return Source_File
.Table
(S
).License
;
1063 function Num_SRef_Pragmas
(S
: SFI
) return Nat
is
1065 return Source_File
.Table
(S
).Num_SRef_Pragmas
;
1066 end Num_SRef_Pragmas
;
1068 function Reference_Name
(S
: SFI
) return File_Name_Type
is
1070 return Source_File
.Table
(S
).Reference_Name
;
1073 function Source_Checksum
(S
: SFI
) return Word
is
1075 return Source_File
.Table
(S
).Source_Checksum
;
1076 end Source_Checksum
;
1078 function Source_First
(S
: SFI
) return Source_Ptr
is
1080 return Source_File
.Table
(S
).Source_First
;
1083 function Source_Last
(S
: SFI
) return Source_Ptr
is
1085 return Source_File
.Table
(S
).Source_Last
;
1088 function Source_Text
(S
: SFI
) return Source_Buffer_Ptr
is
1090 return Source_File
.Table
(S
).Source_Text
;
1093 function Template
(S
: SFI
) return SFI
is
1095 return Source_File
.Table
(S
).Template
;
1098 function Time_Stamp
(S
: SFI
) return Time_Stamp_Type
is
1100 return Source_File
.Table
(S
).Time_Stamp
;
1103 ------------------------------------------
1104 -- Set Procedures for Source File Table --
1105 ------------------------------------------
1107 procedure Set_Identifier_Casing
(S
: SFI
; C
: Casing_Type
) is
1109 Source_File
.Table
(S
).Identifier_Casing
:= C
;
1110 end Set_Identifier_Casing
;
1112 procedure Set_Keyword_Casing
(S
: SFI
; C
: Casing_Type
) is
1114 Source_File
.Table
(S
).Keyword_Casing
:= C
;
1115 end Set_Keyword_Casing
;
1117 procedure Set_License
(S
: SFI
; L
: License_Type
) is
1119 Source_File
.Table
(S
).License
:= L
;
1126 procedure wl
(P
: Source_Ptr
) is