1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
9 -- Copyright (C) 2001-2009, Free Software Foundation, Inc. --
11 -- GNAT is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 3, or (at your option) any later ver- --
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
17 -- for more details. You should have received a copy of the GNU General --
18 -- Public License distributed with GNAT; see file COPYING3. If not, go to --
19 -- http://www.gnu.org/licenses for a complete copy of the license. --
21 -- GNAT was originally developed by the GNAT team at New York University. --
22 -- Extensive contributions were provided by Ada Core Technologies Inc. --
24 ------------------------------------------------------------------------------
26 -- Support for procedure Gnatname
28 -- For arbitrary naming schemes, create or update a project file, or create a
29 -- configuration pragmas file.
31 with System
.Regexp
; use System
.Regexp
;
37 Project_File
: Boolean;
38 Preproc_Switches
: Argument_List
;
39 Very_Verbose
: Boolean;
40 Flags
: Processing_Flags
);
41 -- Start the creation of a configuration pragmas file or the creation or
42 -- modification of a project file, for gnatname.
44 -- When Project_File is False, File_Path is the name of a configuration
45 -- pragmas file to create. When Project_File is True, File_Path is the name
46 -- of a project file to create if it does not exist or to modify if it
49 -- Preproc_Switches is a list of switches to be used when invoking the
50 -- compiler to get the name and kind of unit of a source file.
52 -- Very_Verbose controls the verbosity of the output, in conjunction with
55 type Regexp_List
is array (Positive range <>) of Regexp
;
58 (Directories
: Argument_List
;
59 Name_Patterns
: Regexp_List
;
60 Excluded_Patterns
: Regexp_List
;
61 Foreign_Patterns
: Regexp_List
);
62 -- Look for source files in the specified directories, with the specified
65 -- Directories is the list of source directories where to look for sources.
67 -- Name_Patterns is a potentially empty list of file name patterns to check
70 -- Excluded_Patterns is a potentially empty list of file name patterns that
71 -- should not be checked for Ada or non Ada sources.
73 -- Foreign_Patterns is a potentially empty list of file name patterns to
74 -- check for non Ada sources.
76 -- At least one of Name_Patterns and Foreign_Patterns is not empty
78 -- Note that this procedure currently assumes that it is only used by
79 -- gnatname. If other processes start using it, then an additional
80 -- parameter would need to be added, and call to Osint.Program_Name
81 -- updated accordingly in the body.
84 -- Write the configuration pragmas file or the project file indicated in a
85 -- call to procedure Initialize, after one or several calls to procedure