-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, 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- --
with GNAT.Spitbol; use GNAT.Spitbol;
with GNAT.Spitbol.Patterns; use GNAT.Spitbol.Patterns;
+with XUtil;
+
procedure XNmake is
Err : exception;
-- Raised to terminate execution
- A : VString := Nul;
- Arg : VString := Nul;
- Arg_List : VString := Nul;
- Comment : VString := Nul;
- Default : VString := Nul;
- Field : VString := Nul;
- Line : VString := Nul;
- Node : VString := Nul;
- Op_Name : VString := Nul;
- Prevl : VString := Nul;
- Synonym : VString := Nul;
- X : VString := Nul;
+ A : VString := Nul;
+ Arg : VString := Nul;
+ Arg_List : VString := Nul;
+ Comment : VString := Nul;
+ Default : VString := Nul;
+ Field : VString := Nul;
+ Line : VString := Nul;
+ Node : VString := Nul;
+ Op_Name : VString := Nul;
+ Prevl : VString := Nul;
+ Synonym : VString := Nul;
+ X : VString := Nul;
NWidth : Natural;
InS, InT : Ada.Text_IO.File_Type;
OutS, OutB : Sfile;
- wsp : Pattern := Span (' ' & ASCII.HT);
+ wsp : constant Pattern := Span (' ' & ASCII.HT);
- Body_Only : Pattern := BreakX (' ') * X & Span (' ') & "-- body only";
- Spec_Only : Pattern := BreakX (' ') * X & Span (' ') & "-- spec only";
+ Body_Only : constant Pattern := BreakX (' ') * X
+ & Span (' ') & "-- body only";
+ Spec_Only : constant Pattern := BreakX (' ') * X
+ & Span (' ') & "-- spec only";
- Node_Hdr : Pattern := wsp & "-- N_" & Rest * Node;
- Punc : Pattern := BreakX (" .,");
+ Node_Hdr : constant Pattern := wsp & "-- N_" & Rest * Node;
+ Punc : constant Pattern := BreakX (" .,");
- Binop : Pattern := wsp & "-- plus fields for binary operator";
- Unop : Pattern := wsp & "-- plus fields for unary operator";
- Syn : Pattern := wsp & "-- " & Break (' ') * Synonym
- & " (" & Break (')') * Field & Rest * Comment;
+ Binop : constant Pattern := wsp
+ & "-- plus fields for binary operator";
+ Unop : constant Pattern := wsp
+ & "-- plus fields for unary operator";
+ Syn : constant Pattern := wsp & "-- " & Break (' ') * Synonym
+ & " (" & Break (')') * Field
+ & Rest * Comment;
- Templ : Pattern := BreakX ('T') * A & "T e m p l a t e";
- Spec : Pattern := BreakX ('S') * A & "S p e c";
+ Templ : constant Pattern := BreakX ('T') * A & "T e m p l a t e";
+ Spec : constant Pattern := BreakX ('S') * A & "S p e c";
- Sem_Field : Pattern := BreakX ('-') & "-Sem";
- Lib_Field : Pattern := BreakX ('-') & "-Lib";
+ Sem_Field : constant Pattern := BreakX ('-') & "-Sem";
+ Lib_Field : constant Pattern := BreakX ('-') & "-Lib";
- Get_Field : Pattern := BreakX (Decimal_Digit_Set) * Field;
+ Get_Field : constant Pattern := BreakX (Decimal_Digit_Set) * Field;
- Get_Dflt : Pattern := BreakX ('(') & "(set to "
- & Break (" ") * Default & " if";
+ Get_Dflt : constant Pattern := BreakX ('(') & "(set to "
+ & Break (" ") * Default & " if";
- Next_Arg : Pattern := Break (',') * Arg & ',';
+ Next_Arg : constant Pattern := Break (',') * Arg & ',';
- Op_Node : Pattern := "Op_" & Rest * Op_Name;
+ Op_Node : constant Pattern := "Op_" & Rest * Op_Name;
- Shft_Rot : Pattern := "Shift_" or "Rotate_";
+ Shft_Rot : constant Pattern := "Shift_" or "Rotate_";
- No_Ent : Pattern := "Or_Else" or "And_Then" or "In" or "Not_In";
+ No_Ent : constant Pattern := "Or_Else" or "And_Then"
+ or "In" or "Not_In";
M : Match_Result;
V_Elist_Id : constant VString := V ("Elist_Id");
V_Boolean : constant VString := V ("Boolean");
- procedure Put_Line (F : Sfile; S : String);
- procedure Put_Line (F : Sfile; S : VString);
+ procedure Put_Line (F : Sfile; S : String) renames XUtil.Put_Line;
+ procedure Put_Line (F : Sfile; S : VString) renames XUtil.Put_Line;
-- Local version of Put_Line ensures Unix style line endings
procedure WriteS (S : String);
end if;
end WriteS;
- procedure Put_Line (F : Sfile; S : String) is
- begin
- String'Write (Stream (F), S);
- Character'Write (Stream (F), ASCII.LF);
- end Put_Line;
-
- procedure Put_Line (F : Sfile; S : VString) is
- begin
- Put_Line (F, To_String (S));
- end Put_Line;
-
-- Start of processing for XNmake
begin