2011-08-03 Emmanuel Briot <briot@adacore.com>
+ * gnatcmd.adb, prj-proc.adb, prj-proc.ads, make.adb, prj-part.adb,
+ prj-part.ads, switch-m.adb, switch-m.ads, prj-makr.adb, clean.adb,
+ prj-pars.adb, prj-pars.ads, prj-conf.adb, prj-conf.ads, prj-tree.adb,
+ prj-tree.ads (Prj.Tree.Environment): new type.
+
+2011-08-03 Emmanuel Briot <briot@adacore.com>
+
* prj-proc.adb, prj.ads, makeutl.adb, makeutl.ads, prj-conf.adb,
prj-tree.adb, prj-tree.ads (Environment): new type.
Project_Node_Tree : Project_Node_Tree_Ref;
+ Root_Environment : Prj.Tree.Environment;
+
Main_Project : Prj.Project_Id := Prj.No_Project;
All_Projects : Boolean := False;
-- Parse the project file. If there is an error, Main_Project
-- will still be No_Project.
- Prj.Env.Initialize_Default_Project_Path
- (Project_Node_Tree.Project_Path, Target_Name => "");
-
Prj.Pars.Parse
(Project => Main_Project,
In_Tree => Project_Tree,
In_Node_Tree => Project_Node_Tree,
Project_File_Name => Project_File_Name.all,
- Flags => Gnatmake_Flags,
+ Env => Root_Environment,
Packages_To_Check => Packages_To_Check_By_Gnatmake);
if Main_Project = No_Project then
Csets.Initialize;
Snames.Initialize;
+ Prj.Tree.Initialize (Root_Environment, Gnatmake_Flags);
+ Prj.Env.Initialize_Default_Project_Path
+ (Root_Environment.Project_Path, Target_Name => "");
+
Project_Node_Tree := new Project_Node_Tree_Data;
Prj.Tree.Initialize (Project_Node_Tree);
elsif Arg (3) = 'P' then
Prj.Env.Add_Directories
- (Project_Node_Tree.Project_Path,
+ (Root_Environment.Project_Path,
Arg (4 .. Arg'Last));
else
Ext_Asgn : constant String := Arg (3 .. Arg'Last);
Start : Positive := Ext_Asgn'First;
Stop : Natural := Ext_Asgn'Last;
- Equal_Pos : Natural;
OK : Boolean := True;
begin
end if;
end if;
- Equal_Pos := Start;
-
- while Equal_Pos <= Stop
- and then Ext_Asgn (Equal_Pos) /= '='
- loop
- Equal_Pos := Equal_Pos + 1;
- end loop;
-
- if Equal_Pos = Start or else Equal_Pos > Stop then
- OK := False;
- end if;
-
- if OK then
- Prj.Ext.Add
- (Project_Node_Tree.External,
- External_Name =>
- Ext_Asgn (Start .. Equal_Pos - 1),
- Value =>
- Ext_Asgn (Equal_Pos + 1 .. Stop));
-
- else
+ if not OK
+ or else not Prj.Ext.Check
+ (Root_Environment.External,
+ Ext_Asgn (Start .. Stop))
+ then
Fail
("illegal external assignment '"
& Ext_Asgn
procedure GNATCmd is
Project_Node_Tree : Project_Node_Tree_Ref;
+ Root_Environment : Prj.Tree.Environment;
Project_File : String_Access;
Project : Prj.Project_Id;
Current_Verbosity : Prj.Verbosity := Prj.Default;
-- Get the sources in the closure of the ASIS_Main and add them to the
-- list of arguments.
- function Index (Char : Character; Str : String) return Natural;
- -- Returns first occurrence of Char in Str, returns 0 if Char not in Str
-
procedure Non_VMS_Usage;
-- Display usage for platforms other than VMS
end if;
end Get_Closure;
- -----------
- -- Index --
- -----------
-
- function Index (Char : Character; Str : String) return Natural is
- begin
- for Index in Str'Range loop
- if Str (Index) = Char then
- return Index;
- end if;
- end loop;
-
- return 0;
- end Index;
-
------------------
-- Mapping_File --
------------------
Csets.Initialize;
Snames.Initialize;
- Project_Node_Tree := new Project_Node_Tree_Data;
+ Prj.Tree.Initialize (Root_Environment, Gnatmake_Flags);
Prj.Env.Initialize_Default_Project_Path
- (Project_Node_Tree.Project_Path, Target_Name => "");
+ (Root_Environment.Project_Path, Target_Name => "");
+ Project_Node_Tree := new Project_Node_Tree_Data;
Prj.Tree.Initialize (Project_Node_Tree);
Prj.Initialize (Project_Tree);
and then Argv (Argv'First + 1 .. Argv'First + 2) = "aP"
then
Prj.Env.Add_Directories
- (Project_Node_Tree.Project_Path,
+ (Root_Environment.Project_Path,
Argv (Argv'First + 3 .. Argv'Last));
Remove_Switch (Arg_Num);
elsif Argv'Length >= 5
and then Argv (Argv'First + 1) = 'X'
then
- declare
- Equal_Pos : constant Natural :=
- Index
- ('=',
- Argv (Argv'First + 2 .. Argv'Last));
- begin
- if Equal_Pos >= Argv'First + 3
- and then Equal_Pos /= Argv'Last
- then
- Add (Project_Node_Tree.External,
- External_Name =>
- Argv (Argv'First + 2 .. Equal_Pos - 1),
- Value => Argv (Equal_Pos + 1 .. Argv'Last));
- else
- Fail
- (Argv.all
+ if not Check (Root_Environment.External,
+ Argv (Argv'First + 2 .. Argv'Last))
+ then
+ Fail (Argv.all
& " is not a valid external assignment.");
- end if;
- end;
+ end if;
Remove_Switch (Arg_Num);
In_Tree => Project_Tree,
In_Node_Tree => Project_Node_Tree,
Project_File_Name => Project_File.all,
- Flags => Gnatmake_Flags,
+ Env => Root_Environment,
Packages_To_Check => Packages_To_Check);
if Project = Prj.No_Project then
-- directory of the ultimate extending project. If it is not, we ignore
-- the fact that this ALI file is read-only.
- procedure Process_Multilib (Project_Node_Tree : Project_Node_Tree_Ref);
+ procedure Process_Multilib (Env : in out Prj.Tree.Environment);
-- Add appropriate --RTS argument to handle multilib
----------------------------------------------------
Index : Int;
Program : Make_Program_Type;
Unknown_Switches_To_The_Compiler : Boolean := True;
- Project_Node_Tree : Project_Node_Tree_Ref);
+ Project_Node_Tree : Project_Node_Tree_Ref;
+ Env : in out Prj.Tree.Environment);
procedure Add_Switch
(S : String_Access;
Program : Make_Program_Type;
-- Call the CodePeer globalizer on all the project's object directories,
-- or on the current directory if no projects.
- procedure Initialize (Project_Node_Tree : out Project_Node_Tree_Ref);
+ procedure Initialize
+ (Project_Node_Tree : out Project_Node_Tree_Ref;
+ Env : out Prj.Tree.Environment);
-- Performs default and package initialization. Therefore,
-- Compile_Sources can be called by an external unit.
-- succeeded or not.
procedure Scan_Make_Arg
- (Project_Node_Tree : Project_Node_Tree_Ref;
+ (Env : in out Prj.Tree.Environment;
Argv : String;
And_Save : Boolean);
-- Scan make arguments. Argv is a single argument to be processed.
Index : Int;
Program : Make_Program_Type;
Unknown_Switches_To_The_Compiler : Boolean := True;
- Project_Node_Tree : Project_Node_Tree_Ref)
+ Project_Node_Tree : Project_Node_Tree_Ref;
+ Env : in out Prj.Tree.Environment)
is
Switches : Variable_Value;
Switch_List : String_List_Id;
Write_Line (Argv);
end if;
- Scan_Make_Arg
- (Project_Node_Tree, Argv, And_Save => False);
+ Scan_Make_Arg (Env, Argv, And_Save => False);
if not Gnatmake_Switch_Found
and then not Switch_May_Be_Passed_To_The_Compiler
-- The path name of the mapping file
Project_Node_Tree : Project_Node_Tree_Ref;
+ Root_Environment : Prj.Tree.Environment;
Discard : Boolean;
pragma Warnings (Off, Discard);
Obsoleted.Reset;
- Make.Initialize (Project_Node_Tree);
+ Make.Initialize (Project_Node_Tree, Root_Environment);
Bind_Shared := No_Shared_Switch'Access;
Link_With_Shared_Libgcc := No_Shared_Libgcc_Switch'Access;
Add_Switches
(Project_Node_Tree => Project_Node_Tree,
+ Env => Root_Environment,
File_Name => Main_Unit_File_Name,
Index => Main_Index,
The_Package => Builder_Package,
Add_Switches
(Project_Node_Tree => Project_Node_Tree,
+ Env => Root_Environment,
File_Name => " ",
Index => 0,
The_Package => Builder_Package,
Add_Switches
(Project_Node_Tree => Project_Node_Tree,
+ Env => Root_Environment,
File_Name => " ",
Index => 0,
The_Package => Builder_Package,
Add_Switches
(Project_Node_Tree => Project_Node_Tree,
+ Env => Root_Environment,
File_Name => Main_Unit_File_Name,
Index => Main_Index,
The_Package => Binder_Package,
Add_Switches
(Project_Node_Tree => Project_Node_Tree,
+ Env => Root_Environment,
File_Name => Main_Unit_File_Name,
Index => Main_Index,
The_Package => Linker_Package,
Add_Switches
(Project_Node_Tree => Project_Node_Tree,
+ Env => Root_Environment,
File_Name => Main_Unit_File_Name,
Index => Main_Index,
The_Package => Binder_Package,
Add_Switches
(Project_Node_Tree => Project_Node_Tree,
+ Env => Root_Environment,
File_Name => Main_Unit_File_Name,
Index => Main_Index,
The_Package => Linker_Package,
-- Initialize --
----------------
- procedure Initialize (Project_Node_Tree : out Project_Node_Tree_Ref) is
-
+ procedure Initialize
+ (Project_Node_Tree : out Project_Node_Tree_Ref;
+ Env : out Prj.Tree.Environment)
+ is
procedure Check_Version_And_Help is
new Check_Version_And_Help_G (Makeusg);
-- references, project path and other attributes that can be impacted by
-- the command line switches
- Project_Node_Tree := new Project_Node_Tree_Data;
+ Prj.Tree.Initialize (Env, Gnatmake_Flags);
Prj.Env.Initialize_Default_Project_Path
- (Project_Node_Tree.Project_Path, Target_Name => "");
+ (Env.Project_Path, Target_Name => "");
+ Project_Node_Tree := new Project_Node_Tree_Data;
Prj.Tree.Initialize (Project_Node_Tree);
-- Override default initialization of Check_Object_Consistency since
-- do not include --version or --help.
Scan_Args : for Next_Arg in 1 .. Argument_Count loop
- Scan_Make_Arg
- (Project_Node_Tree, Argument (Next_Arg), And_Save => True);
+ Scan_Make_Arg (Env, Argument (Next_Arg), And_Save => True);
end loop Scan_Args;
if N_M_Switch > 0 and RTS_Specified = null then
- Process_Multilib (Project_Node_Tree);
+ Process_Multilib (Env);
end if;
if Commands_To_Stdout then
In_Tree => Project_Tree,
Project_File_Name => Project_File_Name.all,
Packages_To_Check => Packages_To_Check_By_Gnatmake,
- Flags => Gnatmake_Flags,
+ Env => Env,
In_Node_Tree => Project_Node_Tree);
-- The parsing of project files may have changed the current output
-- Process_Multilib --
----------------------
- procedure Process_Multilib
- (Project_Node_Tree : Project_Node_Tree_Ref)
- is
+ procedure Process_Multilib (Env : in out Prj.Tree.Environment) is
Output_FD : File_Descriptor;
Output_Name : String_Access;
Arg_Index : Natural := 0;
-- Otherwise add -margs --RTS=output
- Scan_Make_Arg (Project_Node_Tree, "-margs", And_Save => True);
- Scan_Make_Arg
- (Project_Node_Tree, "--RTS=" & Line (1 .. N_Read), And_Save => True);
+ Scan_Make_Arg (Env, "-margs", And_Save => True);
+ Scan_Make_Arg (Env, "--RTS=" & Line (1 .. N_Read), And_Save => True);
end Process_Multilib;
-----------
-------------------
procedure Scan_Make_Arg
- (Project_Node_Tree : Project_Node_Tree_Ref;
+ (Env : in out Prj.Tree.Environment;
Argv : String;
And_Save : Boolean)
is
(Argv (Create_Map_File_Switch'Length + 2 .. Argv'Last));
else
- Scan_Make_Switches (Project_Node_Tree, Argv, Success);
+ Scan_Make_Switches (Env, Argv, Success);
end if;
-- If we have seen a regular switch process it
("-D cannot be used in conjunction with a project file");
else
- Scan_Make_Switches (Project_Node_Tree, Argv, Success);
+ Scan_Make_Switches (Env, Argv, Success);
end if;
-- -d
Make_Failed
("-i cannot be used in conjunction with a project file");
else
- Scan_Make_Switches (Project_Node_Tree, Argv, Success);
+ Scan_Make_Switches (Env, Argv, Success);
end if;
-- -j (need to save the result)
elsif Argv (2) = 'j' then
- Scan_Make_Switches (Project_Node_Tree, Argv, Success);
+ Scan_Make_Switches (Env, Argv, Success);
if And_Save then
Saved_Maximum_Processes := Maximum_Processes;
-- -Xext=val (External assignment)
elsif Argv (2) = 'X'
- and then Is_External_Assignment (Project_Node_Tree, Argv)
+ and then Is_External_Assignment (Env, Argv)
then
-- Is_External_Assignment has side effects when it returns True
-- is passed to the compiler.
else
- Scan_Make_Switches
- (Project_Node_Tree, Argv, Gnatmake_Switch_Found);
+ Scan_Make_Switches (Env, Argv, Gnatmake_Switch_Found);
if not Gnatmake_Switch_Found then
Add_Switch (Argv, Compiler, And_Save => And_Save);
(Project : Project_Id;
Project_Tree : Project_Tree_Ref;
Project_Node_Tree : Prj.Tree.Project_Node_Tree_Ref;
- Env : Prj.Tree.Environment;
+ Env : in out Prj.Tree.Environment;
Allow_Automatic_Generation : Boolean;
Config_File_Name : String := "";
Autoconf_Specified : Boolean;
Config : out Prj.Project_Id;
Config_File_Path : out String_Access;
Automatically_Generated : out Boolean;
- Flags : Processing_Flags;
On_Load_Config : Config_File_Hook := null)
is
end if;
if not Is_Directory (Obj_Dir) then
- case Flags.Require_Obj_Dirs is
+ case Env.Flags.Require_Obj_Dirs is
when Error =>
Raise_Invalid_Config
("object directory " & Obj_Dir & " does not exist");
when Warning =>
Prj.Err.Error_Msg
- (Flags,
+ (Env.Flags,
"?object directory " & Obj_Dir & " does not exist");
Obj_Dir_Exists := False;
when Silent =>
Packages_To_Check => Packages_To_Check,
Current_Directory => Current_Directory,
Is_Config_File => True,
- Flags => Flags);
+ Env => Env);
else
Config_Project_Node := Empty_Node;
end if;
Success => Success,
From_Project_Node => Config_Project_Node,
From_Project_Node_Tree => Project_Node_Tree,
- Flags => Flags,
+ Env => Env,
Reset_Tree => False);
end if;
Project_File_Name : String;
Project_Tree : Prj.Project_Tree_Ref;
Project_Node_Tree : Prj.Tree.Project_Node_Tree_Ref;
+ Env : in out Prj.Tree.Environment;
Packages_To_Check : String_List_Access;
Allow_Automatic_Generation : Boolean := True;
Automatically_Generated : out Boolean;
Config_File_Path : out String_Access;
Target_Name : String := "";
Normalized_Hostname : String;
- Flags : Processing_Flags;
On_Load_Config : Config_File_Hook := null)
is
begin
- pragma Assert (Prj.Env.Is_Initialized (Project_Node_Tree.Project_Path));
+ pragma Assert (Prj.Env.Is_Initialized (Env.Project_Path));
-- Parse the user project tree
Packages_To_Check => Packages_To_Check,
Current_Directory => Current_Directory,
Is_Config_File => False,
- Flags => Flags);
+ Env => Env);
if User_Project_Node = Empty_Node then
User_Project_Node := Empty_Node;
Autoconf_Specified => Autoconf_Specified,
Project_Tree => Project_Tree,
Project_Node_Tree => Project_Node_Tree,
+ Env => Env,
Packages_To_Check => Packages_To_Check,
Allow_Automatic_Generation => Allow_Automatic_Generation,
Automatically_Generated => Automatically_Generated,
Config_File_Path => Config_File_Path,
Target_Name => Target_Name,
Normalized_Hostname => Normalized_Hostname,
- Flags => Flags,
On_Load_Config => On_Load_Config);
end Parse_Project_And_Apply_Config;
Autoconf_Specified : Boolean;
Project_Tree : Prj.Project_Tree_Ref;
Project_Node_Tree : Prj.Tree.Project_Node_Tree_Ref;
+ Env : in out Prj.Tree.Environment;
Packages_To_Check : String_List_Access;
Allow_Automatic_Generation : Boolean := True;
Automatically_Generated : out Boolean;
Config_File_Path : out String_Access;
Target_Name : String := "";
Normalized_Hostname : String;
- Flags : Processing_Flags;
On_Load_Config : Config_File_Hook := null;
Reset_Tree : Boolean := True)
is
Success => Success,
From_Project_Node => User_Project_Node,
From_Project_Node_Tree => Project_Node_Tree,
- Flags => Flags,
+ Env => Env,
Reset_Tree => Reset_Tree);
if not Success then
Project => Main_Project,
Project_Tree => Project_Tree,
Project_Node_Tree => Project_Node_Tree,
+ Env => Env,
Allow_Automatic_Generation => Allow_Automatic_Generation,
Config_File_Name => Config_File_Name,
Autoconf_Specified => Autoconf_Specified,
Packages_To_Check => Packages_To_Check,
Config_File_Path => Config_File_Path,
Automatically_Generated => Automatically_Generated,
- Flags => Flags,
On_Load_Config => On_Load_Config);
Apply_Config_File (Main_Config_Project, Project_Tree);
Success => Success,
From_Project_Node => User_Project_Node,
From_Project_Node_Tree => Project_Node_Tree,
- Flags => Flags);
+ Env => Env);
if Success then
if Project_Tree.Source_Info_File_Name /= null and then
-- --
-- S p e c --
-- --
--- Copyright (C) 2006-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 2006-2011, 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- --
Project_File_Name : String;
Project_Tree : Prj.Project_Tree_Ref;
Project_Node_Tree : Prj.Tree.Project_Node_Tree_Ref;
+ Env : in out Prj.Tree.Environment;
Packages_To_Check : String_List_Access;
Allow_Automatic_Generation : Boolean := True;
Automatically_Generated : out Boolean;
Config_File_Path : out String_Access;
Target_Name : String := "";
Normalized_Hostname : String;
- Flags : Processing_Flags;
On_Load_Config : Config_File_Hook := null);
-- Find the main configuration project and parse the project tree rooted at
-- this configuration project.
Autoconf_Specified : Boolean;
Project_Tree : Prj.Project_Tree_Ref;
Project_Node_Tree : Prj.Tree.Project_Node_Tree_Ref;
+ Env : in out Prj.Tree.Environment;
Packages_To_Check : String_List_Access;
Allow_Automatic_Generation : Boolean := True;
Automatically_Generated : out Boolean;
Config_File_Path : out String_Access;
Target_Name : String := "";
Normalized_Hostname : String;
- Flags : Processing_Flags;
On_Load_Config : Config_File_Hook := null;
Reset_Tree : Boolean := True);
-- Same as above, except the project must already have been parsed through
(Project : Prj.Project_Id;
Project_Tree : Prj.Project_Tree_Ref;
Project_Node_Tree : Prj.Tree.Project_Node_Tree_Ref;
+ Env : in out Prj.Tree.Environment;
Allow_Automatic_Generation : Boolean;
Config_File_Name : String := "";
Autoconf_Specified : Boolean;
Config : out Prj.Project_Id;
Config_File_Path : out String_Access;
Automatically_Generated : out Boolean;
- Flags : Processing_Flags;
On_Load_Config : Config_File_Hook := null);
-- Compute the name of the configuration file that should be used. If no
-- default configuration file is found, a new one will be automatically
Tree : constant Project_Node_Tree_Ref := new Project_Node_Tree_Data;
-- The project tree where the project file is parsed
+ Root_Environment : Prj.Tree.Environment;
+
Args : Argument_List_Access;
-- The list of arguments for calls to the compiler to get the unit names
-- and kinds (spec or body) in the Ada sources.
Csets.Initialize;
Snames.Initialize;
+
Prj.Initialize (No_Project_Tree);
- Prj.Tree.Initialize (Tree);
+
+ Prj.Tree.Initialize (Root_Environment, Flags);
Prj.Env.Initialize_Default_Project_Path
- (Tree.Project_Path, Target_Name => "");
+ (Root_Environment.Project_Path, Target_Name => "");
+
+ Prj.Tree.Initialize (Tree);
Sources.Set_Last (0);
Source_Directories.Set_Last (0);
Errout_Handling => Part.Finalize_If_Error,
Store_Comments => True,
Is_Config_File => False,
- Flags => Flags,
+ Env => Root_Environment,
Current_Directory => Get_Current_Dir,
Packages_To_Check => Packages_To_Check_By_Gnatname);
with Output; use Output;
with Prj.Conf; use Prj.Conf;
-with Prj.Env;
with Prj.Err; use Prj.Err;
with Prj.Part;
with Prj.Tree; use Prj.Tree;
Project : out Project_Id;
Project_File_Name : String;
Packages_To_Check : String_List_Access := All_Packages;
- Flags : Processing_Flags;
Reset_Tree : Boolean := True;
- In_Node_Tree : Prj.Tree.Project_Node_Tree_Ref := null)
+ In_Node_Tree : Prj.Tree.Project_Node_Tree_Ref := null;
+ Env : in out Prj.Tree.Environment)
is
Project_Node : Project_Node_Id := Empty_Node;
The_Project : Project_Id := No_Project;
if Project_Node_Tree = null then
Project_Node_Tree := new Project_Node_Tree_Data;
Prj.Tree.Initialize (Project_Node_Tree);
- Prj.Env.Initialize_Default_Project_Path
- (Project_Node_Tree.Project_Path, Target_Name => "");
end if;
-- Parse the main project file into a tree
Errout_Handling => Prj.Part.Finalize_If_Error,
Packages_To_Check => Packages_To_Check,
Current_Directory => Current_Dir,
- Flags => Flags,
+ Env => Env,
Is_Config_File => False);
-- If there were no error, process the tree
Allow_Automatic_Generation => False,
Automatically_Generated => Automatically_Generated,
Config_File_Path => Config_File_Path,
- Flags => Flags,
+ Env => Env,
Normalized_Hostname => "",
On_Load_Config =>
Add_Default_GNAT_Naming_Scheme'Access,
-- --
-- S p e c --
-- --
--- Copyright (C) 2000-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 2000-2011, 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- --
Project : out Project_Id;
Project_File_Name : String;
Packages_To_Check : String_List_Access := All_Packages;
- Flags : Processing_Flags;
Reset_Tree : Boolean := True;
- In_Node_Tree : Prj.Tree.Project_Node_Tree_Ref := null);
+ In_Node_Tree : Prj.Tree.Project_Node_Tree_Ref := null;
+ Env : in out Prj.Tree.Environment);
-- Parse and process a project files and all its imported project files, in
-- the project tree In_Tree.
-- All the project files are parsed (through Prj.Tree) to create a tree in
Depth : Natural;
Current_Dir : String;
Is_Config_File : Boolean;
- Flags : Processing_Flags);
+ Env : in out Environment);
-- Parse a project file. This is a recursive procedure: it calls itself for
-- imported and extended projects. When From_Extended is not None, if the
-- project has already been parsed and is an extended project A, return the
Depth : Natural;
Current_Dir : String;
Is_Config_File : Boolean;
- Flags : Processing_Flags);
+ Env : in out Environment);
-- Parse the imported projects that have been stored in table Withs, if
-- any. From_Extended is used for the call to Parse_Single_Project below.
-- When In_Limited is True, the importing path includes at least one
Store_Comments : Boolean := False;
Current_Directory : String := "";
Is_Config_File : Boolean;
- Flags : Processing_Flags;
+ Env : in out Prj.Tree.Environment;
Target_Name : String := "")
is
Dummy : Boolean;
Path_Name_Id : Path_Name_Type;
begin
- if not Is_Initialized (In_Tree.Project_Path) then
+ if not Is_Initialized (Env.Project_Path) then
Prj.Env.Initialize_Default_Project_Path
- (In_Tree.Project_Path, Target_Name);
+ (Env.Project_Path, Target_Name);
end if;
if Real_Project_File_Name = null then
Project := Empty_Node;
- Find_Project (In_Tree.Project_Path,
+ Find_Project (Env.Project_Path,
Project_File_Name => Real_Project_File_Name.all,
Directory => Current_Directory,
Path => Path_Name_Id);
declare
P : String_Access;
begin
- Get_Path (In_Tree.Project_Path, Path => P);
+ Get_Path (Env.Project_Path, Path => P);
Prj.Com.Fail
("project file """
Depth => 0,
Current_Dir => Current_Directory,
Is_Config_File => Is_Config_File,
- Flags => Flags);
+ Env => Env);
exception
when Types.Unrecoverable_Error =>
Depth : Natural;
Current_Dir : String;
Is_Config_File : Boolean;
- Flags : Processing_Flags)
+ Env : in out Environment)
is
Current_With_Clause : With_Id := Context_Clause;
if Limited_Withs = Current_With.Limited_With then
Find_Project
- (In_Tree.Project_Path,
+ (Env.Project_Path,
Project_File_Name => Get_Name_String (Current_With.Path),
Directory => Project_Directory_Path,
Path => Imported_Path_Name_Id);
Error_Msg_File_1 := File_Name_Type (Current_With.Path);
Error_Msg
- (Flags, "unknown project file: {", Current_With.Location);
+ (Env.Flags, "unknown project file: {", Current_With.Location);
-- If this is not imported by the main project file, display
-- the import path.
File_Name_Type
(Project_Stack.Table (Index).Path_Name);
Error_Msg
- (Flags, "\imported by {", Current_With.Location);
+ (Env.Flags, "\imported by {", Current_With.Location);
end loop;
end if;
Depth => Depth,
Current_Dir => Current_Dir,
Is_Config_File => Is_Config_File,
- Flags => Flags);
+ Env => Env);
else
Extends_All := Is_Extending_All (Withed_Project, In_Tree);
Depth : Natural;
Current_Dir : String;
Is_Config_File : Boolean;
- Flags : Processing_Flags)
+ Env : in out Environment)
is
Path_Name : constant String := Get_Name_String (Path_Name_Id);
end;
if Has_Circular_Dependencies
- (Flags, Normed_Path_Name, Canonical_Path_Name)
+ (Env.Flags, Normed_Path_Name, Canonical_Path_Name)
then
Project := Empty_Node;
return;
if A_Project_Name_And_Node.Extended then
if A_Project_Name_And_Node.Proj_Qualifier /= Dry then
Error_Msg
- (Flags,
+ (Env.Flags,
"cannot extend the same project file several times",
Token_Ptr);
end if;
else
Error_Msg
- (Flags,
+ (Env.Flags,
"cannot extend an already imported project file",
Token_Ptr);
end if;
end;
else
Error_Msg
- (Flags,
+ (Env.Flags,
"cannot import an already extended project file",
Token_Ptr);
end if;
-- following Ada identifier's syntax).
Error_Msg_File_1 := File_Name_Type (Canonical_Path_Name);
- Error_Msg (Flags,
+ Error_Msg (Env.Flags,
"?{ is not a valid path name for a project file",
Token_Ptr);
end if;
(In_Tree => In_Tree,
Is_Config_File => Is_Config_File,
Context_Clause => First_With,
- Flags => Flags);
+ Flags => Env.Flags);
Project := Default_Project_Node
(Of_Kind => N_Project, In_Tree => In_Tree);
Set_Path_Name_Of (Project, In_Tree, Normed_Path_Name);
Read_Project_Qualifier
- (Flags, In_Tree, Is_Config_File, Qualifier_Location, Project);
+ (Env.Flags, In_Tree, Is_Config_File, Qualifier_Location, Project);
Set_Location_Of (Project, In_Tree, Token_Ptr);
if Is_Config_File then
Error_Msg
- (Flags,
+ (Env.Flags,
"extending configuration project not allowed", Token_Ptr);
end if;
end if;
Error_Msg
- (Flags,
+ (Env.Flags,
"?file name does not match project name, should be `%%"
& Extension.all & "`",
Token_Ptr);
Depth => Depth + 1,
Current_Dir => Current_Dir,
Is_Config_File => Is_Config_File,
- Flags => Flags);
+ Env => Env);
Set_First_With_Clause_Of (Project, In_Tree, Imported_Projects);
end;
Duplicated := True;
Error_Msg_Name_1 := Project_Name;
Error_Msg
- (Flags, "duplicate project name %%",
+ (Env.Flags, "duplicate project name %%",
Location_Of (Project, In_Tree));
Error_Msg_Name_1 :=
Name_Id (Path_Name_Of (Name_And_Node.Node, In_Tree));
Error_Msg
- (Flags, "\already in %%", Location_Of (Project, In_Tree));
+ (Env.Flags,
+ "\already in %%", Location_Of (Project, In_Tree));
end if;
end;
end if;
begin
Find_Project
- (In_Tree.Project_Path,
+ (Env.Project_Path,
Project_File_Name => Original_Path_Name,
Directory => Get_Name_String (Project_Directory),
Path => Extended_Project_Path_Name_Id);
Error_Msg_Name_1 := Token_Name;
- Error_Msg (Flags, "unknown project file: %%", Token_Ptr);
+ Error_Msg (Env.Flags, "unknown project file: %%", Token_Ptr);
-- If not in the main project file, display the import path
Error_Msg_Name_1 :=
Name_Id
(Project_Stack.Table (Project_Stack.Last).Path_Name);
- Error_Msg (Flags, "\extended by %%", Token_Ptr);
+ Error_Msg (Env.Flags, "\extended by %%", Token_Ptr);
for Index in reverse 1 .. Project_Stack.Last - 1 loop
Error_Msg_Name_1 :=
Name_Id
(Project_Stack.Table (Index).Path_Name);
- Error_Msg (Flags, "\imported by %%", Token_Ptr);
+ Error_Msg (Env.Flags, "\imported by %%", Token_Ptr);
end loop;
end if;
Depth => Depth + 1,
Current_Dir => Current_Dir,
Is_Config_File => Is_Config_File,
- Flags => Flags);
+ Env => Env);
end;
if Present (Extended_Project) then
Project_Qualifier_Of (Extended_Project, In_Tree) /= Dry
then
Error_Msg
- (Flags, "an abstract project can only extend " &
+ (Env.Flags, "an abstract project can only extend " &
"another abstract project",
Qualifier_Location);
end if;
end if;
end if;
- Check_Extending_All_Imports (Flags, In_Tree, Project);
- Check_Aggregate_Imports (Flags, In_Tree, Project);
+ Check_Extending_All_Imports (Env.Flags, In_Tree, Project);
+ Check_Aggregate_Imports (Env.Flags, In_Tree, Project);
-- Check that a project with a name including a dot either imports
-- or extends the project whose name precedes the last dot.
Error_Msg_Name_1 := Name_Of_Project;
Error_Msg_Name_2 := Parent_Name;
- Error_Msg (Flags,
+ Error_Msg (Env.Flags,
"project %% does not import or extend project %%",
Location_Of (Project, In_Tree));
end if;
Extends => Extended_Project,
Packages_To_Check => Packages_To_Check,
Is_Config_File => Is_Config_File,
- Flags => Flags);
+ Flags => Env.Flags);
Set_Project_Declaration_Of (Project, In_Tree, Project_Declaration);
if Present (Extended_Project)
then
-- Invalid name: report an error
- Error_Msg (Flags, "expected """ &
+ Error_Msg (Env.Flags, "expected """ &
Get_Name_String (Name_Of (Project, In_Tree)) & """",
Token_Ptr);
end if;
if Token /= Tok_EOF then
Error_Msg
- (Flags, "unexpected text following end of project", Token_Ptr);
+ (Env.Flags,
+ "unexpected text following end of project", Token_Ptr);
end if;
end if;
Depth => Depth + 1,
Current_Dir => Current_Dir,
Is_Config_File => Is_Config_File,
- Flags => Flags);
+ Env => Env);
Set_First_With_Clause_Of (Project, In_Tree, Imported_Projects);
end;
Store_Comments : Boolean := False;
Current_Directory : String := "";
Is_Config_File : Boolean;
- Flags : Processing_Flags;
+ Env : in out Prj.Tree.Environment;
Target_Name : String := "");
-- Parse project file and all its imported project files and create a tree.
-- Return the node for the project (or Empty_Node if parsing failed). If
function Expression
(Project : Project_Id;
In_Tree : Project_Tree_Ref;
- Flags : Processing_Flags;
From_Project_Node : Project_Node_Id;
From_Project_Node_Tree : Project_Node_Tree_Ref;
+ Env : Prj.Tree.Environment;
Pkg : Package_Id;
First_Term : Project_Node_Id;
Kind : Variable_Kind) return Variable_Value;
procedure Process_Declarative_Items
(Project : Project_Id;
In_Tree : Project_Tree_Ref;
- Flags : Processing_Flags;
From_Project_Node : Project_Node_Id;
Node_Tree : Project_Node_Tree_Ref;
+ Env : Prj.Tree.Environment;
Pkg : Package_Id;
Item : Project_Node_Id);
-- Process declarative items starting with From_Project_Node, and put them
procedure Recursive_Process
(In_Tree : Project_Tree_Ref;
Project : out Project_Id;
- Flags : Processing_Flags;
From_Project_Node : Project_Node_Id;
From_Project_Node_Tree : Project_Node_Tree_Ref;
+ Env : in out Prj.Tree.Environment;
Extended_By : Project_Id);
-- Process project with node From_Project_Node in the tree. Do nothing if
-- From_Project_Node is Empty_Node. If project has already been processed,
function Expression
(Project : Project_Id;
In_Tree : Project_Tree_Ref;
- Flags : Processing_Flags;
From_Project_Node : Project_Node_Id;
From_Project_Node_Tree : Project_Node_Tree_Ref;
+ Env : Prj.Tree.Environment;
Pkg : Package_Id;
First_Term : Project_Node_Id;
Kind : Variable_Kind) return Variable_Value
Value := Expression
(Project => Project,
In_Tree => In_Tree,
- Flags => Flags,
From_Project_Node => From_Project_Node,
From_Project_Node_Tree => From_Project_Node_Tree,
+ Env => Env,
Pkg => Pkg,
First_Term =>
Tree.First_Term
Expression
(Project => Project,
In_Tree => In_Tree,
- Flags => Flags,
From_Project_Node => From_Project_Node,
From_Project_Node_Tree => From_Project_Node_Tree,
+ Env => Env,
Pkg => Pkg,
First_Term =>
Tree.First_Term
Def_Var := Expression
(Project => Project,
In_Tree => In_Tree,
- Flags => Flags,
From_Project_Node => From_Project_Node,
From_Project_Node_Tree => From_Project_Node_Tree,
+ Env => Env,
Pkg => Pkg,
First_Term =>
Tree.First_Term
From_Project_Node_Tree) = List;
if Ext_List then
- Value :=
- Prj.Ext.Value_Of
- (From_Project_Node_Tree.External, Name, No_Name);
+ Value := Prj.Ext.Value_Of (Env.External, Name, No_Name);
if Value /= No_Name then
declare
else
-- Get the value
- Value :=
- Prj.Ext.Value_Of
- (From_Project_Node_Tree.External, Name, Default);
+ Value := Prj.Ext.Value_Of (Env.External, Name, Default);
if Value = No_Name then
if not Quiet_Output then
Error_Msg
- (Flags, "?undefined external reference",
+ (Env.Flags, "?undefined external reference",
Location_Of
(The_Current_Term, From_Project_Node_Tree),
Project);
Success : out Boolean;
From_Project_Node : Project_Node_Id;
From_Project_Node_Tree : Project_Node_Tree_Ref;
- Flags : Processing_Flags;
+ Env : in out Prj.Tree.Environment;
Reset_Tree : Boolean := True)
is
begin
Success => Success,
From_Project_Node => From_Project_Node,
From_Project_Node_Tree => From_Project_Node_Tree,
- Flags => Flags,
+ Env => Env,
Reset_Tree => Reset_Tree);
if Project_Qualifier_Of (From_Project_Node, From_Project_Node_Tree) /=
Success => Success,
From_Project_Node => From_Project_Node,
From_Project_Node_Tree => From_Project_Node_Tree,
- Flags => Flags);
+ Env => Env);
end if;
end Process;
procedure Process_Declarative_Items
(Project : Project_Id;
In_Tree : Project_Tree_Ref;
- Flags : Processing_Flags;
From_Project_Node : Project_Node_Id;
- Node_Tree : Project_Node_Tree_Ref;
+ Node_Tree : Project_Node_Tree_Ref;
+ Env : Prj.Tree.Environment;
Pkg : Package_Id;
Item : Project_Node_Id)
is
if Value.Value = Empty_String then
Error_Msg_Name_1 := Name_Of (Declaration, Node_Tree);
- case Flags.Allow_Invalid_External is
+ case Env.Flags.Allow_Invalid_External is
when Error =>
- Error_Msg (Flags, "no value defined for %%", Loc, Project);
+ Error_Msg
+ (Env.Flags, "no value defined for %%", Loc, Project);
when Warning =>
Reset_Value := True;
- Error_Msg (Flags, "?no value defined for %%", Loc, Project);
+ Error_Msg
+ (Env.Flags, "?no value defined for %%", Loc, Project);
when Silent =>
Reset_Value := True;
end case;
Error_Msg_Name_1 := Value.Value;
Error_Msg_Name_2 := Name_Of (Declaration, Node_Tree);
- case Flags.Allow_Invalid_External is
+ case Env.Flags.Allow_Invalid_External is
when Error =>
Error_Msg
- (Flags, "value %% is illegal for typed string %%",
+ (Env.Flags, "value %% is illegal for typed string %%",
Loc, Project);
when Warning =>
Error_Msg
- (Flags, "?value %% is illegal for typed string %%",
+ (Env.Flags, "?value %% is illegal for typed string %%",
Loc, Project);
Reset_Value := True;
when Silent =>
Process_Declarative_Items
(Project => Project,
In_Tree => In_Tree,
- Flags => Flags,
From_Project_Node => From_Project_Node,
- Node_Tree => Node_Tree,
+ Node_Tree => Node_Tree,
+ Env => Env,
Pkg => New_Pkg,
Item =>
First_Declarative_Item_Of (Current_Item, Node_Tree));
if Orig_Array = No_Array then
Error_Msg
- (Flags,
+ (Env.Flags,
"associative array value not found",
Location_Of (Current_Item, Node_Tree),
Project);
Expression
(Project => Project,
In_Tree => In_Tree,
- Flags => Flags,
From_Project_Node => From_Project_Node,
From_Project_Node_Tree => Node_Tree,
+ Env => Env,
Pkg => Pkg,
First_Term =>
Tree.First_Term
Process_Declarative_Items
(Project => Project,
In_Tree => In_Tree,
- Flags => Flags,
From_Project_Node => From_Project_Node,
Node_Tree => Node_Tree,
+ Env => Env,
Pkg => Pkg,
Item => Decl_Item);
end if;
Success : out Boolean;
From_Project_Node : Project_Node_Id;
From_Project_Node_Tree : Project_Node_Tree_Ref;
- Flags : Processing_Flags;
+ Env : in out Prj.Tree.Environment;
Reset_Tree : Boolean := True)
is
begin
Recursive_Process
(Project => Project,
In_Tree => In_Tree,
- Flags => Flags,
From_Project_Node => From_Project_Node,
From_Project_Node_Tree => From_Project_Node_Tree,
+ Env => Env,
Extended_By => No_Project);
Success :=
Success : out Boolean;
From_Project_Node : Project_Node_Id;
From_Project_Node_Tree : Project_Node_Tree_Ref;
- Flags : Processing_Flags)
+ Env : Environment)
is
Obj_Dir : Path_Name_Type;
Extending : Project_Id;
Debug_Increase_Indent ("Process tree, phase 2");
if Project /= No_Project then
- Check (In_Tree, Project, From_Project_Node_Tree, Flags);
+ Check (In_Tree, Project, From_Project_Node_Tree, Env.Flags);
end if;
-- If main project is an extending all project, set object directory of
if Extending2.Virtual then
Error_Msg_Name_1 := Prj.Project.Display_Name;
Error_Msg
- (Flags,
+ (Env.Flags,
"project %% cannot be extended by a virtual" &
" project with the same object directory",
Prj.Project.Location, Project);
Error_Msg_Name_1 := Extending2.Display_Name;
Error_Msg_Name_2 := Prj.Project.Display_Name;
Error_Msg
- (Flags,
+ (Env.Flags,
"project %% cannot extend project %%",
Extending2.Location, Project);
Error_Msg
- (Flags,
+ (Env.Flags,
"\they share the same object directory",
Extending2.Location, Project);
end if;
procedure Recursive_Process
(In_Tree : Project_Tree_Ref;
Project : out Project_Id;
- Flags : Processing_Flags;
From_Project_Node : Project_Node_Id;
From_Project_Node_Tree : Project_Node_Tree_Ref;
+ Env : in out Prj.Tree.Environment;
Extended_By : Project_Id)
is
procedure Process_Imported_Projects
Recursive_Process
(In_Tree => In_Tree,
Project => New_Project,
- Flags => Flags,
From_Project_Node =>
Project_Node_Of
(With_Clause, From_Project_Node_Tree),
From_Project_Node_Tree => From_Project_Node_Tree,
+ Env => Env,
Extended_By => No_Project);
-- Imported is the id of the last imported project. If
(Tree => In_Tree,
Project => Project,
Node_Tree => From_Project_Node_Tree,
- Flags => Flags);
+ Flags => Env.Flags);
List := Project.Aggregated_Projects;
while Success and then List /= null loop
Errout_Handling => Prj.Part.Never_Finalize,
Current_Directory => Get_Name_String (Project.Directory.Name),
Is_Config_File => False,
- Flags => Flags);
+ Env => Env);
Success := not Prj.Tree.No (Loaded_Tree);
Recursive_Process
(In_Tree => In_Tree,
Project => List.Project,
- Flags => Flags,
From_Project_Node => Loaded_Tree,
From_Project_Node_Tree => From_Project_Node_Tree,
+ Env => Env,
Extended_By => No_Project);
else
Debug_Output ("Failed to parse", Name_Id (List.Path));
Recursive_Process
(In_Tree => In_Tree,
Project => Project.Extends,
- Flags => Flags,
From_Project_Node => Extended_Project_Of
(Declaration_Node, From_Project_Node_Tree),
From_Project_Node_Tree => From_Project_Node_Tree,
+ Env => Env,
Extended_By => Project);
Process_Declarative_Items
(Project => Project,
In_Tree => In_Tree,
- Flags => Flags,
From_Project_Node => From_Project_Node,
Node_Tree => From_Project_Node_Tree,
+ Env => Env,
Pkg => No_Package,
Item => First_Declarative_Item_Of
(Declaration_Node, From_Project_Node_Tree));
-- --
-- S p e c --
-- --
--- Copyright (C) 2001-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 2001-2011, 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- --
Success : out Boolean;
From_Project_Node : Project_Node_Id;
From_Project_Node_Tree : Project_Node_Tree_Ref;
- Flags : Prj.Processing_Flags;
+ Env : in out Prj.Tree.Environment;
Reset_Tree : Boolean := True);
-- Process a project tree (ie the direct resulting of parsing a .gpr file)
-- based on the current external references.
Success : out Boolean;
From_Project_Node : Project_Node_Id;
From_Project_Node_Tree : Project_Node_Tree_Ref;
- Flags : Processing_Flags);
+ Env : Prj.Tree.Environment);
-- Perform the second phase of the processing, filling the rest of the
-- project with the information extracted from the project tree. This phase
-- requires that the configuration file has already been parsed (in fact
Success : out Boolean;
From_Project_Node : Project_Node_Id;
From_Project_Node_Tree : Project_Node_Tree_Ref;
- Flags : Processing_Flags;
+ Env : in out Prj.Tree.Environment;
Reset_Tree : Boolean := True);
-- Performs the two phases of the processing
-- Initialize --
----------------
- procedure Initialize
- (Tree : Project_Node_Tree_Ref; Env : in out Environment) is
+ procedure Initialize (Tree : Project_Node_Tree_Ref) is
begin
Project_Node_Table.Init (Tree.Project_Nodes);
Projects_Htable.Reset (Tree.Projects_HT);
- Initialize (Env);
end Initialize;
+ --------------------
+ -- Override_Flags --
+ --------------------
+
+ procedure Override_Flags
+ (Self : in out Environment; Flags : Prj.Processing_Flags) is
+ begin
+ Self.Flags := Flags;
+ end Override_Flags;
+
----------------
-- Initialize --
----------------
- procedure Initialize (Self : in out Environment) is
+ procedure Initialize
+ (Self : in out Environment; Flags : Processing_Flags) is
begin
-- Do not reset the external references, in case we are reloading a
-- project, since we want to preserve the current environment.
Prj.Ext.Initialize (Self.External);
-- Prj.Ext.Reset (Tree.External);
+
+ Self.Flags := Flags;
end Initialize;
----------
-- Free --
----------
- procedure Free
- (Proj : in out Project_Node_Tree_Ref;
- Env : in out Environment)
- is
+ procedure Free (Proj : in out Project_Node_Tree_Ref) is
procedure Unchecked_Free is new Ada.Unchecked_Deallocation
(Project_Node_Tree_Data, Project_Node_Tree_Ref);
begin
Projects_Htable.Reset (Proj.Projects_HT);
Unchecked_Free (Proj);
end if;
- Free (Env);
end Free;
-------------------------------
-----------------
type Environment is record
- External : Prj.Ext.External_References;
+ External : Prj.Ext.External_References;
-- External references are stored in this hash table (and manipulated
-- through subprograms in prj-ext.ads). External references are
-- project-tree specific so that one can load the same tree twice but
-- simultaneously multiple projects, each with its own search path, in
-- particular when using different compilers with different default
-- search directories.
+
+ Flags : Prj.Processing_Flags;
+ -- Configure errors and warnings
end record;
-- This record contains the context in which projects are parsed and
-- processed (finding importing project, resolving external values,...)
- procedure Initialize (Self : in out Environment);
+ procedure Initialize (Self : in out Environment; Flags : Processing_Flags);
-- Initialize a new environment
procedure Free (Self : in out Environment);
-- Free the memory used by Self
+ procedure Override_Flags
+ (Self : in out Environment; Flags : Prj.Processing_Flags);
+ -- Override the subprogram called in case there are parsing errors. This
+ -- is needed in applications that do their own error handling, since the
+ -- error handler is likely to be a local subprogram in this case (which
+ -- can't be stored when the flags are created).
+
-------------------
-- Project nodes --
-------------------
pragma Inline (No);
-- Return True if Node = Empty_Node
- procedure Initialize (Tree : Project_Node_Tree_Ref;
- Env : in out Environment);
+ procedure Initialize (Tree : Project_Node_Tree_Ref);
-- Initialize the Project File tree: empty the Project_Nodes table
-- and reset the Projects_Htable.
Projects_HT : Tree_Private_Part.Projects_Htable.Instance;
end record;
- procedure Free (Proj : in out Project_Node_Tree_Ref;
- Env : in out Environment);
+ procedure Free (Proj : in out Project_Node_Tree_Ref);
-- Free memory used by Prj
private
-- --
-- B o d y --
-- --
--- Copyright (C) 2001-2010, Free Software Foundation, Inc. --
+-- Copyright (C) 2001-2011, 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- --
------------------------
procedure Scan_Make_Switches
- (Project_Node_Tree : Prj.Tree.Project_Node_Tree_Ref;
+ (Env : in out Prj.Tree.Environment;
Switch_Chars : String;
Success : out Boolean)
is
and then Switch_Chars (Ptr .. Ptr + 1) = "aP"
then
Add_Directories
- (Project_Node_Tree.Project_Path,
+ (Env.Project_Path,
Switch_Chars (Ptr + 2 .. Switch_Chars'Last));
elsif C = 'v' and then Switch_Chars'Length = 3 then
-- --
-- S p e c --
-- --
--- Copyright (C) 2001-2010, Free Software Foundation, Inc. --
+-- Copyright (C) 2001-2011, 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- --
package Switch.M is
procedure Scan_Make_Switches
- (Project_Node_Tree : Prj.Tree.Project_Node_Tree_Ref;
+ (Env : in out Prj.Tree.Environment;
Switch_Chars : String;
Success : out Boolean);
-- Scan a gnatmake switch and act accordingly. For switches that are