~ubuntu-branches/debian/stretch/adabrowse/stretch

« back to all changes in this revision

Viewing changes to asis2-declarations.ads

  • Committer: Bazaar Package Importer
  • Author(s): Ludovic Brenta
  • Date: 2004-02-14 13:22:40 UTC
  • Revision ID: james.westby@ubuntu.com-20040214132240-cqumhiq1677pkvzo
Tags: upstream-4.0.2
ImportĀ upstreamĀ versionĀ 4.0.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
------------------------------------------------------------------------------
 
2
--
 
3
--  This unit is part of the @Asis2@ ASIS secondary library.
 
4
--
 
5
--  <STRONG>Copyright (c) 2002, 2003 by Thomas Wolf.</STRONG>
 
6
--  <BLOCKQUOTE>
 
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,
 
17
--    USA.
 
18
--  </BLOCKQUOTE>
 
19
--  <BLOCKQUOTE>
 
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.
 
25
--  </BLOCKQUOTE>
 
26
--
 
27
--  <AUTHOR>
 
28
--    Thomas Wolf  (TW) <E_MAIL>
 
29
--  </AUTHOR>
 
30
--
 
31
--  <PURPOSE>
 
32
--    Utility routines operating on naming expressions and defining names.
 
33
--  </PURPOSE>
 
34
--
 
35
--  <HISTORY>
 
36
--    05-JUN-2003   TW  Last release as part of @AdaBrowse@.
 
37
--    18-JUL-2003   TW  Created from operations in @AD.Queries@.
 
38
--  </HISTORY>
 
39
-------------------------------------------------------------------------------
 
40
 
 
41
pragma License (Modified_GPL);
 
42
 
 
43
with Asis;
 
44
 
 
45
package Asis2.Declarations is
 
46
 
 
47
   function References
 
48
     (Expr : in Asis.Expression;
 
49
      Decl : in Asis.Declaration)
 
50
     return Boolean;
 
51
   --  Returns True if 'Expr' is @An_Identifier@ or @A_Selected_Component@, and
 
52
   --  that name refers to 'Decl'.
 
53
 
 
54
   function Name_Definition
 
55
     (Expr : in Asis.Expression)
 
56
     return Asis.Defining_Name;
 
57
   --  Appropriate expression kinds:
 
58
   --
 
59
   --    All those for @Asis.Expressions.Corresponding_Name_Definition@ plus
 
60
   --    @A_Selected_Component@, for which it returns the name definition of
 
61
   --    the selector.
 
62
   --
 
63
   --  Returns @Nil_Element@ if @Expr@ refers to more than one definition.
 
64
 
 
65
   function Name_Declaration
 
66
     (Expr : in Asis.Expression)
 
67
     return Asis.Declaration;
 
68
   --  Synonym to <CODE>Enclosing_Declaration (Name_Definition (Expr));</CODE>.
 
69
 
 
70
   function Enclosing_Declaration
 
71
     (Element : in Asis.Element)
 
72
     return Asis.Declaration;
 
73
   --  Returns the declaration that contains @Element@.
 
74
 
 
75
   function Real_Declaration
 
76
     (Decl : in Asis.Declaration)
 
77
     return Asis.Declaration;
 
78
   --  Appropriate declaration kinds:
 
79
   --
 
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@.
 
85
   --
 
86
   --  For all other declaration kinds, identical to function
 
87
   --  @Asis.Declarations.Corresponding_Declaration@.
 
88
 
 
89
end Asis2.Declarations;