source: trunk/ada-2012/src/semantic/ 552

Last change on this file since 552 was 490, checked in by Maxim Reznik, 6 years ago

Change name resolution in an instantination.

Drop package_instance use copy of generic_package instead.
Resolve each generic_association.Actual_Parameter independently on others.
Add Corresponding_View property.

The idea is to gather formal parameter list into Up of Generic_Actual_Part.
Then resolve the list at instantination node where template is available.
Propagate resolved formal names via Down. Actual parameter is resolved
at generic_association node, one by one, left to right.

  • Property svn:keywords set to Author Date Revision
File size: 1.4 KB
1with Gela.Compilations;
2with Gela.Elements.Package_Instantiations;
3with Gela.Semantic_Types;
5package Gela.Instantiation is
6 pragma Preelaborate;
8 -- Each instantination declaration has property Expanded with
9 -- deep copy of corresponding generic declaration.
10 --
11 -- Defining_Name property of each identifier in this copy is fixed to refer
12 -- to copied defining name. Each defining_name in the copy has property
13 -- named Corresponding_Generic_Element. It refers to corresponding
14 -- defining name in the template.
15 --
16 -- Each formal declaration of this copy has property Corresponding_View.
17 -- It refers to corresponding expression of Generic_Actual_Part.
18 -- Type manager takes this property into account when resolves types in
19 -- Generic_Actual_Part and in other places outside of instance.
21 procedure Expand
22 (Comp : Gela.Compilations.Compilation_Access;
23 Node : not null Gela.Elements.Package_Instantiations.
24 Package_Instantiation_Access;
25 Expanded : out Gela.Elements.Element_Access);
27 procedure Environment
28 (Comp : Gela.Compilations.Compilation_Access;
29 Node : not null Gela.Elements.Package_Instantiations.
30 Package_Instantiation_Access;
31 Env_In : Gela.Semantic_Types.Env_Index;
32 Env_Out : out Gela.Semantic_Types.Env_Index);
34end Gela.Instantiation;
Note: See TracBrowser for help on using the repository browser.