-- This should really be reset on encountering a new main unit, but in
-- practice we are not using multiple main units so it is not critical.
- -------------------------------------------------
- -- Formal packages and partial parametrization --
- -------------------------------------------------
+ --------------------------------------------------
+ -- Formal packages and partial parameterization --
+ --------------------------------------------------
-- When compiling a generic, a formal package is a local instantiation. If
-- declared with a box, its generic formals are visible in the enclosing
-- In a generic, a formal package is treated like a special instantiation.
-- Our Ada 95 compiler handled formals with and without box in different
- -- ways. With partial parametrization, we use a single model for both.
+ -- ways. With partial parameterization, we use a single model for both.
-- We create a package declaration that consists of the specification of
-- the generic package, and a set of declarations that map the actuals
-- into local renamings, just as we do for bona fide instantiations. For
Others_Present : Boolean := False;
Others_Choice : Node_Id := Empty;
- -- In Ada 2005, indicates partial parametrization of a formal
+ -- In Ada 2005, indicates partial parameterization of a formal
-- package. As usual an other association must be last in the list.
procedure Check_Overloaded_Formal_Subprogram (Formal : Entity_Id);
-- but return Empty for the actual itself. In this case the code below
-- creates a corresponding declaration for the formal.
- function Partial_Parametrization return Boolean;
+ function Partial_Parameterization return Boolean;
-- Ada 2005: if no match is found for a given formal, check if the
-- association for it includes a box, or whether the associations
-- include an Others clause.
return Act;
end Matching_Actual;
- -----------------------------
- -- Partial_Parametrization --
- -----------------------------
+ ------------------------------
+ -- Partial_Parameterization --
+ ------------------------------
- function Partial_Parametrization return Boolean is
+ function Partial_Parameterization return Boolean is
begin
return Others_Present
or else (Present (Found_Assoc) and then Box_Present (Found_Assoc));
- end Partial_Parametrization;
+ end Partial_Parameterization;
---------------------
-- Process_Default --
if Present (Actuals) then
- -- Check for an Others choice, indicating a partial parametrization
+ -- Check for an Others choice, indicating a partial parameterization
-- for a formal package.
Actual := First (Actuals);
Defining_Identifier (Formal),
Defining_Identifier (Analyzed_Formal));
- if No (Match) and then Partial_Parametrization then
+ if No (Match) and then Partial_Parameterization then
Process_Default (Formal);
else
Append_List
Defining_Identifier (Analyzed_Formal));
if No (Match) then
- if Partial_Parametrization then
+ if Partial_Parameterization then
Process_Default (Formal);
else
end if;
-- If there is no corresponding actual, this may be case of
- -- partial parametrization, or else the formal has a default
- -- or a box.
+ -- partial parameterization, or else the formal has a
+ -- default or a box.
- if No (Match) and then Partial_Parametrization then
+ if No (Match) and then Partial_Parameterization then
Process_Default (Formal);
if Nkind (I_Node) = N_Formal_Package_Declaration then
Defining_Identifier (Original_Node (Analyzed_Formal)));
if No (Match) then
- if Partial_Parametrization then
+ if Partial_Parameterization then
Process_Default (Formal);
else
-- actual parameter associations for later formals that depend on
-- actuals declared in the formal package.
- -- In Ada 2005, partial parametrization requires that we make visible
- -- the actuals corresponding to formals that were defaulted in the
- -- formal package. There formals are identified because they remain
- -- formal generics within the formal package, rather than being
- -- renamings of the actuals supplied.
+ -- In Ada 2005, partial parameterization requires that we make
+ -- visible the actuals corresponding to formals that were defaulted
+ -- in the formal package. There formals are identified because they
+ -- remain formal generics within the formal package, rather than
+ -- being renamings of the actuals supplied.
declare
Gen_Decl : constant Node_Id :=