1---------------------------------------------------------------------- 2-- Rules.Unnecessary_Use_Clause - Package specification -- 3-- -- 4-- This software is (c) The European Organisation for the Safety -- 5-- of Air Navigation (EUROCONTROL) and Adalog 2004-2005. The Ada -- 6-- Controller is free software; you can redistribute it and/or -- 7-- modify it under terms of the GNU General Public License as -- 8-- published by the Free Software Foundation; either version 2, or -- 9-- (at your option) any later version. This unit is distributed -- 10-- in the hope that it will be useful, but WITHOUT ANY WARRANTY; -- 11-- without even the implied warranty of MERCHANTABILITY or FITNESS -- 12-- FOR A PARTICULAR PURPOSE. See the GNU General Public License -- 13-- for more details. You should have received a copy of the GNU -- 14-- General Public License distributed with this program; see file -- 15-- COPYING. If not, write to the Free Software Foundation, 59 -- 16-- Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- 17-- -- 18-- As a special exception, if other files instantiate generics -- 19-- from the units of this program, or if you link this unit with -- 20-- other files to produce an executable, this unit does not by -- 21-- itself cause the resulting executable to be covered by the GNU -- 22-- General Public License. This exception does not however -- 23-- invalidate any other reasons why the executable file might be -- 24-- covered by the GNU Public License. -- 25-- -- 26-- This software is distributed in the hope that it will be -- 27-- useful, but WITHOUT ANY WARRANTY; without even the implied -- 28-- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -- 29-- PURPOSE. -- 30---------------------------------------------------------------------- 31 32-- Asis 33with Asis; 34 35package Rules.Unnecessary_Use_Clause is 36 37 Rule_Id : constant Wide_String := "UNNECESSARY_USE_CLAUSE"; 38 39 procedure Process_Use_Clause (Clause : in Asis.Clause); 40 -- Called whenever a use clause is encountered 41 -- Must be called as a post_procedure, to ensure that the names contained in it 42 -- are checked against other use clauses, but not this one. 43 -- 44 -- Expected Clause_Kinds: 45 -- A_Use_Package_Clause 46 47 procedure Process_Identifier (Name : in Asis.Name); 48 -- Called whenever an identifier is encountered 49 -- Check whether it is declared inside one of the packages that are mentionned 50 -- in a (currently active) use clause. 51 52 procedure Process_Instantiation (Instantiation : Asis.Declaration); 53 -- Called for generic instantiations 54 -- We need to process instantiations specially, because we need the visibility 55 -- on defaulted parameters, and these won't be traversed by the ruler. 56 -- 57 -- Expected Declaration_Kinds: 58 -- A_Generic_Instantiation 59 60 procedure Process_Scope_Exit (Scope : in Asis.Element); 61 62end Rules.Unnecessary_Use_Clause; 63