-- --
-- B o d y --
-- --
--- $Revision: 1.46 $
--- --
--- Copyright (C) 1992-2001 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2003 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- --
-- MA 02111-1307, USA. --
-- --
-- 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. --
-- --
------------------------------------------------------------------------------
-- bother to check for it being exceeded.
begin
- Idents (1) := P_Defining_Identifier;
+ Idents (1) := P_Defining_Identifier (C_Comma_Colon);
Num_Idents := 1;
while Comma_Present loop
Num_Idents := Num_Idents + 1;
- Idents (Num_Idents) := P_Defining_Identifier;
+ Idents (Num_Idents) := P_Defining_Identifier (C_Comma_Colon);
end loop;
T_Colon;
function P_Formal_Type_Declaration return Node_Id is
Decl_Node : Node_Id;
+ Def_Node : Node_Id;
begin
Decl_Node := New_Node (N_Formal_Type_Declaration, Token_Ptr);
T_Is;
- Set_Formal_Type_Definition (Decl_Node, P_Formal_Type_Definition);
- TF_Semicolon;
+ Def_Node := P_Formal_Type_Definition;
+
+ if Def_Node /= Error then
+ Set_Formal_Type_Definition (Decl_Node, Def_Node);
+ TF_Semicolon;
+
+ else
+ Decl_Node := Error;
+
+ -- If we have semicolon, skip it to avoid cascaded errors
+
+ if Token = Tok_Semicolon then
+ Scan;
+ end if;
+ end if;
+
return Decl_Node;
end P_Formal_Type_Declaration;
Scan; -- past WITH
Set_Private_Present (Def_Node, True);
T_Private;
+
+ elsif Token = Tok_Tagged then
+ Scan;
+
+ if Token = Tok_Private then
+ Error_Msg_SC ("TAGGED should be WITH");
+ Set_Private_Present (Def_Node, True);
+ T_Private;
+ else
+ Ignore (Tok_Tagged);
+ end if;
end if;
return Def_Node;
begin
Def_Node := New_Node (N_Formal_Package_Declaration, Prev_Token_Ptr);
Scan; -- past PACKAGE
- Set_Defining_Identifier (Def_Node, P_Defining_Identifier);
+ Set_Defining_Identifier (Def_Node, P_Defining_Identifier (C_Is));
T_Is;
T_New;
Set_Name (Def_Node, P_Qualified_Simple_Name);