text stringlengths 0 234 |
|---|
return Next.Properties; |
end if; |
end loop; |
raise Program_Error; |
end Get_Parent_Props; |
------------------- |
-- Prop_Argument -- |
------------------- |
function Prop_Argument |
(F : aliased in out Ada_Pretty.Factory; |
Prop : Classes.Property) return Ada_Pretty.Node_Access |
is |
Name : constant Ada_Pretty.Node_Access := F.New_Name (Prop.Name); |
begin |
return F.New_Component_Association |
(Choices => Name, |
Value => Name); |
end Prop_Argument; |
-------------------- |
-- Prop_Parameter -- |
-------------------- |
function Prop_Parameter |
(F : aliased in out Ada_Pretty.Factory; |
Prop : Classes.Property) return Ada_Pretty.Node_Access is |
begin |
if Is_Boolean (Prop.Type_Name) then |
return F.New_Parameter |
(Name => F.New_Name (Prop.Name), |
Type_Definition => Property_Type (F, Prop), |
Initialization => F.New_Name (+"False")); |
else |
return F.New_Parameter |
(Name => F.New_Name (Prop.Name), |
Type_Definition => Property_Type (F, Prop)); |
end if; |
end Prop_Parameter; |
function Prop_Check_Spec |
(F : aliased in out Ada_Pretty.Factory; |
Name : League.Strings.Universal_String; |
Base_Name : Ada_Pretty.Node_Access) return Ada_Pretty.Node_Access is |
begin |
return F.New_Subprogram_Specification |
(Is_Overriding => Ada_Pretty.True, |
Name => F.New_Name ("Is_" & Name & "_Element"), |
Parameters => F.New_Parameter |
(Name => F.New_Name (+"Self"), |
Type_Definition => Base_Name), |
Result => F.New_Name (+"Boolean")); |
end Prop_Check_Spec; |
------------------- |
-- Property_Type -- |
------------------- |
function Property_Type |
(F : aliased in out Ada_Pretty.Factory; |
P : Meta.Classes.Property) return Ada_Pretty.Node_Access |
is |
use all type Meta.Classes.Capacity_Kind; |
R_Type : Ada_Pretty.Node_Access; |
begin |
if Is_Boolean (P.Type_Name) or Is_Text (P.Type_Name) then |
R_Type := F.New_Name (P.Type_Name); |
elsif Is_Token (P.Type_Name) then |
R_Type := F.New_Selected_Name (Full_Access_Name (Lexical_Element)); |
elsif P.Capacity in Just_One | Zero_Or_One then |
R_Type := F.New_Selected_Name (Full_Access_Name (P.Type_Name)); |
elsif Is_Element (P.Type_Name) then |
R_Type := F.New_Selected_Name |
(+"Program.Element_Vectors.Element_Vector_Access"); |
else |
R_Type := F.New_Selected_Name |
(Full_Vector_Name (P.Type_Name) & "_Access"); |
end if; |
if P.Capacity in Just_One | One_Or_More |
and then not Is_Boolean (P.Type_Name) |
and then not Is_Text (P.Type_Name) |
then |
R_Type := F.New_Null_Exclusion (R_Type); |
end if; |
return R_Type; |
end Property_Type; |
--------------- |
-- Get_Props -- |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.