1
-------------------------------------------------------------------------------
3
-- This file is part of AdaBrowse.
5
-- <STRONG>Copyright (c) 2002 by Thomas Wolf.</STRONG>
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,
21
-- Author:</STRONG><DD>
23
-- <ADDRESS><A HREF="mailto:twolf@acm.org">twolf@acm.org</A></ADDRESS></DL>
26
-- Purpose:</STRONG><DD>
27
-- Handling of the -f parameter value.</DL>
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.
37
-------------------------------------------------------------------------------
43
package AD.Parameters is
45
Input_Error : exception;
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.
57
-- In both cases, a possible path or suffix in the unit name are ignored.
59
-- Raises @Input_Error@ in the first case if the file cannot be opened, or
60
-- doesn't contain a unit name at all.
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.
67
function Advance_Input
69
-- Returns True if there is a next input unit (and makes it the current
70
-- input unit), False if not.
74
-- Returns True if the input unit names come from a file.
77
-- If input comes from a file, close that file if it is open (and not
82
-- Returns the current source file name, including suffix, but without
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.
91
procedure Set_Unit_Name
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'.
98
-- If the current input name contained a path, it is returned here.