-- --
-- B o d y --
-- --
--- $Revision: 1.33 $
--- --
--- Copyright (C) 1992-2001 Free Software Foundation, Inc.
+-- Copyright (C) 1992-2003 Free Software Foundation, 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- --
-- MA 02111-1307, USA. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
--- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
Prefix : VString := Nul;
S : VString := Nul;
S1 : VString := Nul;
- Sinforev : VString := Nul;
Syn : VString := Nul;
Synonym : VString := Nul;
- Temprev : VString := Nul;
Term : VString := Nul;
- Treeprsrev : VString := Nul;
OutS : File_Type;
-- Output file
wsp : Pattern := Span (' ' & ASCII.HT);
- Get_SRev : Pattern := BreakX ('$') & "$Rev" & "ision: "
- & Break (' ') * Sinforev;
- Get_TRev : Pattern := BreakX ('$') & "$Rev" & "ision: "
- & Break (' ') * Temprev;
Is_Temp : Pattern := BreakX ('T') * A & "T e m p l a t e";
Get_Node : Pattern := wsp & "-- N_" & Rest * Node;
Tst_Punc : Pattern := Break (" ,.");
begin
Anchored_Mode := True;
- Match ("$Revision: 1.33 $", "$Rev" & "ision: " & Break (' ') * Treeprsrev);
-
if Argument_Count > 0 then
Create (OutS, Out_File, Argument (1));
else
Set (Special, "Raises_Constraint_Error", True);
Set (Special, "Right_Opnd", True);
- -- Get sinfo revs and write header to output file
-
- loop
- Line := Get_Line (InS);
- Lineno := Lineno + 1;
-
- if Line = "" then
- raise Err;
- end if;
-
- exit when Match (Line, Get_SRev);
- end loop;
-
-- Read template header and generate new header
loop
Line := Get_Line (InT);
- if Match (Line, Get_TRev) then
- Put_Line
- (OutS,
- "-- Generated by xtreeprs revision " &
- Treeprsrev & " using --");
+ -- Skip lines describing the template
- Put_Line
- (OutS,
- "-- sinfo.ads revision " &
- Sinforev & " --");
-
- Put_Line
- (OutS,
- "-- treeprs.adt revision "
- & Temprev & " --");
-
- else
- -- Skip lines describing the template
-
- if Match (Line, "-- This file is a template") then
- loop
- Line := Get_Line (InT);
- exit when Line = "";
- end loop;
- end if;
-
- exit when Match (Line, "package");
+ if Match (Line, "-- This file is a template") then
+ loop
+ Line := Get_Line (InT);
+ exit when Line = "";
+ end loop;
+ end if;
- if Match (Line, Is_Temp, M) then
- Replace (M, A & " S p e c ");
- end if;
+ exit when Match (Line, "package");
- Put_Line (OutS, Line);
+ if Match (Line, Is_Temp, M) then
+ Replace (M, A & " S p e c ");
end if;
+
+ Put_Line (OutS, Line);
end loop;
Put_Line (OutS, Line);