-- --
-- S p e c --
-- --
--- $Revision: 1.78 $
--- --
--- Copyright (C) 1992-2001 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
--- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- stored in an encoded form (Uhh for upper half and
-- Whhhh for wide characters, as provided by the routine
-- Store_Encoded_Character, where hh are hex digits for
--- the character code using lower case a-f). Other
--- internally generated names use upper case letters
--- (other than O,Q,U,W) to ensure that they do not clash
--- with identifier names in the source program.
+-- the character code using lower case a-f). Normally
+-- the use of U or W in other internal names is avoided,
+-- but these letters may be used in internal names
+-- (without this special meaning), if the appear as
+-- the last character of the name, or they are followed
+-- by an upper case letter or an underscore.
+
-- Operator symbols Stored with an initial letter O, and the remainder
-- of the name is the lower case characters XXX where
-- the name is Name_Op_XXX, see Snames spec for a full
--- list of the operator names.
+-- list of the operator names. Normally the use of O
+-- in other internal names is avoided, but it may be
+-- used in internal names (without this special meaning)
+-- if it is the last character of the name, or if it is
+-- followed by an upper case letter or an underscore.
-- Character literals Character literals have names that are used only for
-- debugging and error message purposes. The form is a
--- upper case Q followed by a single letter, or by a Uxx
--- or Wxxxx encoding as described for identifiers. The
--- Set_Character_Literal_Name procedure should be used
--- to construct these encodings.
+-- upper case Q followed by a single lower case letter,
+-- or by a Uxx or Wxxxx encoding as described for
+-- identifiers. The Set_Character_Literal_Name procedure
+-- should be used to construct these encodings. Normally
+-- the use of O in other internal names is avoided, but
+-- it may be used in internal names (without this special
+-- meaning) if it is the last character of the name, or
+-- if it is followed by an upper case letter or an
+-- underscore.
-- Unit names Stored with upper case letters folded to lower case,
-- using Uhh/Whhhh encoding as described for identifiers,
procedure Get_Unqualified_Name_String (Id : Name_Id);
-- Similar to the above except that qualification (as defined in unit
-- Exp_Dbug) is removed (including both preceding __ delimited names,
- -- and also the suffix used to indicate package body entities). Note
- -- that names are not qualified until just before the call to gigi, so
- -- this routine is only needed by processing that occurs after gigi has
- -- been called. This includes all ASIS processing, since ASIS works on
- -- the tree written after gigi has been called.
+ -- and also the suffixes used to indicate package body entities and to
+ -- distinguish between overloaded entities). Note that names are not
+ -- qualified until just before the call to gigi, so this routine is
+ -- only needed by processing that occurs after gigi has been called.
+ -- This includes all ASIS processing, since ASIS works on the tree
+ -- written after gigi has been called.
procedure Get_Name_String_And_Append (Id : Name_Id);
-- Like Get_Name_String but the resulting characters are appended to
pragma Inline (Get_Name_Table_Info);
-- Fetches the Int value associated with the given name
+ function Is_Operator_Name (Id : Name_Id) return Boolean;
+ -- Returns True if name given is of the form of an operator (that
+ -- is, it starts with an upper case O).
+
procedure Initialize;
-- Initializes the names table, including initializing the first 26
-- entries in the table (for the 1-character lower case names a-z)
-- table to see if the string has already been stored. If so the Id of
-- the existing entry is returned. Otherwise a new entry is created with
-- its Name_Table_Info field set to zero. The contents of Name_Buffer
- -- and Name_Len are not modified by this call.
+ -- and Name_Len are not modified by this call. Note that it is permissible
+ -- for Name_Len to be set to zero to lookup the null name string.
function Name_Enter return Name_Id;
-- Name_Enter has the same calling interface as Name_Find. The difference
procedure Tree_Write;
-- Writes out internal tables to current tree file using Tree_Write
+ procedure Get_Last_Two_Chars (N : Name_Id; C1, C2 : out Character);
+ -- Obtains last two characters of a name. C1 is last but one character
+ -- and C2 is last character. If name is less than two characters long,
+ -- then both C1 and C2 are set to ASCII.NUL on return.
+
procedure Write_Name (Id : Name_Id);
-- Write_Name writes the characters of the specified name using the
-- standard output procedures in package Output. No end of line is
-- the name table). If Id is Error_Name, or No_Name, no text is output.
procedure wn (Id : Name_Id);
+ pragma Export (Ada, wn);
-- Like Write_Name, but includes new line at end. Intended for use
-- from the debugger only.
procedure Write_Name_Decoded (Id : Name_Id);
-- Like Write_Name, except that the name written is the decoded name, as
- -- described for Get_Name_Decoded, and the resulting value stored in
- -- Name_Len and Name_Buffer is the decoded name.
+ -- described for Get_Decoded_Name_String, and the resulting value stored
+ -- in Name_Len and Name_Buffer is the decoded name.
---------------------------
-- Table Data Structures --