Commit ede007da by Vincent Celier Committed by Arnaud Charlet

prj.ads, prj.adb: Update Project Manager to new attribute names for gprbuild.

2007-08-14  Vincent Celier  <celier@adacore.com>

	* prj.ads, prj.adb: Update Project Manager to new attribute names for
	gprbuild.
	Allow all valid declarations in configuration project files
	(Reset): Initialize all tables and hash tables in the project tree data
	Major update of the Project Manager and of the project aware tools,
	including gprmake, so that the same sources in the GNAT repository
	can be used by gprbuild.
	(Slash_Id): Change type to be Path_Name_Type
	(Slash): Return a Path_Name_Type instead of a File_Name_Type

	* prj-attr.ads, prj-attr.adb: Remove attributes no longer used by
	gprbuild.
	Update Project Manager to new attribute names for ghprbuild
	Allow all valid declarations in configuration project files
	Major update of the Project Manager and of the project aware tools,
	including gprmake, so that the same sources in the GNAT repository
	can be used by gprbuild.

	* prj-com.ads: 
	Major update of the Project Manager and of the project aware tools,
	including gprmake, so that the same sources in the GNAT repository
	can be used by gprbuild.

	* prj-dect.adb (Prj.Strt.Attribute_Reference): Set correctly the case
	insensitive flag for attributes with optional index.
	(Prj.Dect.Parse_Attribute_Declaration): For case insensitive associative
	array attribute, put the index in lower case.
	Update Project Manager to new attribute names for ghprbuild
	Allow all valid declarations in configuration project files
	Major update of the Project Manager and of the project aware tools,
	including gprmake, so that the same sources in the GNAT repository
	can be used by gprbuild.

	* prj-env.ads, prj-env.adb: 
	Major update of the Project Manager and of the project aware tools,
	including gprmake, so that the same sources in the GNAT repository
	can be used by gprbuild.
	(Get_Reference): Change type of parameter Path to Path_Name_Type

	* prj-ext.ads, prj-ext.adb (Initialize_Project_Path): Make sure, after
	removing '-' from the path to start with the first character of the
	next directory.
	Major update of the Project Manager and of the project aware tools,
	including gprmake, so that the same sources in the GNAT repository
	can be used by gprbuild.
	Major update of the Project Manager and of the project aware tools,
	including gprmake, so that the same sources in the GNAT repository
	can be used by gprbuild.

	* prj-nmsc.ads, prj-nmsc.adb: 
	Update Project Manager to new attribute names for ghprbuild
	Allow all valid declarations in configuration project files
	(Search_Directories): Detect subunits that are specified with an
	attribute Body in package Naming. Do not replace a source/unit in the
	same project when the order of the source dirs are known. Detect
	duplicate sources/units in the same project when the order of the
	source dirs are not known.
	(Check_Ada_Name): Allow all identifiers that are not reserved words
	in Ada 95.
	Major update of the Project Manager and of the project aware tools,
	including gprmake, so that the same sources in the GNAT repository
	can be used by gprbuild.
	(Look_For_Sources): If the list of sources is empty, set the object
	directory of non extending project to nil.
	Change type of path name variables to be Path_Name_Type
	(Locate_Directory): Make sure that on Windows '/' is converted to '\',
	otherwise creating missing directories will fail.

	* prj-attr-pm.adb, prj-tree.ads, prj-proc.ads, prj-proc.adb, 
	prj-part.ads, prj-part.adb:
	Major update of the Project Manager and of the project aware tools,
	including gprmake, so that the same sources in the GNAT repository
	can be used by gprbuild.

	* prj-strt.adb (Prj.Strt.Attribute_Reference): Set correctly the case
	insensitive flag for attributes with optional index.
	(Prj.Dect.Parse_Attribute_Declaration): For case insensitive associative
	array attribute, put the index in lower case.
	(Parse_Variable_Reference): Allow the current project name to be used in
	the prefix of an attribute reference.

	* prj-util.ads, prj-util.adb
	(Value_Of (for arrays)): New Boolean parameter Force_Lower_Case_Index,
	defaulted to False. When True, always check against indexes in lower
	case.

	* snames.ads, snames.h, snames.adb: 
	Update Project Manager to new attribute names for gprbuild
	Allow all valid declarations in configuration project files

From-SVN: r127420
parent 86cde7b1
......@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2004 Free Software Foundation, Inc. --
-- Copyright (C) 2004-2007, 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- --
......@@ -45,6 +45,7 @@ package body Prj.Attr.PM is
Var_Kind => Undefined,
Optional_Index => False,
Attr_Kind => Unknown,
Read_Only => False,
Next =>
Package_Attributes.Table (To_Package.Value).First_Attribute);
Package_Attributes.Table (To_Package.Value).First_Attribute :=
......@@ -62,7 +63,9 @@ package body Prj.Attr.PM is
Package_Attributes.Increment_Last;
Id := (Value => Package_Attributes.Last);
Package_Attributes.Table (Id.Value) :=
(Name => Name, Known => False, First_Attribute => Empty_Attr);
(Name => Name,
Known => False,
First_Attribute => Empty_Attr);
end Add_Unknown_Package;
end Prj.Attr.PM;
......@@ -153,6 +153,8 @@ package Prj.Attr is
-- Returns True if Attribute is a known attribute and may have an
-- optional index. Returns False otherwise.
function Is_Read_Only (Attribute : Attribute_Node_Id) return Boolean;
function Next_Attribute
(After : Attribute_Node_Id) return Attribute_Node_Id;
-- Returns the attribute that follow After in the list of project level
......@@ -269,18 +271,18 @@ private
Var_Kind : Variable_Kind;
Optional_Index : Boolean;
Attr_Kind : Attribute_Kind;
Read_Only : Boolean;
Next : Attr_Node_Id;
end record;
-- Data for an attribute
package Attrs is
new Table.Table
(Table_Component_Type => Attribute_Record,
Table_Index_Type => Attr_Node_Id,
Table_Low_Bound => First_Attribute,
Table_Initial => Attributes_Initial,
Table_Increment => Attributes_Increment,
Table_Name => "Prj.Attr.Attrs");
new Table.Table (Table_Component_Type => Attribute_Record,
Table_Index_Type => Attr_Node_Id,
Table_Low_Bound => First_Attribute,
Table_Initial => Attributes_Initial,
Table_Increment => Attributes_Increment,
Table_Name => "Prj.Attr.Attrs");
-- The table of the attributes
--------------
......@@ -288,20 +290,19 @@ private
--------------
type Package_Record is record
Name : Name_Id;
Known : Boolean := True;
First_Attribute : Attr_Node_Id;
Name : Name_Id;
Known : Boolean := True;
First_Attribute : Attr_Node_Id;
end record;
-- Data for a package
package Package_Attributes is
new Table.Table
(Table_Component_Type => Package_Record,
Table_Index_Type => Pkg_Node_Id,
Table_Low_Bound => First_Package,
Table_Initial => Packages_Initial,
Table_Increment => Packages_Increment,
Table_Name => "Prj.Attr.Packages");
new Table.Table (Table_Component_Type => Package_Record,
Table_Index_Type => Pkg_Node_Id,
Table_Low_Bound => First_Package,
Table_Initial => Packages_Initial,
Table_Increment => Packages_Increment,
Table_Name => "Prj.Attr.Packages");
-- The table of the packages
end Prj.Attr;
......@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 2000-2005, Free Software Foundation, Inc. --
-- Copyright (C) 2000-2007, 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- --
......@@ -24,10 +24,8 @@
-- --
------------------------------------------------------------------------------
-- The following package declares data types for GNAT project.
-- These data types are used in the bodies of the Prj hierarchy.
-- Above comment seems *far* too general ???
-- The following package declares a Fail procedure that is used in the
-- Project Manager.
with Osint;
......
......@@ -24,14 +24,17 @@
-- --
------------------------------------------------------------------------------
with Err_Vars; use Err_Vars;
with Err_Vars; use Err_Vars;
with GNAT.Case_Util; use GNAT.Case_Util;
with Opt; use Opt;
with Prj.Attr; use Prj.Attr;
with Prj.Attr.PM; use Prj.Attr.PM;
with Prj.Err; use Prj.Err;
with Prj.Strt; use Prj.Strt;
with Prj.Tree; use Prj.Tree;
with Snames;
with Prj.Attr; use Prj.Attr;
with Prj.Attr.PM; use Prj.Attr.PM;
with Uintp; use Uintp;
package body Prj.Dect is
......@@ -214,11 +217,19 @@ package body Prj.Dect is
-- Set, if appropriate the index case insensitivity flag
elsif Attribute_Kind_Of (Current_Attribute) in
else
if Is_Read_Only (Current_Attribute) then
Error_Msg
("read-only attribute cannot be given a value",
Token_Ptr);
end if;
if Attribute_Kind_Of (Current_Attribute) in
Case_Insensitive_Associative_Array ..
Optional_Index_Case_Insensitive_Associative_Array
then
Set_Case_Insensitive (Attribute, In_Tree, To => True);
then
Set_Case_Insensitive (Attribute, In_Tree, To => True);
end if;
end if;
Scan (In_Tree); -- past the attribute name
......@@ -272,7 +283,13 @@ package body Prj.Dect is
Expect (Tok_String_Literal, "literal string");
if Token = Tok_String_Literal then
Set_Associative_Array_Index_Of (Attribute, In_Tree, Token_Name);
Get_Name_String (Token_Name);
if Case_Insensitive (Attribute, In_Tree) then
To_Lower (Name_Buffer (1 .. Name_Len));
end if;
Set_Associative_Array_Index_Of (Attribute, In_Tree, Name_Find);
Scan (In_Tree); -- past the literal string index
if Token = Tok_At then
......@@ -996,6 +1013,10 @@ package body Prj.Dect is
end if;
if Token = Tok_Renames then
if In_Configuration then
Error_Msg
("no package renames in configuration projects", Token_Ptr);
end if;
-- Scan past "renames"
......@@ -1130,7 +1151,7 @@ package body Prj.Dect is
and then Token_Name /= Name_Of (Package_Declaration, In_Tree)
then
Error_Msg_Name_1 := Name_Of (Package_Declaration, In_Tree);
Error_Msg ("expected %", Token_Ptr);
Error_Msg ("expected %%", Token_Ptr);
end if;
if Token /= Tok_Semicolon then
......@@ -1251,13 +1272,13 @@ package body Prj.Dect is
Current_Package : Project_Node_Id)
is
Expression_Location : Source_Ptr;
String_Type_Name : Name_Id := No_Name;
Project_String_Type_Name : Name_Id := No_Name;
Type_Location : Source_Ptr := No_Location;
Project_Location : Source_Ptr := No_Location;
Expression : Project_Node_Id := Empty_Node;
String_Type_Name : Name_Id := No_Name;
Project_String_Type_Name : Name_Id := No_Name;
Type_Location : Source_Ptr := No_Location;
Project_Location : Source_Ptr := No_Location;
Expression : Project_Node_Id := Empty_Node;
Variable_Name : constant Name_Id := Token_Name;
OK : Boolean := True;
OK : Boolean := True;
begin
Variable :=
......
......@@ -44,6 +44,16 @@ package Prj.Env is
-- in the closure of immediate sources of Project, put the mapping of
-- its spec and or body to its file name and path name in this file.
procedure Create_Mapping_File
(Project : Project_Id;
Language : Name_Id;
Runtime : Project_Id;
In_Tree : Project_Tree_Ref;
Name : out Path_Name_Type);
-- Create a temporary mapping file for project Project. For each source or
-- template of Language in the of Project, put the mapping of its file
-- name and path name in this file.
procedure Set_Mapping_File_Initial_State_To_Empty;
-- When creating a mapping file, create an empty map. This case occurs
-- when run time source files are found in the project files.
......@@ -61,6 +71,14 @@ package Prj.Env is
-- a temporary file that contains all configuration pragmas, and specify
-- the configuration pragmas file in the project data.
procedure Create_New_Path_File
(In_Tree : Project_Tree_Ref;
Path_FD : out File_Descriptor;
Path_Name : out Path_Name_Type);
-- Create a new temporary path file. Get the file name in Path_Name.
-- The name is normally obtained by increasing the number in
-- Temp_Path_File_Name by 1.
function Ada_Include_Path
(Project : Project_Id;
In_Tree : Project_Tree_Ref) return String_Access;
......@@ -135,7 +153,7 @@ package Prj.Env is
(Source_File_Name : String;
In_Tree : Project_Tree_Ref;
Project : out Project_Id;
Path : out File_Name_Type);
Path : out Path_Name_Type);
-- Returns the project of a source and its path in displayable form
generic
......
......@@ -29,14 +29,14 @@ with Makeutl; use Makeutl;
with Output; use Output;
with Osint; use Osint;
with Sdefault;
with Table;
with GNAT.HTable;
package body Prj.Ext is
Gpr_Project_Path : constant String := "GPR_PROJECT_PATH";
Ada_Project_Path : constant String := "ADA_PROJECT_PATH";
-- Name of the env. variables that contain path name(s) of directories
-- Name of alternate env. variable that contain path name(s) of directories
-- where project files may reside. GPR_PROJECT_PATH has precedence over
-- ADA_PROJECT_PATH.
......@@ -67,6 +67,7 @@ package body Prj.Ext is
-- first for external reference in this table, before checking the
-- environment. Htable is emptied (reset) by procedure Reset.
---------
package Search_Directories is new Table.Table
(Table_Component_Type => Name_Id,
Table_Index_Type => Natural,
......@@ -76,7 +77,6 @@ package body Prj.Ext is
Table_Name => "Prj.Ext.Search_Directories");
-- The table for the directories specified with -aP switches
---------
-- Add --
---------
......@@ -97,6 +97,7 @@ package body Prj.Ext is
Htable.Set (The_Key, The_Value);
end Add;
-----------
----------------------------------
-- Add_Search_Project_Directory --
----------------------------------
......@@ -108,7 +109,6 @@ package body Prj.Ext is
Search_Directories.Append (Name_Find);
end Add_Search_Project_Directory;
-----------
-- Check --
-----------
......@@ -140,28 +140,22 @@ package body Prj.Ext is
Last : Positive;
New_Len : Positive;
New_Last : Positive;
Prj_Path : String_Access := null;
Prj_Path : String_Access := Gpr_Prj_Path;
begin
if Gpr_Prj_Path.all /= "" then
if Hostparm.OpenVMS then
Prj_Path := To_Canonical_Path_Spec ("GPR_PROJECT_PATH:");
else
Prj_Path := To_Canonical_Path_Spec (Gpr_Prj_Path.all);
end if;
if Get_Mode = Ada_Only then
if Gpr_Prj_Path.all /= "" then
-- Warn if both environment variables are defined
-- Warn if both environment variables are defined
if Ada_Prj_Path.all /= "" then
Write_Line ("Warning: ADA_PROJECT_PATH is not taken into account");
Write_Line (" when GPR_PROJECT_PATH is defined");
end if;
if Ada_Prj_Path.all /= "" then
Write_Line
("Warning: ADA_PROJECT_PATH is not taken into account");
Write_Line (" when GPR_PROJECT_PATH is defined");
end if;
elsif Ada_Prj_Path.all /= "" then
if Hostparm.OpenVMS then
Prj_Path := To_Canonical_Path_Spec ("ADA_PROJECT_PATH:");
else
Prj_Path := To_Canonical_Path_Spec (Ada_Prj_Path.all);
Prj_Path := Ada_Prj_Path;
end if;
end if;
......@@ -179,9 +173,9 @@ package body Prj.Ext is
(Get_Name_String (Search_Directories.Table (J)));
end loop;
-- If environment variable is defined, add its content
-- If environment variable is defined and not empty, add its content
if Prj_Path /= null then
if Prj_Path.all /= "" then
Name_Len := Name_Len + 1;
Name_Buffer (Name_Len) := Path_Separator;
......@@ -223,6 +217,11 @@ package body Prj.Ext is
Name_Len := Name_Len - No_Project_Default_Dir'Length - 1;
-- After removing the '-', go back one character to get the next
-- directory corectly.
Last := Last - 1;
elsif not Hostparm.OpenVMS
or else not Is_Absolute_Path (Name_Buffer (First .. Last))
then
......@@ -264,9 +263,19 @@ package body Prj.Ext is
Prefix := new String'(Executable_Prefix_Path);
if Prefix.all /= "" then
Current_Project_Path :=
new String'(Name_Buffer (1 .. Name_Len) & Path_Separator &
Prefix.all & Directory_Separator & "gnat");
if Get_Mode = Ada_Only then
Current_Project_Path :=
new String'(Name_Buffer (1 .. Name_Len) &
Path_Separator &
Prefix.all & Directory_Separator & "gnat");
else
Current_Project_Path :=
new String'(Name_Buffer (1 .. Name_Len) &
Path_Separator &
Prefix.all & Directory_Separator &
"share" & Directory_Separator & "gpr");
end if;
end if;
else
......@@ -278,7 +287,9 @@ package body Prj.Ext is
".." & Directory_Separator & "gnat");
end if;
end;
else
end if;
if Current_Project_Path = null then
Current_Project_Path := new String'(Name_Buffer (1 .. Name_Len));
end if;
end Initialize_Project_Path;
......
......@@ -29,6 +29,10 @@
package Prj.Ext is
Gpr_Project_Path : constant String := "GPR_PROJECT_PATH";
-- Name of primary env. variable that contain path name(s) of directories
-- where project files may reside.
procedure Add_Search_Project_Directory (Path : String);
-- Add a directory to the project path. Directories added with this
-- procedure are added in order after the current directory and before
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 2000-2005, Free Software Foundation, Inc. --
-- Copyright (C) 2000-2007, 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- --
......@@ -59,7 +59,7 @@ private package Prj.Nmsc is
-- still valid if they point to a file which is outside of the project),
-- and that no directory has a name which is a valid source name.
--
-- When_No_Ada_Sources indicates what should be done when no Ada sources
-- are found in a project where Ada is a language.
-- When_No_Sources indicates what should be done when no sources of a
-- language are found in a project where this language is declared.
end Prj.Nmsc;
......@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2001-2006, Free Software Foundation, Inc. --
-- Copyright (C) 2001-2007, 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- --
......@@ -32,6 +32,7 @@ with Prj.Err; use Prj.Err;
with Prj.Part;
with Prj.Proc;
with Prj.Tree; use Prj.Tree;
with Sinput.P;
package body Prj.Pars is
......@@ -44,7 +45,8 @@ package body Prj.Pars is
Project : out Project_Id;
Project_File_Name : String;
Packages_To_Check : String_List_Access := All_Packages;
When_No_Sources : Error_Warning := Error)
When_No_Sources : Error_Warning := Error;
Reset_Tree : Boolean := True)
is
Project_Node_Tree : constant Project_Node_Tree_Ref :=
new Project_Node_Tree_Data;
......@@ -57,6 +59,7 @@ package body Prj.Pars is
-- Parse the main project file into a tree
Sinput.P.Reset_First;
Prj.Part.Parse
(In_Tree => Project_Node_Tree,
Project => Project_Node,
......@@ -75,7 +78,8 @@ package body Prj.Pars is
From_Project_Node_Tree => Project_Node_Tree,
Report_Error => null,
Follow_Links => Opt.Follow_Links,
When_No_Sources => When_No_Sources);
When_No_Sources => When_No_Sources,
Reset_Tree => Reset_Tree);
Prj.Err.Finalize;
if not Success then
......
......@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 2000-2005, Free Software Foundation, Inc. --
-- Copyright (C) 2000-2007, 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- --
......@@ -36,7 +36,8 @@ package Prj.Pars is
Project : out Project_Id;
Project_File_Name : String;
Packages_To_Check : String_List_Access := All_Packages;
When_No_Sources : Error_Warning := Error);
When_No_Sources : Error_Warning := Error;
Reset_Tree : Boolean := True);
-- Parse a project files and all its imported project files, in the
-- project tree In_Tree.
--
......@@ -50,5 +51,8 @@ package Prj.Pars is
--
-- When_No_Sources indicates what should be done when no sources
-- are found in a project for a specified or implied language.
--
-- When Reset_Tree is True, all the project data are removed from the
-- project table before processing.
end Prj.Pars;
......@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 2000-2005, Free Software Foundation, Inc. --
-- Copyright (C) 2000-2007, 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- --
......@@ -46,4 +46,27 @@ package Prj.Part is
-- unknown attribute produces a warning. When Store_Comments is True,
-- comments are stored in the parse tree.
type Extension_Origin is (None, Extending_Simple, Extending_All);
-- Type of parameter From_Extended for procedures Parse_Single_Project and
-- Post_Parse_Context_Clause. Extending_All means that we are parsing the
-- tree rooted at an extending all project.
procedure Parse_Single_Project
(In_Tree : Project_Node_Tree_Ref;
Project : out Project_Node_Id;
Extends_All : out Boolean;
Path_Name : String;
Extended : Boolean;
From_Extended : Extension_Origin;
In_Limited : Boolean;
Packages_To_Check : String_List_Access;
Depth : Natural);
-- Parse a project file.
-- 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 ultimate
-- (not extended) project that extends A. When In_Limited is True,
-- the importing path includes at least one "limited with".
-- When parsing configuration projects, do not allow a depth > 1.
end Prj.Part;
......@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 2001-2005, Free Software Foundation, Inc. --
-- Copyright (C) 2001-2007, 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- --
......@@ -40,7 +40,8 @@ package Prj.Proc is
From_Project_Node_Tree : Project_Node_Tree_Ref;
Report_Error : Put_Line_Access;
Follow_Links : Boolean := True;
When_No_Sources : Error_Warning := Error);
When_No_Sources : Error_Warning := Error;
Reset_Tree : Boolean := True);
-- Process a project file tree into project file data structures. If
-- Report_Error is null, use the error reporting mechanism. Otherwise,
-- report errors using Report_Error.
......@@ -53,6 +54,9 @@ package Prj.Proc is
-- When_No_Sources indicates what should be done when no sources
-- are found in a project for a specified or implied language.
--
-- When Reset_Tree is True, all the project data are removed from the
-- project table before processing.
--
-- Process is a bit of a junk name, how about Process_Project_Tree???
end Prj.Proc;
......@@ -29,6 +29,8 @@
with GNAT.Dynamic_HTables;
with GNAT.Dynamic_Tables;
with Table;
with Prj.Attr; use Prj.Attr;
package Prj.Tree is
......@@ -196,8 +198,11 @@ package Prj.Tree is
-- The following query functions are part of the abstract interface
-- of the Project File tree. They provide access to fields of a project.
-- In the following, there are "valid if" comments, but no indication
-- of what happens if they are called with invalid arguments ???
-- The access functions should be called only with valid arguments.
-- For each function the condition of validity is specified. If an access
-- function is called with invalid arguments, then exception
-- Assertion_Error is raised if assertions are enabled, otherwise the
-- behaviour is not defined and may result in a crash.
function Name_Of
(Node : Project_Node_Id;
......@@ -1206,7 +1211,8 @@ package Prj.Tree is
-- Node of the project in table Project_Nodes
Canonical_Path : Path_Name_Type;
-- Resolved and canonical path of the project file
-- Resolved and canonical path of a real project file.
-- No_Name in case of virtual projects.
Extended : Boolean;
-- True when the project is being extended by another project
......
......@@ -40,6 +40,17 @@ package Prj.Util is
-- Executable_Suffix is specified, add this suffix, otherwise add the
-- standard executable suffix for the platform.
procedure Put
(Into_List : in out Name_List_Index;
From_List : String_List_Id;
In_Tree : Project_Tree_Ref);
-- Append a name list to a string list
procedure Duplicate
(This : in out Name_List_Index;
In_Tree : Project_Tree_Ref);
-- Duplicate a name list
function Value_Of
(Variable : Variable_Value;
Default : String) return String;
......@@ -58,10 +69,11 @@ package Prj.Util is
-- associative array.
function Value_Of
(Index : Name_Id;
Src_Index : Int := 0;
In_Array : Array_Element_Id;
In_Tree : Project_Tree_Ref) return Variable_Value;
(Index : Name_Id;
Src_Index : Int := 0;
In_Array : Array_Element_Id;
In_Tree : Project_Tree_Ref;
Force_Lower_Case_Index : Boolean := False) return Variable_Value;
-- Get a string array component (single String or String list). Returns
-- Nil_Variable_Value if no component Index or if In_Array is null.
--
......@@ -75,7 +87,8 @@ package Prj.Util is
Index : Int := 0;
Attribute_Or_Array_Name : Name_Id;
In_Package : Package_Id;
In_Tree : Project_Tree_Ref) return Variable_Value;
In_Tree : Project_Tree_Ref;
Force_Lower_Case_Index : Boolean := False) return Variable_Value;
-- In a specific package,
-- - if there exists an array Attribute_Or_Array_Name with an index Name,
-- returns the corresponding component (depending on the attribute, the
......
......@@ -33,6 +33,7 @@
with Opt; use Opt;
with Table;
with Types; use Types;
package body Snames is
......@@ -179,6 +180,7 @@ package body Snames is
"ada_2005#" &
"assertion_policy#" &
"c_pass_by_copy#" &
"check_name#" &
"compile_time_error#" &
"compile_time_warning#" &
"component_alignment#" &
......@@ -192,6 +194,7 @@ package body Snames is
"extensions_allowed#" &
"external_name_casing#" &
"float_representation#" &
"implicit_packing#" &
"initialize_scalars#" &
"interrupt_state#" &
"license#" &
......@@ -447,6 +450,7 @@ package body Snames is
"digits#" &
"elaborated#" &
"emax#" &
"enabled#" &
"enum_rep#" &
"epsilon#" &
"exponent#" &
......@@ -672,16 +676,12 @@ package body Snames is
"archive_indexer#" &
"archive_suffix#" &
"binder#" &
"binder_driver#" &
"binder_prefix#" &
"body_suffix#" &
"builder#" &
"builder_switches#" &
"compiler#" &
"compiler_driver#" &
"compiler_kind#" &
"compiler_pic_option#" &
"compute_dependency#" &
"config_body_file_name#" &
"config_body_file_name_pattern#" &
"config_file_switches#" &
......@@ -689,21 +689,18 @@ package body Snames is
"config_spec_file_name#" &
"config_spec_file_name_pattern#" &
"cross_reference#" &
"default_builder_switches#" &
"default_global_compiler_switches#" &
"default_language#" &
"default_linker#" &
"default_minimum_linker_options#" &
"default_switches#" &
"dependency_driver#" &
"dependency_file_kind#" &
"dependency_option#" &
"dependency_switches#" &
"driver#" &
"exec_dir#" &
"executable#" &
"executable_suffix#" &
"extends#" &
"externally_built#" &
"finder#" &
"global_compiler_switches#" &
"global_configuration_pragmas#" &
"global_config_file#" &
"gnatls#" &
......@@ -735,7 +732,7 @@ package body Snames is
"library_symbol_file#" &
"library_symbol_policy#" &
"library_version#" &
"library_version_options#" &
"library_version_switches#" &
"linker#" &
"linker_executable_option#" &
"linker_lib_dir_option#" &
......@@ -747,19 +744,19 @@ package body Snames is
"mapping_spec_suffix#" &
"mapping_body_suffix#" &
"metrics#" &
"minimum_binder_options#" &
"minimum_compiler_options#" &
"minimum_linker_options#" &
"naming#" &
"objects_path#" &
"objects_path_file#" &
"object_dir#" &
"pic_option#" &
"pretty_printer#" &
"prefix#" &
"project#" &
"roots#" &
"required_switches#" &
"run_path_option#" &
"runtime_project#" &
"shared_library_minimum_options#" &
"shared_library_minimum_switches#" &
"shared_library_prefix#" &
"shared_library_suffix#" &
"separate_suffix#" &
......@@ -853,15 +850,6 @@ package body Snames is
return Attribute_Id'Val (N - First_Attribute_Name);
end Get_Attribute_Id;
------------------
-- Get_Check_Id --
------------------
function Get_Check_Id (N : Name_Id) return Check_Id is
begin
return Check_Id'Val (N - First_Check_Name);
end Get_Check_Id;
-----------------------
-- Get_Convention_Id --
-----------------------
......@@ -1032,15 +1020,6 @@ package body Snames is
return N in First_Attribute_Name .. Last_Attribute_Name;
end Is_Attribute_Name;
-------------------
-- Is_Check_Name --
-------------------
function Is_Check_Name (N : Name_Id) return Boolean is
begin
return N in First_Check_Name .. Last_Check_Name;
end Is_Check_Name;
------------------------
-- Is_Convention_Name --
------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment