~ubuntu-branches/debian/stretch/adabrowse/stretch

« back to all changes in this revision

Viewing changes to ad-parameters.ads

  • Committer: Bazaar Package Importer
  • Author(s): Ludovic Brenta
  • Date: 2004-02-14 13:22:40 UTC
  • Revision ID: james.westby@ubuntu.com-20040214132240-cqumhiq1677pkvzo
Tags: upstream-4.0.2
ImportĀ upstreamĀ versionĀ 4.0.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
-------------------------------------------------------------------------------
 
2
--
 
3
--  This file is part of AdaBrowse.
 
4
--
 
5
-- <STRONG>Copyright (c) 2002 by Thomas Wolf.</STRONG>
 
6
-- <BLOCKQUOTE>
 
7
--    AdaBrowse is free software; you can redistribute it and/or modify it
 
8
--    under the terms of the  GNU General Public License as published by the
 
9
--    Free Software  Foundation; either version 2, or (at your option) any
 
10
--    later version. AdaBrowse is distributed in the hope that it will be
 
11
--    useful, but <EM>without any warranty</EM>; without even the implied
 
12
--    warranty of <EM>merchantability or fitness for a particular purpose.</EM>
 
13
--    See the GNU General Public License for  more details. You should have
 
14
--    received a copy of the GNU General Public License with this distribution,
 
15
--    see file "<A HREF="GPL.txt">GPL.txt</A>". If not, write to the Free
 
16
--    Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 
17
--    USA.
 
18
-- </BLOCKQUOTE>
 
19
--
 
20
-- <DL><DT><STRONG>
 
21
-- Author:</STRONG><DD>
 
22
--   Thomas Wolf  (TW)
 
23
--   <ADDRESS><A HREF="mailto:twolf@acm.org">twolf@acm.org</A></ADDRESS></DL>
 
24
--
 
25
-- <DL><DT><STRONG>
 
26
-- Purpose:</STRONG><DD>
 
27
--   Handling of the -f parameter value.</DL>
 
28
--
 
29
-- <!--
 
30
-- Revision History
 
31
--
 
32
--   02-FEB-2002   TW  First release.
 
33
--   13-MAR-2002   TW  Changed to support -f @filename.
 
34
--   26-MAR-2002   TW  Added 'Set_Unit_Name': support for krunched file names.
 
35
--   08-JUN-2003   TW  Added 'Set_Input' with a file access.
 
36
-- -->
 
37
-------------------------------------------------------------------------------
 
38
 
 
39
pragma License (GPL);
 
40
 
 
41
with Ada.Text_IO;
 
42
 
 
43
package AD.Parameters is
 
44
 
 
45
   Input_Error : exception;
 
46
 
 
47
   procedure Save_Input;
 
48
 
 
49
   procedure Set_Input
 
50
     (File_Name : in String);
 
51
   --  If 'File_Name' starts with '@', assumes it to be a file containing the
 
52
   --  units, opens the file and set the current input unit to the first one
 
53
   --  found in the file. If the File_Name is "@-" or just "-", reads the
 
54
   --  input units from stdin. Otherwise, assumes 'File_Name' to be the name of
 
55
   --  of the unit to process.
 
56
   --
 
57
   --  In both cases, a possible path or suffix in the unit name are ignored.
 
58
   --
 
59
   --  Raises @Input_Error@ in the first case if the file cannot be opened, or
 
60
   --  doesn't contain a unit name at all.
 
61
 
 
62
   procedure Set_Input
 
63
     (File : in Ada.Text_IO.File_Access);
 
64
   --  Set input to come from @File@. The file will not be closed upon @Close@!
 
65
   --  Raises @Input_Error@ if the file does not contain a unit name.
 
66
 
 
67
   function Advance_Input
 
68
     return Boolean;
 
69
   --  Returns True if there is a next input unit (and makes it the current
 
70
   --  input unit), False if not.
 
71
 
 
72
   function Is_File
 
73
     return Boolean;
 
74
   --  Returns True if the input unit names come from a file.
 
75
 
 
76
   procedure Close;
 
77
   --  If input comes from a file, close that file if it is open (and not
 
78
   --  stdin).
 
79
 
 
80
   function Source_Name
 
81
     return String;
 
82
   --  Returns the current source file name, including suffix, but without
 
83
   --  path.
 
84
 
 
85
   function Unit_Name
 
86
     return String;
 
87
   --  Returns the source name of the current input with all '-' replaced
 
88
   --  by '.', and without suffix. If @Set_Unit_Name@ has been called,
 
89
   --  returns whatever was set there.
 
90
 
 
91
   procedure Set_Unit_Name
 
92
     (Name : in String);
 
93
   --  If we've figured out that a file 'x' contains a unit named 'y', and 'y'
 
94
   --  cannot be derived from 'x', we force the unit name to 'y'.
 
95
 
 
96
   function Path
 
97
     return String;
 
98
   --  If the current input name contained a path, it is returned here.
 
99
 
 
100
end AD.Parameters;