1
------------------------------------------------------------------------------
3
-- This unit is part of the @Asis2@ ASIS secondary library.
5
-- <STRONG>Copyright (c) 2002, 2003 by Thomas Wolf.</STRONG>
7
-- AdaBrowse is free software; you can redistribute it and/or modify it
8
-- under the terms of the GNU General Public License as published by the
9
-- Free Software Foundation; either version 2, or (at your option) any
10
-- later version. AdaBrowse is distributed in the hope that it will be
11
-- useful, but <EM>without any warranty</EM>; without even the implied
12
-- warranty of <EM>merchantability or fitness for a particular purpose.</EM>
13
-- See the GNU General Public License for more details. You should have
14
-- received a copy of the GNU General Public License with this distribution,
15
-- see file "<A HREF="GPL.txt">GPL.txt</A>". If not, write to the Free
16
-- Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
20
-- As a special exception from the GPL, if other files instantiate generics
21
-- from this unit, or you link this unit with other files to produce an
22
-- executable, this unit does not by itself cause the resulting executable
23
-- to be covered by the GPL. This exception does not however invalidate any
24
-- other reasons why the executable file might be covered by the GPL.
28
-- Thomas Wolf (TW) <E_MAIL>
32
-- Utility routines operating on naming expressions and defining names.
36
-- 05-JUN-2003 TW Last release as part of @AdaBrowse@.
37
-- 18-JUL-2003 TW Created from operations in @AD.Queries@.
39
-------------------------------------------------------------------------------
41
pragma License (Modified_GPL);
45
package Asis2.Declarations is
48
(Expr : in Asis.Expression;
49
Decl : in Asis.Declaration)
51
-- Returns True if 'Expr' is @An_Identifier@ or @A_Selected_Component@, and
52
-- that name refers to 'Decl'.
54
function Name_Definition
55
(Expr : in Asis.Expression)
56
return Asis.Defining_Name;
57
-- Appropriate expression kinds:
59
-- All those for @Asis.Expressions.Corresponding_Name_Definition@ plus
60
-- @A_Selected_Component@, for which it returns the name definition of
63
-- Returns @Nil_Element@ if @Expr@ refers to more than one definition.
65
function Name_Declaration
66
(Expr : in Asis.Expression)
67
return Asis.Declaration;
68
-- Synonym to <CODE>Enclosing_Declaration (Name_Definition (Expr));</CODE>.
70
function Enclosing_Declaration
71
(Element : in Asis.Element)
72
return Asis.Declaration;
73
-- Returns the declaration that contains @Element@.
75
function Real_Declaration
76
(Decl : in Asis.Declaration)
77
return Asis.Declaration;
78
-- Appropriate declaration kinds:
80
-- All those for @Asis.Declarations.Corresponding_Declaration@ plus
81
-- @An_Enumeration_Literal_Specification@, for which, if the enumeration
82
-- literal is implicitly inherited, it returns the explicit declaration
83
-- from which the enumeration literal was inherited, if such an explicit
84
-- declaration exists. If none exists, returns @Nil_Element@.
86
-- For all other declaration kinds, identical to function
87
-- @Asis.Declarations.Corresponding_Declaration@.
89
end Asis2.Declarations;