8sa1-gcc/gcc/ada/sinfo-cn.adb
Thomas Quinot 68e2ea2757 ali-util.adb (Get_File_Checksum): Update to account for change in profile of Initialize_Scanner.
2006-02-13  Thomas Quinot  <quinot@adacore.com>
	    Vincent Celier  <celier@adacore.com>
	    Robert Dewar  <dewar@adacore.com>

	* ali-util.adb (Get_File_Checksum): Update to account for change in
	profile of Initialize_Scanner.

	* gprep.adb (Gnatprep): Update to account for change in profile of
	Initialize_Scanner.
	(Process_One_File): Same.

	* lib.adb (Get_Code_Or_Source_Unit): New subprogram factoring the
	common code between Get_Code_Unit and Get_Source_Unit. Reimplement
	that behaviour using the new Unit information recorded in the source
	files table, rather than going through all units every time.
	(Get_Code_Unit): Reimplement in terms of Get_Code_Or_Source_Unit.
	(Get_Source_Unit): Same.

	* prepcomp.adb (Parse_Preprocessing_Data_File): Update to account for
	change in profile of Initialize_Scanner.
	(Prepare_To_Preprocess): Same.

	* lib.ads: Fix typo in comment (templace -> template).

	* prj-part.adb (Parse_Single_Project): Update to account for change in
	profile of Initialize_Scanner.

	* scn.adb (Initialize_Scanner): Account for change in profile of
	Scng.Initialize_Scanner: set Current_Source_Unit in Scn instead of Scng.
	Also record the association of the given Source_File_Index to the
	corresponding Unit_Number_Type.

	* scng.ads, scng.adb (Initialize_Scanner.Set_Reserved): Remove
	procedure.
	(Initialize_Scanner): Call Scans.Initialize_Ada_Keywords.
	Remove Unit formal for generic scanner: this formal
	is only relevant to Scn (the scanner instance used to parse Ada source
	files), not to other instances. Update comment accordingly.
	(Scan): Use new function Snames.Is_Keyword_Name.

	* sinfo-cn.adb: Fix typo in comment.

	* sinput.adb (Unit, Set_Unit): Accessors for new source file attribute
	Unit.

	* sinput.ads (Source_File_Record): New component Unit, used to capture
	the unit identifier (if any) associated to a source file.

	* sinput-c.adb, sinput-l.adb (Load_File): Initialize new component
	Unit in Source_File_Record.

	* sinput-p.adb (Source_File_Is_Subunit): Update to account for change
	in profile of Initialize_Scanner.

	* scans.adb (Initialize_Ada_Keywords): New procedure

	* scans.ads (Initialize_Ada_Keywords): New procedure to initialize the
	Ada keywords in the Namet table, without the need to call
	Initialize_Scanner.

	* snames.adb: Add pragma Ada_2005 (synonym for Ada_05)
	(Is_Keyword_Name): New function

	* snames.ads: Add subtype Configuration_Pragma_Names
	Add pragma Ada_2005 (synonym for Ada_05)
	(Is_Keyword_Name): New function

	* snames.h: Add pragma Ada_2005 (synonym for Ada_05)

From-SVN: r111032
2006-02-15 10:32:12 +01:00

113 lines
5.1 KiB
Ada

------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S I N F O . C N --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2006, 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- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This child package of Sinfo contains some routines that permit in place
-- alteration of existing tree nodes by changing the value in the Nkind
-- field. Since Nkind functions logically in a manner similar to a variant
-- record discriminant part, such alterations cannot be permitted in a
-- general manner, but in some specific cases, the fields of related nodes
-- have been deliberately layed out in a manner that permits such alteration.
-- that determin
with Atree; use Atree;
package body Sinfo.CN is
use Atree.Unchecked_Access;
-- This package is one of the few packages which is allowed to make direct
-- references to tree nodes (since it is in the business of providing a
-- higher level of tree access which other clients are expected to use and
-- which implements checks).
------------------------------------------------------------
-- Change_Character_Literal_To_Defining_Character_Literal --
------------------------------------------------------------
procedure Change_Character_Literal_To_Defining_Character_Literal
(N : in out Node_Id)
is
begin
Set_Nkind (N, N_Defining_Character_Literal);
N := Extend_Node (N);
end Change_Character_Literal_To_Defining_Character_Literal;
------------------------------------
-- Change_Conversion_To_Unchecked --
------------------------------------
procedure Change_Conversion_To_Unchecked (N : Node_Id) is
begin
Set_Do_Overflow_Check (N, False);
Set_Do_Tag_Check (N, False);
Set_Do_Length_Check (N, False);
Set_Nkind (N, N_Unchecked_Type_Conversion);
end Change_Conversion_To_Unchecked;
----------------------------------------------
-- Change_Identifier_To_Defining_Identifier --
----------------------------------------------
procedure Change_Identifier_To_Defining_Identifier (N : in out Node_Id) is
begin
Set_Nkind (N, N_Defining_Identifier);
N := Extend_Node (N);
end Change_Identifier_To_Defining_Identifier;
--------------------------------------------------------
-- Change_Operator_Symbol_To_Defining_Operator_Symbol --
--------------------------------------------------------
procedure Change_Operator_Symbol_To_Defining_Operator_Symbol
(N : in out Node_Id)
is
begin
Set_Nkind (N, N_Defining_Operator_Symbol);
Set_Node2 (N, Empty); -- Clear unused Str2 field
N := Extend_Node (N);
end Change_Operator_Symbol_To_Defining_Operator_Symbol;
----------------------------------------------
-- Change_Operator_Symbol_To_String_Literal --
----------------------------------------------
procedure Change_Operator_Symbol_To_String_Literal (N : Node_Id) is
begin
Set_Nkind (N, N_String_Literal);
Set_Node1 (N, Empty); -- clear Name1 field
end Change_Operator_Symbol_To_String_Literal;
------------------------------------------------
-- Change_Selected_Component_To_Expanded_Name --
------------------------------------------------
procedure Change_Selected_Component_To_Expanded_Name (N : Node_Id) is
begin
Set_Nkind (N, N_Expanded_Name);
Set_Chars (N, Chars (Selector_Name (N)));
end Change_Selected_Component_To_Expanded_Name;
end Sinfo.CN;