diff options
author | Emmanuel Briot <briot@adacore.com> | 2009-07-13 09:50:58 +0000 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2009-07-13 11:50:58 +0200 |
commit | 32404665670241aa41589352c2fb9805f5aac4c6 (patch) | |
tree | bdefab7fc895960f09b6dd991c164a52f489ac1c /gcc/ada/prj.ads | |
parent | 959dd7d8a085ca0f7bab2d37069559e98e63ebc1 (diff) | |
download | gcc-32404665670241aa41589352c2fb9805f5aac4c6.zip gcc-32404665670241aa41589352c2fb9805f5aac4c6.tar.gz gcc-32404665670241aa41589352c2fb9805f5aac4c6.tar.bz2 |
gnatcmd.adb, [...]: Minor reformatting.
2009-07-13 Emmanuel Briot <briot@adacore.com>
* gnatcmd.adb, prj-proc.adb, prj-proc.ads, make.adb, prj-part.adb,
prj.adb, prj.ads, clean.adb, prj-nmsc.adb, prj-nmsc.ads, prj-pars.adb,
prj-pars.ads, prj-conf.adb, prj-conf.ads, prj-env.adb, prj-tree.adb,
prj-tree.ads: Minor reformatting.
(Processing_Flags): new record to encapsulate the set of common
parameters to several subprograms in the project manager.
(Prj.Nmsc.Process_Naming_Scheme): renames Check, and moved to body
Remove the need for the Current_Dir parameter in subprograms.
(Look_For_Sources): minor refactoring, now that we no longer need to
share subprograms between the two Ada_Only and Multi_Language modes
(Processing_Flags): New field Error_On_Unknown_Language.
Merge tests for library project between gnatmake and gprbuild.
From-SVN: r149563
Diffstat (limited to 'gcc/ada/prj.ads')
-rw-r--r-- | gcc/ada/prj.ads | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/gcc/ada/prj.ads b/gcc/ada/prj.ads index bf6b03b..72193ca 100644 --- a/gcc/ada/prj.ads +++ b/gcc/ada/prj.ads @@ -1342,6 +1342,42 @@ package Prj is -- This procedure resets all the tables that are used when processing a -- project file tree. Initialize must be called before the call to Reset. + type Processing_Flags is private; + -- Flags used while parsing and processing a project tree. + -- These configure various behavior in the parser, as well as indicate how + -- to report error messages. + -- This structure does not allocate memory and never needs to be freed + + function Create_Flags + (Report_Error : Put_Line_Access; + When_No_Sources : Error_Warning; + Require_Sources_Other_Lang : Boolean := True; + Allow_Duplicate_Basenames : Boolean := True; + Compiler_Driver_Mandatory : Boolean := False; + Error_On_Unknown_Language : Boolean := True) + return Processing_Flags; + -- If Allow_Duplicate_Basenames, then files with the same base names are + -- authorized within a project for source-based languages (never for unit + -- based languages) + -- If Compiler_Driver_Mandatory is true, then a Compiler.Driver attribute + -- for each language must be defined, or we will not look for its source + -- files. + -- When_No_Sources indicates what should be done when no sources of a + -- language are found in a project where this language is declared. + -- If Require_Sources_Other_Lang is true, then all languages must have at + -- least one source file, or an error is reported via When_No_Sources. If + -- it is false, this is only required for Ada (and only if it is a language + -- of the project). + -- If Report_Error is null, use the standard error reporting mechanism + -- (Errout). Otherwise, report errors using Report_Error. + -- If Error_On_Unknown_Language is true, an error is displayed if some of + -- the source files listed in the project do not match any naming scheme + + Gprbuild_Flags : constant Processing_Flags; + Gnatmake_Flags : constant Processing_Flags; + -- Flags used by the various tools. They all display the error messages + -- through Prj.Err + package Project_Boolean_Htable is new Simple_HTable (Header_Num => Header_Num, Element => Boolean, @@ -1517,4 +1553,29 @@ private -- Type to represent the part of a project tree which is private to the -- Project Manager. + type Processing_Flags is record + Require_Sources_Other_Lang : Boolean; + Report_Error : Put_Line_Access; + When_No_Sources : Error_Warning; + Allow_Duplicate_Basenames : Boolean; + Compiler_Driver_Mandatory : Boolean; + Error_On_Unknown_Language : Boolean; + end record; + + Gprbuild_Flags : constant Processing_Flags := + (Report_Error => null, + When_No_Sources => Warning, + Require_Sources_Other_Lang => True, + Allow_Duplicate_Basenames => False, + Compiler_Driver_Mandatory => True, + Error_On_Unknown_Language => True); + + Gnatmake_Flags : constant Processing_Flags := + (Report_Error => null, + When_No_Sources => Error, + Require_Sources_Other_Lang => False, + Allow_Duplicate_Basenames => False, + Compiler_Driver_Mandatory => False, + Error_On_Unknown_Language => False); + end Prj; |