text
stringlengths
0
234
List := F.New_List
(List, F.New_Component_Association
(Choices => F.New_Literal (Index),
Value => F.New_Parentheses
(F.New_List (Data))
));
Index := Index + 1;
Function Definition: function Prop_Parameters is new Generic_List_Reduce
Function Body: (Classes.Property, Classes.Property_Array, Prop_Parameter, F);
function Prop_Check
(F : aliased in out Ada_Pretty.Factory;
Name : League.Strings.Universal_String) return Ada_Pretty.Node_Access;
function Prop_Checks is new Generic_List_Reduce
(League.Strings.Universal_String, String_Array, Prop_Check, F);
-------------------
-- Prop_Variable --
-------------------
function Prop_Variable
(F : aliased in out Ada_Pretty.Factory;
Prop : Classes.Property) return Ada_Pretty.Node_Access
is
begin
return F.New_Variable
(Name => F.New_Name (Prop.Name),
Type_Definition => Property_Type (F, Prop));
end Prop_Variable;
function Prop_Variables is new Generic_List_Reduce
(Classes.Property, Classes.Property_Array, Prop_Variable, F);
Text_Name : constant League.Strings.Universal_String :=
Get_Package_Name (Item.Name) & "." & Item.Name & "_Text";
Elem : constant Classes.Class := Vector.First_Element;
Bool_Props : constant Classes.Property_Array :=
Only_Booleans (Elem.Properties & Item.Properties);
Parent_Props : constant Classes.Property_Array :=
Get_Parent_Props (Item, Vector);
Bool_Vars : constant Ada_Pretty.Node_Access :=
Prop_Variables (Bool_Props);
Package_Name : constant League.Strings.Universal_String :=
Node_Package_Name (Item.Name);
Element_Package_Name : constant League.Strings.Universal_String :=
Get_Package_Name (Item.Name);
Pure : constant Ada_Pretty.Node_Access :=
F.New_Pragma (F.New_Name (+"Preelaborate"));
Base_Name : constant Ada_Pretty.Node_Access :=
F.New_Name ("Base_" & Item.Name);
----------------
-- Prop_Check --
----------------
function Prop_Check
(F : aliased in out Ada_Pretty.Factory;
Name : League.Strings.Universal_String) return Ada_Pretty.Node_Access
is
begin
return F.New_Subprogram_Declaration
(Specification => Prop_Check_Spec (F, Name, Base_Name));
end Prop_Check;
Base_Props : constant Ada_Pretty.Node_Access := Prop_Variables
(Only_Objects (Item.Properties) & Only_Booleans (Parent_Props));
Base : constant Ada_Pretty.Node_Access :=
F.New_Type
(Name => Base_Name,
Definition => F.New_Record
(Parent => F.New_List
(F.New_Selected_Name (+"Program.Nodes.Node"),
F.New_Infix
(Operator => +"and",
Left => F.New_Selected_Name
(Full_Record_Name (Item.Name)))),
Components => Base_Props,
Is_Abstract => True));
Base_Init : constant Ada_Pretty.Node_Access :=
F.New_Subprogram_Declaration
(Specification => F.New_Subprogram_Specification
(Name => F.New_Name (+"Initialize"),
Parameters => F.New_Parameter
(Name => F.New_Name (+"Self"),
Type_Definition => F.New_Name
("Base_" & Item.Name & "'Class"),
Is_Aliased => True,