155682Smarkm------------------------------------------------------------------------------
2233294Sstas--                                                                          --
3233294Sstas--                         GNAT COMPILER COMPONENTS                         --
4233294Sstas--                                                                          --
555682Smarkm--                              P R J . P A R S                             --
6233294Sstas--                                                                          --
7233294Sstas--                                 S p e c                                  --
8233294Sstas--                                                                          --
955682Smarkm--          Copyright (C) 2000-2011, Free Software Foundation, Inc.         --
10233294Sstas--                                                                          --
11233294Sstas-- GNAT is free software;  you can  redistribute it  and/or modify it under --
1255682Smarkm-- terms of the  GNU General Public License as published  by the Free Soft- --
13233294Sstas-- ware  Foundation;  either version 3,  or (at your option) any later ver- --
14233294Sstas-- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
15233294Sstas-- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
1655682Smarkm-- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
17233294Sstas-- for  more details.  You should have  received  a copy of the GNU General --
18233294Sstas-- Public License  distributed with GNAT; see file COPYING3.  If not, go to --
19233294Sstas-- http://www.gnu.org/licenses for a complete copy of the license.          --
2055682Smarkm--                                                                          --
21233294Sstas-- GNAT was originally developed  by the GNAT team at  New York University. --
22233294Sstas-- Extensive contributions were provided by Ada Core Technologies Inc.      --
23233294Sstas--                                                                          --
24233294Sstas------------------------------------------------------------------------------
25233294Sstas
26233294Sstas--  General wrapper for the parsing of project files
27233294Sstas
28233294Sstaswith Prj.Tree;
29233294Sstas
30233294Sstaspackage Prj.Pars is
31233294Sstas
3255682Smarkm   procedure Set_Verbosity (To : Verbosity);
3355682Smarkm   --  Set the verbosity when parsing the project files
3455682Smarkm
35233294Sstas   procedure Parse
3655682Smarkm     (In_Tree           : Project_Tree_Ref;
3755682Smarkm      Project           : out Project_Id;
3855682Smarkm      Project_File_Name : String;
3955682Smarkm      Packages_To_Check : String_List_Access;
4055682Smarkm      Reset_Tree        : Boolean := True;
4155682Smarkm      In_Node_Tree      : Prj.Tree.Project_Node_Tree_Ref := null;
4255682Smarkm      Env               : in out Prj.Tree.Environment);
4372445Sassar   --  Parse and process a project files and all its imported project files, in
4455682Smarkm   --  the project tree In_Tree.
4555682Smarkm   --
4655682Smarkm   --  All the project files are parsed (through Prj.Tree) to create a tree in
4755682Smarkm   --  memory. That tree is then processed (through Prj.Proc) to create a
4855682Smarkm   --  expanded representation of the tree based on the current external
4955682Smarkm   --  references. This function is only a convenient wrapper over other
5055682Smarkm   --  services provided in the Prj.* package hierarchy.
5155682Smarkm   --
5255682Smarkm   --  If parsing is successful, Project is the project ID of the root project
5355682Smarkm   --  file; otherwise, Project_Id is set to No_Project. Project_Node_Tree is
5455682Smarkm   --  set to the tree (unprocessed) representation of the project file. This
5555682Smarkm   --  tree is permanently correct, whereas Project will need to be recomputed
5655682Smarkm   --  if the external references change.
5755682Smarkm   --
5855682Smarkm   --  Packages_To_Check indicates the packages where any unknown attribute
5955682Smarkm   --  produces an error. For other packages, an unknown attribute produces a
6055682Smarkm   --  warning.
6155682Smarkm   --
6255682Smarkm   --  When Reset_Tree is True, all the project data are removed from the
6355682Smarkm   --  project table before processing.
6455682Smarkm   --
65233294Sstas   --  In_Node_Tree (if given) must have been Initialized. The main reason to
6655682Smarkm   --  pass an existing tree, is to pass the external references that will then
6755682Smarkm   --  be used to process the tree.
6855682Smarkm
6955682Smarkmend Prj.Pars;
7055682Smarkm