1------------------------------------------------------------------------------ 2-- -- 3-- ASIS-for-GNAT IMPLEMENTATION COMPONENTS -- 4-- -- 5-- A 4 G . A _ O P T -- 6-- -- 7-- S p e c -- 8-- -- 9-- Copyright (C) 1995-2015, Free Software Foundation, Inc. -- 10-- -- 11-- ASIS-for-GNAT is free software; you can redistribute it and/or modify it -- 12-- under terms of the GNU General Public License as published by the Free -- 13-- Software Foundation; either version 3, or (at your option) any later -- 14-- version. ASIS-for-GNAT is distributed in the hope that it will be -- 15-- useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -- 16-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -- 17-- -- 18-- -- 19-- -- 20-- -- 21-- -- 22-- You should have received a copy of the GNU General Public License and -- 23-- a copy of the GCC Runtime Library Exception distributed with GNAT; see -- 24-- the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- 25-- <http://www.gnu.org/licenses/>. -- 26-- -- 27-- ASIS-for-GNAT was originally developed by the ASIS-for-GNAT team at the -- 28-- Software Engineering Laboratory of the Swiss Federal Institute of -- 29-- Technology (LGL-EPFL) in Lausanne, Switzerland, in cooperation with the -- 30-- Scientific Research Computer Center of Moscow State University (SRCC -- 31-- MSU), Russia, with funding partially provided by grants from the Swiss -- 32-- National Science Foundation and the Swiss Academy of Engineering -- 33-- Sciences. ASIS-for-GNAT is now maintained by AdaCore -- 34-- (http://www.adacore.com). -- 35-- -- 36------------------------------------------------------------------------------ 37 38-- This package contains global switches set by the 39-- Asis_Environment.Initialize routine from the Parameters siting and 40-- referenced throughout the ASIS-for-GNAT 41-- 42-- This package may be considered as an ASIS analog of the GNAT Opt 43-- package 44 45package A4G.A_Opt is 46 47 Is_Initialized : Boolean := False; 48 -- flag indicating if the environment has already been initialized. 49 50 Was_Initialized_At_Least_Once : Boolean := False; 51 -- flag indicating if the environment was initialized at least 52 -- once during the current launch of an ASIS application 53 54 type ASIS_Warning_Mode_Type is (Suppress, Normal, Treat_As_Error); 55 ASIS_Warning_Mode : ASIS_Warning_Mode_Type := Normal; 56 -- Controls treatment of warning messages. If set to Suppress, warning 57 -- messages are not generated at all. In Normal mode, they are generated 58 -- but do not count as errors. In Treat_As_Error mode, a warning is 59 -- treated as an error: ASIS_Failed is raised and the warning message is 60 -- sent to an ASIS Diagnosis string. 61 62 Strong_Version_Check : Boolean := True; 63 -- Strong version check means that version strings read from the tree and 64 -- stored in Gnatvsn are compared. Weak check means comparing ASIS version 65 -- numbers. See BA23-002 66 67 Generate_Bug_Box : Boolean := True; 68 -- Flag indicating if the ASIS bug box should be generated into Stderr 69 -- when an ASIS implementation bug is detected. 70 71 Keep_Going : Boolean := False; 72 -- Flag indicating if the exit to OS should NOT be generated in case if 73 -- ASIS internal implementation error. Set ON by Initialize '-k' parameter. 74 75 ASIS_2005_Mode_Internal : constant Boolean := True; 76 -- If this switch is ON, ASIS detects as predefined units also units listed 77 -- as predefined in the 2005 revision of the Ada Standard. Now this flag is 78 -- always ON, and we do not have any parameter to tell ASIS that only 79 -- Ada 95 predefined units should be classified as predefined Compilation 80 -- Units in ASIS. 81 82 Cache_EE_Results : Boolean := False; 83 -- If this flag is ON, the cache storage is used to optimize computation 84 -- of Enclosing_Element for expressions (normally it requires traversing 85 -- the subtree rooted by rough estimation of enclosing Element); 86 -- 87 -- Theiretically this flag should be set individually for each Context, 88 -- but the only practical ASIS operational mode is one Context at a time. 89 -- This flag is set ON by '--cache_ee' and is set OFF by a call to 90 -- Asis.Ada_Environments.Dissociate (for any Context argument). 91 92 procedure Process_Initialization_Parameters (Parameters : String); 93 -- Processes a Parameters string passed to the 94 -- Asis.Implementation.Initialize query: check parameters and makes the 95 -- corresponding settings for ASIS global switches and flags. 96 97 procedure Process_Finalization_Parameters (Parameters : String); 98 -- Processes a Parameters string passed to the 99 -- Asis.Implementation.Finalize query. 100 101 procedure Set_Off; 102 -- Sets Is_Initialized flag OFF and then sets all the global switches 103 -- except Was_Initialized_At_Least_Once in the initial (default) position. 104 -- Is to be called by Asis_Environment.Finalize 105 106 -- the type declarations below should probably be moved into A_Types??? 107 108 type Context_Mode is 109 -- different ways to define an ASIS Context: 110 (One_Tree, 111 -- a Context is made up by only one tree file 112 N_Trees, 113 -- a Context is made up by N tree files 114 Partition, 115 -- a partition Context 116 All_Trees); 117 -- all the tree files in tree search path are considered as making up a 118 -- given Context 119 120 type Tree_Mode is 121 -- how ASIS deals with tree files 122 (On_The_Fly, 123 -- trees are created on the fly, created trees are reused as long as a 124 -- Context remains opened 125 Pre_Created, 126 -- only those trees which have been created before a Context is opened 127 -- are used 128 Mixed, 129 -- mixed approach - if ASIS cannot find a needed tree, it tries to 130 -- create it on the fly 131 Incremental, 132 -- Similar to Mixed, but these mode goes beyond the ASIS standard and 133 -- allows to change the environment when the Context remains open: 134 -- - when the Context is opened, all the existing trees are processed; 135 -- - if ASIS can not find a needed tree, it tries to create it on the 136 -- fly, and it refreshes the information in the Context unit table 137 -- using the data from this newly created tree; 138 -- - any access to a unit or to an element checks that a tree to be 139 -- accessed is consistent with the sources 140 -- ???? This documentation definitely needs revising??? 141 GNSA 142 -- Any tree is created on the fly by calling GNSA. It is not written 143 -- in a tree file and then read back by ASIS, but it is left in the 144 -- same data structures where it has been created, and after that ASIS 145 -- works on the same data structures. 146 ); 147 148 type Source_Mode is 149 -- how ASIS takes into account source files when checking the consistency 150 (All_Sources, 151 -- sources of all the units from a given Context (except the predefined 152 -- Standard package) should be around, and they should be the same as 153 -- the sources from which tree files making up the Context were created 154 Existing_Sources, 155 -- If for a given unit from the Context the corresponding source file 156 -- exists, it should be the same as those used to create tree files 157 -- making up the Context 158 No_Sources); 159 -- Existing source files are not taken into account when checking the 160 -- consistency of tree files 161 162 Check_Temporary_Files : Boolean := False; 163 -- If this flag is OFF, all the consistency checks (when ASIS reads in tree 164 -- files) ignore GNAT temporary files. This is needed in case when tree 165 -- files are created by gprbuild calls. gprbuild on the fly creates Ada 166 -- configuration files (as GNAT temporary files), passes them as arguments 167 -- of compiler calls that create trees and then deletes these files. So we 168 -- may have more than one temporary configuration file used for creation 169 -- different tree files with the same name and with different time stamps. 170 -- 171 -- At the moment there is no option to change setting of this flag but we 172 -- may want to add it later. 173 174end A4G.A_Opt; 175