Namet

Simple types

File_Name_Type
type File_Name_Type is new Name_Id;
File names are stored in the names table and this type is used to indicate that a Name_Id value is being used to hold a simple file name (which does not include any directory information).
Name_Id
type Name_Id is range Names_Low_Bound .. Names_High_Bound;
Type used to identify entries in the names table
Path_Name_Type
type Path_Name_Type is new Name_Id;
Path names are stored in the names table and this type is used to indicate that a Name_Id value is being used to hold a path name (that may contain directory information).
Unit_Name_Type
type Unit_Name_Type is new Name_Id;
Unit names are stored in the names table and this type is used to indicate that a Name_Id value is being used to hold a unit name, which terminates in %b for a body or %s for a spec.

Subtypes

Error_File_Name_Or_No_File
subtype Error_File_Name_Or_No_File is
  File_Name_Type range No_File .. Error_File_Name;
Used to test for either error file name or no file
Error_Name_Or_No_Name
subtype Error_Name_Or_No_Name is Name_Id range No_Name .. Error_Name;
Used to test for either error name or no name
Error_Unit_Name_Or_No_Unit_Name
subtype Error_Unit_Name_Or_No_Unit_Name is
  Unit_Name_Type range No_Unit_Name .. Error_Unit_Name;

Constants

Error_File_Name
Error_File_Name : constant File_Name_Type := File_Name_Type (Error_Name);
The special File_Name_Type value Error_File_Name is used to indicate a unit name where some previous processing has found an error.
Error_Name
Error_Name : constant Name_Id := Names_Low_Bound +  1;
The special Name_Id value Error_Name is used in the parser to indicate that some kind of error was encountered in scanning out the relevant name, so it does not have a representable label.
Error_Unit_Name
Error_Unit_Name : constant Unit_Name_Type := Unit_Name_Type (Error_Name);
The special Unit_Name_Type value Error_Unit_Name is used to indicate a unit name where some previous processing has found an error.
First_Name_Id
First_Name_Id : constant Name_Id := Names_Low_Bound + 2;
Subscript of first entry in names table
No_File
No_File : constant File_Name_Type := File_Name_Type (No_Name);
Constant used to indicate no file is present (this is used for example when a search for a file indicates that no file of the name exists).
No_Name
No_Name : constant Name_Id := Names_Low_Bound;
The special Name_Id value No_Name is used in the parser to indicate a situation where no name is present (e.g. on a loop or block).
No_Path
No_Path : constant Path_Name_Type := Path_Name_Type (No_Name);
Constant used to indicate no path name is present
No_Unit_Name
No_Unit_Name : constant Unit_Name_Type := Unit_Name_Type (No_Name);
Constant used to indicate no file name present

Variables

Name_Buffer
Name_Buffer : String (1 .. 4 * Max_Line_Length);
This buffer is used to set the name to be stored in the table for the Name_Find call, and to retrieve the name for the Get_Name_String call. The limit here is intended to be an infinite value that ensures that we never overflow the buffer (names this long are too absurd to worry).
Name_Len
Name_Len : Natural := 0;
Length of name stored in Name_Buffer. Used as an input parameter for Name_Find, and as an output value by Get_Name_String, or Write_Name. Note: in normal usage, all users of Name_Buffer/Name_Len are expected to initialize Name_Len appropriately. The reason we preinitialize to zero here is that some circuitry (e.g. Osint.Write_Program_Name) does a save/restore on Name_Len and Name_Buffer (1 .. Name_Len), and we do not want some arbitrary junk value to result in saving an arbitrarily long slice which would waste time and blow the stack.